diff --git a/src/views/fileTransfer/components/rectFeedbackDetail.vue b/src/views/fileTransfer/components/rectFeedbackDetail.vue index a1dd87b9..e3734353 100644 --- a/src/views/fileTransfer/components/rectFeedbackDetail.vue +++ b/src/views/fileTransfer/components/rectFeedbackDetail.vue @@ -42,9 +42,17 @@ {{ scope.row.deptName || '--' }} + - {{ scope.row.archiveName || '--' }} + + {{ scope.row.archiveName || '--' }} + + {{ scope.row.archiveName || '--' }} @@ -60,6 +68,15 @@ 整改下发人:{{ issuerName || '--' }} 联系方式:{{ issuerPhone || '--' }} + + + @@ -69,6 +86,9 @@ import { useRoute, useRouter } from 'vue-router' import { ElMessage } from 'element-plus' import { Close, Timer } from '@element-plus/icons-vue' +// ✅ 新增:引入 ViewFile 组件 +import ViewFile from '@/views/viewFile/viewFile.vue' + // API(请根据你实际路径调整) import { getRectifyDetailApi } from '@/api/filesTransfer/rectFeedback.js' @@ -84,12 +104,15 @@ const fileList = ref([]) const issuerName = ref('') const issuerPhone = ref('') +// ✅ 新增:预览相关响应式变量 +const isViewFlag = ref(false) +const currentRow = ref({}) + // 生命周期 onMounted(() => { document.body.style.overflow = 'hidden' initData() }) - onBeforeUnmount(() => { document.body.style.overflow = 'auto' }) @@ -99,23 +122,24 @@ const initData = async () => { try { const res = await getRectifyDetailApi({ id, proId }) console.log('获取整改详情成功:', res.data) - if (res.data?.code === 200) { const data = res.data.data || {} - // 1. 先赋值下发人信息(用于底部) issuerName.value = data.issuerName || '--' issuerPhone.value = data.issuerPhone || '--' // 关键:把单条记录转为数组 if (Object.keys(data).length > 0) { - fileList.value = [{ - proName: data.proName || '--', - singleProName: data.singleProName || '--', - deptName: data.deptName || '', // 避免显示 -- - archiveName: (data.contentName || ''), - description: data.description || '--', - id: data.id - }] + fileList.value = [ + { + proName: data.proName || '--', + singleProName: data.singleProName || '--', + deptName: data.deptName || '', + archiveName: data.contentName || '', + description: data.description || '--', + id: data.id, + fileId: data.fileId || '' + } + ] } else { fileList.value = [] } @@ -134,6 +158,12 @@ const initData = async () => { const handleClose = () => { router.go(-1) } + +// ✅ 新增:预览方法 +const viewFile = (row) => { + currentRow.value = row + isViewFlag.value = true +}