Просмотр исходного кода

fix:修复复合附件预览、下载

sunqijun 1 месяц назад
Родитель
Сommit
5879fe7dd1

+ 3 - 3
src/views/production-safety/implement-safety-duty/public-list-responsibilities/list.vue

@@ -67,9 +67,9 @@
       <div class="table-content">
         <el-table :data="tableData.data">
           <el-table-column type="index" label="序号" width="80" />
-          <el-table-column label="楼宇/区域" prop="buildingArea" width="120" />
-          <el-table-column label="楼层/房号" prop="floorRoomNo" width="180" />
-          <el-table-column label="名称/功能" prop="nameFunction" width="120" />
+          <el-table-column label="楼宇/区域" prop="buildingArea" width="160" />
+          <el-table-column label="楼层/房号" prop="floorRoomNo" width="160" />
+          <el-table-column label="名称/功能" prop="nameFunction" width="160" />
           <el-table-column label="安全责任所/中心" prop="safetyResponsibleCenter" width="200" />
           <el-table-column label="安全责任所/中心负责人" prop="safetyCenterManagerName" width="200" />
           <el-table-column label="安全责任部门" prop="safetyResponsibleDepartment" width="180" />

+ 16 - 4
src/views/production-safety/safetyAssessment/evaluationSystem/components/EvaluationSystemFeedback.vue

@@ -20,6 +20,17 @@
             @uploadSuccess="handleUploadSuccess"
           />
         </div>
+        <div class="file-list">
+            <div class="file-item" v-for="item in ruleFormData.attachmentDocument" :key="item.fileId">
+                <span class="file-item--name">{{ item.fileName }}</span>
+                <div class="file-item--footer">
+                    <el-button link type="primary" @click="previewOnline(item.fileUrl, item.fileType)"
+                    >预览</el-button>
+                    <el-button link type="primary" @click.stop="downloadFile(item.fileUrl, item.fileName)"
+                    >下载</el-button>
+                </div>
+            </div>
+        </div>
       </el-form-item>
       <el-form-item label="评分说明:" prop="scoringDescription">
         <el-input
@@ -58,10 +69,10 @@
             </template>
           </el-table-column>
           <el-table-column label="资料说明" prop="materialDescription" min-width="200">
-            <template #default="scope">
+            <template #default="scope" >
               <div
                 class="file-container--div"
-                v-for="item in parseAttachments(scope.row.materialDescription)"
+                v-for="item in scope.row.materialDescription"
                 :key="item.fileUrl"
               >
                 <img
@@ -138,6 +149,7 @@
       <el-button type="primary" @click="confirmReject">确定</el-button>
     </template>
   </el-dialog>
+    <PreviewOnline ref="previewOnlineRef" />
 </template>
 
 <script setup lang="ts">
@@ -471,7 +483,7 @@
 
       // 映射表单字段
       ruleFormData.value.evaluationTitle = detail.exName || ''; // 考核表名称
-      ruleFormData.value.attachmentDocument = parseAttachmentsToFileList(detail.attachments); // 附件文档
+      ruleFormData.value.attachmentDocument = JSON.parse(detail.attachments) //parseAttachmentsToFileList(detail.attachments); // 附件文档
       ruleFormData.value.scoringDescription = detail.ratingDescribe; // 评分说明(接口暂无此字段,留空)
 
       // 映射考核项目列表(scores 数组)
@@ -488,7 +500,7 @@
           reviewUserName: score.reviewUserName || '-', // 复核人姓名(从详情顶层获取)
           reviewScore: score.reviewScore, // 复核得分
           reviewRejectReson: score.reviewRejectReson || '', // 复核不通过原因
-          materialDescription: score.attachments || '', // 资料说明(使用附件字段,字符串)
+          materialDescription: JSON.parse(score.attachments) || '', // 资料说明(使用附件字段,字符串)
           attachmentFileList: parseAttachmentsToFileList(score.attachments || ''), // 资料说明对应的附件文件列表
           isReviewInput: score.isReviewInput, // 是否显示复核得分输入框
           // reviewRejectResonShow: detail.isSelfApproveButton || '', // 复核不通过原因

+ 1 - 0
src/views/production-safety/safetyAssessment/evaluationSystem/configs/tables.ts

@@ -26,6 +26,7 @@ export const EVALUATION_SYSTEM_TABLE_COLUMNS: TableColumnProps[] = [
   {
     label: '下发部门',
     prop: 'issueDepartment',
+    showOverflowTooltip: true,
     align: 'left',
     minWidth: '120px',
   },