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,
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;
},

View File

@@ -110,7 +110,6 @@ const tablePagination = reactive<PaginationProps>({
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();
};

View File

@@ -91,7 +91,6 @@ const tablePagination = reactive<PaginationProps>({
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();
};