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