[update 拆分] 译文改成多字段
This commit is contained in:
@@ -497,6 +497,7 @@ module.exports = {
|
|||||||
docTool: {
|
docTool: {
|
||||||
// 文档拆分
|
// 文档拆分
|
||||||
split: {
|
split: {
|
||||||
|
translation: 'Translation',
|
||||||
splitText: 'Split Library File',
|
splitText: 'Split Library File',
|
||||||
importResults: 'Import Split Results',
|
importResults: 'Import Split Results',
|
||||||
splitState: 'Split Status',
|
splitState: 'Split Status',
|
||||||
|
|||||||
@@ -497,6 +497,7 @@ module.exports = {
|
|||||||
docTool: {
|
docTool: {
|
||||||
// 文档拆分
|
// 文档拆分
|
||||||
split: {
|
split: {
|
||||||
|
translation: '译文',
|
||||||
splitText: '拆分已入库文本',
|
splitText: '拆分已入库文本',
|
||||||
importResults: '导入拆分结果',
|
importResults: '导入拆分结果',
|
||||||
splitState: '拆分状态',
|
splitState: '拆分状态',
|
||||||
|
|||||||
@@ -156,7 +156,15 @@
|
|||||||
|
|
||||||
<!--条文内容-->
|
<!--条文内容-->
|
||||||
<template slot="item_content" slot-scope="{text, record}">
|
<template slot="item_content" slot-scope="{text, record}">
|
||||||
<div class="table-text" v-if="text || text === 0" @click="showContent('item_content', text,record)">
|
<div style="cursor: pointer;" class="table-text" v-if="text || text === 0" @click="showContent('item_content', text,record)">
|
||||||
|
{{ text && text !== 'null' ? text.replace(/<.*?>/ig, ' ') : '' }}
|
||||||
|
</div>
|
||||||
|
<div class="table-text" v-else>{{ global.emptyLine }}</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!--译文-->
|
||||||
|
<template slot="translation" slot-scope="{text, record}">
|
||||||
|
<div style="cursor: pointer;" class="table-text" v-if="text || text === 0" @click="showContent('translation', text,record)">
|
||||||
{{ text && text !== 'null' ? text.replace(/<.*?>/ig, ' ') : '' }}
|
{{ text && text !== 'null' ? text.replace(/<.*?>/ig, ' ') : '' }}
|
||||||
</div>
|
</div>
|
||||||
<div class="table-text" v-else>{{ global.emptyLine }}</div>
|
<div class="table-text" v-else>{{ global.emptyLine }}</div>
|
||||||
@@ -164,7 +172,7 @@
|
|||||||
|
|
||||||
<!--条文解读-->
|
<!--条文解读-->
|
||||||
<template slot="interpretation_articles" slot-scope="{text, record}">
|
<template slot="interpretation_articles" slot-scope="{text, record}">
|
||||||
<div class="table-text" v-if="text || text === 0" @click="showContent('interpretation_articles', text,record)">
|
<div style="cursor: pointer;" class="table-text" v-if="text || text === 0" @click="showContent('interpretation_articles', text,record)">
|
||||||
{{ text && text !== 'null' ? text.replace(/<.*?>/ig, ' ') : '' }}
|
{{ text && text !== 'null' ? text.replace(/<.*?>/ig, ' ') : '' }}
|
||||||
</div>
|
</div>
|
||||||
<div class="table-text" v-else>{{ global.emptyLine }}</div>
|
<div class="table-text" v-else>{{ global.emptyLine }}</div>
|
||||||
@@ -291,7 +299,7 @@ export default {
|
|||||||
downTemplateUrl: '/laws/DocumentTool/documentSplit/downloadImportTemplate' // 模板下载
|
downTemplateUrl: '/laws/DocumentTool/documentSplit/downloadImportTemplate' // 模板下载
|
||||||
},
|
},
|
||||||
disabledMixinsCreate: true,
|
disabledMixinsCreate: true,
|
||||||
tableSlotField: ['item_content', 'interpretation_articles'],
|
tableSlotField: ['item_content', 'translation', 'interpretation_articles'],
|
||||||
uploadData: {},
|
uploadData: {},
|
||||||
isBackTitle: true,
|
isBackTitle: true,
|
||||||
expandedKeys: []
|
expandedKeys: []
|
||||||
|
|||||||
@@ -172,47 +172,46 @@
|
|||||||
|
|
||||||
<!--条款内容部分-->
|
<!--条款内容部分-->
|
||||||
<div class="header-text">
|
<div class="header-text">
|
||||||
{{ $t('docTool.split.clauseContent') }}
|
{{ $t('docTool.split.clauseContent') }} / {{ $t('docTool.split.translation') }}
|
||||||
<!--新增条款项-->
|
<!--新增条款项-->
|
||||||
<a-button type="primary" icon="plus" ghost @click="handleAddClauseContent(multiFieldEnums.content, -1)">{{ $t('newlyAdded') }}</a-button>
|
<a-button type="primary" icon="plus" ghost @click="handleAddClauseContent(-1)">{{ $t('newlyAdded') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="contentList && contentList.length > 0">
|
<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="index + 'clause'">
|
||||||
<div class="clause-item-content">
|
|
||||||
<!--文本-->
|
|
||||||
<a-input type="textarea"
|
|
||||||
:maxLength="500"
|
|
||||||
v-model="clause.itemContent"
|
|
||||||
v-if="clause.type === TypeOfClauseItem.TEXT.value" />
|
|
||||||
<!--图片-->
|
|
||||||
<viewer>
|
|
||||||
<img v-if="clause.type === TypeOfClauseItem.IMG.value"
|
|
||||||
:src="clause.thumbUrl?clause.thumbUrl:clause.itemContent"
|
|
||||||
alt="">
|
|
||||||
</viewer>
|
|
||||||
<!--表格-->
|
|
||||||
<div v-if="clause.type === TypeOfClauseItem.TABLE.value" v-html="clause.itemContent"></div>
|
|
||||||
</div>
|
|
||||||
<div class="clause-item-operate">
|
<div class="clause-item-operate">
|
||||||
<a-button @click="handleAddClauseContent(index)">{{ $t('newlyAdded') }}</a-button>
|
<a-button @click="handleAddClauseContent(index)">{{ $t('newlyAdded') }}</a-button>
|
||||||
<a-button v-if="clause.type === TypeOfClauseItem.TABLE.value" @click="splitEdit(multiFieldEnums.content,index,clause)">{{
|
<a-button v-if="clause.type === TypeOfClauseItem.TABLE.value" @click="splitEdit(index,clause)">
|
||||||
$t('edit')
|
{{ $t('edit') }}
|
||||||
}}
|
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button @click="handleDeleteClauseContent(multiFieldEnums.content, index, clause)">{{ $t('delete') }}</a-button>
|
<!--编辑译文表格-->
|
||||||
|
<a-button v-if="clause.type === TypeOfClauseItem.TABLE.value"
|
||||||
|
@click="splitEditTranslation(index,clause)">
|
||||||
|
{{ $t('edit') + $t('docTool.split.translation') }}
|
||||||
|
</a-button>
|
||||||
|
<!--没有图片时,新增译文图片-->
|
||||||
|
<a-button v-if="clause.type === TypeOfClauseItem.IMG.value && !clause.translation"
|
||||||
|
@click="splitEditTranslation(index,clause)">
|
||||||
|
{{ $t('newlyAdded') + $t('docTool.split.translation') + $t('docTool.split.picture') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button @click="handleDeleteClauseContent(index, clause)">{{ $t('delete') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="clause-item-box">
|
||||||
</template>
|
<div class="clause-item-content">
|
||||||
|
<!--文本-->
|
||||||
<!--译文部分-->
|
<a-input type="textarea"
|
||||||
<div class="header-text">
|
:maxLength="500"
|
||||||
{{ $t('docTool.split.translation') }}
|
v-model="clause.itemContent"
|
||||||
<!--新增条款项-->
|
v-if="clause.type === TypeOfClauseItem.TEXT.value" />
|
||||||
<a-button type="primary" icon="plus" ghost @click="handleAddClauseContent(multiFieldEnums.translation, -1)">{{ $t('newlyAdded') }}</a-button>
|
<!--图片-->
|
||||||
</div>
|
<viewer>
|
||||||
<template v-if="translationList && translationList.length > 0">
|
<img v-if="clause.type === TypeOfClauseItem.IMG.value"
|
||||||
<div class="clause-item" v-for="(clause, index) in translationList" :key="index + 'translation'">
|
:src="clause[operateField.content.tempUrlField] ? clause[operateField.content.tempUrlField] : clause.itemContent"
|
||||||
<div class="clause-item-content">
|
alt="">
|
||||||
|
</viewer>
|
||||||
|
<!--表格-->
|
||||||
|
<div v-if="clause.type === TypeOfClauseItem.TABLE.value" v-html="clause.itemContent"></div>
|
||||||
|
</div>
|
||||||
|
<div class="clause-item-content" style="margin-left: 20px;">
|
||||||
<!--文本-->
|
<!--文本-->
|
||||||
<a-input type="textarea"
|
<a-input type="textarea"
|
||||||
:maxLength="500"
|
:maxLength="500"
|
||||||
@@ -221,19 +220,12 @@
|
|||||||
<!--图片-->
|
<!--图片-->
|
||||||
<viewer>
|
<viewer>
|
||||||
<img v-if="clause.type === TypeOfClauseItem.IMG.value"
|
<img v-if="clause.type === TypeOfClauseItem.IMG.value"
|
||||||
:src="clause.thumbUrl?clause.thumbUrl:clause.translation"
|
:src="clause[operateField.translation.tempUrlField] ? clause[operateField.translation.tempUrlField] : clause.translation"
|
||||||
alt="">
|
alt="">
|
||||||
</viewer>
|
</viewer>
|
||||||
<!--表格-->
|
<!--表格-->
|
||||||
<div v-if="clause.type === TypeOfClauseItem.TABLE.value" v-html="clause.translation"></div>
|
<div v-if="clause.type === TypeOfClauseItem.TABLE.value" v-html="clause.translation"></div>
|
||||||
</div>
|
</div>
|
||||||
<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(multiFieldEnums.translation,index,clause)">{{
|
|
||||||
$t('edit')
|
|
||||||
}}
|
|
||||||
</a-button>
|
|
||||||
<a-button @click="handleDeleteClauseContent(multiFieldEnums.translation, index, clause)">{{ $t('delete') }}</a-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -244,6 +236,15 @@
|
|||||||
<a-button type="primary" class="footer-btn-save" @click="handleSave">{{ $t('preservation') }}</a-button>
|
<a-button type="primary" class="footer-btn-save" @click="handleSave">{{ $t('preservation') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 上传图片弹框 -->
|
||||||
|
<split-add-clause-upload-image
|
||||||
|
ref="uploadImg"
|
||||||
|
:disabled="disabled"
|
||||||
|
:title="$t('uploadPictures')"
|
||||||
|
listType="picture"
|
||||||
|
accept=".png,.jpeg,.jpg,.gif"
|
||||||
|
@uploadSuccess="uploadSuccess">
|
||||||
|
</split-add-clause-upload-image>
|
||||||
<!-- 类型选择弹框 -->
|
<!-- 类型选择弹框 -->
|
||||||
<split-detail-add-type-check ref="splitDetailAddTypeCheck" @ok="handleAddOk" />
|
<split-detail-add-type-check ref="splitDetailAddTypeCheck" @ok="handleAddOk" />
|
||||||
<!-- 编辑表格弹框 -->
|
<!-- 编辑表格弹框 -->
|
||||||
@@ -271,10 +272,12 @@ import { getAction } from '../../../../api/manage'
|
|||||||
import { getFormDictTreeList } from '../../../../api/api'
|
import { getFormDictTreeList } from '../../../../api/api'
|
||||||
import STreeSelect from '../../../../components/STreeSelect'
|
import STreeSelect from '../../../../components/STreeSelect'
|
||||||
import TreeSelection from '../../../../components/selection/TreeSelection'
|
import TreeSelection from '../../../../components/selection/TreeSelection'
|
||||||
|
import SplitAddClauseUploadImage from '@comp/splitUpload/SplitAddClauseUploadImage'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SplitAddForm',
|
name: 'SplitAddForm',
|
||||||
components: {
|
components: {
|
||||||
|
SplitAddClauseUploadImage,
|
||||||
TreeSelection,
|
TreeSelection,
|
||||||
JMultipleDatePicker,
|
JMultipleDatePicker,
|
||||||
SplitDetailAddTable,
|
SplitDetailAddTable,
|
||||||
@@ -293,26 +296,16 @@ export default {
|
|||||||
specialPlaceholder: {}, // 特殊的placeholder
|
specialPlaceholder: {}, // 特殊的placeholder
|
||||||
optionsData: {}, // 通过接口获取的下拉数据
|
optionsData: {}, // 通过接口获取的下拉数据
|
||||||
title: this.$t('newlyAdded'),
|
title: this.$t('newlyAdded'),
|
||||||
// 多字段的数据枚举
|
|
||||||
multiFieldEnums: Object.freeze({
|
|
||||||
content: {
|
|
||||||
thisField: 'contentList',
|
|
||||||
dataField: 'itemContent',
|
|
||||||
index: 'contentAddIndex'
|
|
||||||
},
|
|
||||||
translation: {
|
|
||||||
thisField: 'translationList',
|
|
||||||
dataField: 'translation',
|
|
||||||
index: 'translationAddIndex'
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
// 当前打开弹框时的对应字段枚举对象,回调时操作该字段
|
|
||||||
operateMultiFieldEnum: {},
|
|
||||||
contentList: [], // 条款内容数据
|
contentList: [], // 条款内容数据
|
||||||
translationList: [], // 译文内容数据
|
|
||||||
visible: false,
|
visible: false,
|
||||||
contentAddIndex: 0, // 新增条款的index
|
addIndex: 0, // 新增条款的index
|
||||||
translationAddIndex: 0, // 新增译文的index
|
// 操作的字段
|
||||||
|
operateField: {
|
||||||
|
content: { field: 'itemContent', tempUrlField: 'itemContentThumbUrl' },
|
||||||
|
translation: { field: 'translation', tempUrlField: 'translationThumbUrl' }
|
||||||
|
},
|
||||||
|
// 当前操作的字段,保存上面对象,方便扩展(用于回调使用)
|
||||||
|
currentFieldObj: {},
|
||||||
disabled: false,
|
disabled: false,
|
||||||
formInline: {},
|
formInline: {},
|
||||||
isFormInline: false,
|
isFormInline: false,
|
||||||
@@ -356,7 +349,6 @@ export default {
|
|||||||
this.visible = true
|
this.visible = true
|
||||||
this.formInline = {}
|
this.formInline = {}
|
||||||
this.contentList = []
|
this.contentList = []
|
||||||
this.translationList = []
|
|
||||||
this.type = 'add'
|
this.type = 'add'
|
||||||
this.getForm()
|
this.getForm()
|
||||||
},
|
},
|
||||||
@@ -511,12 +503,14 @@ export default {
|
|||||||
this.loading = true
|
this.loading = true
|
||||||
getEditClauseContent({ id: this.itemVal.id }).then(res => {
|
getEditClauseContent({ id: this.itemVal.id }).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
Object.values(this.multiFieldEnums).forEach(enums => {
|
this.contentList = [...res.result]
|
||||||
this[enums.thisField] = JSON.parse(JSON.stringify(res.result)).filter(item => item[enums.dataField])
|
this.contentList.forEach(item => {
|
||||||
this[enums.thisField].forEach(item => {
|
const imgData = item.itemContent.split('fileName=')[1]
|
||||||
const imgData = item[enums.dataField] ? item[enums.dataField].split('fileName=')[1] : ''
|
const imgDataTranslation = item.itemContent.split('fileName=')[1]
|
||||||
item.thumbUrl = window._CONFIG.domianURL + '/sys/split/file/getImage?fileName=' + imgData
|
if (item.type === TypeOfClauseItem.IMG.value) {
|
||||||
})
|
item[this.operateField.content.tempUrlField] = window._CONFIG.domianURL + '/sys/split/file/getImage?fileName=' + imgData
|
||||||
|
item[this.operateField.translation.tempUrlField] = window._CONFIG.domianURL + '/sys/split/file/getImage?fileName=' + imgDataTranslation
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
@@ -525,23 +519,21 @@ export default {
|
|||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 新增条款内容
|
* 新增条款内容
|
||||||
* @param fieldEnum - 操作的对应枚举对象
|
|
||||||
* @param index
|
* @param index
|
||||||
*/
|
*/
|
||||||
handleAddClauseContent (fieldEnum, index) {
|
handleAddClauseContent (index) {
|
||||||
// 记录操作的字段,弹框完成时用
|
this.currentFieldObj = this.operateField.content
|
||||||
this.operateMultiFieldEnum = fieldEnum
|
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
this[fieldEnum.indexField] = this[fieldEnum.thisField].length - 1
|
this.addIndex = this.contentList.length - 1
|
||||||
} else {
|
} else {
|
||||||
this[fieldEnum.indexField] = index
|
this.addIndex = index
|
||||||
}
|
}
|
||||||
this.$refs.splitDetailAddTypeCheck.open()
|
this.$refs.splitDetailAddTypeCheck.open()
|
||||||
},
|
},
|
||||||
// 增加条款内容成功
|
// 增加条款内容成功
|
||||||
handleAddOk (type, content) {
|
handleAddOk (type, content) {
|
||||||
const headerArr = this[this.operateMultiFieldEnum.thisField].splice(0, this[this.operateMultiFieldEnum.indexField] + 1)
|
const headerArr = this.contentList.splice(0, this.addIndex + 1)
|
||||||
const footerArr = this[this.operateMultiFieldEnum.thisField].splice(-this[this.operateMultiFieldEnum.indexField])
|
const footerArr = this.contentList.splice(-this.addIndex)
|
||||||
const insertArr = []
|
const insertArr = []
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TypeOfClauseItem.TEXT.value:
|
case TypeOfClauseItem.TEXT.value:
|
||||||
@@ -549,7 +541,7 @@ export default {
|
|||||||
insertArr.push({
|
insertArr.push({
|
||||||
id: '',
|
id: '',
|
||||||
type: TypeOfClauseItem.TEXT.value,
|
type: TypeOfClauseItem.TEXT.value,
|
||||||
[this.operateMultiFieldEnum.dataField]: ''
|
[this.currentFieldObj.field]: ''
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
@@ -557,29 +549,53 @@ export default {
|
|||||||
insertArr[0] = {
|
insertArr[0] = {
|
||||||
id: '',
|
id: '',
|
||||||
type: TypeOfClauseItem.IMG.value,
|
type: TypeOfClauseItem.IMG.value,
|
||||||
[this.operateMultiFieldEnum.dataField]: content.file.response.result.url,
|
[this.currentFieldObj.field]: content.file.response.result.url,
|
||||||
thumbUrl: window._CONFIG.domianURL + '/sys/split/file/getImage?fileName=' + content.file.response.result.fileName
|
[this.currentFieldObj.tempUrlField]: window._CONFIG.domianURL + '/sys/split/file/getImage?fileName=' + content.file.response.result.fileName
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case TypeOfClauseItem.TABLE.value:
|
case TypeOfClauseItem.TABLE.value:
|
||||||
insertArr[0] = {
|
insertArr[0] = {
|
||||||
id: '',
|
id: '',
|
||||||
type: 'TABLE',
|
type: 'TABLE',
|
||||||
[this.operateMultiFieldEnum.dataField]: content[0]
|
[this.currentFieldObj.field]: content[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this[this.operateMultiFieldEnum.thisField] = [...headerArr, ...insertArr, ...footerArr]
|
this.contentList = [...headerArr, ...insertArr, ...footerArr]
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 表格编辑
|
* 译文编辑
|
||||||
* @param fieldEnum - 操作的对应枚举对象
|
|
||||||
* @param index
|
* @param index
|
||||||
* @param item
|
* @param item
|
||||||
*/
|
*/
|
||||||
splitEdit (fieldEnum, index, item) {
|
splitEditTranslation (index, item) {
|
||||||
this.operateMultiFieldEnum = fieldEnum
|
this.currentFieldObj = this.operateField.translation
|
||||||
this[fieldEnum.indexField] = index
|
this.addIndex = index
|
||||||
this.$refs.splitDetailAddTable.open(item[fieldEnum.dataField])
|
// 图片
|
||||||
|
if (item.type === TypeOfClauseItem.IMG.value) {
|
||||||
|
this.$refs.uploadImg.open()
|
||||||
|
} else if (item.type === TypeOfClauseItem.TABLE.value) {
|
||||||
|
this.$refs.splitDetailAddTable.open(item.translation)
|
||||||
|
this.$refs.splitDetailAddTable.isTableEdit = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 译文上传图片
|
||||||
|
uploadSuccess (file, data, imgs) {
|
||||||
|
Object.assign(this.contentList[this.addIndex], {
|
||||||
|
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
|
||||||
|
})
|
||||||
|
this.$forceUpdate()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 表格编辑
|
||||||
|
* @param index
|
||||||
|
* @param item
|
||||||
|
*/
|
||||||
|
splitEdit (index, item) {
|
||||||
|
this.currentFieldObj = this.operateField.content
|
||||||
|
this.addIndex = index
|
||||||
|
this.$refs.splitDetailAddTable.open(item.itemContent)
|
||||||
this.$refs.splitDetailAddTable.isTableEdit = true
|
this.$refs.splitDetailAddTable.isTableEdit = true
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -587,12 +603,12 @@ export default {
|
|||||||
* @param ueContent
|
* @param ueContent
|
||||||
*/
|
*/
|
||||||
editTableOk (ueContent) {
|
editTableOk (ueContent) {
|
||||||
this[this.operateMultiFieldEnum.thisField][this[this.operateMultiFieldEnum.indexField]] = {
|
this.contentList[this.addIndex] = {
|
||||||
id: '',
|
id: '',
|
||||||
type: 'TABLE',
|
type: 'TABLE',
|
||||||
[this.operateMultiFieldEnum.dataField]: ueContent[0]
|
[this.currentFieldObj.field]: ueContent[0]
|
||||||
}
|
}
|
||||||
this[this.operateMultiFieldEnum.thisField] = JSON.parse(JSON.stringify(this[this.operateMultiFieldEnum.thisField]))
|
this.contentList = JSON.parse(JSON.stringify(this.contentList))
|
||||||
},
|
},
|
||||||
// 点击点击上传按钮
|
// 点击点击上传按钮
|
||||||
clickButtonToUpload (item) {
|
clickButtonToUpload (item) {
|
||||||
@@ -623,12 +639,11 @@ export default {
|
|||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 删除条款内容
|
* 删除条款内容
|
||||||
* @param fieldEnum - 操作的对应枚举对象
|
|
||||||
* @param index
|
* @param index
|
||||||
* @param clause
|
* @param clause
|
||||||
*/
|
*/
|
||||||
handleDeleteClauseContent (fieldEnum, index, clause) {
|
handleDeleteClauseContent (index, clause) {
|
||||||
this[fieldEnum.thisField].splice(index, 1)
|
this.contentList.splice(index, 1)
|
||||||
if (clause.id) {
|
if (clause.id) {
|
||||||
this.deleteIds.push(clause.id)
|
this.deleteIds.push(clause.id)
|
||||||
}
|
}
|
||||||
@@ -640,7 +655,6 @@ export default {
|
|||||||
this.visible = false
|
this.visible = false
|
||||||
this.formInline = {}
|
this.formInline = {}
|
||||||
this.contentList = []
|
this.contentList = []
|
||||||
this.translationList = []
|
|
||||||
this.interpretationArticlesList = []
|
this.interpretationArticlesList = []
|
||||||
},
|
},
|
||||||
handleSave () {
|
handleSave () {
|
||||||
@@ -675,17 +689,13 @@ export default {
|
|||||||
formData.info_id = this.infoId
|
formData.info_id = this.infoId
|
||||||
formData.menu_id = this.menuId
|
formData.menu_id = this.menuId
|
||||||
const contentList = JSON.parse(JSON.stringify(this.contentList))
|
const contentList = JSON.parse(JSON.stringify(this.contentList))
|
||||||
const translationList = JSON.parse(JSON.stringify(this.translationList))
|
contentList.forEach((item, index) => {
|
||||||
const resultList = []
|
if (item.type === 'IMG') {
|
||||||
for (let i = 0; i < Math.max(contentList.length, translationList.length); i++) {
|
delete item[this.operateField.content.tempUrlField]
|
||||||
// 译文属性防止覆盖内容
|
delete item[this.operateField.translation.tempUrlField]
|
||||||
if (contentList[i].itemContent) {
|
|
||||||
delete translationList[i].itemContent
|
|
||||||
}
|
}
|
||||||
resultList.push({}, Object.assign(contentList[i], translationList[i]))
|
})
|
||||||
delete resultList[i].thumbUrl
|
formData.itemValEOList = contentList
|
||||||
}
|
|
||||||
formData.itemValEOList = resultList
|
|
||||||
formData.interpretationArticlesList = this.interpretationArticlesList.filter(tt => !!tt.itemContent)
|
formData.interpretationArticlesList = this.interpretationArticlesList.filter(tt => !!tt.itemContent)
|
||||||
formData.delItemIds = this.deleteIds.join(',')
|
formData.delItemIds = this.deleteIds.join(',')
|
||||||
submitFunc(formData).then(res => {
|
submitFunc(formData).then(res => {
|
||||||
@@ -936,30 +946,33 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.clause-item {
|
.clause-item {
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin: 0 0 20px 20px;
|
margin: 0 0 20px 20px;
|
||||||
|
|
||||||
&-content {
|
&-box {
|
||||||
width: 0;
|
display: flex;
|
||||||
flex: 1;
|
justify-content: space-between;
|
||||||
|
|
||||||
/deep/ table {
|
.clause-item-content {
|
||||||
width: 100%;
|
width: 0;
|
||||||
border: 1px solid;
|
flex: 1;
|
||||||
td {
|
|
||||||
|
/deep/ table {
|
||||||
|
width: 100%;
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
|
td {
|
||||||
|
border: 1px solid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/deep/ img {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 500px;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/deep/ img {
|
|
||||||
max-width: 100%;
|
|
||||||
max-height: 500px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-operate {
|
&-operate {
|
||||||
|
margin-bottom: 15px;
|
||||||
.ant-btn {
|
.ant-btn:not(:first-child) {
|
||||||
margin-left: 15px
|
margin-left: 15px
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user