update 在线编辑调试
This commit is contained in:
@@ -644,5 +644,8 @@ module.exports = {
|
|||||||
// 首页
|
// 首页
|
||||||
dashboard,
|
dashboard,
|
||||||
// 工作中心
|
// 工作中心
|
||||||
workCenter
|
workCenter,
|
||||||
|
onlineEditor: {
|
||||||
|
missRequireField: '缺少必填字段'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,28 +50,12 @@ const getEmptyFileTemplate = (params) => {
|
|||||||
* @param fileId 文件id,有的话是编辑,没有是新增
|
* @param fileId 文件id,有的话是编辑,没有是新增
|
||||||
*/
|
*/
|
||||||
export const onlineEditor = async (params, fileId) => {
|
export const onlineEditor = async (params, fileId) => {
|
||||||
let fileInfo = {
|
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) {
|
if (fileId) {
|
||||||
fileInfo = await queryFileInfo(fileId)
|
fileInfo = await queryFileInfo(fileId)
|
||||||
} else {
|
} else {
|
||||||
const param = {
|
const param = {
|
||||||
model: `${params.standard_name}` // 处理文件名
|
model: `${params.standard_number} ${params.standard_name}` // 处理文件名
|
||||||
}
|
}
|
||||||
fileInfo = await getEmptyFileTemplate(param)
|
fileInfo = await getEmptyFileTemplate(param)
|
||||||
}
|
}
|
||||||
@@ -82,9 +66,17 @@ export const onlineEditor = async (params, fileId) => {
|
|||||||
const userInfo = Vue.ls.get(USER_INFO)
|
const userInfo = Vue.ls.get(USER_INFO)
|
||||||
// 截取文件后缀名
|
// 截取文件后缀名
|
||||||
const fileSuffix = (fileInfo.fileName ? fileInfo.fileName.split('.')[fileInfo.fileName.split('.').length - 1] : '').toLowerCase()
|
const fileSuffix = (fileInfo.fileName ? fileInfo.fileName.split('.')[fileInfo.fileName.split('.').length - 1] : '').toLowerCase()
|
||||||
// 处理文件路径
|
// Q/ZZ 部分截取
|
||||||
// const filePathArr = fileInfo.editFilePath.split('/')
|
const standardNumberPrefix = params.standard_number.split(' ')[0]
|
||||||
// const filePath = filePathArr[0] + '/' + filePathArr[1] + '/'
|
const businessParams = {
|
||||||
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}`
|
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')
|
window.open(url, '_blank')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
:standard-number="formInline.standard_number"
|
:standard-number="formInline.standard_number"
|
||||||
:searchParam="{projectStatus: 1}"
|
:searchParam="{projectStatus: 1}"
|
||||||
@listChange="listChange"
|
@listChange="listChange"
|
||||||
:disabled="disabled"/>
|
:disabled="disabled" />
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</div>
|
</div>
|
||||||
<!--
|
<!--
|
||||||
@@ -201,6 +201,7 @@ import StandardSelection from '@/components/selection/StandardSelection'
|
|||||||
import UploadFile from '@/components/UploadFile'
|
import UploadFile from '@/components/UploadFile'
|
||||||
import EnterprisePlanSelection from '@/components/selection/EnterprisePlanSelection'
|
import EnterprisePlanSelection from '@/components/selection/EnterprisePlanSelection'
|
||||||
import TreeSelection from '@/components/selection/TreeSelection'
|
import TreeSelection from '@/components/selection/TreeSelection'
|
||||||
|
import error from '../../../result/Error'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'BaseInfoForm',
|
name: 'BaseInfoForm',
|
||||||
@@ -680,6 +681,20 @@ export default {
|
|||||||
standard_name: this.formInline.standard_name, // 标准名称
|
standard_name: this.formInline.standard_name, // 标准名称
|
||||||
standard_english_name: this.formInline.standard_english_name // 标准英文名称
|
standard_english_name: this.formInline.standard_english_name // 标准英文名称
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 校验部分字段
|
||||||
|
* @param fields
|
||||||
|
*/
|
||||||
|
validateFormByFields (fields) {
|
||||||
|
const resultList = []
|
||||||
|
this.$refs.ruleForm.validateField(fields, (error) => {
|
||||||
|
resultList.push(error)
|
||||||
|
})
|
||||||
|
if (resultList.every(tt => !tt)) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,14 +206,14 @@ export default {
|
|||||||
* 跳转在线编辑
|
* 跳转在线编辑
|
||||||
*/
|
*/
|
||||||
toOnlineEditor () {
|
toOnlineEditor () {
|
||||||
// 获取参数(用于自动生成封面,企标编号、代替标准号、发布日期、实施日期、企标名称)
|
// 获取参数(用于自动生成封面)
|
||||||
// const params = this.$refs.baseInfoForm.getOnlineEditorParams()
|
const params = this.$refs.baseInfoForm.getOnlineEditorParams()
|
||||||
// 第一个参数type:如果之前没有文件,就是add,否则是edit
|
// 校验必填字段(最后一个字段是企标编号)
|
||||||
const params = {
|
const requiredField = ['implementation_date', 'release_date', 'standard_name', 'standard_number', 'espId']
|
||||||
standard_number: 'Q/JC 40004-2023',
|
const validateResult = this.$refs.baseInfoForm.validateFormByFields(requiredField)
|
||||||
standard_name: 'ldq流程新建完整字段企标计划'
|
if (validateResult) {
|
||||||
|
onlineEditor(params)
|
||||||
}
|
}
|
||||||
onlineEditor(params)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user