diff --git a/src/components/file/list.vue b/src/components/file/list.vue index a1f76b2..168fae8 100644 --- a/src/components/file/list.vue +++ b/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; } diff --git a/src/views/report/edit/controlPrice.vue b/src/views/report/edit/controlPrice.vue index e6c7569..ec24b60 100644 --- a/src/views/report/edit/controlPrice.vue +++ b/src/views/report/edit/controlPrice.vue @@ -1304,6 +1304,16 @@ function hasAuditAttachment() { + +
+ +