[update 拆分] 译文表格完善

This commit is contained in:
danshihao
2024-08-01 19:41:43 +08:00
parent 1f71dd3612
commit fdfa15b1d1
2 changed files with 12 additions and 5 deletions
@@ -603,10 +603,15 @@ export default {
* @param ueContent
*/
editTableOk (ueContent) {
this.contentList[this.addIndex] = {
id: '',
type: 'TABLE',
[this.currentFieldObj.field]: ueContent[0]
// 如果内容和译文有一个有内容,就不进行覆盖
if (this.contentList[this.addIndex][this.operateField.content.field] || this.contentList[this.addIndex][this.operateField.translation.field]) {
this.contentList[this.addIndex][this.currentFieldObj.field] = ueContent[0]
} else {
this.contentList[this.addIndex] = {
id: '',
type: 'TABLE',
[this.currentFieldObj.field]: ueContent[0]
}
}
this.contentList = JSON.parse(JSON.stringify(this.contentList))
},
@@ -132,7 +132,9 @@ export default {
// 表格确认按钮
handleOkTable () {
let ueContent = []
ueContent = this.ueContent.match(/<table.{0,}?.+?>{0,}?<\/table>/g) || []
if (this.ueContent) {
ueContent = this.ueContent.match(/<table.{0,}?.+?>{0,}?<\/table>/g) || []
}
if (ueContent && ueContent.length > 1) {
this.$message.warning(this.$t('oneTableAdded'))
} else if (!ueContent || ueContent.length < 1) {