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
@@ -136,7 +136,8 @@ export default {
{
title: this.$t('docTool.comparison.oldTextState'),
width: 150,
dataIndex: 'fileTypeLeft_dictText'
dataIndex: 'fileTypeLeft_dictText',
scopedSlots: { customRender: 'dictText' }
},
// 新文档文本号
{
@@ -156,13 +157,15 @@ export default {
{
title: this.$t('docTool.comparison.newTextState'),
width: 150,
dataIndex: 'fileTypeRight_dictText'
dataIndex: 'fileTypeRight_dictText',
scopedSlots: { customRender: 'dictText' }
},
// 发布情况
{
title: this.$t('docTool.comparison.releaseSituation'),
width: 150,
dataIndex: 'releaseState_dictText'
dataIndex: 'releaseState_dictText',
scopedSlots: { customRender: 'dictText' }
},
// 创建人
{
@@ -256,6 +259,11 @@ export default {
onOk: () => {
const idList = []
const selectionRows = JSON.parse(JSON.stringify(this.selectionRows))
// 发布状态不能删除
if (selectionRows.some(item => item.releaseState !== 'draft')) {
this.$message.warning(this.$t('publishedAndCannotDeleted'))
return
}
for (let i = 0; i < selectionRows.length; i++) {
if (selectionRows[i].createBy === this.userInfo.username &&
selectionRows[i].releaseState === 'draft') {
@@ -166,7 +166,7 @@ export default {
queryParamLeft: {},
ipaginationLeft: {
current: 1,
pageSize: 50,
pageSize: 10,
pageSizeOptions: ['10', '50', '100', '150', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
@@ -182,7 +182,7 @@ export default {
queryParamRight: {},
ipaginationRight: {
current: 1,
pageSize: 50,
pageSize: 10,
pageSizeOptions: ['10', '50', '100', '150', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
@@ -230,7 +230,8 @@ export default {
title: this.$t('docTool.comparison.textStatus'),
ellipsis: true,
dataIndex: 'fileType_dictText',
width: 100
width: 100,
scopedSlots: { customRender: 'dictText' }
},
{
title: this.$t('fileName'),
@@ -263,7 +264,8 @@ export default {
title: this.$t('docTool.comparison.textStatus'),
ellipsis: true,
dataIndex: 'fileType_dictText',
width: 100
width: 100,
scopedSlots: { customRender: 'dictText' }
},
{
title: this.$t('fileName'),
@@ -96,7 +96,7 @@ import '../../../assets/less/common.less'
import JTable from '../../../components/jero/JTable.vue'
import SplitText from './modules/SplitText.vue'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import { releaseSplitStandard, changePermission, withdraw } from '@api/documentToolApi'
import { releaseSplitStandard, changePermission, withdraw, checkChangePermission } from '@api/documentToolApi'
import ImportSplitResultModal from './modules/ImportSplitResultModal.vue'
import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
import { SplitStatus, StandardSource } from '@/enums/commonEnums'
@@ -183,7 +183,8 @@ export default {
{
dataIndex: 'fileType_dictText',
title: this.$t('docTool.split.fileStatus'),
width: 150
width: 150,
scopedSlots: { customRender: 'dictText' }
},
// 文件名称
{
@@ -195,7 +196,8 @@ export default {
{
dataIndex: 'splitStatus_dictText',
title: this.$t('docTool.split.splitState'),
width: 150
width: 150,
scopedSlots: { customRender: 'dictText' }
},
// 编辑人
{
@@ -292,6 +294,7 @@ export default {
query: {
infoId: record.id,
infoNumber: record.serialNumber,
standardClass: record.standardClass,
createBy: record.createBy,
standardName: record.title
}
@@ -327,7 +330,14 @@ export default {
this.$message.warning(this.$t('selectAtLeastOne'))
return
}
this.$refs.userSelectModal.open()
// 校验是否有权限更改
checkChangePermission({ ids: this.selectedRowKeys.join(',') }).then(res => {
if (res.success) {
this.$refs.userSelectModal.open()
} else {
this.$message.warn(res.message)
}
})
},
continueChangePermission (id) {
this.loading = true
@@ -48,19 +48,19 @@
<i class="iconfont icon-shanchu_" />
</a-button>
<!--节点上移是否可以上移在树形数据中应该有字段标识-->
<a-button icon="up"
v-if="record.pid"
class="tree-operate-node-btn"
@click.stop="orgMoveUp(record)"
v-has="'split:sarFileSplitMenu:moveUp'">
</a-button>
<!--<a-button icon="up"-->
<!-- v-if="record.pid"-->
<!-- class="tree-operate-node-btn"-->
<!-- @click.stop="orgMoveUp(record)"-->
<!-- v-has="'split:sarFileSplitMenu:moveUp'">-->
<!--</a-button>-->
<!--节点下移是否可以下移在树形数据中应该有字段标识-->
<a-button icon="down"
v-if="record.pid"
class="tree-operate-node-btn"
@click.stop="orgmoveDown(record)"
v-has="'split:sarFileSplitMenu:moveDown'">
</a-button>
<!--<a-button icon="down"-->
<!-- v-if="record.pid"-->
<!-- class="tree-operate-node-btn"-->
<!-- @click.stop="orgmoveDown(record)"-->
<!-- v-has="'split:sarFileSplitMenu:moveDown'">-->
<!--</a-button>-->
</div>
</div>
</template>
@@ -243,6 +243,8 @@ export default {
mixins: [ConfigurableTableMixin],
data () {
return {
// 导入的最大大小
importMaxSize: 20,
StandardSource,
data: [],
loading: false, // 提交的加载
@@ -373,7 +375,8 @@ export default {
this.menuId = this.selectedKeys[0]
this.uploadData = {
menuId: this.menuId,
infoId: this.infoId
infoId: this.infoId,
standardClass: this.$route.query.standardClass
}
this.filters.info_id = this.infoId
this.filters.menu_id = this.menuId
@@ -17,9 +17,12 @@
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardSelect.standardNumber')">
<standard-selection :placeholder="$t('pleaseSelect') + $t('standardSelect.standardNumber')"
type="radio"
splitSearch
disabledSourceSearch
@nameChange="handleStandardNumberChange"
@listChange="handleStandardListChange"
:select-only="true"
:can-selected-source="[StandardSource.FOREIGN.value, StandardSource.ENTERPRISE.value]"
:can-selected-source="[StandardSource.FOREIGN.value]"
class="readonly-input"
v-decorator="['serialNumber', validatorRules.serialNumber]" />
</a-form-item>
@@ -111,6 +114,7 @@ export default {
validateTrigger: 'change'
}
},
standardInfo: {}, // 选择的标准
downTemplateUrl: '/laws/DocumentTool/documentSplit/downloadImportTemplate' // 模板下载
}
},
@@ -122,8 +126,10 @@ export default {
this.form.validateFields(async (errors, values) => {
if (!errors) {
this.confirmLoading = true
const formData = values
const formData = Object.assign({}, values)
const fileInfo = await getFileInfo({ id: formData.splitFileId })
formData.standardId = this.standardInfo.id
formData.standardClass = this.standardInfo.standardClass
if (fileInfo.success) {
formData.fileName = fileInfo.result.fileName
}
@@ -196,6 +202,9 @@ export default {
handleStandardNumberChange (name) {
this.form.setFieldsValue({ title: name })
},
handleStandardListChange (list) {
this.standardInfo = list[0] || {}
},
// 下载导入模板
downTemplate (fileName, fileSuffix = '.xls') {
if (!fileName || typeof fileName !== 'string') {
@@ -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
@@ -128,7 +128,7 @@ export default {
disabled: false,
titleImg: this.$t('uploadPictures'),
listType: 'picture',
accept: '.png,.jpeg,.jpg,.gif',
accept: '.png,.jpeg,.jpg',
// 表格行列相关数据
rowColForm: {},
validatorRowColRules: {
@@ -159,8 +159,11 @@ export default {
},
// 上传文件
uploadSuccess (file, data, imgs) {
this.$emit('ok', TypeOfClauseItem.IMG.value, { file, data, imgs })
this.visible = false
// 所有文件都上传完成再去关闭弹框
if (Array.isArray(imgs) && imgs.every(item => item.status === 'done')) {
this.$emit('ok', TypeOfClauseItem.IMG.value, { file, data, imgs })
this.visible = false
}
// this.$emit('addImageOk', file, data, imgs)
},
// 确定增加的类型
@@ -146,7 +146,7 @@
:label-in-value="false"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt + getPlaceholderSuffix(item)" />
<!--16树形弹框选择-->
<tree-selection v-else-if="item.fieldShowType === FieldType.TREE_MODAL_SELECT.value"
<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"
@@ -108,7 +108,8 @@ export default {
{
dataIndex: 'origin_dictText',
title: this.$t('docTool.split.dataType'),
width: 150
width: 150,
scopedSlots: { customRender: 'dictText' }
},
// 标准号
{
@@ -126,7 +127,8 @@ export default {
{
dataIndex: 'standardFileType_dictText',
title: this.$t('docTool.comparison.textStatus'),
width: 150
width: 150,
scopedSlots: { customRender: 'dictText' }
},
// 附件
{
@@ -151,6 +153,20 @@ export default {
this.loadStandardStructureTree()
},
methods: {
// 获取树结构没有被禁用的value值
getValuesWhereNotDisabled (tree = []) {
const values = []
function traverse (node) {
if (!node.disabled) { // 只处理 disabled 不为 true 的节点
values.push(node.value)
}
if (node.children && node.children.length > 0) {
node.children.forEach(child => traverse(child))
}
}
tree.forEach(node => traverse(node))
return values
},
getQueryParams () {
// 获取查询条件
const sqp = {}
@@ -162,17 +178,18 @@ export default {
param.field = this.getQueryField()
param.pageNo = this.ipagination.current
param.pageSize = this.ipagination.pageSize
if (Array.isArray(param.standardSystem)) {
if (Array.isArray(param.standardSystem) && param.standardSystem.length) {
param.standardSystem = param.standardSystem.map(item => item.value).join(',')
} else {
param.standardSystem = this.getValuesWhereNotDisabled(this.standardStructureTree).join(',')
}
return filterObj(param)
},
// 加载标准结构树
loadStandardStructureTree () {
// option 不传显示我的收藏,1不显示我的收藏
getForeignStandardTree({ option: 1 }).then(res => {
// option 不传显示我的收藏,1不显示我的收藏, 2只能选二级中国及中国下三级,和欧盟EU
getForeignStandardTree({ option: 2 }).then(res => {
if (res.success) {
console.log(res.result)
this.standardStructureTree = res.result || []
}
})
@@ -132,14 +132,14 @@ export default {
title: this.$t('docTool.ocrTextRecognition.textStatus'),
align: 'center',
width: 180,
dataIndex: 'fileTypeDictText',
scopedSlots: { customRender: 'text' }
dataIndex: 'fileType_dictText',
scopedSlots: { customRender: 'dictText' }
},
{ // 转换结果
title: this.$t('docTool.ocrTextRecognition.conversionResults'),
align: 'center',
width: 180,
dataIndex: 'resultContentDictText',
dataIndex: this.isChinese() ? 'resultContent_dictText' : 'resultContent_dictTextEn',
scopedSlots: { customRender: 'tag' }
},
{ // 消耗时间
@@ -88,7 +88,8 @@ export default {
{
dataIndex: 'origin_dictText',
title: this.$t('docTool.split.dataType'),
width: 150
width: 150,
scopedSlots: { customRender: 'dictText' }
},
// 标准号
{
@@ -106,7 +107,8 @@ export default {
{
dataIndex: 'standardFileType_dictText',
title: this.$t('docTool.comparison.textStatus'),
width: 150
width: 150,
scopedSlots: { customRender: 'dictText' }
},
// 附件
{