diff --git a/frontend/src/business/components/common/components/table/MsCustomTableHeader.vue b/frontend/src/business/components/common/components/table/MsCustomTableHeader.vue index 0d5b3482a1..242c3f1e63 100644 --- a/frontend/src/business/components/common/components/table/MsCustomTableHeader.vue +++ b/frontend/src/business/components/common/components/table/MsCustomTableHeader.vue @@ -52,19 +52,29 @@ export default { it.label = SYSTEM_FIELD_NAME_MAP[it.id] ? this.$t(SYSTEM_FIELD_NAME_MAP[it.id]) : it.label; } }) + let hasRemoveField = undefined; + if (this.customFields) { + let index = this.customFields.findIndex(c => c.remove === true); + if (index > -1) { + hasRemoveField = this.customFields[index]; + } + } let fields = getAllFieldWithCustomFields(this.type, this.customFields); this.selectedKeys = []; this.fromFields = []; this.selectedKeys = items.map(item => item.key); this.selectedFields = items; - fields.forEach(field => { + for (let field of fields) { 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 } + if (hasRemoveField && field.id === hasRemoveField.id) { + continue; + } this.fromFields.push(field); } - }); + } this.visible = true; }, saveHeader() { diff --git a/frontend/src/business/components/project/menu/EditProject.vue b/frontend/src/business/components/project/menu/EditProject.vue index 0dde882a72..a574870011 100644 --- a/frontend/src/business/components/project/menu/EditProject.vue +++ b/frontend/src/business/components/project/menu/EditProject.vue @@ -155,7 +155,8 @@ export default { screenHeight: 'calc(100vh - 195px)', labelWidth: '150px', platformOptions: [], - issueOptions: [] + issueOptions: [], + issueTemplateId: "" }; }, props: { @@ -220,6 +221,7 @@ export default { this.title = this.$t('project.edit'); row.issueConfigObj = row.issueConfig ? JSON.parse(row.issueConfig) : {}; this.form = Object.assign({}, row); + this.issueTemplateId = row.issueTemplateId; } else { this.form = {issueConfigObj: {}}; } @@ -258,6 +260,10 @@ export default { this.form.workspaceId = getCurrentWorkspaceId(); this.form.createUser = getCurrentUserId(); this.form.issueConfig = JSON.stringify(this.form.issueConfigObj); + if (this.issueTemplateId !== this.form.issueTemplateId) { + // 更换缺陷模版移除字段 + localStorage.removeItem("ISSUE_LIST"); + } this.result = this.$post("/project/" + saveType, this.form, () => { this.createVisible = false; this.reload(); diff --git a/frontend/src/business/components/track/issue/IssueList.vue b/frontend/src/business/components/track/issue/IssueList.vue index 5e5c557f1c..cc4ca7fd7b 100644 --- a/frontend/src/business/components/track/issue/IssueList.vue +++ b/frontend/src/business/components/track/issue/IssueList.vue @@ -280,6 +280,9 @@ export default { break; } } + // 如果不是三方平台则移除备选字段中的平台状态 + let removeField = {id: 'platformStatus', name: 'platformStatus', remove: true}; + this.issueTemplate.customFields.push(removeField); } if (this.$refs.table) this.$refs.table.reloadTable(); },