From 70ef5063c65e2cb3c50b97e8992a1b29a4aef518 Mon Sep 17 00:00:00 2001 From: 3octaves <873551943@qq.com> Date: Mon, 23 Sep 2024 16:26:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E6=94=B9=E5=8F=98=E5=88=86?= =?UTF-8?q?=E9=A1=B5limit=E9=A1=B5=E7=A0=81=E6=9C=AA=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D=20#7080?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../big-data-host-table/hook/useLocalPagination.ts | 3 +++ dbm-ui/frontend/src/components/db-table/index.vue | 1 + dbm-ui/frontend/src/hooks/useLocalPagination.ts | 1 + .../report/components/render-dynamic-table/Index.vue | 1 + .../src/views/resource-manage/pool/components/RenderTable.vue | 1 + 5 files changed, 7 insertions(+) diff --git a/dbm-ui/frontend/src/components/cluster-common/big-data-host-table/hook/useLocalPagination.ts b/dbm-ui/frontend/src/components/cluster-common/big-data-host-table/hook/useLocalPagination.ts index 1f08de240c..ca182b5890 100644 --- a/dbm-ui/frontend/src/components/cluster-common/big-data-host-table/hook/useLocalPagination.ts +++ b/dbm-ui/frontend/src/components/cluster-common/big-data-host-table/hook/useLocalPagination.ts @@ -51,13 +51,16 @@ export default function (originalData: Ref) { const handlePaginationCurrentChange = (current: number) => { pagination.current = current; }; + const handlePaginationLimitChange = (limit: number) => { pagination.limit = limit; + pagination.current = 1; }; watch(searchKey, () => { pagination.current = 1; }); + watch( serachList, (list) => { diff --git a/dbm-ui/frontend/src/components/db-table/index.vue b/dbm-ui/frontend/src/components/db-table/index.vue index b79cde5607..ac35730505 100644 --- a/dbm-ui/frontend/src/components/db-table/index.vue +++ b/dbm-ui/frontend/src/components/db-table/index.vue @@ -528,6 +528,7 @@ // 切换每页条数 const handlePageLimitChange = (pageLimit: number) => { pagination.limit = pageLimit; + pagination.current = 1; fetchListData(); }; diff --git a/dbm-ui/frontend/src/hooks/useLocalPagination.ts b/dbm-ui/frontend/src/hooks/useLocalPagination.ts index bf701571d5..e37f45469a 100644 --- a/dbm-ui/frontend/src/hooks/useLocalPagination.ts +++ b/dbm-ui/frontend/src/hooks/useLocalPagination.ts @@ -51,6 +51,7 @@ export function useLocalPagination(originalData: Ref>, callback: (ru }; const handlePaginationLimitChange = (limit: number) => { pagination.limit = limit; + handlePaginationCurrentChange(1); }; watch(searchKey, () => { diff --git a/dbm-ui/frontend/src/views/inspection-manage/report/components/render-dynamic-table/Index.vue b/dbm-ui/frontend/src/views/inspection-manage/report/components/render-dynamic-table/Index.vue index 54e1af2db5..1ab25675fa 100644 --- a/dbm-ui/frontend/src/views/inspection-manage/report/components/render-dynamic-table/Index.vue +++ b/dbm-ui/frontend/src/views/inspection-manage/report/components/render-dynamic-table/Index.vue @@ -113,6 +113,7 @@ const pageLimitChange = (pageLimit: number) => { pagination.limit = pageLimit; + pagination.current = 1; fetchData(); }; diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/RenderTable.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/RenderTable.vue index 6cc0287bf2..f751330827 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/RenderTable.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/RenderTable.vue @@ -459,6 +459,7 @@ // 切换每页条数 const handlePageLimitChange = (pageLimit: number) => { pagination.limit = pageLimit; + pagination.current = 1; fetchListData(); };