fix(工作台): 修复工作台跳转bugs

This commit is contained in:
xinxin.wu 2024-12-12 18:44:33 +08:00 committed by Craftsman
parent 92200c4ed1
commit 0da20a700b
6 changed files with 12 additions and 33 deletions

View File

@ -848,7 +848,7 @@
}; };
const filterData = computed(() => { const filterData = computed(() => {
return (attrs.filter || {}) as Record<string, any>; return { ...(attrs.filter || {}) } as Record<string, any>;
}); });
const handleFilterConfirm = ( const handleFilterConfirm = (

View File

@ -626,22 +626,16 @@
async function loadApiList(hasRefreshTree: boolean) { async function loadApiList(hasRefreshTree: boolean) {
const moduleIds = await getModuleIds(); const moduleIds = await getModuleIds();
let filterParams = {
...propsRes.value.filter,
};
if (route.query.home) { if (route.query.home) {
filterParams = { propsRes.value.filter = { ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum] };
...propsRes.value.filter,
...NAV_NAVIGATION[route.query.home as WorkNavValueEnum],
};
} }
const params = { const params = {
keyword: keyword.value, keyword: keyword.value,
projectId: appStore.currentProjectId, projectId: appStore.currentProjectId,
moduleIds, moduleIds,
protocols: isAdvancedSearchMode.value ? protocolList.value.map((item) => item.protocol) : props.selectedProtocols, protocols: isAdvancedSearchMode.value ? protocolList.value.map((item) => item.protocol) : props.selectedProtocols,
filter: filterParams, filter: propsRes.value.filter,
viewId: viewId.value, viewId: viewId.value,
combineSearch: advanceFilter, combineSearch: advanceFilter,
}; };
@ -649,7 +643,7 @@
if (!hasRefreshTree && typeof refreshModuleTreeCount === 'function' && !isAdvancedSearchMode.value) { if (!hasRefreshTree && typeof refreshModuleTreeCount === 'function' && !isAdvancedSearchMode.value) {
refreshModuleTreeCount({ refreshModuleTreeCount({
keyword: keyword.value, keyword: keyword.value,
filter: filterParams, filter: propsRes.value.filter,
moduleIds: [], moduleIds: [],
protocols: props.selectedProtocols, protocols: props.selectedProtocols,
projectId: appStore.currentProjectId, projectId: appStore.currentProjectId,

View File

@ -672,12 +672,8 @@
async function loadCaseList() { async function loadCaseList() {
const selectModules = await getModuleIds(); const selectModules = await getModuleIds();
let filterParams = { ...propsRes.value.filter };
if (route.query.home) { if (route.query.home) {
filterParams = { propsRes.value.filter = { ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum] };
...propsRes.value.filter,
...NAV_NAVIGATION[route.query.home as WorkNavValueEnum],
};
} }
const params = { const params = {
@ -686,7 +682,7 @@
projectId: appStore.currentProjectId, projectId: appStore.currentProjectId,
moduleIds: selectModules, moduleIds: selectModules,
protocols: isAdvancedSearchMode.value ? protocolList.value.map((item) => item.protocol) : props.selectedProtocols, protocols: isAdvancedSearchMode.value ? protocolList.value.map((item) => item.protocol) : props.selectedProtocols,
filter: filterParams, filter: propsRes.value.filter,
viewId: viewId.value, viewId: viewId.value,
combineSearch: advanceFilter, combineSearch: advanceFilter,
}; };

View File

@ -977,10 +977,8 @@
async function loadScenarioList(refreshTreeCount?: boolean) { async function loadScenarioList(refreshTreeCount?: boolean) {
const moduleIds = await getModuleIds(); const moduleIds = await getModuleIds();
let filterParams = { ...propsRes.value.filter };
if (route.query.home) { if (route.query.home) {
filterParams = { propsRes.value.filter = {
...propsRes.value.filter,
...NAV_NAVIGATION[route.query.home as WorkNavValueEnum], ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum],
}; };
} }
@ -988,7 +986,7 @@
keyword: keyword.value, keyword: keyword.value,
projectId: appStore.currentProjectId, projectId: appStore.currentProjectId,
moduleIds, moduleIds,
filter: filterParams, filter: propsRes.value.filter,
}; };
setLoadListParams({ ...params, viewId: viewId.value, combineSearch: advanceFilter }); setLoadListParams({ ...params, viewId: viewId.value, combineSearch: advanceFilter });
await loadList(); await loadList();

View File

@ -1028,13 +1028,8 @@
} }
} }
let filterParams = { ...propsRes.value.filter };
if (route.query.home) { if (route.query.home) {
filterParams = { propsRes.value.filter = { ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum] };
...propsRes.value.filter,
...NAV_NAVIGATION[route.query.home as WorkNavValueEnum],
};
} }
return { return {
@ -1044,7 +1039,7 @@
selectAll: batchParams.value.selectAll, selectAll: batchParams.value.selectAll,
selectIds: batchParams.value.selectedIds || [], selectIds: batchParams.value.selectedIds || [],
keyword: keyword.value, keyword: keyword.value,
filter: filterParams, filter: propsRes.value.filter,
}; };
} }
// //

View File

@ -900,15 +900,11 @@
moduleIds = []; moduleIds = [];
} }
let filterParams = { ...propsRes.value.filter };
if (route.query.home) { if (route.query.home) {
if (route.query.home === WorkNavValueEnum.TEST_PLAN_ARCHIVED) { if (route.query.home === WorkNavValueEnum.TEST_PLAN_ARCHIVED) {
viewId.value = 'archived'; viewId.value = 'archived';
} else { } else {
filterParams = { propsRes.value.filter = { ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum] };
...propsRes.value.filter,
...NAV_NAVIGATION[route.query.home as WorkNavValueEnum],
};
} }
} }
@ -920,7 +916,7 @@
selectAll: !!batchParams.value?.selectAll, selectAll: !!batchParams.value?.selectAll,
selectIds: batchParams.value.selectedIds || [], selectIds: batchParams.value.selectedIds || [],
keyword: keyword.value, keyword: keyword.value,
filter: filterParams, filter: propsRes.value.filter,
}; };
} }