From 01a441eb50d25981de46571084f6652ff75aa7cf Mon Sep 17 00:00:00 2001 From: jianxing Date: Tue, 11 Jul 2023 13:48:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=8A=9F=E8=83=BD=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E7=BC=96=E8=BE=91=E9=A1=B5=EF=BC=8C=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1027626 --user=陈建星 【测试跟踪】github#25427,测试用例,查看并修改用例状态为 已完成,将该用例加入到测试计划中,点击执行页面的 用例状态还是未开始 https://www.tapd.cn/55049933/s/1391309 --- .../base/mapper/ext/ExtTestPlanTestCaseMapper.xml | 3 ++- test-track/frontend/src/business/case/test-case.js | 13 +++++++++++++ .../comonents/functional/FunctionalTestCaseEdit.vue | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) 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) => {