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]; }