From 23e1eec2e735c4f75f0364ab5fcd1a6d947277b9 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Tue, 23 Jul 2024 17:10:49 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E5=9B=BD=E6=A0=87=E5=A4=96=E6=A0=87?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=96=87=E4=BB=B6=E6=9C=89pdfId=E4=BC=98?= =?UTF-8?q?=E5=85=88=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commonPage/StandardDetailPage.vue | 6 ++++++ .../domesticStandard/DomesticStandardList.vue | 13 ++++++++++++- .../overseasStandard/OverseasStandardList.vue | 13 ++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/views/standardRegulationLibrary/commonPage/StandardDetailPage.vue b/src/views/standardRegulationLibrary/commonPage/StandardDetailPage.vue index c7553152..930bfdda 100644 --- a/src/views/standardRegulationLibrary/commonPage/StandardDetailPage.vue +++ b/src/views/standardRegulationLibrary/commonPage/StandardDetailPage.vue @@ -405,6 +405,12 @@ export default { if (!file || !file.url) { return } + if (file.pdfId) { + // 说明是onlyOffice生成的 + const url = previewPdf(file.pdfId) + window.open(url) + return + } // 截取文件后缀名 const fileSuffix = file.fileName ? file.fileName.split('.')[file.fileName.split('.').length - 1] : '' const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix.toLowerCase() === tt) diff --git a/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue b/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue index d1c24245..f76382e2 100644 --- a/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue +++ b/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue @@ -693,6 +693,14 @@ export default { } console.log('seletedFile', file) + // 预览关联的pdf文件 + if (file.pdfId) { + // 说明是onlyOffice生成的 + const url = previewPdf(file.pdfId) + window.open(url) + return + } + // 预览选择的文件 const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}` console.log(fileFullUrl) @@ -709,7 +717,10 @@ export default { */ async selectNewestFile (fileList) { if (!fileList || fileList.length === 0) return null - if (fileList.length === 1) return fileList[0] + if (fileList.length === 1) { + const res = await getFileInfo(fileList[0]) + return { ...fileList[0], ...res.result } + } const newFileList = [] // 获取时间信息 for (const file of fileList) { diff --git a/src/views/standardRegulationLibrary/overseasStandard/OverseasStandardList.vue b/src/views/standardRegulationLibrary/overseasStandard/OverseasStandardList.vue index 9dfb278e..d19952b1 100644 --- a/src/views/standardRegulationLibrary/overseasStandard/OverseasStandardList.vue +++ b/src/views/standardRegulationLibrary/overseasStandard/OverseasStandardList.vue @@ -694,6 +694,14 @@ export default { } console.log('seletedFile', file) + // 预览关联的pdf文件 + if (file.pdfId) { + // 说明是onlyOffice生成的 + const url = previewPdf(file.pdfId) + window.open(url) + return + } + // 预览选择的文件 const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}` console.log(fileFullUrl) @@ -710,7 +718,10 @@ export default { */ async selectNewestFile (fileList) { if (!fileList || fileList.length === 0) return null - if (fileList.length === 1) return fileList[0] + if (fileList.length === 1) { + const res = await getFileInfo(fileList[0]) + return { ...fileList[0], ...res.result } + } const newFileList = [] // 获取时间信息 for (const file of fileList) {