Merge branch 'master' into 标准拆分译文变更

# Conflicts:
#	src/common/lang/en-us.js
#	src/common/lang/zh-cn.js
#	src/views/documentTool/documentSplit/modules/SplitAddForm.vue
#	src/views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTable.vue
This commit is contained in:
danshihao
2024-08-14 17:15:31 +08:00
152 changed files with 3192 additions and 1176 deletions
@@ -126,6 +126,7 @@
<!-- 12, 树选择 -->
<s-tree-select
v-else-if="item.fieldShowType === FieldType.TREE.value"
:replaceFields="getReplaceFields(item.dbFieldName)"
v-model="formInline[item.dbFieldName]"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:tree-data="optionsData[item.dbFieldName]"
@@ -145,24 +146,33 @@
<!-- 15, 树选择单选 -->
<s-tree-select v-else-if="item.fieldShowType === FieldType.TREE_SINGLE.value"
v-model="formInline[item.dbFieldName]"
:replaceFields="getReplaceFields(item.dbFieldName)"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:tree-data="optionsData[item.dbFieldName]"
:label-in-value="false"
@change="updateDom"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt + getPlaceholderSuffix(item)" />
<!--16树形弹框选择-->
<tree-selection v-else-if="item.fieldShowType === FieldType.TREE_MODAL_SELECT.value"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt + getPlaceholderSuffix(item)"
v-model="formInline[item.dbFieldName]"
:filedName="item.dbFieldName"
type="checkbox"
:options-href="item.fieldHref"
:nameStr="formInline[item.dbFieldName + '_dictText']"
:dict-id="item.dictId"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:children-column-name="getTreeSelectionChildrenColumnName(item)"
:is-tag-library-restriction="item.dbFieldName === 'property_tag'"
:search-field-name="item.dbFieldName === 'property_tag' ? 'firstNodeName' : null" />
<!--<tree-selection v-else-if="item.fieldShowType === FieldType.TREE_MODAL_SELECT.value || item.fieldShowType === FieldType.TREE_MODAL_SELECT_SEARCH_DIFF.value"-->
<!-- :placeholder="$t('pleaseSelect')+item.dbFieldTxt + getPlaceholderSuffix(item)"-->
<!-- v-model="formInline[item.dbFieldName]"-->
<!-- :filedName="item.dbFieldName"-->
<!-- type="checkbox"-->
<!-- :options-href="item.fieldHref"-->
<!-- :nameStr="formInline[item.dbFieldName + '_dictText']"-->
<!-- :dict-id="item.dictId"-->
<!-- :disabled="disabled || disabledFieldList.includes(item.dbFieldName)"-->
<!-- :children-column-name="getTreeSelectionChildrenColumnName(item)"-->
<!-- :is-tag-library-restriction="item.dbFieldName === 'property_tag'"-->
<!-- :search-field-name="item.dbFieldName === 'property_tag' ? 'firstNodeName' : null" />-->
<tree-data-selection v-else-if="item.fieldShowType === FieldType.TREE_MODAL_SELECT.value || item.fieldShowType === FieldType.TREE_MODAL_SELECT_SEARCH_DIFF.value"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
v-model="formInline[item.dbFieldName]"
:fieldName="item.dbFieldName"
:nameStr="formInline[item.dbFieldName + '_dictText']"
@nameChange="treeDataSelectNameChange"
:optionsHref="item.treeFirstHref"
:dict-id="item.dictId"/>
</a-form-model-item>
</div>
</template>
@@ -177,7 +187,7 @@
<a-button type="primary" icon="plus" ghost @click="handleAddClauseContent(-1)">{{ $t('newlyAdded') }}</a-button>
</div>
<template v-if="contentList && contentList.length > 0">
<div class="clause-item" v-for="(clause, index) in contentList" :key="index + 'clause'">
<div class="clause-item" v-for="(clause, index) in contentList" :key="clause.uuid || (index + 'clause')">
<div class="clause-item-operate">
<a-button @click="handleAddClauseContent(index)">{{ $t('newlyAdded') }}</a-button>
<a-button v-if="clause.type === TypeOfClauseItem.TABLE.value" @click="splitEdit(index,clause)">
@@ -273,12 +283,15 @@ import { getAction } from '../../../../api/manage'
import { getFormDictTreeList } from '../../../../api/api'
import STreeSelect from '../../../../components/STreeSelect'
import TreeSelection from '../../../../components/selection/TreeSelection'
import { randomUUID } from '@/utils/util'
import TreeDataSelection from '@comp/selection/TreeDataSelection'
import SplitAddClauseUploadImage from '@comp/splitUpload/SplitAddClauseUploadImage'
export default {
name: 'SplitAddForm',
components: {
SplitAddClauseUploadImage,
TreeDataSelection,
TreeSelection,
JMultipleDatePicker,
SplitDetailAddTable,
@@ -294,6 +307,12 @@ export default {
hiddenFieldList: ['item_content', 'translation'], // 隐藏的字段
radioDictSelect: [], // 使用radio样式的数据字典单选
disabledFieldList: [], // 禁用的字段
// 需要英文状态下翻译下拉的字段
dictTextFieldList: [
'professional_field', // 全部-专业领域
'applicable_market', // 适用市场
'domain_area' // 条款-专业领域
],
specialPlaceholder: {}, // 特殊的placeholder
optionsData: {}, // 通过接口获取的下拉数据
title: this.$t('newlyAdded'),
@@ -343,6 +362,18 @@ export default {
}
},
methods: {
/**
* 处理英文下树结构下拉的字段替换
* @param field - 字段名
*/
getReplaceFields (field) {
const obj = {}
// 数据字典或标签内容管理英文是enTitle
if (this.dictTextFieldList.includes(field)) {
obj.title = this.isChinese() ? 'title' : 'enTitle'
}
return obj
},
/**
* 新增
*/
@@ -533,35 +564,45 @@ export default {
},
// 增加条款内容成功
handleAddOk (type, content) {
const headerArr = this.contentList.splice(0, this.addIndex + 1)
const footerArr = this.contentList.splice(-this.addIndex)
const insertArr = []
switch (type) {
case TypeOfClauseItem.TEXT.value:
for (let i = 0; i < content; i++) {
insertArr.push({
id: '',
uuid: randomUUID(),
type: TypeOfClauseItem.TEXT.value,
[this.currentFieldObj.field]: ''
})
}
break
case TypeOfClauseItem.IMG.value:
insertArr[0] = {
id: '',
type: TypeOfClauseItem.IMG.value,
[this.currentFieldObj.field]: content.file.response.result.url,
[this.currentFieldObj.tempUrlField]: window._CONFIG.domianURL + '/sys/split/file/getImage?fileName=' + content.file.response.result.fileName
// 处理上传接口报错的情况
if (content.imgs) {
content.imgs.forEach(file => {
insertArr.push({
id: '',
uuid: randomUUID(),
type: TypeOfClauseItem.IMG.value,
[this.currentFieldObj.field]: file.response.result.url,
[this.currentFieldObj.tempUrlField]: window._CONFIG.domianURL + '/sys/split/file/getImage?fileName=' + file.response.result.fileName
})
})
}
break
case TypeOfClauseItem.TABLE.value:
insertArr[0] = {
id: '',
uuid: randomUUID(),
type: 'TABLE',
[this.currentFieldObj.field]: content[0]
}
}
this.contentList = [...headerArr, ...insertArr, ...footerArr]
if (this.addIndex !== -1) {
this.contentList.splice(this.addIndex + 1, 0, ...insertArr)
} else {
this.contentList.push(...insertArr)
}
},
/**
* 译文编辑
@@ -770,6 +811,9 @@ export default {
}
return null
},
treeDataSelectNameChange (value, fieldName) {
this.formInline[fieldName + '_dictText'] = value
},
/**
* 如果字段中的usableRange只有一个值,那么就需要在placeholder中标识
* @param field