update 在线编辑调试
This commit is contained in:
@@ -50,28 +50,12 @@ const getEmptyFileTemplate = (params) => {
|
||||
* @param fileId 文件id,有的话是编辑,没有是新增
|
||||
*/
|
||||
export const onlineEditor = async (params, fileId) => {
|
||||
let fileInfo = {
|
||||
'id': '1749318391395676161',
|
||||
'standId': null,
|
||||
'userId': null,
|
||||
'mesg': null,
|
||||
'taskInfo': null,
|
||||
'taskId': 'task_2442bc43',
|
||||
'fileName': 'Q/JC 40004-2023 ldq流程新建完整字段企标计划.docx',
|
||||
'createTime': '2024-01-22 14:29:39',
|
||||
'updateTime': null,
|
||||
'editStatus': null,
|
||||
'editFilePath': 'model/task_2442bc43/task_2442bc43_top_2442bc43_node.docx',
|
||||
'editType': null,
|
||||
'delFlag': '0',
|
||||
'downLoadUrl': null,
|
||||
'pid': 'top_2442bc43'
|
||||
}
|
||||
let fileInfo
|
||||
if (fileId) {
|
||||
fileInfo = await queryFileInfo(fileId)
|
||||
} else {
|
||||
const param = {
|
||||
model: `${params.standard_name}` // 处理文件名
|
||||
model: `${params.standard_number} ${params.standard_name}` // 处理文件名
|
||||
}
|
||||
fileInfo = await getEmptyFileTemplate(param)
|
||||
}
|
||||
@@ -82,9 +66,17 @@ export const onlineEditor = async (params, fileId) => {
|
||||
const userInfo = Vue.ls.get(USER_INFO)
|
||||
// 截取文件后缀名
|
||||
const fileSuffix = (fileInfo.fileName ? fileInfo.fileName.split('.')[fileInfo.fileName.split('.').length - 1] : '').toLowerCase()
|
||||
// 处理文件路径
|
||||
// const filePathArr = fileInfo.editFilePath.split('/')
|
||||
// const filePath = filePathArr[0] + '/' + filePathArr[1] + '/'
|
||||
const url = `${window._CONFIG.onlyOfficeUrl}/editor?filePath=${fileInfo.editFilePath}&fileName=${fileInfo.fileName}&fileType=${fileSuffix}&fileId=${fileInfo.id}&key=${fileInfo.id}&userId=${userInfo.id}&userName=${userInfo.realname}`
|
||||
// Q/ZZ 部分截取
|
||||
const standardNumberPrefix = params.standard_number.split(' ')[0]
|
||||
const businessParams = {
|
||||
standCode: params.standard_number,
|
||||
dtqbbhbuss: params.substitute_standard_number,
|
||||
standName: params.standard_name,
|
||||
standEnName: params.standard_english_name,
|
||||
issueTime: params.release_date,
|
||||
putTime: params.implementation_date,
|
||||
standardNumberPrefix: standardNumberPrefix
|
||||
}
|
||||
const url = `${window._CONFIG.onlyOfficeUrl}/editor?filePath=${fileInfo.editFilePath}&fileName=${fileInfo.fileName}&fileType=${fileSuffix}&fileId=${fileInfo.id}&key=${fileInfo.id}&userId=${userInfo.id}&userName=${userInfo.realname}&business=${JSON.stringify(businessParams)}`
|
||||
window.open(url, '_blank')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user