Browse Source

审计预警监督--附件变回可在线预览、给用户加上附件预览提示

main
buaixuexideshitongxue 1 month ago
parent
commit
049da9fa00
  1. 79
      src/components/file/list.vue
  2. 10
      src/views/report/edit/controlPrice.vue

79
src/components/file/list.vue

@ -258,48 +258,55 @@ let initialY = 0;
const fileRrror = ref(false);
const tableDatas = ref([])
function filePreview(file) {
if (!file?.filePath) {
ElMessage?.warning?.('文件路径不存在,无法下载')
return
}
const url = `${BASE_PATH}/file/stream/${file.filePath}`
const type = getFileType(file.fileName)
// 1. PDF
if (type === FileType.PDF) {
window.open(url, '_blank')
return
}
// 2. Word / Excel
if (
type === FileType.WORD ||
type === FileType.EXCEL
) {
const a = document.createElement('a')
a.href = url
a.download = file.fileName || ''
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
return
}
// 3.
const a = document.createElement('a')
a.href = url
a.download = file.fileName || ''
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
activeIndex.value = index;
activeFile.value = file;
console.log(activeFile.value)
preview.value = true;
activeFile.value = file;
rotate.value = 0;
scale.value = 1;
translateX.value = 0;
translateY.value = 0;
moveFlag = false;
// if (!file?.filePath) {
// ElMessage?.warning?.('')
// return
// }
// const url = `${BASE_PATH}/file/stream/${file.filePath}`
// const type = getFileType(file.fileName)
// // 1. PDF
// if (type === FileType.PDF) {
// window.open(url, '_blank')
// return
// }
// // 2. Word / Excel
// if (
// type === FileType.WORD ||
// type === FileType.EXCEL
// ) {
// const a = document.createElement('a')
// a.href = url
// a.download = file.fileName || ''
// document.body.appendChild(a)
// a.click()
// document.body.removeChild(a)
// return
// }
//
// // 3.
// const a = document.createElement('a')
// a.href = url
// a.download = file.fileName || ''
// document.body.appendChild(a)
// a.click()
// document.body.removeChild(a)
//
// activeIndex.value = index;
// activeFile.value = file;
// console.log(activeFile.value)
// preview.value = true;
// rotate.value = 0;
// scale.value = 1;
// translateX.value = 0;
// translateY.value = 0;
// moveFlag = false;
}

10
src/views/report/edit/controlPrice.vue

@ -1304,6 +1304,16 @@ function hasAuditAttachment() {
<el-tab-pane v-if="formData.review?.isCross === '1'" label="对审附件" name="cross"></el-tab-pane>
<el-tab-pane v-if="showSjbg()" label="审计报告" name="sjbg"></el-tab-pane>
</el-tabs>
<!-- 新增的提示信息 -->
<div class="table-tips" style="margin-bottom: 10px; ">
<el-alert
title='点击序号左侧"小三角"可以展开查看附件详情'
type="warning"
:closable="false"
show-icon
style="padding: 8px 16px; "
/>
</div>
<el-table :data="formData.files[activeName]" preserve-expanded-content style="z-index:9">
<el-table-column type="expand">
<template #default="props">

Loading…
Cancel
Save