From a734ce3b3bcc1c3976ac052861ef366d7878d39e Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 20 Mar 2023 14:18:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95=E8=AF=84=E5=AE=A1=E5=85=B3?= =?UTF-8?q?=E8=81=94=E7=94=A8=E4=BE=8B=E5=81=B6=E5=8F=91=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=8A=A0=E8=BD=BD=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1024438 --user=赵勇 【测试跟踪】用例评审-关联用例-切换项目关联成功后再次关联-默认项目下数据仍显示其它项目下用例 https://www.tapd.cn/55049933/s/1352816 Signed-off-by: fit2-zhao --- .../view/components/TestReviewRelevance.vue | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/test-track/frontend/src/business/review/view/components/TestReviewRelevance.vue b/test-track/frontend/src/business/review/view/components/TestReviewRelevance.vue index 2f643efd79..bf536189f4 100644 --- a/test-track/frontend/src/business/review/view/components/TestReviewRelevance.vue +++ b/test-track/frontend/src/business/review/view/components/TestReviewRelevance.vue @@ -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)