refactor: ♻️ 优化系统配置和通知公告的页面

优化系统配置和通知公告的页面
This commit is contained in:
Theo
2024-11-23 00:07:08 +08:00
parent f8a1fdf8cf
commit 2e5e59d10c
8 changed files with 382 additions and 697 deletions

17
src/utils/commonUtil.ts Normal file
View File

@@ -0,0 +1,17 @@
/**
* 防抖函数
* @param fn 函数
* @param delay 延迟时间
* @returns
*/
const debounce = <T extends (...args: any[]) => any>(fn: T, delay: number) => {
let timer: number | null = null;
return function (this: any, ...args: Parameters<T>) {
if (timer) clearTimeout(timer);
timer = setTimeout(() => {
fn.apply(this, args);
}, delay);
};
};
export { debounce };