feat(功能用例): 功能用例表格支持是否显示子目录数据
This commit is contained in:
parent
5674d80bb5
commit
8fc3fc6283
|
@ -45,6 +45,7 @@
|
|||
v-on="propsEvent"
|
||||
@batch-action="handleTableBatch"
|
||||
@change="changeHandler"
|
||||
@module-change="initData()"
|
||||
>
|
||||
<template #num="{ record, rowIndex }">
|
||||
<span type="text" class="px-0" @click="showCaseDetail(record.id, rowIndex)">{{ record.num }}</span>
|
||||
|
@ -878,10 +879,19 @@
|
|||
const caseFilters = ref<string[]>([]);
|
||||
const executeResultFilters = ref(Object.keys(executionResultMap));
|
||||
|
||||
function initTableParams() {
|
||||
async function initTableParams() {
|
||||
let moduleIds: string[] = [];
|
||||
if (props.activeFolder && props.activeFolder !== 'all') {
|
||||
moduleIds = [...featureCaseStore.moduleId];
|
||||
const getAllChildren = await tableStore.getSubShow(TableKeyEnum.CASE_MANAGEMENT_TABLE);
|
||||
if (getAllChildren) {
|
||||
moduleIds = [...featureCaseStore.moduleId, ...props.offspringIds];
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
keyword: keyword.value,
|
||||
moduleIds: props.activeFolder === 'all' ? [] : [props.activeFolder, ...props.offspringIds],
|
||||
moduleIds,
|
||||
projectId: currentProjectId.value,
|
||||
|
||||
filter: {
|
||||
|
@ -899,10 +909,10 @@
|
|||
};
|
||||
}
|
||||
// 获取父组件模块数量
|
||||
function emitTableParams() {
|
||||
const moduleIds = props.activeFolder === 'all' ? [] : [props.activeFolder, ...props.offspringIds];
|
||||
async function emitTableParams() {
|
||||
const tableParams = await initTableParams();
|
||||
emit('init', {
|
||||
...initTableParams(),
|
||||
...tableParams,
|
||||
current: propsRes.value.msPagination?.current,
|
||||
pageSize: propsRes.value.msPagination?.pageSize,
|
||||
});
|
||||
|
@ -938,13 +948,8 @@
|
|||
}
|
||||
const executeResultFilterList = ref(getExecuteResultList());
|
||||
|
||||
function getLoadListParams() {
|
||||
if (props.activeFolder === 'all') {
|
||||
searchParams.value.moduleIds = [];
|
||||
} else {
|
||||
searchParams.value.moduleIds = [...featureCaseStore.moduleId, ...props.offspringIds];
|
||||
}
|
||||
setLoadListParams(initTableParams());
|
||||
async function getLoadListParams() {
|
||||
setLoadListParams(await initTableParams());
|
||||
}
|
||||
|
||||
// 执行结果表头检索
|
||||
|
@ -954,8 +959,8 @@
|
|||
|
||||
// 初始化列表
|
||||
async function initData() {
|
||||
getLoadListParams();
|
||||
loadList();
|
||||
await getLoadListParams();
|
||||
await loadList();
|
||||
emitTableParams();
|
||||
}
|
||||
|
||||
|
|
|
@ -94,6 +94,7 @@
|
|||
@selected-change="handleTableSelect"
|
||||
v-on="propsEvent"
|
||||
@batch-action="handleTableBatch"
|
||||
@module-change="initRecycleList()"
|
||||
>
|
||||
<template #num="{ record }">
|
||||
<span class="flex w-full">{{ record.num }}</span>
|
||||
|
@ -677,10 +678,18 @@
|
|||
};
|
||||
}
|
||||
|
||||
function initTableParams() {
|
||||
async function initTableParams() {
|
||||
let moduleIds: string[] = [];
|
||||
if (activeFolder.value !== 'all') {
|
||||
moduleIds = [activeFolder.value];
|
||||
const getAllChildren = await tableStore.getSubShow(TableKeyEnum.CASE_MANAGEMENT_RECYCLE_TABLE);
|
||||
if (getAllChildren) {
|
||||
moduleIds = [activeFolder.value, ...offspringIds.value];
|
||||
}
|
||||
}
|
||||
return {
|
||||
keyword: keyword.value,
|
||||
moduleIds: activeFolder.value === 'all' ? [] : [activeFolder.value, ...offspringIds.value],
|
||||
moduleIds,
|
||||
projectId: currentProjectId.value,
|
||||
filter: {
|
||||
reviewStatus: statusFilters.value,
|
||||
|
@ -699,22 +708,28 @@
|
|||
}
|
||||
|
||||
// 获取回收站模块数量
|
||||
function initRecycleModulesCount() {
|
||||
async function initRecycleModulesCount() {
|
||||
const tableParams = await initTableParams();
|
||||
featureCaseStore.getRecycleModulesCount({
|
||||
...initTableParams(),
|
||||
...tableParams,
|
||||
current: propsRes.value.msPagination?.current,
|
||||
pageSize: propsRes.value.msPagination?.pageSize,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取用例参数
|
||||
function getLoadListParams() {
|
||||
async function getLoadListParams() {
|
||||
if (activeFolder.value === 'all') {
|
||||
searchParams.value.moduleIds = [];
|
||||
} else {
|
||||
searchParams.value.moduleIds = [activeFolder.value, ...offspringIds.value];
|
||||
const getAllChildren = await tableStore.getSubShow(TableKeyEnum.CASE_MANAGEMENT_RECYCLE_TABLE);
|
||||
if (getAllChildren) {
|
||||
searchParams.value.moduleIds = [activeFolder.value, ...offspringIds.value];
|
||||
} else {
|
||||
searchParams.value.moduleIds = [activeFolder.value];
|
||||
}
|
||||
}
|
||||
setLoadListParams(initTableParams());
|
||||
setLoadListParams(await initTableParams());
|
||||
}
|
||||
|
||||
// 执行结果表头检索
|
||||
|
@ -725,7 +740,7 @@
|
|||
|
||||
// 初始化回收站列表
|
||||
async function initRecycleList() {
|
||||
getLoadListParams();
|
||||
await getLoadListParams();
|
||||
await loadList();
|
||||
initRecycleModulesCount();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue