|
@@ -6,14 +6,17 @@ import { isFunction } from '/@/utils/is';
|
|
export function useTableForm(
|
|
export function useTableForm(
|
|
propsRef: ComputedRef<BasicTableProps>,
|
|
propsRef: ComputedRef<BasicTableProps>,
|
|
slots: Slots,
|
|
slots: Slots,
|
|
- fetch: (opt?: FetchParams | undefined) => Promise<void>
|
|
|
|
|
|
+ fetch: (opt?: FetchParams | undefined) => Promise<void>,
|
|
|
|
+ getLoading: ComputedRef<boolean | undefined>
|
|
) {
|
|
) {
|
|
const getFormProps = computed(
|
|
const getFormProps = computed(
|
|
(): Partial<FormProps> => {
|
|
(): Partial<FormProps> => {
|
|
const { formConfig } = unref(propsRef);
|
|
const { formConfig } = unref(propsRef);
|
|
|
|
+ const { submitButtonOptions } = formConfig || {};
|
|
return {
|
|
return {
|
|
showAdvancedButton: true,
|
|
showAdvancedButton: true,
|
|
...formConfig,
|
|
...formConfig,
|
|
|
|
+ submitButtonOptions: { loading: unref(getLoading), ...submitButtonOptions },
|
|
compact: true,
|
|
compact: true,
|
|
};
|
|
};
|
|
}
|
|
}
|