|
|
@@ -43,13 +43,29 @@
|
|
|
<el-table-column label="评分方式" prop="scoringMethod" min-width="150" />
|
|
|
<el-table-column label="加减分项" prop="scoreType" min-width="120" />
|
|
|
<el-table-column label="自评得分" prop="selfScore" min-width="120" />
|
|
|
- <el-table-column label="资料说明" prop="materialDescription" min-width="400">
|
|
|
+ <el-table-column label="资料说明" prop="materialDescription" min-width="200">
|
|
|
<template #default="scope">
|
|
|
- <UploadFiles
|
|
|
- label="上传附件"
|
|
|
- :file-list="scope.row.attachmentFileList"
|
|
|
- @uploadSuccess="(files) => handleRowUploadSuccess(scope.$index, files)"
|
|
|
- />
|
|
|
+ <div
|
|
|
+ class="file-container--div"
|
|
|
+ v-for="item in parseAttachments(scope.row.materialDescription)"
|
|
|
+ :key="item.fileUrl"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ class="file-container--div__icon"
|
|
|
+ @click="previewOnline(item.fileUrl, item.fileType as keyof typeof FILE_TYPE_ICON)"
|
|
|
+ :src="FILE_TYPE_ICON[item.fileType]"
|
|
|
+ />
|
|
|
+ <span
|
|
|
+ class="file-container--div__name"
|
|
|
+ @click="previewOnline(item.fileUrl, item.fileType as keyof typeof FILE_TYPE_ICON)"
|
|
|
+ >{{ item.fileName }}</span
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ class="file-container--div__download"
|
|
|
+ :src="DownloadIcon"
|
|
|
+ @click="downloadFile(item.fileUrl, item.fileName)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="复核人姓名" prop="reviewUserName" min-width="120" />
|
|
|
@@ -106,7 +122,6 @@
|
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
import type { FormInstance } from 'element-plus';
|
|
|
- import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
|
|
|
import {
|
|
|
querySecurityExamineIssueDetail,
|
|
|
updateSecurityExamineIssueReviewSubmit,
|
|
|
@@ -119,6 +134,10 @@
|
|
|
} from '@/api/evaluationSystem';
|
|
|
import type { FileItem } from '@/components/UploadFiles/types';
|
|
|
import { formatAttachmentList } from '@/components/UploadFiles/utils';
|
|
|
+ import DownloadIcon from '@/views/disaster/disaster-control/src/svg/download.svg';
|
|
|
+ import { downloadFile } from '@/views/disaster/utils';
|
|
|
+ import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
|
|
|
+ import { FILE_TYPE_ICON } from '@/components/UploadFiles/constants';
|
|
|
|
|
|
const props = defineProps<{
|
|
|
id: number;
|
|
|
@@ -322,10 +341,51 @@
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- // 行内上传附件成功
|
|
|
- const handleRowUploadSuccess = (rowIndex: number, files: FileItem[]) => {
|
|
|
- if (!evaluationItems.value[rowIndex]) return;
|
|
|
- evaluationItems.value[rowIndex].attachmentFileList = files;
|
|
|
+ // 预览
|
|
|
+ const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
|
|
|
+ const previewOnline = (url: string | undefined, type: keyof typeof FILE_TYPE_ICON) => {
|
|
|
+ if (url) {
|
|
|
+ previewOnlineRef.value?.open(url, type);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 解析逗号分隔的URL字符串为文件列表(用于表格资料说明展示)
|
|
|
+ const parseAttachments = (
|
|
|
+ attachmentsStr: string | undefined,
|
|
|
+ ): Array<{
|
|
|
+ fileUrl: string;
|
|
|
+ fileName: string;
|
|
|
+ fileType: string;
|
|
|
+ }> => {
|
|
|
+ if (!attachmentsStr || !attachmentsStr.trim()) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+
|
|
|
+ const urls = attachmentsStr
|
|
|
+ .split(',')
|
|
|
+ .map((url) => url.trim())
|
|
|
+ .filter((url) => url);
|
|
|
+
|
|
|
+ return urls.map((url) => {
|
|
|
+ const urlParts = url.split('/');
|
|
|
+ const fileName = urlParts[urlParts.length - 1] || '未知文件';
|
|
|
+
|
|
|
+ const extension = fileName.split('.').pop()?.toLowerCase() || '';
|
|
|
+ let fileType = 'pdf';
|
|
|
+ if (extension === 'doc' || extension === 'docx') {
|
|
|
+ fileType = 'word';
|
|
|
+ } else if (extension === 'xls' || extension === 'xlsx') {
|
|
|
+ fileType = 'excel';
|
|
|
+ } else if (extension === 'ppt' || extension === 'pptx') {
|
|
|
+ fileType = 'ppt';
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ fileUrl: url,
|
|
|
+ fileName,
|
|
|
+ fileType,
|
|
|
+ };
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
// 将逗号分隔的 URL 字符串转换为 FileItem[] 格式
|
|
|
@@ -537,6 +597,7 @@
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
@use '@/styles/page-details-layout.scss' as *;
|
|
|
+ @use '@/styles/basic-table-file.scss' as *;
|
|
|
|
|
|
.reject-alert {
|
|
|
margin-bottom: 20px;
|