refactor: remove useless pageCount in pagination config
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user