From ec9514ee6330e88ed610e25be989514a7a85fdfc Mon Sep 17 00:00:00 2001 From: zyn Date: Thu, 6 Apr 2023 00:32:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=80=E6=9C=AF=E6=A0=87=E5=87=86(=E5=BE=81?= =?UTF-8?q?=E6=B1=82=E6=84=8F=E8=A7=81)-=E5=88=9B=E5=BB=BA=E6=9D=A1?= =?UTF-8?q?=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/creatProcess/qbrk/step5.vue | 59 ++++++++++++++----- 1 file changed, 43 insertions(+), 16 deletions(-) diff --git a/src/pages/processCenter/pages/creatProcess/qbrk/step5.vue b/src/pages/processCenter/pages/creatProcess/qbrk/step5.vue index b7f4e76ac..955da075b 100644 --- a/src/pages/processCenter/pages/creatProcess/qbrk/step5.vue +++ b/src/pages/processCenter/pages/creatProcess/qbrk/step5.vue @@ -898,6 +898,7 @@ import TreeSelect from '@/components/treeSelect/treeSelect.vue'; import TreeSelectNew from '@/components/treeSelect/treeSelectNew.vue'; let Base64 = require('js-base64').Base64; + import axios from '@/common/axiosV2' export default { name: "bussLibrary5", @@ -1445,27 +1446,53 @@ previewShow(attId) { this.iframeLoading = true return new Promise((resolve, reject) => { + if(attId.indexOf('ATT_FILE') === 0){ getBusStandFileByAttId({ - attId + attId }).then(res => { - if(res){ - const history = res; - const editFileInfo = res.data - if(editFileInfo.fileSuffix.toLowerCase() === 'pdg'){ - this.iframeUrl = 'book://ssreader/e0?url='+editFileInfo.downLoadUrl - }else if(editFileInfo.fileSuffix.toLowerCase() === 'pdf'){ - this.iframeUrl = './static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id) - }else { - const nowTime = new Date().getTime() - // window.open(onlyOfficeUrl+'/onlyOffice?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName) - this.iframeUrl = kkFileViewUrl+'/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))+'&office.preview.type=pdf'; - } - this.iframeLoading = false - this.$forceUpdate() - resolve(history) + if(res){ + const history = res; + const editFileInfo = res.data + if(editFileInfo.fileSuffix.toLowerCase() === 'pdg'){ + this.iframeUrl = 'book://ssreader/e0?url='+editFileInfo.downLoadUrl + }else if(editFileInfo.fileSuffix.toLowerCase() === 'pdf'){ + this.iframeUrl = './static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id) + }else { + const nowTime = new Date().getTime() + // window.open(onlyOfficeUrl+'/onlyOffice?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName) + this.iframeUrl = kkFileViewUrl+'/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))+'&office.preview.type=pdf'; } + this.iframeLoading = false + this.$forceUpdate() + resolve(history) + } }).catch(e => { }) + }else{ + axios({ + url: 'api/lawss/activiti/selectOnlineFile', + method: 'get', + params: attId + }).then(res=>{ + if(res){ + const history = res; + const editFileInfo = res.data + if(editFileInfo.fileSuffix.toLowerCase() === 'pdg'){ + this.iframeUrl = 'book://ssreader/e0?url='+editFileInfo.downLoadUrl + }else if(editFileInfo.fileSuffix.toLowerCase() === 'pdf'){ + this.iframeUrl = './static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id) + }else { + const nowTime = new Date().getTime() + // window.open(onlyOfficeUrl+'/onlyOffice?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName) + this.iframeUrl = kkFileViewUrl+'/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))+'&office.preview.type=pdf'; + } + this.iframeLoading = false + this.$forceUpdate() + resolve(history) + } + }).catch(e=>{}) + } + }) }, previewIframe(targetName, action){