feat(测试计划): 测试计划报告tableKey计划和计划组隔离

This commit is contained in:
xinxin.wu 2024-09-11 18:39:27 +08:00 committed by Craftsman
parent 7e287301c1
commit beb9298dd9
3 changed files with 29 additions and 7 deletions

View File

@ -93,8 +93,11 @@ export enum TableKeyEnum {
ASSOCIATE_CASE = 'associateCase',
JSON_SCHEMA = 'jsonSchema',
TEST_PLAN_REPORT_FUNCTIONAL_TABLE = 'testPlanReportFunctionTable',
TEST_PLAN_REPORT_FUNCTIONAL_TABLE_GROUP = 'testPlanReportFunctionTableGroup',
TEST_PLAN_REPORT_API_TABLE = 'testPlanReportApiTable',
TEST_PLAN_REPORT_API_TABLE_GROUP = 'testPlanReportApiTableGroup',
TEST_PLAN_REPORT_SCENARIO_TABLE = 'testPlanReportScenarioTable',
TEST_PLAN_REPORT_SCENARIO_TABLE_GROUP = 'testPlanReportScenarioTableGroup',
}
// 具有特殊功能的列

View File

@ -181,12 +181,25 @@
});
const keyMap: Record<string, any> = {
API_CASE_DETAIL: TableKeyEnum.TEST_PLAN_REPORT_API_TABLE,
SCENARIO_CASE_DETAIL: TableKeyEnum.TEST_PLAN_REPORT_SCENARIO_TABLE,
GROUP: {
API_CASE_DETAIL: TableKeyEnum.TEST_PLAN_REPORT_API_TABLE_GROUP,
SCENARIO_CASE_DETAIL: TableKeyEnum.TEST_PLAN_REPORT_SCENARIO_TABLE_GROUP,
},
TEST_PLAN: {
API_CASE_DETAIL: TableKeyEnum.TEST_PLAN_REPORT_API_TABLE,
SCENARIO_CASE_DETAIL: TableKeyEnum.TEST_PLAN_REPORT_SCENARIO_TABLE,
},
};
const tableKey = computed(() => {
if (props.isGroup) {
return keyMap.GROUP[props.activeType];
}
return keyMap.TEST_PLAN[props.activeType];
});
const useApiTable = useTable(getApiPage, {
tableKey: TableKeyEnum.TEST_PLAN_REPORT_API_TABLE,
tableKey: tableKey.value,
scroll: { x: '100%' },
columns: columns.value,
showSelectorAll: false,
@ -195,8 +208,9 @@
isSimpleSetting: true,
paginationSize: 'mini',
});
const useScenarioTable = useTable(getScenarioPage, {
tableKey: TableKeyEnum.TEST_PLAN_REPORT_SCENARIO_TABLE,
tableKey: tableKey.value,
scroll: { x: '100%' },
columns: columns.value,
showSelectorAll: false,
@ -264,7 +278,7 @@
loadCaseList,
});
await tableStore.initColumn(keyMap[props.activeType], columns.value, 'drawer');
await tableStore.initColumn(tableKey.value, columns.value, 'drawer');
</script>
<style lang="less" scoped></style>

View File

@ -202,8 +202,13 @@
return !props.shareId ? getReportFeatureCaseList : getReportShareFeatureCaseList;
};
const tableKey = computed(() =>
props.isGroup
? TableKeyEnum.TEST_PLAN_REPORT_FUNCTIONAL_TABLE_GROUP
: TableKeyEnum.TEST_PLAN_REPORT_FUNCTIONAL_TABLE
);
const { propsRes, propsEvent, loadList, setLoadListParams } = useTable(reportFeatureCaseList(), {
tableKey: TableKeyEnum.TEST_PLAN_REPORT_FUNCTIONAL_TABLE,
tableKey: tableKey.value,
columns: columns.value,
scroll: { x: '100%' },
heightUsed: 236,
@ -271,7 +276,7 @@
loadCaseList,
});
await tableStore.initColumn(TableKeyEnum.TEST_PLAN_REPORT_FUNCTIONAL_TABLE, columns.value, 'drawer');
await tableStore.initColumn(tableKey.value, columns.value, 'drawer');
</script>
<style lang="less" scoped></style>