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;