From 0c6db1fb8c61412eff3690a8e2605519a96fcf60 Mon Sep 17 00:00:00 2001 From: yangsy Date: Fri, 5 Sep 2025 14:26:47 +0800 Subject: [PATCH] refactor: remove useless pageCount in pagination config --- src/components/dashboard-page/device-alarm-detail-modal.vue | 6 +----- src/pages/alarm-page.vue | 5 +---- src/pages/vimp-log-page.vue | 5 +---- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/components/dashboard-page/device-alarm-detail-modal.vue b/src/components/dashboard-page/device-alarm-detail-modal.vue index baad649..d6fa2dc 100644 --- a/src/components/dashboard-page/device-alarm-detail-modal.vue +++ b/src/components/dashboard-page/device-alarm-detail-modal.vue @@ -117,8 +117,6 @@ const tablePagination = reactive({ page: 1, pageSize: 10, pageSizes: [5, 10, 20, 50, 80, 100], - // itemCount: 0, - // pageCount: 1, prefix: ({ itemCount }) => { return h('div', {}, { default: () => `共${itemCount}条` }); }, @@ -147,7 +145,6 @@ const onAfterModalLeave = () => { resetFilterFields(); tablePagination.page = 1; tablePagination.pageSize = 10; - tablePagination.pageCount = 1; tablePagination.itemCount = 0; tableData.value = []; }; @@ -182,9 +179,8 @@ const { mutate: getStaionAlarmList, isPending: isTableLoading } = useMutation({ return res; }, onSuccess: (res) => { - const { records, pages, size, total } = res; + const { records, size, total } = res; tablePagination.pageSize = parseInt(size); - tablePagination.pageCount = parseInt(pages); tablePagination.itemCount = parseInt(total); tableData.value = records; }, diff --git a/src/pages/alarm-page.vue b/src/pages/alarm-page.vue index 9f5eec6..2715c68 100644 --- a/src/pages/alarm-page.vue +++ b/src/pages/alarm-page.vue @@ -110,7 +110,6 @@ const tablePagination = reactive({ page: 1, pageSize: 10, pageSizes: [5, 10, 20, 50, 80, 100], - pageCount: 1, itemCount: 0, prefix: ({ itemCount }) => { return h('div', {}, { default: () => `共${itemCount}条` }); @@ -147,9 +146,8 @@ const { mutate: getAlarmList, isPending: isTableLoading } = useMutation({ return res; }, onSuccess: (res) => { - const { records, pages, size, total } = res; + const { records, size, total } = res; tablePagination.pageSize = parseInt(size); - tablePagination.pageCount = parseInt(pages); tablePagination.itemCount = parseInt(total); tableData.value = records; }, @@ -162,7 +160,6 @@ const onClickReset = () => { resetSearchFields(); tablePagination.page = 1; tablePagination.pageSize = 10; - tablePagination.pageCount = 1; tablePagination.itemCount = 0; getAlarmList(); }; diff --git a/src/pages/vimp-log-page.vue b/src/pages/vimp-log-page.vue index 7cff51a..10fad8d 100644 --- a/src/pages/vimp-log-page.vue +++ b/src/pages/vimp-log-page.vue @@ -91,7 +91,6 @@ const tablePagination = reactive({ page: 1, pageSize: 10, pageSizes: [5, 10, 20, 50, 80, 100], - pageCount: 1, itemCount: 0, prefix: ({ itemCount }) => { return h('div', {}, { default: () => `共${itemCount}条` }); @@ -125,9 +124,8 @@ const { mutate: getVimpLogList, isPending: isTableLoading } = useMutation({ return res; }, onSuccess: (res) => { - const { records, pages, size, total } = res; + const { records, size, total } = res; tablePagination.pageSize = parseInt(size); - tablePagination.pageCount = parseInt(pages); tablePagination.itemCount = parseInt(total); tableData.value = records; }, @@ -140,7 +138,6 @@ const onClickReset = () => { resetSearchFields(); tablePagination.page = 1; tablePagination.pageSize = 10; - tablePagination.pageCount = 1; tablePagination.itemCount = 0; getVimpLogList(); };