fix: 手机端预览回滚

This commit is contained in:
zyn
2024-01-06 12:10:54 +08:00
parent 35453f68ea
commit 0507ed813f
+8 -10
View File
@@ -1350,29 +1350,28 @@ export default {
}) })
}, },
openFileInPdf (attId, oldFileName) { openFileInPdf (attId, oldFileName) {
this.$preview(attId) // this.$preview(attId)
/*
// 判断是否是图片格式,图片格式不预览,直接下载 // 判断是否是图片格式,图片格式不预览,直接下载
let index1 = oldFileName.lastIndexOf('.') const index1 = oldFileName.lastIndexOf('.')
let index2 = oldFileName.length const index2 = oldFileName.length
let fileSuffix = oldFileName.substring(index1, index2) let fileSuffix = oldFileName.substring(index1, index2)
//把后缀转大写 // 把后缀转大写
if (fileSuffix !== undefined && fileSuffix !== null) { if (fileSuffix !== undefined && fileSuffix !== null) {
fileSuffix = fileSuffix.toUpperCase() fileSuffix = fileSuffix.toUpperCase()
} }
if(fileSuffix !== 'pdg' && fileSuffix !== 'PDG'){ if(fileSuffix !== 'pdg' && fileSuffix !== 'PDG') {
this.getBusStandFileByAttId(attId) this.getBusStandFileByAttId(attId)
.then(res => { .then(res => {
if (res) { if (res) {
const editFileInfo = res const editFileInfo = res
const nowTime = new Date().getTime() const nowTime = new Date().getTime()
if(editFileInfo.fileSuffix.toLowerCase() === 'pdf'){ if(editFileInfo.fileSuffix.toLowerCase() === 'pdf') {
window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
}else { }else {
const nowTime = new Date().getTime() 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(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)); window.open(kkFileViewUrl + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)) + '&watermarkTxt=' + encodeURIComponent(this.$store.getters.userInfo.userName));
} }
} }
}).catch(e => { }).catch(e => {
@@ -1381,7 +1380,6 @@ export default {
}else { }else {
this.$message.warning('PDG文件,不支持手机端预览') this.$message.warning('PDG文件,不支持手机端预览')
} }
*/
}, },
showItemsModel (attField) { showItemsModel (attField) {
if (attField) { if (attField) {