diff --git a/test-track/frontend/src/business/case/components/BatchEdit.vue b/test-track/frontend/src/business/case/components/BatchEdit.vue index 3558060bfe..e76de63b1c 100644 --- a/test-track/frontend/src/business/case/components/BatchEdit.vue +++ b/test-track/frontend/src/business/case/components/BatchEdit.vue @@ -223,7 +223,12 @@ export default { getCustomField(id) .then(res => { this.loading = false; - this.customField = res ? res.data : {}; + if (res) { + res.data.defaultValue = null; + this.customField = res.data; + } else { + this.customField = {defaultValue: null}; + } this.customField.options = JSON.parse(this.customField.options); if (this.customField.type === 'checkbox' || this.customField.type === 'multipleMember') { this.customField.defaultValue = []; diff --git a/test-track/frontend/src/business/case/components/TestCaseList.vue b/test-track/frontend/src/business/case/components/TestCaseList.vue index 2253c4cb59..f0acbf74e4 100644 --- a/test-track/frontend/src/business/case/components/TestCaseList.vue +++ b/test-track/frontend/src/business/case/components/TestCaseList.vue @@ -219,7 +219,6 @@ import MsTag from "metersphere-frontend/src/components/MsTag"; import { buildBatchParam, getCustomFieldBatchEditOption, getCustomFieldFilter, - getCustomFieldValue, getCustomTableHeader, getCustomTableWidth, getLastTableSortField, @@ -264,7 +263,12 @@ import MsCreateTimeColumn from "metersphere-frontend/src/components/table/MsCrea import TestCaseReviewStatusTableItem from "@/business/common/tableItems/TestCaseReviewStatusTableItem"; import RelateDemand from "@/business/case/components/RelateDemand"; import TestPlanCaseStatusTableItem from "@/business/common/tableItems/TestPlanCaseStatusTableItem"; -import {generateColumnKey, getAdvSearchCustomField, getProjectMemberOption} from "@/business/utils/sdk-utils"; +import { + generateColumnKey, + getAdvSearchCustomField, + getCustomFieldValueForTrack, + getProjectMemberOption +} from "@/business/utils/sdk-utils"; export default { @@ -591,7 +595,7 @@ export default { useStore().testCaseDefaultValue = testCaseDefaultValue; }, getCustomFieldValue(row, field, defaultVal = '') { - let value = getCustomFieldValue(row, field, this.members); + let value = getCustomFieldValueForTrack(row, field, this.members); if (field.name === '用例等级') { return row.priority; } else if (field.name === '责任人') { 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 0125dfa897..80c548ecf8 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 @@ -285,7 +285,6 @@ import BatchEdit from "../../../../case/components/BatchEdit"; import MsTag from "metersphere-frontend/src/components/MsTag"; import { buildBatchParam, - getCustomFieldValue, getCustomTableHeader, getCustomTableWidth, getLastTableSortField, @@ -307,7 +306,7 @@ import {SYSTEM_FIELD_NAME_MAP} from "metersphere-frontend/src/utils/table-consta import {getTestPlanTestCase} from "@/api/testCase"; import TestPlanCaseIssueItem from "@/business/plan/view/comonents/functional/TestPlanCaseIssueItem"; import {getProjectVersions} from "@/api/project"; -import {getProjectMemberOption} from "@/business/utils/sdk-utils"; +import {getCustomFieldValueForTrack, getProjectMemberOption} from "@/business/utils/sdk-utils"; import { testPlanTestCaseBatchDelete, testPlanTestCaseBatchEdit, @@ -560,7 +559,7 @@ export default { }); }, getCustomFieldValue(row, field) { - return getCustomFieldValue(row, field, this.members); + return getCustomFieldValueForTrack(row, field, this.members); }, initTableData(callback) { initCondition(this.condition, this.condition.selectAll); diff --git a/test-track/frontend/src/business/utils/sdk-utils.js b/test-track/frontend/src/business/utils/sdk-utils.js index 6627015a00..bbf07d58c8 100644 --- a/test-track/frontend/src/business/utils/sdk-utils.js +++ b/test-track/frontend/src/business/utils/sdk-utils.js @@ -17,3 +17,26 @@ export {getOwnerProjects, getProjectListAll} from "metersphere-frontend/src/api/ export {deleteRelationshipEdge} from "metersphere-frontend/src/api/relationship-edge"; export {isProjectVersionEnable} from "metersphere-frontend/src/api/version"; + +import { + getCustomFieldValue, +} from "metersphere-frontend/src/utils/tableUtils"; +import i18n from "@/i18n"; + +export function getCustomFieldValueForTrack(row, field, members) { + if (field.name === '用例状态' && field.system) { + return parseStatus(row, field.options); + } + return getCustomFieldValue(row, field, members); +} + +function parseStatus(row, options) { + if (options) { + for (let option of options) { + if (option.value === row.status) { + return option.system ? i18n.t(option.text) : option.text; + } + } + } + return row.status; +}