From 8702f3f542a898a0d4298def19898c7716d29084 Mon Sep 17 00:00:00 2001 From: xlsea Date: Tue, 4 Jun 2024 15:24:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(sj=5F1.0.0=5Fbeta4):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=A1=A8=E5=8D=95=E6=90=9C=E7=B4=A2=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/search-form.vue | 4 +++- src/hooks/common/table.ts | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/common/search-form.vue b/src/components/common/search-form.vue index 615347b..16ef179 100644 --- a/src/components/common/search-form.vue +++ b/src/components/common/search-form.vue @@ -12,7 +12,7 @@ interface Props { model: Record; } -defineProps(); +const props = defineProps(); interface Emits { (e: 'reset'): void; @@ -29,11 +29,13 @@ const { formRef, validate, restoreValidation } = useNaiveForm(); async function reset() { await restoreValidation(); + Object.assign(props.model, { ...props.model, page: 1 }); emit('reset'); } async function search() { await validate(); + Object.assign(props.model, { ...props.model, page: 1 }); emit('search'); } diff --git a/src/hooks/common/table.ts b/src/hooks/common/table.ts index 74a11f2..962deaf 100644 --- a/src/hooks/common/table.ts +++ b/src/hooks/common/table.ts @@ -32,7 +32,7 @@ export function useTable(config: NaiveUI.NaiveTabl getData, searchParams, updateSearchParams, - resetSearchParams + resetSearchParams: resetSearchParams0 } = useHookTable, TableColumn>>>({ apiFn, apiParams, @@ -172,6 +172,11 @@ export function useTable(config: NaiveUI.NaiveTabl scope.stop(); }); + const resetSearchParams = () => { + resetSearchParams0(); + getData(); + }; + return { loading, empty, From e1aef477cb3d1c2a767e3c8e2c74c8da21f95e90 Mon Sep 17 00:00:00 2001 From: xlsea Date: Tue, 4 Jun 2024 15:44:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?style(sj=5F1.0.0=5Fbeta4):=20=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E6=90=9C=E7=B4=A2=E6=8C=89=E9=92=AE=E5=8F=B3=E9=9D=A0?= =?UTF-8?q?=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/search-form.vue | 9 +++++++-- src/views/user/manager/index.vue | 3 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/common/search-form.vue b/src/components/common/search-form.vue index 16ef179..991299e 100644 --- a/src/components/common/search-form.vue +++ b/src/components/common/search-form.vue @@ -1,5 +1,5 @@