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) {