fix(测试跟踪): 测试计划及评审用例等级选项值展示有误

--bug=1025905 --user=宋昌昌 【测试跟踪】测试计划-功能用例-用例等级不显示 https://www.tapd.cn/55049933/s/1369289
This commit is contained in:
song-cc-rock 2023-05-06 14:53:35 +08:00 committed by fit2-zhao
parent fc64d0b608
commit c38955b4c9
4 changed files with 27 additions and 21 deletions

View File

@ -71,7 +71,7 @@
<ms-table-column
prop="priority"
:filters="priorityFilters"
:filters="priorityOptions"
sortable
:label="$t('test_track.case.priority')"
width="120px">

View File

@ -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 = '') {

View File

@ -84,7 +84,7 @@
:label="$t('test_track.case.priority')"
show-overflow-tooltip>
<template v-slot:default="scope">
<priority-table-item :value="scope.row.priority"/>
<priority-table-item :value="scope.row.priority" :priority-options="priorityFilters"/>
</template>
</el-table-column>
@ -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)'

View File

@ -88,7 +88,7 @@
min-width="120px"
:label="$t('test_track.case.priority')">
<template v-slot:default="scope">
<priority-table-item :value="scope.row.priority" ref="priority"/>
<priority-table-item :value="scope.row.priority" ref="priority" :priority-options="priorityFilters"/>
</template>
</ms-table-column>
@ -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) => {