commit
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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 => {
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user