This commit is contained in:
dap
2024-12-18 13:32:33 +08:00
20 changed files with 186 additions and 29 deletions

View File

@@ -68,6 +68,7 @@ const { isMobile } = usePreferences();
const slots = useSlots();
const [Form, formApi] = useTableForm({
compact: true,
handleSubmit: async () => {
const formValues = formApi.form.values;
formApi.setLatestSubmissionValues(toRaw(formValues));
@@ -286,6 +287,10 @@ watch(
},
);
const isCompactForm = computed(() => {
return formApi.getState()?.compact;
});
onMounted(() => {
props.api?.mount?.(gridRef.value, formApi);
init();
@@ -340,7 +345,7 @@ onUnmounted(() => {
<div
v-if="formOptions"
v-show="showSearchForm !== false"
class="relative rounded py-3 pb-4"
:class="cn('relative rounded py-3', isCompactForm ? 'pb-6' : 'pb-4')"
>
<slot name="form">
<Form>