fix(测试跟踪): 编辑评审用例后,切换评审编辑相同用例,评论还是显示的之前的评论

--bug=1023023 --user=陈建星 【测试跟踪】功能用例,历史用例数据中的用例评审评论显示了2次 https://www.tapd.cn/55049933/s/1335385
This commit is contained in:
chenjianxing 2023-02-15 15:11:04 +08:00 committed by jianxing
parent b296717ad4
commit 6dfb278d9b
2 changed files with 17 additions and 19 deletions

View File

@ -78,8 +78,8 @@
<comment-history
default-type="REVIEW"
:case-id="testCase.caseId"
:review-id="testCase.reviewId"
:case-id="caseId"
:review-id="reviewId"
@emptyChange="handleCommentEmptyChange"
ref="comment"/>
@ -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 (

View File

@ -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;