refactor: i18n#1005314

--bug=1005314 --user=lyh 【测试跟踪】国际化问题
https://www.tapd.cn/55049933/s/1052794
This commit is contained in:
shiziyuan9527 2021-09-28 16:25:46 +08:00 committed by shiziyuan9527
parent 391e4224a8
commit 05f75c74ca
2 changed files with 11 additions and 1 deletions

View File

@ -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);
}
});

View File

@ -134,7 +134,7 @@
<ms-table-column v-for="field in issueTemplate.customFields" :key="field.id"
:field="item"
:fields-width="fieldsWidth"
:label="field.name"
:label="field.system ? $t(systemNameMap[field.name]) :field.name"
:prop="field.name">
<template v-slot="scope">
<span v-if="field.name === '状态'">