[update] 修改预览调公用方法不止word文件,其他能预览的都调
This commit is contained in:
@@ -161,8 +161,6 @@ import { getFileAccessHttpUrl, downloadFile } from '@/api/manage'
|
||||
import { getFileInfo } from '../../../../api/api'
|
||||
import { kkFilePreview } from '@/utils/kkFilePreview'
|
||||
|
||||
// 支持预览的文件类型
|
||||
const CAN_PREVIEW_FILE_TYPE = ['pdf', 'image']
|
||||
// 支持预览的文件后缀
|
||||
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
|
||||
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
||||
@@ -242,13 +240,8 @@ export default {
|
||||
window.open(url)
|
||||
return
|
||||
}
|
||||
// word用KKfile预览
|
||||
if (canPreview && (fileSuffix === 'doc' || fileSuffix === 'docx')) {
|
||||
kkFilePreview(fileFullUrl)
|
||||
return
|
||||
}
|
||||
// 如果都不能预览就下载
|
||||
downloadFile(`/sys/common/download/${file.id}`, file.fileName)
|
||||
// 其余可预览文件仍使用KKFile进行预览
|
||||
kkFilePreview(fileFullUrl)
|
||||
},
|
||||
getFileInfo (fileId) {
|
||||
return new Promise(resolve => {
|
||||
|
||||
Reference in New Issue
Block a user