From aefea087dec3f83acc93c0acd3b08df7b9e1bf2a Mon Sep 17 00:00:00 2001 From: jianxing Date: Mon, 26 Jun 2023 11:05:46 +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=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=1027305 --user=陈建星 【测试跟踪】批量修改功能用例状态后关联进测试计划,用例状态还是批量操作之前的状态 https://www.tapd.cn/55049933/s/1386007 --- .../base/mapper/ext/ExtTestPlanTestCaseMapper.xml | 4 +++- .../main/java/io/metersphere/dto/TestPlanCaseDTO.java | 1 + .../comonents/functional/FunctionalTestCaseList.vue | 6 +++--- test-track/frontend/src/business/utils/sdk-utils.js | 10 +++++----- 4 files changed, 12 insertions(+), 9 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 d2976dbe14..edd2432771 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 @@ -298,7 +298,9 @@ test_case.node_path, test_case.method, test_case.num, test_case.custom_num, test_case.project_id, - test_plan_test_case.executor, test_plan_test_case.status, + test_plan_test_case.executor, + test_plan_test_case.status as status, + test_case.status as caseStatus, test_plan_test_case.actual_result, test_plan_test_case.update_time, test_plan_test_case.create_time, test_plan_test_case.issues_count as issuesCount, diff --git a/test-track/backend/src/main/java/io/metersphere/dto/TestPlanCaseDTO.java b/test-track/backend/src/main/java/io/metersphere/dto/TestPlanCaseDTO.java index edcbdb5c65..d41ed51d1f 100644 --- a/test-track/backend/src/main/java/io/metersphere/dto/TestPlanCaseDTO.java +++ b/test-track/backend/src/main/java/io/metersphere/dto/TestPlanCaseDTO.java @@ -27,6 +27,7 @@ public class TestPlanCaseDTO extends TestCaseWithBLOBs { private int issuesCount; private String versionName; private String creatorName; + private String caseStatus; private List list; private List issueList; diff --git a/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseList.vue b/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseList.vue index 55869302f7..f9cbd461d8 100644 --- a/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseList.vue +++ b/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseList.vue @@ -247,7 +247,7 @@ :value="getCustomFieldValue(scope.row, field)" :priority-options="priorityOptions"/> - {{ getCustomFieldValue(scope.row, field, scope.row.status) }} + {{ getCustomFieldValue(scope.row, field, scope.row.caseStatus) }} {{ getCustomFieldValue(scope.row, field) }} @@ -329,7 +329,7 @@ import TestPlanCaseIssueItem from "@/business/plan/view/comonents/functional/Tes import { getProjectMemberOption, getProjectVersions, - getAdvSearchCustomField, parseTag + getAdvSearchCustomField, parseTag, getCustomFieldValueForTrack } from "@/business/utils/sdk-utils"; import { testPlanTestCaseBatchDelete, @@ -615,7 +615,7 @@ export default { return getCustomFieldFilter(field, this.userFilters); }, getCustomFieldValue(row, field, defaultVal = '') { - let value = _getCustomFieldValue(row, field, this.members); + let value = getCustomFieldValueForTrack(row, field, this.members, 'caseStatus'); if (field.name === '用例等级') { return row.priority; } else if (field.name === '责任人') { diff --git a/test-track/frontend/src/business/utils/sdk-utils.js b/test-track/frontend/src/business/utils/sdk-utils.js index 8acb1f54a0..124c0c3d23 100644 --- a/test-track/frontend/src/business/utils/sdk-utils.js +++ b/test-track/frontend/src/business/utils/sdk-utils.js @@ -28,20 +28,20 @@ import { } from "metersphere-frontend/src/utils/tableUtils"; import i18n from "@/i18n"; -export function getCustomFieldValueForTrack(row, field, members) { +export function getCustomFieldValueForTrack(row, field, members, statusProp = 'status') { if (field.name === '用例状态' && field.system) { - return parseStatus(row, field.options); + return parseStatus(row, field.options, statusProp); } return getCustomFieldValue(row, field, members); } -function parseStatus(row, options) { +function parseStatus(row, options, prop = 'status') { if (options) { for (let option of options) { - if (option.value === row.status) { + if (option.value === row[prop]) { return option.system ? i18n.t(option.text) : option.text; } } } - return row.status; + return row[prop]; }