mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat: 添加流程实例功能
This commit is contained in:
@ -64,7 +64,10 @@ export default function useHookTable<A extends ApiFn, T, C>(config: TableConfig<
|
||||
const { loading, startLoading, endLoading } = useLoading();
|
||||
const { bool: empty, setBool: setEmpty } = useBoolean();
|
||||
|
||||
const { apiFn, apiParams, transformer, immediate = true, getColumnChecks, getColumns } = config;
|
||||
const { transformer, immediate = true, getColumnChecks, getColumns } = config;
|
||||
|
||||
let currentApiFn = config.apiFn;
|
||||
const apiParams = config.apiParams;
|
||||
|
||||
const searchParams: NonNullable<Parameters<A>[0]> = reactive(jsonClone({ ...apiParams }));
|
||||
|
||||
@ -94,7 +97,7 @@ export default function useHookTable<A extends ApiFn, T, C>(config: TableConfig<
|
||||
|
||||
const formattedParams = formatSearchParams(searchParams);
|
||||
|
||||
const response = await apiFn(formattedParams);
|
||||
const response = await currentApiFn(formattedParams);
|
||||
|
||||
const transformed = transformer(response as Awaited<ReturnType<A>>);
|
||||
|
||||
@ -119,6 +122,10 @@ export default function useHookTable<A extends ApiFn, T, C>(config: TableConfig<
|
||||
return formattedParams;
|
||||
}
|
||||
|
||||
function updateApiFn(newApiFn: A) {
|
||||
currentApiFn = newApiFn;
|
||||
}
|
||||
|
||||
/**
|
||||
* update search params
|
||||
*
|
||||
@ -148,6 +155,7 @@ export default function useHookTable<A extends ApiFn, T, C>(config: TableConfig<
|
||||
getData,
|
||||
searchParams,
|
||||
updateSearchParams,
|
||||
resetSearchParams
|
||||
resetSearchParams,
|
||||
updateApiFn
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user