chore: 默认的清理函数

This commit is contained in:
dap 2024-10-07 14:01:31 +08:00
parent e13690379c
commit 3edad0459d
2 changed files with 8 additions and 4 deletions

View File

@ -27,7 +27,9 @@ const formOptions: VbenFormProps = {
handleReset: async () => { handleReset: async () => {
selectDeptId.value = []; selectDeptId.value = [];
// eslint-disable-next-line no-use-before-define // eslint-disable-next-line no-use-before-define
await tableApi.query(); const { formApi, reload } = tableApi;
await formApi.resetForm();
await reload();
}, },
}; };
@ -138,7 +140,7 @@ function handleMultiDelete() {
<Page :auto-content-height="true" content-class="flex gap-[8px]"> <Page :auto-content-height="true" content-class="flex gap-[8px]">
<DeptTree <DeptTree
v-model:select-dept-id="selectDeptId" v-model:select-dept-id="selectDeptId"
:height="300" :height="360"
class="w-[260px]" class="w-[260px]"
@select="() => tableApi.query()" @select="() => tableApi.query()"
/> />

View File

@ -64,7 +64,9 @@ const formOptions: VbenFormProps = {
handleReset: async () => { handleReset: async () => {
selectDeptId.value = []; selectDeptId.value = [];
// eslint-disable-next-line no-use-before-define // eslint-disable-next-line no-use-before-define
await tableApi.query(); const { formApi, reload } = tableApi;
await formApi.resetForm();
await reload();
}, },
}; };
@ -194,7 +196,7 @@ function handleResetPwd(record: Recordable<any>) {
<div class="flex h-full gap-[8px]"> <div class="flex h-full gap-[8px]">
<DeptTree <DeptTree
v-model:select-dept-id="selectDeptId" v-model:select-dept-id="selectDeptId"
:height="300" :height="360"
class="w-[260px]" class="w-[260px]"
@select="() => tableApi.query()" @select="() => tableApi.query()"
/> />