update 在线编辑
This commit is contained in:
Vendored
+1
-1
@@ -11,7 +11,7 @@ window._CONFIG.casPrefixUrl = 'http://cas.example.org:8443/cas'
|
||||
// 预览文件地址
|
||||
window._CONFIG.onlinePreviewDomainURL = 'http://127.0.0.1:8012/onlinePreview'
|
||||
// onlyOffice前端服务地址
|
||||
window._CONFIG.onlyOfficeUrl = 'http://127.0.0.1:8080'
|
||||
window._CONFIG.onlyOfficeUrl = 'http://10.0.1.19:8083'
|
||||
// onlyOffice下载文件地址(暂时没用)
|
||||
window._CONFIG.onlyOfficeDownloadFileUrl = 'http://localhost:8184/sys/common/download'
|
||||
// 管理员角色code,英文逗号拼接
|
||||
|
||||
@@ -427,6 +427,9 @@ const queryStandardComplianceResult = (params) => getAction('/process/projectSta
|
||||
// 归档节点查询下方表格数据
|
||||
const queryStandardComplianceEvaluateDetail = (params) => getAction('/process/projectStandard/getTermApprovalList', params)
|
||||
|
||||
// 在线编辑-生成空白模板
|
||||
const generateEmptyFileTemplate = (params) => getAction('/onlyoffice/saveEditFile', params)
|
||||
|
||||
export {
|
||||
getProcessNodeList,
|
||||
urgeProcessNode,
|
||||
@@ -641,5 +644,7 @@ export {
|
||||
rejectStandardCompliance,
|
||||
queryStandardCompliance,
|
||||
queryStandardComplianceResult,
|
||||
queryStandardComplianceEvaluateDetail
|
||||
queryStandardComplianceEvaluateDetail,
|
||||
|
||||
generateEmptyFileTemplate
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
import { getFileInfo } from '../api/api'
|
||||
import { generateEmptyFileTemplate } from '../api/workCenter'
|
||||
import { USER_INFO } from '../store/mutation-types'
|
||||
import Vue from 'vue'
|
||||
|
||||
/**
|
||||
* 获取文件信息
|
||||
* @param fileId
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
const queryFileInfo = (fileId) => {
|
||||
return new Promise(resolve => {
|
||||
let fileInfo
|
||||
getFileInfo({ id: fileId }).then(res => {
|
||||
if (res.success) {
|
||||
fileInfo = res.result
|
||||
}
|
||||
}).finally(() => {
|
||||
resolve(fileInfo)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成空白模板并获取模板路径
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
const getEmptyFileTemplate = (params) => {
|
||||
return new Promise(resolve => {
|
||||
let fileInfo
|
||||
generateEmptyFileTemplate(params).then(res => {
|
||||
if (res.success) {
|
||||
fileInfo = res.result
|
||||
}
|
||||
}).finally(() => {
|
||||
resolve(fileInfo)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转在线编辑
|
||||
* @param params Object {
|
||||
* standard_number: 标准编号,
|
||||
* substitute_standard_number: 代替标准号,
|
||||
* implementation_date: 实施日期,
|
||||
* release_date: 发布日期,
|
||||
* standard_name: 标准名称
|
||||
* }
|
||||
* @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'
|
||||
}
|
||||
if (fileId) {
|
||||
fileInfo = await queryFileInfo(fileId)
|
||||
} else {
|
||||
const param = {
|
||||
model: `${params.standard_name}` // 处理文件名
|
||||
}
|
||||
fileInfo = await getEmptyFileTemplate(param)
|
||||
}
|
||||
if (!fileInfo) {
|
||||
return false
|
||||
}
|
||||
// 获取用户信息
|
||||
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}`
|
||||
window.open(url, '_blank')
|
||||
}
|
||||
@@ -186,7 +186,6 @@ import { postAction, getAction } from '@/api/manage'
|
||||
|
||||
import { getRSAPublicKey } from '@/utils/encryption.js'
|
||||
import { JSEncrypt } from 'jsencrypt'
|
||||
import onlyOfficeEdit from '@/common/onlyOffice/onlyOfficeEdit'
|
||||
// const Base64 = require('js-base64').Base64
|
||||
|
||||
export default {
|
||||
|
||||
+17
-1
@@ -12,7 +12,7 @@
|
||||
<div class="online-edit-wrapper">
|
||||
<!-- todo: 还不确定这里展示的是什么 -->
|
||||
<p>企业标准</p>
|
||||
<a-button type="primary">{{ $t('workCenter.enStandardRevision.onLineEditing') }}</a-button>
|
||||
<a-button type="primary" @click="toOnlineEditor">{{ $t('workCenter.enStandardRevision.onLineEditing') }}</a-button>
|
||||
</div>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
@@ -56,6 +56,7 @@
|
||||
import JTable from '@/components/jero/JTable'
|
||||
import BaseInfoForm from './BaseInfoForm'
|
||||
import AddEditDrafterDrawer from './AddEditDrafterDrawer'
|
||||
import { onlineEditor } from '../../../../utils/onlyOfficeUtils'
|
||||
|
||||
export default {
|
||||
name: 'MainDrafterSentBaseInfo',
|
||||
@@ -200,6 +201,19 @@ export default {
|
||||
const dataIndex = this.dataSource.findIndex(item => item.uid === this.modalType.split(',')[1])
|
||||
this.dataSource.splice(dataIndex, 1, value)
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 跳转在线编辑
|
||||
*/
|
||||
toOnlineEditor () {
|
||||
// 获取参数(用于自动生成封面,企标编号、代替标准号、发布日期、实施日期、企标名称)
|
||||
// const params = this.$refs.baseInfoForm.getOnlineEditorParams()
|
||||
// 第一个参数type:如果之前没有文件,就是add,否则是edit
|
||||
const params = {
|
||||
standard_number: 'Q/JC 40004-2023',
|
||||
standard_name: 'ldq流程新建完整字段企标计划'
|
||||
}
|
||||
onlineEditor(params)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -207,6 +221,7 @@ export default {
|
||||
|
||||
<style scoped lang="less">
|
||||
@import '~@assets/less/common.less';
|
||||
|
||||
.collapsible-content-no-head {
|
||||
border-top: 1px solid #E5E6EB;
|
||||
border-radius: 8px 8px 8px 8px;
|
||||
@@ -217,6 +232,7 @@ export default {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
p {
|
||||
margin-bottom: 0;
|
||||
height: 100%;
|
||||
|
||||
Reference in New Issue
Block a user