30 lines
1.2 KiB
JavaScript
30 lines
1.2 KiB
JavaScript
/**
|
|
* 工作流文件在线编辑预览
|
|
*/
|
|
import { onlyOfficeUrl,kkFileViewUrl } from '@/sysConfig'
|
|
import { processEditFile } from 'api/process'
|
|
let Base64 = require('js-base64').Base64;
|
|
export default (id,nodeName,userId,userName) => {
|
|
processEditFile({
|
|
id
|
|
}).then(res => {
|
|
if(res){
|
|
const editFileInfo = res
|
|
const showName = nodeName
|
|
const editFilePath = editFileInfo.editFilePath.split("/")
|
|
editFileInfo.filePath = editFilePath[0]+'/'+editFilePath[1]+'/'
|
|
editFileInfo.fileName = editFilePath[2]
|
|
editFileInfo.userId = userId
|
|
editFileInfo.userName = userName
|
|
if(editFileInfo.pid){
|
|
editFileInfo.pId = editFileInfo.pid
|
|
}
|
|
editFileInfo.fileSuffix = 'docx'
|
|
const nowTime = new Date().getTime()
|
|
window.open(onlyOfficeUrl+'/onlyOffice?oldFileName=' + showName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
|
|
}
|
|
}).catch(e => {
|
|
})
|
|
}
|
|
|