fix(测试跟踪): 修复测试评审关联用例偶发项目资源加载错误问题

--bug=1024438 --user=赵勇 【测试跟踪】用例评审-关联用例-切换项目关联成功后再次关联-默认项目下数据仍显示其它项目下用例 https://www.tapd.cn/55049933/s/1352816

Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
fit2-zhao 2023-03-20 14:18:19 +08:00 committed by fit2-zhao
parent a4d960bb8e
commit ebb9b1ebc0
1 changed files with 25 additions and 16 deletions

View File

@ -248,10 +248,11 @@ export default {
}
});
},
openTestReviewRelevanceDialog() {
async openTestReviewRelevanceDialog() {
this.getProject();
this.dialogFormVisible = true;
this.getProjectNode(this.projectId);
await this.getProjectNode(this.projectId);
this.getReviews();
},
saveReviewRelevance() {
let param = {};
@ -308,12 +309,17 @@ export default {
this.close();
},
close() {
this.testReviews = [];
this.treeNodes = [];
this.lineStatus = false;
this.selectIds.clear();
this.selectNodeIds = [];
this.selectNodeNames = [];
this.dialogFormVisible = false;
this.condition.filters = {}
this.condition.filters = {};
if(this.condition.projectId) {
delete this.condition.projectId;
}
},
filter(filters) {
_filter(filters, this.condition);
@ -363,19 +369,22 @@ export default {
this.projectId = project.id;
},
getProjectNode(projectId, condition) {
const index = this.projects.findIndex(project => project.id === projectId);
if (index !== -1) {
this.projectName = this.projects[index].name;
this.currentProject = this.projects[index];
}
if (projectId) {
this.projectId = projectId;
}
testCaseNodeListReviewRelate({reviewId: this.reviewId, projectId: this.projectId, ...condition})
.then((response) => {
this.treeNodes = response.data;
});
this.selectNodeIds = [];
return new Promise((resolve) => {
const index = this.projects.findIndex(project => project.id === projectId);
if (index !== -1) {
this.projectName = this.projects[index].name;
this.currentProject = this.projects[index];
}
if (projectId) {
this.projectId = projectId;
}
testCaseNodeListReviewRelate({reviewId: this.reviewId, projectId: this.projectId, ...condition})
.then((response) => {
this.treeNodes = response.data;
resolve();
});
this.selectNodeIds = [];
});
},
getVersionOptions() {
getVersionFilters(this.projectId)