fix(测试跟踪): 用例评审展示用例自定义字段值

--bug=1021536 --user=宋昌昌 【测试跟踪】github #21073功能用例自定义字段的值在用例评审页面不能显示 https://www.tapd.cn/55049933/s/1349534
This commit is contained in:
song-cc-rock 2023-03-14 14:34:53 +08:00 committed by jianxing
parent a42b5eee47
commit bdc86619a6
2 changed files with 15 additions and 1 deletions

View File

@ -343,6 +343,13 @@ export default {
null, null,
buildTestCaseOldFields(item) buildTestCaseOldFields(item)
); );
this.testCaseTemplate.customFields.forEach((item) => {
try {
item.defaultValue = JSON.parse(item.defaultValue);
} catch (e) {
// nothing
}
});
this.isCustomFiledActive = true; this.isCustomFiledActive = true;
this.testCase = item; this.testCase = item;
if (!this.testCase.actualResult) { if (!this.testCase.actualResult) {

View File

@ -44,6 +44,7 @@ import ReviewStatus from "@/business/case/components/ReviewStatus";
import {getReviewerStatusComment} from "@/api/test-review-test-case"; import {getReviewerStatusComment} from "@/api/test-review-test-case";
import MsUserIcon from "metersphere-frontend/src/components/MsUserIcon"; import MsUserIcon from "metersphere-frontend/src/components/MsUserIcon";
import {openCaseEdit} from "@/business/case/test-case"; import {openCaseEdit} from "@/business/case/test-case";
import { checkProjectPermission } from "@/api/testCase";
export default { export default {
name: "TestReviewTestCaseEditHeaderBar", name: "TestReviewTestCaseEditHeaderBar",
@ -78,7 +79,13 @@ export default {
} }
}, },
openTestCase() { openTestCase() {
openCaseEdit({caseId: this.testCase.caseId}, this); checkProjectPermission(this.testCase.projectId).then((r) => {
if (r.data) {
openCaseEdit({caseId: this.testCase.caseId}, this);
} else {
this.$error(this.$t("commons.project_permission"));
}
});
}, },
close() { close() {
this.$emit('close'); this.$emit('close');