fix(工作台): 工作台我的待办展示了已关闭的缺陷

--bug=1021915 --user=陈建星 [我的工作台]我的待办-缺陷管理中有已关闭状态的缺陷 https://www.tapd.cn/55049933/s/1327005
This commit is contained in:
chenjianxing 2023-01-12 14:46:30 +08:00 committed by 刘瑞斌
parent e7abfb42a1
commit 982ddf19e2
1 changed files with 36 additions and 12 deletions

View File

@ -250,6 +250,9 @@ export default {
},
workspaceId() {
return getCurrentWorkspaceId();
},
isToDo() {
return !this.isFocus && !this.isCreation;
}
},
created() {
@ -262,8 +265,8 @@ export default {
getIssuePartTemplateWithProject((template) => {
this.initFields(template);
this.page.result.loading = false;
this.getIssues();
});
this.getIssues();
});
},
methods: {
@ -300,6 +303,9 @@ export default {
item.filters = this.columns[item.id].filters;
}
}
if (this.isToDo && item.id === '状态') {
item.filters = item.filters.filter(i => i.value !== 'closed')
}
});
this.fields = fields;
@ -350,17 +356,7 @@ export default {
}
} else {
if (this.page.condition.filters) {
this.page.condition.filters.status = ["new"];
} else {
this.page.condition.filters = {status: ["new"]};
}
this.page.condition.combine = {
creator: {
operator: "current user",
value: "current user",
}
}
this.addDefaultStatusFilter();
}
this.page.condition.workspaceId = getCurrentWorkspaceId();
this.page.condition.orders = getLastTableSortField(this.tableHeaderKey);
@ -382,6 +378,34 @@ export default {
});
}
},
addDefaultStatusFilter() {
this.page.condition.combine = {
creator: {
operator: "current user",
value: "current user",
}
}
if (this.isToDo) {
let statusFieldId = null;
this.issueTemplate.customFields.forEach(field => {
if (field.name === '状态') {
statusFieldId = field.id;
}
});
if (statusFieldId) {
this.page.condition.combine.customs = [
{
id: statusFieldId,
operator: 'not in',
value:[
'closed'
],
type: 'select'
}
];
}
}
},
initCustomFieldValue() {
if (this.fields.length <= 0) {
return;