diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml index 0c73a5387f..6e19ba9020 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml @@ -441,7 +441,8 @@ test_plan_test_case.*, test_case.*, test_case_node.name as model, - project.name as projectName + project.name as projectName, + test_case.status as caseStatus from test_plan_test_case inner join test_case on test_plan_test_case.case_id = test_case.id left join test_case_node on test_case_node.id = test_case.node_id diff --git a/test-track/frontend/src/business/case/test-case.js b/test-track/frontend/src/business/case/test-case.js index 75a231ab8e..410de84f41 100644 --- a/test-track/frontend/src/business/case/test-case.js +++ b/test-track/frontend/src/business/case/test-case.js @@ -133,3 +133,16 @@ export function resetCaseSystemField(customFields, testCase) { } }); } + +export function resetPlanCaseSystemField(customFields, testCase) { + // 用例等级等字段以表中对应字段为准 + customFields.forEach((field) => { + if (field.name === "用例等级") { + field.defaultValue = testCase.priority; + } else if (field.name === "责任人") { + field.defaultValue = testCase.maintainer; + } else if (field.name === "用例状态") { + field.defaultValue = testCase.caseStatus; + } + }); +} diff --git a/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseEdit.vue b/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseEdit.vue index 99f29817ec..7e2ae07a95 100644 --- a/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseEdit.vue +++ b/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseEdit.vue @@ -229,7 +229,7 @@ import { import { testPlanEditStatus } from "@/api/remote/plan/test-plan"; import { getTestTemplate } from "@/api/custom-field-template"; import { checkProjectPermission } from "@/api/testCase"; -import {openCaseEdit, resetCaseSystemField} from "@/business/case/test-case"; +import {openCaseEdit, resetPlanCaseSystemField} from "@/business/case/test-case"; import CustomFieldFormItems from "@/business/common/CustomFieldFormItems"; export default { @@ -511,7 +511,7 @@ export default { }); }, resetSystemField() { - resetCaseSystemField(this.testCaseTemplate.customFields, this.testCase); + resetPlanCaseSystemField(this.testCaseTemplate.customFields, this.testCase); }, openTestCaseEdit(testCase, tableData) { checkProjectPermission(testCase.projectId).then((r) => {