fix(测试跟踪): 功能用例高级搜索,用例等级条件不准确

【【测试跟踪】github #20669,测试跟踪中功能测试用例模块,通过批量编辑修改用例等级,修改后在高级搜索按用例等级进行查询,无法查询到正确的结果。】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001020972
This commit is contained in:
chenjianxing 2022-12-22 17:02:21 +08:00 committed by jianxing
parent 078f24d86b
commit 0d6fbb2df5
2 changed files with 29 additions and 11 deletions

View File

@ -670,6 +670,19 @@ export const TEST_CASE_STATUS = {
}
}
export const TEST_CASE_PRIORITY = {
key: "priority",
name: 'MsTableSearchSelect',
label: "custom_field.case_priority",
operator: {
options: [OPERATORS.IN, OPERATORS.NOT_IN]
},
options: [],
props: {
multiple: true
}
}
export const PLAN_CASE_STATUS = {
key: "planCaseStatus",
name: 'MsTableSearchSelect',
@ -883,7 +896,7 @@ export const UI_CUSTOM_COMMAND_CONFIGS = [NAME, CREATE_TIME, PROJECT_CREATOR, UI
export const UI_CUSTOM_COMMAND_CONFIGS_TRASH = [NAME, CREATE_TIME, PROJECT_CREATOR, UI_CUSTOM_COMMAND_TRASH_MODULE_TREE];
// 测试跟踪-测试用例 列表
export const TEST_CASE_CONFIGS = [ID, NAME, TAGS, TEST_CASE_MODULE_TREE, CREATE_TIME, UPDATE_TIME, CREATOR, CASE_REVIEW_STATUS, FOLLOW_PEOPLE, CASE_DEMAND, TEST_CASE_STATUS];
export const TEST_CASE_CONFIGS = [ID, NAME, TAGS, TEST_CASE_MODULE_TREE, CREATE_TIME, UPDATE_TIME, CREATOR, CASE_REVIEW_STATUS, FOLLOW_PEOPLE, CASE_DEMAND, TEST_CASE_STATUS, TEST_CASE_PRIORITY];
export const TEST_PLAN_CONFIGS = [NAME, UPDATE_TIME, CREATE_TIME, PRINCIPAL, TEST_PLAN_STATUS, STAGE, TAGS, FOLLOW_PEOPLE, ACTUAL_START_TIME, ACTUAL_END_TIME, PLAN_START_TIME, PLAN_END_TIME];

View File

@ -6,16 +6,19 @@ export function initTestCaseConditionComponents(condition, customFields, trashEn
conditionComponents = conditionComponents.filter(item => item.custom !== true);
let comp = getAdvSearchCustomField(condition, customFields);
let statusOption = null;
let priorityOption = null;
// 系统字段国际化处理
comp = comp.filter(element => {
if (element.label === '责任人') {
element.label = i18n.t('custom_field.case_maintainer')
element.label = i18n.t('custom_field.case_maintainer');
}
if (element.label === '用例等级') {
element.label = i18n.t('custom_field.case_priority')
element.label = i18n.t('custom_field.case_priority');
priorityOption = element.options;
return false;
}
if (element.label === '用例状态') {
element.label = i18n.t('custom_field.case_status')
element.label = i18n.t('custom_field.case_status');
// 回收站TAB页处理高级搜索用例状态字段
if (trashEnable) {
element.operator.options = [OPERATORS.IN];
@ -29,13 +32,15 @@ export function initTestCaseConditionComponents(condition, customFields, trashEn
}
return true;
});
if (statusOption) {
conditionComponents.forEach((item) => {
if (item.key === 'status' || item.label === '用例状态') {
item .options = statusOption;
}
});
} else {
conditionComponents.forEach((item) => {
if ((item.key === 'status' || item.label === '用例状态') && statusOption) {
item.options = statusOption;
} else if (item.key === 'priority') {
item.options = priorityOption;
}
});
if (!statusOption) {
// statusOption 为空,则去掉状态选项
conditionComponents = conditionComponents.filter(item => item.key !== 'status' && item.label !== '用例状态');
}