From 0b97e4013eabdcd2c1d1740eb34b2d9bb915cff2 Mon Sep 17 00:00:00 2001 From: SalleeMatthew <132789789+SalleeMatthew@users.noreply.github.com> Date: Mon, 23 Sep 2024 01:46:54 -0500 Subject: [PATCH] Update Page Generation Updated how number of pages was determined. --- spa/src/pages/mall/staff/pending.vue | 5 +---- spa/src/pages/mall/staff/stocked.vue | 5 +---- spa/src/pages/mall/staff/warehouse.vue | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/spa/src/pages/mall/staff/pending.vue b/spa/src/pages/mall/staff/pending.vue index 6fdf0460..50ab883c 100644 --- a/spa/src/pages/mall/staff/pending.vue +++ b/spa/src/pages/mall/staff/pending.vue @@ -150,10 +150,7 @@ export default Vue.extend({ this.totalCount = response.data.objects.total[0].count; this.objects = response.data.objects.objects; this.showSuccess = true; - let pages = Math.round(this.totalCount/this.limit); - if(pages < this.totalCount/this.limit){ - pages++ - } + let pages = Math.ceil(this.totalCount/this.limit); for(let i = 1; pages >= i; i++){ this.pages.push(i); } diff --git a/spa/src/pages/mall/staff/stocked.vue b/spa/src/pages/mall/staff/stocked.vue index b73111ff..5552efec 100644 --- a/spa/src/pages/mall/staff/stocked.vue +++ b/spa/src/pages/mall/staff/stocked.vue @@ -149,10 +149,7 @@ export default Vue.extend({ this.totalCount = response.data.objects.total[0].count; this.objects = response.data.objects.objects; this.showSuccess = true; - let pages = Math.round(this.totalCount/this.limit); - if(pages < this.totalCount/this.limit){ - pages++ - } + let pages = Math.ceil(this.totalCount/this.limit); for(let i = 1; pages >= i; i++){ this.pages.push(i); } diff --git a/spa/src/pages/mall/staff/warehouse.vue b/spa/src/pages/mall/staff/warehouse.vue index 30094eeb..f2578ca2 100644 --- a/spa/src/pages/mall/staff/warehouse.vue +++ b/spa/src/pages/mall/staff/warehouse.vue @@ -162,10 +162,7 @@ export default Vue.extend({ this.totalCount = response.data.objects.total[0].count; this.objects = response.data.objects.objects; this.showSuccess = true; - let pages = Math.round(this.totalCount/this.limit); - if(pages < this.totalCount/this.limit){ - pages++ - } + let pages = Math.ceil(this.totalCount/this.limit); for(let i = 1; pages >= i; i++){ this.pages.push(i); }