From 63098c8fcfaaf1d5b22e3cf554b0248c6eaba56d Mon Sep 17 00:00:00 2001 From: zyd Date: Thu, 22 Sep 2022 22:20:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BE=81=E6=B1=82=E6=84=8F=E8=A7=81?= =?UTF-8?q?=E5=A1=AB=E5=86=99=E6=84=8F=E8=A7=81=E9=A1=B5=E9=9D=A2=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=96=87=E4=BB=B6=E6=9C=BA=E5=88=B6=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bzzqyj/ZQYJAddFileDetails.vue | 60 +++++++++++++------ 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/src/pages/processCenter/pages/creatProcess/bzzqyj/ZQYJAddFileDetails.vue b/src/pages/processCenter/pages/creatProcess/bzzqyj/ZQYJAddFileDetails.vue index c5702479f..cf88d25e8 100644 --- a/src/pages/processCenter/pages/creatProcess/bzzqyj/ZQYJAddFileDetails.vue +++ b/src/pages/processCenter/pages/creatProcess/bzzqyj/ZQYJAddFileDetails.vue @@ -91,27 +91,51 @@ previewShow(attId) { this.iframeLoading = true return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - 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)); + this.$http.get('lawss/sarStandFile/queryConvertAtt', { + attId: attId + }, { + _this: this + }, res => { + if (res.data) { + let fileObj = {} + fileObj.fileId = res.data.attId + fileObj.fileName = res.data.fileOldName + let fileList = [] + let repeatData = 0 + if (sessionStorage.getItem('fileInfo')) { + fileList = JSON.parse(sessionStorage.getItem('fileInfo')) + if (fileList != null && fileList.length > 0) { + for (let i = 0; i < fileList.length; i++) { + if (fileList[i].fileId === res.data.attId) { + repeatData = 1 + break + } + } + if (repeatData === 0) { + fileList.push(fileObj) + fileList = JSON.stringify(fileList) + sessionStorage.setItem('fileInfo', fileList) + } + } + } else { + fileList.push(fileObj) + fileList = JSON.stringify(fileList) + sessionStorage.setItem('fileInfo', fileList) } - this.iframeLoading = false - this.$forceUpdate() - resolve(history) + this.iframeUrl = './static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + res.data.attId) + } else { + this.$message.error('文档未转换成功或该文档无法读取') } - }).catch(e => { + this.iframeLoading = false + this.$forceUpdate() + resolve(history) + }, e => { + this.iframeLoading = false + this.$forceUpdate() + resolve(history) + this.$message.error('文档未转换成功或该文档无法读取') }) + }) console.log(this.iframeUrl); },