diff --git a/frontend/src/components/pure/ms-table/base-table.vue b/frontend/src/components/pure/ms-table/base-table.vue index 02869cdf01..3167ae7241 100644 --- a/frontend/src/components/pure/ms-table/base-table.vue +++ b/frontend/src/components/pure/ms-table/base-table.vue @@ -848,7 +848,7 @@ }; const filterData = computed(() => { - return (attrs.filter || {}) as Record; + return { ...(attrs.filter || {}) } as Record; }); const handleFilterConfirm = ( diff --git a/frontend/src/views/api-test/management/components/management/api/apiTable.vue b/frontend/src/views/api-test/management/components/management/api/apiTable.vue index a1b555036d..72f78a0da2 100644 --- a/frontend/src/views/api-test/management/components/management/api/apiTable.vue +++ b/frontend/src/views/api-test/management/components/management/api/apiTable.vue @@ -626,22 +626,16 @@ async function loadApiList(hasRefreshTree: boolean) { const moduleIds = await getModuleIds(); - let filterParams = { - ...propsRes.value.filter, - }; 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 = { keyword: keyword.value, projectId: appStore.currentProjectId, moduleIds, protocols: isAdvancedSearchMode.value ? protocolList.value.map((item) => item.protocol) : props.selectedProtocols, - filter: filterParams, + filter: propsRes.value.filter, viewId: viewId.value, combineSearch: advanceFilter, }; @@ -649,7 +643,7 @@ if (!hasRefreshTree && typeof refreshModuleTreeCount === 'function' && !isAdvancedSearchMode.value) { refreshModuleTreeCount({ keyword: keyword.value, - filter: filterParams, + filter: propsRes.value.filter, moduleIds: [], protocols: props.selectedProtocols, projectId: appStore.currentProjectId, diff --git a/frontend/src/views/api-test/management/components/management/case/caseTable.vue b/frontend/src/views/api-test/management/components/management/case/caseTable.vue index d1b392535c..bab795cbcf 100644 --- a/frontend/src/views/api-test/management/components/management/case/caseTable.vue +++ b/frontend/src/views/api-test/management/components/management/case/caseTable.vue @@ -672,12 +672,8 @@ async function loadCaseList() { const selectModules = await getModuleIds(); - let filterParams = { ...propsRes.value.filter }; 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 = { @@ -686,7 +682,7 @@ projectId: appStore.currentProjectId, moduleIds: selectModules, protocols: isAdvancedSearchMode.value ? protocolList.value.map((item) => item.protocol) : props.selectedProtocols, - filter: filterParams, + filter: propsRes.value.filter, viewId: viewId.value, combineSearch: advanceFilter, }; diff --git a/frontend/src/views/api-test/scenario/components/scenarioTable.vue b/frontend/src/views/api-test/scenario/components/scenarioTable.vue index cb7416ebd2..4ba0cb737b 100644 --- a/frontend/src/views/api-test/scenario/components/scenarioTable.vue +++ b/frontend/src/views/api-test/scenario/components/scenarioTable.vue @@ -977,10 +977,8 @@ async function loadScenarioList(refreshTreeCount?: boolean) { const moduleIds = await getModuleIds(); - let filterParams = { ...propsRes.value.filter }; if (route.query.home) { - filterParams = { - ...propsRes.value.filter, + propsRes.value.filter = { ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum], }; } @@ -988,7 +986,7 @@ keyword: keyword.value, projectId: appStore.currentProjectId, moduleIds, - filter: filterParams, + filter: propsRes.value.filter, }; setLoadListParams({ ...params, viewId: viewId.value, combineSearch: advanceFilter }); await loadList(); diff --git a/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue b/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue index 7475e6eccd..ea5d593960 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue @@ -1028,13 +1028,8 @@ } } - let filterParams = { ...propsRes.value.filter }; - 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 { @@ -1044,7 +1039,7 @@ selectAll: batchParams.value.selectAll, selectIds: batchParams.value.selectedIds || [], keyword: keyword.value, - filter: filterParams, + filter: propsRes.value.filter, }; } // 获取父组件模块数量 diff --git a/frontend/src/views/test-plan/testPlan/components/planTable.vue b/frontend/src/views/test-plan/testPlan/components/planTable.vue index e56afbd368..9b9ccc656a 100644 --- a/frontend/src/views/test-plan/testPlan/components/planTable.vue +++ b/frontend/src/views/test-plan/testPlan/components/planTable.vue @@ -900,15 +900,11 @@ moduleIds = []; } - let filterParams = { ...propsRes.value.filter }; if (route.query.home) { if (route.query.home === WorkNavValueEnum.TEST_PLAN_ARCHIVED) { viewId.value = 'archived'; } 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, selectIds: batchParams.value.selectedIds || [], keyword: keyword.value, - filter: filterParams, + filter: propsRes.value.filter, }; }