refactor: credential table columns

This commit is contained in:
jialin
2025-09-16 11:26:17 +08:00
parent 43936e21d9
commit 0c1057d554
34 changed files with 648 additions and 503 deletions
+4 -4
View File
@@ -14,9 +14,9 @@ type WatchConfig =
| { watch: true; API: string; polling?: false | undefined }
| { polling: true; watch: false | undefined; API?: string };
export default function useTableFetch<ListItem>(
export default function useTableFetch<T>(
options: {
fetchAPI: (params: any) => Promise<Global.PageResponse<ListItem>>;
fetchAPI: (params: any) => Promise<Global.PageResponse<T>>;
deleteAPI?: (id: number, params?: any) => Promise<any>;
contentForDelete?: string;
defaultData?: any[];
@@ -47,7 +47,7 @@ export default function useTableFetch<ListItem>(
});
const [dataSource, setDataSource] = useState<{
dataList: ListItem[];
dataList: T[];
loading: boolean;
loadend: boolean;
total: number;
@@ -217,7 +217,7 @@ export default function useTableFetch<ListItem>(
const handleNameChange = debounceUpdateFilter;
const handleDelete = (
row: ListItem & { name: string; id: number },
row: T & { name: string; id: number },
options?: any
) => {
modalRef.current?.show({