This commit is contained in:
zhutianqi
2021-12-23 10:06:48 +08:00
parent c52fdb5c0f
commit d23d312d70
25 changed files with 77 additions and 772 deletions
+7
View File
@@ -5,6 +5,8 @@
import base64 from './base64'
import dateFormat from './date'
import hasPermission from './hasPermission'
import preview from './preview'
// 表单验证
import verify from './verify'
const install = function (Vue) {
@@ -31,6 +33,11 @@ const install = function (Vue) {
get () {
return hasPermission
}
},
$preview: {
get () {
return preview
}
}
})
}
+23
View File
@@ -0,0 +1,23 @@
/**
* 文件预览
*/
import { onlyOfficeUrl } from '@/sysConfig'
import { getBusStandFileByAttId } from 'api/process'
export default attId => {
getBusStandFileByAttId({
attId
}).then(res => {
if(res){
const editFileInfo = res
if(editFileInfo.fileSuffix.toLowerCase() === 'pdg'){
window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl)
}else 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)
}
}
}).catch(e => {
})
}