From 6dfb278d9bbb543b159b30ffa05350b566e19ed0 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 15 Feb 2023 15:11:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=AF=84=E5=AE=A1=E7=94=A8=E4=BE=8B=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=88=87=E6=8D=A2=E8=AF=84=E5=AE=A1=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=9B=B8=E5=90=8C=E7=94=A8=E4=BE=8B=EF=BC=8C=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E8=BF=98=E6=98=AF=E6=98=BE=E7=A4=BA=E7=9A=84=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=9A=84=E8=AF=84=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023023 --user=陈建星 【测试跟踪】功能用例,历史用例数据中的用例评审评论显示了2次 https://www.tapd.cn/55049933/s/1335385 --- .../components/TestReviewTestCaseEdit.vue | 23 ++++++++++++------- .../components/commnet/CommentHistory.vue | 13 ++--------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/test-track/frontend/src/business/review/view/components/TestReviewTestCaseEdit.vue b/test-track/frontend/src/business/review/view/components/TestReviewTestCaseEdit.vue index 2199d5f6f9..3f0f6a0702 100644 --- a/test-track/frontend/src/business/review/view/components/TestReviewTestCaseEdit.vue +++ b/test-track/frontend/src/business/review/view/components/TestReviewTestCaseEdit.vue @@ -78,8 +78,8 @@ @@ -174,7 +174,9 @@ export default { isCustomFiledActive: false, titleWith: 0, relationGraphOpen: false, - isCommentEmpty: true + isCommentEmpty: true, + caseId: null, + reviewId: null, }; }, props: { @@ -261,12 +263,14 @@ export default { this.$emit("refreshTable"); }, refreshComment() { - this.$refs.comment.getComments(); + if (this.$refs.comment) { + this.$refs.comment.getComments(); + } }, refreshTestCaseStatus(status) { this.testCase.reviewStatus = status; this.updateTestCases(this.testCase); - this.$refs.comment.getComments(); + this.refreshComment(); this.$refs.headerBar.getReviewerStatus(); }, updateTestCases(param) { @@ -386,9 +390,12 @@ export default { if (this.$refs.otherInfo) { this.$refs.otherInfo.reset(); } - if (this.$refs.comment) { - this.$refs.comment.getComments(); - } + + this.caseId = testCase.caseId; + this.reviewId = testCase.reviewId; + this.$nextTick(() => { + this.refreshComment(); + }); }, getRelatedTest() { if ( diff --git a/test-track/frontend/src/business/review/view/components/commnet/CommentHistory.vue b/test-track/frontend/src/business/review/view/components/commnet/CommentHistory.vue index 0ca768e5ff..63878c8833 100644 --- a/test-track/frontend/src/business/review/view/components/commnet/CommentHistory.vue +++ b/test-track/frontend/src/business/review/view/components/commnet/CommentHistory.vue @@ -41,7 +41,6 @@ export default { data() { return { comments: [], - type: '', loading: false, }; }, @@ -52,17 +51,10 @@ export default { }, computed: { isCommentEmpty() { - return !this.comments || this.comments.length == 0 + return !this.comments || this.comments.length == 0; } }, watch: { - caseId() { - this.type = this.defaultType; - this.getComments(); - }, - type() { - this.getComments(); - }, comments() { this.$emit('emptyChange', this.isCommentEmpty); } @@ -71,8 +63,7 @@ export default { getComments() { if (this.caseId) { this.loading = true; - let type = this.type || ''; - testCaseCommentListByTypeAndBelongId(this.caseId, type, this.reviewId) + testCaseCommentListByTypeAndBelongId(this.caseId, this.defaultType, this.reviewId) .then(res => { this.comments = res.data; this.loading = false;