修改禅道已知bug
This commit is contained in:
@@ -196,10 +196,22 @@
|
||||
this.fileList = []
|
||||
},
|
||||
preview(file) {
|
||||
if (file.response) {
|
||||
downloadFile('/sys/common/download', file.response.result.fileName, { id: file.response.result.id })
|
||||
console.log(file)
|
||||
let fileQuery = file.response ? file.response.result : file
|
||||
let fileName = fileQuery.fileName
|
||||
let index1 = fileName.lastIndexOf('.')
|
||||
let index2 = fileName.length
|
||||
let fileSuffix = fileName.substring(index1, index2)
|
||||
if (fileSuffix == '.pdf') {
|
||||
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id))
|
||||
} else if (fileSuffix == '.docx') {
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl + '/' + fileQuery.id)
|
||||
window.open(url, '_blank')
|
||||
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl + '/' + fileQuery.id)
|
||||
window.open(url, '_blank')
|
||||
} else {
|
||||
downloadFile('/sys/common/download', file.fileName, { id: file.id })
|
||||
downloadFile('/sys/common/download', fileQuery.fileName, { id: fileQuery.id })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user