From 8c402416588294b86b5e9da1abee844d72e74f33 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Thu, 17 Jul 2025 10:37:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=20=E6=9B=BF=E6=8D=A2=E5=AD=97=E7=AC=A6=20=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8B=BC=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trial-summary/audit-record/index.vue | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/views/trials/trials-panel/trial-summary/audit-record/index.vue b/src/views/trials/trials-panel/trial-summary/audit-record/index.vue index c8d95d4d..1b9c4180 100644 --- a/src/views/trials/trials-panel/trial-summary/audit-record/index.vue +++ b/src/views/trials/trials-panel/trial-summary/audit-record/index.vue @@ -818,6 +818,10 @@ export default { } return loop(ParentId) }, + extractBraces(str) { + const regex = /{{([\s\S]*?)}}/g; // [\s\S] 匹配任意字符(包括换行符) + return Array.from(str.matchAll(regex), match => match[1]); + }, formatting(config, obj, upObj, parentRow, row, auditData) { this.tableList = [] this.tableListData = [] @@ -859,6 +863,47 @@ export default { } return } + if (v.DataType === 'CombiningString') { + let arr = this.extractBraces(v.Code) + let o = null, up = null; + arr.forEach(key => { + if (!o) { + o = v.Code.replace(`{{${key}}}`, obj[key]) + } else { + o = o.replace(`{{${key}}}`, obj[key]) + } + if (!up) { + up = v.Code.replace(`{{${key}}}`, upObj[key]) + } else { + up = up.replace(`{{${key}}}`, upObj[key]) + } + }) + if (row.OptType === 'Add' || row.OptType === 'Init') { + item = { + key: v.Code, + Enum: this.$i18n.locale === 'zh' ? v.ValueCN : v.Value, + newValue: o ? o : '--', + oldValue: '' + } + } else if (row.OptType === 'Delete') { + item = { + key: v.Code, + Enum: this.$i18n.locale === 'zh' ? v.ValueCN : v.Value, + oldValue: o ? o : '--', + newValue: '--' + } + } else { + item = { + key: v.Code, + Enum: this.$i18n.locale === 'zh' ? v.ValueCN : v.Value, + newValue: o ? o : '--', + oldValue: up ? up : '--', + } + } + item.DataType = v.DataType + this[auditData].push(item) + return + } if (v.DataType === 'FileSize') { if (obj[v.Code]) { // obj[v.Code] = obj[v.Code].filter(s => s && s.trim())