From 05f75c74ca7e7610ade17c64ff6ae538fcdda029 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Tue, 28 Sep 2021 16:25:46 +0800 Subject: [PATCH] refactor: i18n#1005314 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1005314 --user=lyh 【测试跟踪】国际化问题 https://www.tapd.cn/55049933/s/1052794 --- .../common/components/table/MsCustomTableHeader.vue | 10 ++++++++++ .../src/business/components/track/issue/IssueList.vue | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/business/components/common/components/table/MsCustomTableHeader.vue b/frontend/src/business/components/common/components/table/MsCustomTableHeader.vue index dd734b57ba..0d5b3482a1 100644 --- a/frontend/src/business/components/common/components/table/MsCustomTableHeader.vue +++ b/frontend/src/business/components/common/components/table/MsCustomTableHeader.vue @@ -20,6 +20,7 @@ import MsDialogFooter from "@/business/components/common/components/MsDialogFooter"; import treeTransfer from 'el-tree-transfer' import {getAllFieldWithCustomFields, saveCustomTableHeader} from "@/common/js/tableUtils"; +import {SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants"; export default { name: "MsCustomTableHeader", @@ -45,6 +46,12 @@ export default { }, open(items) { items = JSON.parse(JSON.stringify(items)); + items.forEach(it => { + if (it.isCustom) { + // i18n + it.label = SYSTEM_FIELD_NAME_MAP[it.id] ? this.$t(SYSTEM_FIELD_NAME_MAP[it.id]) : it.label; + } + }) let fields = getAllFieldWithCustomFields(this.type, this.customFields); this.selectedKeys = []; this.fromFields = []; @@ -52,6 +59,9 @@ export default { this.selectedFields = items; fields.forEach(field => { if (this.selectedKeys.indexOf(field.key) < 0) { + if (field.isCustom) { + field.label = SYSTEM_FIELD_NAME_MAP[field.id] ? this.$t(SYSTEM_FIELD_NAME_MAP[field.id]) : field.label + } this.fromFields.push(field); } }); diff --git a/frontend/src/business/components/track/issue/IssueList.vue b/frontend/src/business/components/track/issue/IssueList.vue index b6631db62a..fd57441afc 100644 --- a/frontend/src/business/components/track/issue/IssueList.vue +++ b/frontend/src/business/components/track/issue/IssueList.vue @@ -134,7 +134,7 @@