fix(系统): 应用初始化主题&表格加载列表后无需重置 filter

This commit is contained in:
baiqi 2024-12-12 17:34:32 +08:00 committed by Craftsman
parent 37ecb924d9
commit 1e0da292a9
2 changed files with 5 additions and 3 deletions

View File

@ -20,7 +20,7 @@
import { getQueryVariable, getUrlParameterWidthRegExp } from '@/utils';
import { setLoginExpires, setLongType, setToken } from '@/utils/auth';
import { getLocalStorage, setLocalStorage } from '@/utils/local-storage';
import { setFavicon } from '@/utils/theme';
import { setFavicon, watchStyle, watchTheme } from '@/utils/theme';
import { getLarkCallback, getLarkSuiteCallback, getPublicKeyRequest } from './api/modules/user';
import { hasAnyPermission } from './utils/permission';
@ -42,6 +42,9 @@
}
});
//
watchStyle(appStore.pageConfig.style, appStore.pageConfig);
watchTheme(appStore.pageConfig.theme, appStore.pageConfig);
setFavicon(GetPlatformIconUrl);
onBeforeMount(async () => {

View File

@ -72,6 +72,7 @@ export default function useTableProps<T>(
showJumpMethod: false, // 是否显示跳转方法
isSimpleSetting: false, // 是否是简易column设置
filterIconAlignLeft: true, // 筛选图标是否靠左
filter: {}, // 筛选条件
...props,
};
@ -249,14 +250,12 @@ export default function useTableProps<T>(
propsRes.value.data = tmpArr.map((item: MsTableDataItem<T>) => {
return processRecordItem(item);
});
propsRes.value.filter = cloneDeep({ ...filterItem.value, ...loadListParams.value.filter });
if (data.total === 0) {
setTableErrorStatus('empty');
} else {
setTableErrorStatus(false);
}
setPagination({ current: data.current, total: data.total });
return data;
}
} catch (err) {
setTableErrorStatus('error');