From 0507ed813f011a7c1b0a7ac6f4ad47fca6cf95da Mon Sep 17 00:00:00 2001 From: zyn Date: Sat, 6 Jan 2024 12:10:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=89=8B=E6=9C=BA=E7=AB=AF=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/phone/zlzxDetails.vue | 56 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/src/pages/phone/zlzxDetails.vue b/src/pages/phone/zlzxDetails.vue index 1a76bf048..e1badcc66 100644 --- a/src/pages/phone/zlzxDetails.vue +++ b/src/pages/phone/zlzxDetails.vue @@ -1350,38 +1350,36 @@ export default { }) }, openFileInPdf (attId, oldFileName) { - this.$preview(attId) - /* - // 判断是否是图片格式,图片格式不预览,直接下载 - let index1 = oldFileName.lastIndexOf('.') - let index2 = oldFileName.length - let fileSuffix = oldFileName.substring(index1, index2) - //把后缀转大写 - if (fileSuffix !== undefined && fileSuffix !== null) { - fileSuffix = fileSuffix.toUpperCase() - } - if(fileSuffix !== 'pdg' && fileSuffix !== 'PDG'){ - this.getBusStandFileByAttId(attId) - .then(res => { - if (res) { - const editFileInfo = res - const nowTime = new Date().getTime() - if(editFileInfo.fileSuffix.toLowerCase() === 'pdf'){ - window.open('/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) - window.open(kkFileViewUrl+'/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)) + '&watermarkTxt=' + encodeURIComponent(this.$store.getters.userInfo.userName)); + // this.$preview(attId) - } - } - }).catch(e => { + // 判断是否是图片格式,图片格式不预览,直接下载 + const index1 = oldFileName.lastIndexOf('.') + const index2 = oldFileName.length + let fileSuffix = oldFileName.substring(index1, index2) + // 把后缀转大写 + if (fileSuffix !== undefined && fileSuffix !== null) { + fileSuffix = fileSuffix.toUpperCase() + } + if(fileSuffix !== 'pdg' && fileSuffix !== 'PDG') { + this.getBusStandFileByAttId(attId) + .then(res => { + if (res) { + const editFileInfo = res + const nowTime = new Date().getTime() + if(editFileInfo.fileSuffix.toLowerCase() === 'pdf') { + window.open('/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) + window.open(kkFileViewUrl + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)) + '&watermarkTxt=' + encodeURIComponent(this.$store.getters.userInfo.userName)); + } + } + }).catch(e => { this.$message.warning('文件不存在,预览失败') }) - }else { - this.$message.warning('PDG文件,不支持手机端预览') - } - */ + }else { + this.$message.warning('PDG文件,不支持手机端预览') + } }, showItemsModel (attField) { if (attField) {