fix(测试跟踪): 用例评审切换上一条下一条,评论显示有误

This commit is contained in:
AgAngle 2024-06-18 20:09:13 +08:00 committed by jianxing
parent 8ce127cfc5
commit 30237959ef
3 changed files with 20 additions and 4 deletions

View File

@ -252,6 +252,9 @@ export default {
}
}
},
created() {
this.comments = [];
},
methods: {
updateRemark(text) {
this.form.remark = text;

View File

@ -487,6 +487,7 @@ export default {
resetPlanCaseSystemField(this.testCaseTemplate.customFields, this.testCase);
},
openTestCaseEdit(testCase, tableData) {
this.reloadOtherInfo();
checkProjectPermission(testCase.projectId).then((r) => {
this.hasProjectPermission = r.data;
});

View File

@ -60,10 +60,12 @@
v-if="testCase.stepModel === 'STEP'" :form="testCase"/>
<el-form-item :label="$t('test_track.case.other_info')" :label-width="formLabelWidth">
<test-case-edit-other-info @openTest="openTest" :read-only="true"
@syncRelationGraphOpen="syncRelationGraphOpen"
:project-id="projectId" :form="testCase" :case-id="testCase.caseId"
ref="otherInfo"/>
<test-case-edit-other-info
v-if="otherInfoActive"
@openTest="openTest" :read-only="true"
@syncRelationGraphOpen="syncRelationGraphOpen"
:project-id="projectId" :form="testCase" :case-id="testCase.caseId"
ref="otherInfo"/>
</el-form-item>
</el-form>
@ -169,6 +171,7 @@ export default {
isCommentEmpty: true,
caseId: null,
reviewId: null,
otherInfoActive: true,
};
},
props: {
@ -298,6 +301,7 @@ export default {
this.caseId = this.testCases[this.index].caseId;
this.getTestCase(this.testCases[this.index].id);
this.$refs.otherInfo.getFileMetaData(this.caseId);
this.reloadOtherInfo();
},
isLastData() {
return (
@ -317,6 +321,13 @@ export default {
this.caseId = this.testCases[this.index].caseId;
this.getTestCase(this.testCases[this.index].id);
this.$refs.otherInfo.getFileMetaData(this.caseId);
this.reloadOtherInfo();
},
reloadOtherInfo() {
this.otherInfoActive = false;
this.$nextTick(() => {
this.otherInfoActive = true;
});
},
getTestCase(id) {
this.loading = true;
@ -370,6 +381,7 @@ export default {
});
},
openTestCaseEdit(testCase, tableData) {
this.reloadOtherInfo();
if (this.$refs.comment) {
this.$refs.comment.clearComments();
}