diff --git a/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalRelevance.vue b/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalRelevance.vue index 91ff647f9f..2d8a0b0ce0 100644 --- a/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalRelevance.vue +++ b/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalRelevance.vue @@ -71,7 +71,7 @@ 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 b9315233ca..665f347193 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 @@ -77,7 +77,7 @@ prop="priority" :field="item" :fields-width="fieldsWidth" - :filters="priorityFilters" + :filters="priorityOptions" sortable="custom" min-width="120px" :label="$t('test_track.case.priority')"> @@ -605,9 +605,6 @@ export default { }); }, getCustomFieldFilter(field) { - if (field.name === '用例状态') { - return null; - } return getCustomFieldFilter(field, this.userFilters); }, getCustomFieldValue(row, field, defaultVal = '') { diff --git a/test-track/frontend/src/business/review/view/components/TestReviewRelevance.vue b/test-track/frontend/src/business/review/view/components/TestReviewRelevance.vue index 3e45775276..4bf0256d99 100644 --- a/test-track/frontend/src/business/review/view/components/TestReviewRelevance.vue +++ b/test-track/frontend/src/business/review/view/components/TestReviewRelevance.vue @@ -84,7 +84,7 @@ :label="$t('test_track.case.priority')" show-overflow-tooltip> @@ -189,12 +189,7 @@ export default { condition: { components: TEST_REVIEW_RELEVANCE_CASE_CONFIGS }, - priorityFilters: [ - {text: 'P0', value: 'P0'}, - {text: 'P1', value: 'P1'}, - {text: 'P2', value: 'P2'}, - {text: 'P3', value: 'P3'} - ], + priorityFilters: [], statusFilters: [ {text: this.$t('test_track.review.prepare'), value: 'Prepare'}, {text: this.$t('test_track.review.pass'), value: 'Pass'}, @@ -247,9 +242,17 @@ export default { methods: { loadConditionComponents() { getTestTemplate(this.projectId).then((template) => { + this.initPriorityFilters(template); this.condition.components = initTestCaseConditionComponents(this.condition, template.customFields, false); }); }, + initPriorityFilters(template) { + template.customFields.forEach(field => { + if (field.name === '用例等级') { + this.priorityFilters = field.options; + } + }) + }, fullScreen(){ this.isFullScreen = !this.isFullScreen; this.screenHeight = this.isFullScreen ?'calc(100vh - 180px)' :'calc(100vh - 420px)' diff --git a/test-track/frontend/src/business/review/view/components/TestReviewTestCaseList.vue b/test-track/frontend/src/business/review/view/components/TestReviewTestCaseList.vue index 3a4286630e..ce0bad7a2c 100644 --- a/test-track/frontend/src/business/review/view/components/TestReviewTestCaseList.vue +++ b/test-track/frontend/src/business/review/view/components/TestReviewTestCaseList.vue @@ -88,7 +88,7 @@ min-width="120px" :label="$t('test_track.case.priority')"> @@ -226,14 +226,15 @@ import {parseTag} from "metersphere-frontend/src/utils" import {getVersionFilters} from "@/business/utils/sdk-utils"; import {getProjectMember, getProjectMemberUserFilter} from "@/api/user"; import {getProjectApplicationConfig} from "@/api/project-application"; -import {getTagToolTips, parseColumnTag} from "@/business/case/test-case"; +import {getTagToolTips, initTestCaseConditionComponents, parseColumnTag} from "@/business/case/test-case"; import {hasLicense} from "metersphere-frontend/src/utils/permission"; import {getCurrentProjectID} from "metersphere-frontend/src/utils/token"; import {editTestReviewTestCaseOrder, getTestReviewTestCase} from "@/api/testCase"; import { _handleSelectAll, buildBatchParam, deepClone, getCustomTableWidth, getLastTableSortField, getSelectDataCounts, - getTableHeaderWithCustomFields, initCondition, toggleAllSelection, getCustomFieldBatchEditOption } from "metersphere-frontend/src/utils/tableUtils"; + getTableHeaderWithCustomFields, initCondition, toggleAllSelection } from "metersphere-frontend/src/utils/tableUtils"; import {batchDeleteTestReviewCase, batchEditTestReviewCaseReviewer, batchEditTestReviewCaseStatus, deleteTestReviewCase, getTesReviewById} from "@/api/test-review"; +import {getTestTemplate} from "@/api/custom-field-template"; export default { name: "TestReviewTestCaseList", @@ -278,12 +279,7 @@ export default { isTestManagerOrTestUser: false, selectDataCounts: 0, tableHeaderKey: 'TEST_CASE_REVIEW_FUNCTION_TEST_CASE', - priorityFilters: [ - {text: 'P0', value: 'P0'}, - {text: 'P1', value: 'P1'}, - {text: 'P2', value: 'P2'}, - {text: 'P3', value: 'P3'} - ], + priorityFilters: [], statusFilters: [ {text: this.$t('test_track.review.again'), value: 'Again'}, {text: this.$t('test_track.review.pass'), value: 'Pass'}, @@ -387,6 +383,7 @@ export default { this.userFilter = data; }); this.getTemplateField(); + this.initPriorityFilters(); }, mounted() { this.$emit('setCondition', this.condition); @@ -398,6 +395,15 @@ export default { this.getCustomNum(); }, methods: { + initPriorityFilters() { + getTestTemplate(this.projectId).then((template) => { + template.customFields.forEach(field => { + if (field.name === '用例等级') { + this.priorityFilters = field.options; + } + }) + }); + }, getTemplateField() { getProjectMember() .then((response) => {