refactor: remove useless pageCount in pagination config

This commit is contained in:
yangsy
2025-09-05 14:26:47 +08:00
parent ebcd9d0c71
commit 0c6db1fb8c
3 changed files with 3 additions and 13 deletions

View File

@@ -117,8 +117,6 @@ const tablePagination = reactive<PaginationProps>({
page: 1, page: 1,
pageSize: 10, pageSize: 10,
pageSizes: [5, 10, 20, 50, 80, 100], pageSizes: [5, 10, 20, 50, 80, 100],
// itemCount: 0,
// pageCount: 1,
prefix: ({ itemCount }) => { prefix: ({ itemCount }) => {
return h('div', {}, { default: () => `${itemCount}` }); return h('div', {}, { default: () => `${itemCount}` });
}, },
@@ -147,7 +145,6 @@ const onAfterModalLeave = () => {
resetFilterFields(); resetFilterFields();
tablePagination.page = 1; tablePagination.page = 1;
tablePagination.pageSize = 10; tablePagination.pageSize = 10;
tablePagination.pageCount = 1;
tablePagination.itemCount = 0; tablePagination.itemCount = 0;
tableData.value = []; tableData.value = [];
}; };
@@ -182,9 +179,8 @@ const { mutate: getStaionAlarmList, isPending: isTableLoading } = useMutation({
return res; return res;
}, },
onSuccess: (res) => { onSuccess: (res) => {
const { records, pages, size, total } = res; const { records, size, total } = res;
tablePagination.pageSize = parseInt(size); tablePagination.pageSize = parseInt(size);
tablePagination.pageCount = parseInt(pages);
tablePagination.itemCount = parseInt(total); tablePagination.itemCount = parseInt(total);
tableData.value = records; tableData.value = records;
}, },

View File

@@ -110,7 +110,6 @@ const tablePagination = reactive<PaginationProps>({
page: 1, page: 1,
pageSize: 10, pageSize: 10,
pageSizes: [5, 10, 20, 50, 80, 100], pageSizes: [5, 10, 20, 50, 80, 100],
pageCount: 1,
itemCount: 0, itemCount: 0,
prefix: ({ itemCount }) => { prefix: ({ itemCount }) => {
return h('div', {}, { default: () => `${itemCount}` }); return h('div', {}, { default: () => `${itemCount}` });
@@ -147,9 +146,8 @@ const { mutate: getAlarmList, isPending: isTableLoading } = useMutation({
return res; return res;
}, },
onSuccess: (res) => { onSuccess: (res) => {
const { records, pages, size, total } = res; const { records, size, total } = res;
tablePagination.pageSize = parseInt(size); tablePagination.pageSize = parseInt(size);
tablePagination.pageCount = parseInt(pages);
tablePagination.itemCount = parseInt(total); tablePagination.itemCount = parseInt(total);
tableData.value = records; tableData.value = records;
}, },
@@ -162,7 +160,6 @@ const onClickReset = () => {
resetSearchFields(); resetSearchFields();
tablePagination.page = 1; tablePagination.page = 1;
tablePagination.pageSize = 10; tablePagination.pageSize = 10;
tablePagination.pageCount = 1;
tablePagination.itemCount = 0; tablePagination.itemCount = 0;
getAlarmList(); getAlarmList();
}; };

View File

@@ -91,7 +91,6 @@ const tablePagination = reactive<PaginationProps>({
page: 1, page: 1,
pageSize: 10, pageSize: 10,
pageSizes: [5, 10, 20, 50, 80, 100], pageSizes: [5, 10, 20, 50, 80, 100],
pageCount: 1,
itemCount: 0, itemCount: 0,
prefix: ({ itemCount }) => { prefix: ({ itemCount }) => {
return h('div', {}, { default: () => `${itemCount}` }); return h('div', {}, { default: () => `${itemCount}` });
@@ -125,9 +124,8 @@ const { mutate: getVimpLogList, isPending: isTableLoading } = useMutation({
return res; return res;
}, },
onSuccess: (res) => { onSuccess: (res) => {
const { records, pages, size, total } = res; const { records, size, total } = res;
tablePagination.pageSize = parseInt(size); tablePagination.pageSize = parseInt(size);
tablePagination.pageCount = parseInt(pages);
tablePagination.itemCount = parseInt(total); tablePagination.itemCount = parseInt(total);
tableData.value = records; tableData.value = records;
}, },
@@ -140,7 +138,6 @@ const onClickReset = () => {
resetSearchFields(); resetSearchFields();
tablePagination.page = 1; tablePagination.page = 1;
tablePagination.pageSize = 10; tablePagination.pageSize = 10;
tablePagination.pageCount = 1;
tablePagination.itemCount = 0; tablePagination.itemCount = 0;
getVimpLogList(); getVimpLogList();
}; };