From 23078474261a7ba1393ed414cf97ddc2c549a7d6 Mon Sep 17 00:00:00 2001 From: zhutianqi Date: Thu, 23 Dec 2021 10:08:50 +0800 Subject: [PATCH] commit --- src/components/CustomFormComponents/File.vue | 53 ++++++++------------ 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/src/components/CustomFormComponents/File.vue b/src/components/CustomFormComponents/File.vue index dba1a65e4..fb95df303 100644 --- a/src/components/CustomFormComponents/File.vue +++ b/src/components/CustomFormComponents/File.vue @@ -353,39 +353,26 @@ export default { this.$message.warning('文件不存在,下载失败') } } else { - this.getBusStandFileByAttId(attId) - .then(res => { - console.log(res) - if(res){ - const editFileInfo = res - console.log(editFileInfo) - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - 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('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) - } - // switch (res.convertState) { - // case 'ERROR': - // this.$message.warning('文档转换失败') - // break - // case 'LODING': - // this.$message.info('文档转换中,请稍后查看') - // break - // case 'SUCCESS': - // const { convertFileInfo } = res - // window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + convertFileInfo.id)) - // break - // } - }).catch(e => { - console.log(e) - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) + // this.getBusStandFileByAttId(attId) + // .then(res => { + // console.log(res) + // if(res){ + // const editFileInfo = res + // console.log(editFileInfo) + // if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ + // window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) + // }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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) + // } + // } + // }).catch(e => { + // console.log(e) + // this.$message.warning('文件不存在,预览失败') + // }) } },