chenkun 4 hete
szülő
commit
e7fea4969f
2 módosított fájl, 151 hozzáadás és 0 törlés
  1. 39 0
      src/views/admin/TaskManagement.vue
  2. 112 0
      src/views/basic-info/Index.vue

+ 39 - 0
src/views/admin/TaskManagement.vue

@@ -25,6 +25,25 @@
         <el-tab-pane label="图片任务管理" name="image">
           <el-table v-loading="loading" :data="taskList" border stripe style="width: 100%">
             <el-table-column prop="id" label="任务序号" width="100" />
+            <el-table-column label="图片预览" width="120">
+              <template #default="{ row }">
+                <el-image 
+                  v-if="row.image_url"
+                  class="table-image"
+                  :src="row.image_url" 
+                  :preview-src-list="[row.image_url]"
+                  fit="cover"
+                  preview-teleported
+                >
+                  <template #error>
+                    <div class="image-error">
+                      <el-icon><Picture /></el-icon>
+                    </div>
+                  </template>
+                </el-image>
+                <span v-else class="placeholder">无预览图</span>
+              </template>
+            </el-table-column>
             <el-table-column prop="business_id" label="图片ID" min-width="180" />
             <el-table-column prop="name" label="名称" min-width="250" show-overflow-tooltip />
             <el-table-column prop="task_id" label="任务ID (task_id)" min-width="200">
@@ -43,6 +62,7 @@
 <script setup lang="ts">
 import { ref, onMounted } from 'vue'
 import { ElMessage } from 'element-plus'
+import { Picture } from '@element-plus/icons-vue'
 import request from '@/api/request'
 
 interface TaskItem {
@@ -51,6 +71,7 @@ interface TaskItem {
   task_id: string | null
   type: string
   name: string
+  image_url?: string
 }
 
 interface ApiResponse<T = any> {
@@ -124,6 +145,24 @@ onMounted(() => {
   font-size: 13px;
 }
 
+.table-image {
+  width: 80px;
+  height: 60px;
+  border-radius: 4px;
+  display: block;
+}
+
+.image-error {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  width: 100%;
+  height: 100%;
+  background: #f5f7fa;
+  color: #909399;
+  font-size: 20px;
+}
+
 :deep(.el-tabs__header) {
   margin-bottom: 20px;
 }

+ 112 - 0
src/views/basic-info/Index.vue

@@ -146,6 +146,86 @@
         <el-table-column prop="level_3_classification" label="三级分类" width="120" v-if="infoType === 'work'" />
         <el-table-column prop="level_4_classification" label="四级分类" width="120" v-if="infoType === 'work'" />
         <el-table-column prop="professional_field" label="专业领域" width="120" v-if="infoType === 'basis'" />
+        <el-table-column label="参编单位" min-width="150" v-if="infoType === 'basis'">
+          <template #default="scope">
+            <template v-if="scope.row.participating_units">
+              <el-popover
+                placement="top"
+                :width="350"
+                trigger="hover"
+                popper-class="tag-popover"
+              >
+                <template #reference>
+                  <div class="tag-group">
+                    <el-tag 
+                      v-for="(unit, idx) in scope.row.participating_units.split(';').slice(0, 2)" 
+                      :key="idx" 
+                      size="small" 
+                      class="info-tag"
+                    >
+                      {{ unit }}
+                    </el-tag>
+                    <el-tag v-if="scope.row.participating_units.split(';').length > 2" size="small" type="info" class="info-tag">
+                      +{{ scope.row.participating_units.split(';').length - 2 }}
+                    </el-tag>
+                  </div>
+                </template>
+                <div class="popover-tag-list">
+                  <el-tag 
+                    v-for="(unit, idx) in scope.row.participating_units.split(';')" 
+                    :key="idx" 
+                    size="small" 
+                    class="popover-info-tag"
+                  >
+                    {{ unit }}
+                  </el-tag>
+                </div>
+              </el-popover>
+            </template>
+            <span v-else>-</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="参考依据" min-width="150" v-if="infoType === 'basis'">
+          <template #default="scope">
+            <template v-if="scope.row.reference_basis">
+              <el-popover
+                placement="top"
+                :width="350"
+                trigger="hover"
+                popper-class="tag-popover"
+              >
+                <template #reference>
+                  <div class="tag-group">
+                    <el-tag 
+                      v-for="(basis, idx) in scope.row.reference_basis.split(';').slice(0, 2)" 
+                      :key="idx" 
+                      size="small" 
+                      type="info"
+                      class="info-tag"
+                    >
+                      {{ basis }}
+                    </el-tag>
+                    <el-tag v-if="scope.row.reference_basis.split(';').length > 2" size="small" type="info" class="info-tag">
+                      +{{ scope.row.reference_basis.split(';').length - 2 }}
+                    </el-tag>
+                  </div>
+                </template>
+                <div class="popover-tag-list">
+                  <el-tag 
+                    v-for="(basis, idx) in scope.row.reference_basis.split(';')" 
+                    :key="idx" 
+                    size="small" 
+                    type="info"
+                    class="popover-info-tag"
+                  >
+                    {{ basis }}
+                  </el-tag>
+                </div>
+              </el-popover>
+            </template>
+            <span v-else>-</span>
+          </template>
+        </el-table-column>
         <el-table-column prop="validity" label="时效性" width="100" v-if="infoType === 'basis'">
           <template #default="scope">
             <el-tag :type="getValidityType(scope.row.validity)">
@@ -978,6 +1058,21 @@ onMounted(() => {
   justify-content: flex-end;
 }
 
+.info-tag {
+  margin-right: 4px;
+  margin-bottom: 2px;
+  max-width: 120px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.tag-group {
+  display: flex;
+  flex-wrap: wrap;
+  gap: 4px;
+}
+
 .action-buttons {
   display: flex;
   justify-content: center;
@@ -989,6 +1084,23 @@ onMounted(() => {
   margin: 0;
 }
 
+.popover-tag-list {
+  display: flex;
+  flex-direction: column;
+  gap: 8px;
+  padding: 4px 0;
+}
+
+.popover-info-tag {
+  width: 100%;
+  justify-content: flex-start;
+  height: auto;
+  padding: 4px 8px;
+  white-space: normal;
+  word-break: break-all;
+  line-height: 1.4;
+}
+
 :deep(.el-table .cell) {
   white-space: nowrap;
 }