From 5c5e9fac635f09600f64d7dd4c0b7cbcbf8710c8 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Tue, 28 Jan 2025 18:07:57 +0700 Subject: [PATCH] refactor: update screen.sm pagination display for various management pages --- src/i18n/eng.ts | 1 + src/i18n/tha.ts | 1 + .../02_personnel-management/MainPage.vue | 13 ++++--- .../03_customer-management/BranchPage.vue | 13 ++++--- src/pages/03_customer-management/MainPage.vue | 28 ++++++++++----- src/pages/04_flow-managment/MainPage.vue | 19 ++++++---- src/pages/04_product-service/MainPage.vue | 35 +++++++++++++------ src/pages/05_quotation/MainPage.vue | 19 ++++++---- src/pages/07_agencies-management/MainPage.vue | 17 ++++++--- src/pages/08_request-list/MainPage.vue | 17 ++++++--- src/pages/09_task-order/MainPage.vue | 19 ++++++---- src/pages/10_invoice/MainPage.vue | 17 ++++++--- src/pages/11_credit-note/MainPage.vue | 17 ++++++--- src/pages/12_debit-note/MainPage.vue | 17 ++++++--- src/pages/13_receipt/MainPage.vue | 17 ++++++--- 15 files changed, 181 insertions(+), 69 deletions(-) diff --git a/src/i18n/eng.ts b/src/i18n/eng.ts index 6c6c0ea1..ad494148 100644 --- a/src/i18n/eng.ts +++ b/src/i18n/eng.ts @@ -144,6 +144,7 @@ export default { quotationLabor: 'Used to display the list of employees', quotationPayment: 'Used to display payment details', orderDetail: 'To display the list of employees in that product', + ofPage: '{current} of {total}', }, menu: { diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts index fbc30320..7f5929bf 100644 --- a/src/i18n/tha.ts +++ b/src/i18n/tha.ts @@ -146,6 +146,7 @@ export default { quotationLabor: 'ใช้แสดงรายชื่อลูกจ้าง', quotationPayment: 'ใช้แสดงรายละเอียดในการชำระเงิน', orderDetail: 'เพื่อแสดงรายชื่อลูกจ้างในสินค้านั้นๆ', + ofPage: '{current} จาก {total}', }, menu: { diff --git a/src/pages/02_personnel-management/MainPage.vue b/src/pages/02_personnel-management/MainPage.vue index c2b8d2c6..66d90986 100644 --- a/src/pages/02_personnel-management/MainPage.vue +++ b/src/pages/02_personnel-management/MainPage.vue @@ -1427,10 +1427,15 @@ watch(
{{ - $t('general.recordsPage', { - resultcurrentPage: userData?.result.length, - total: userData?.total, - }) + $q.screen.gt.sm + ? $t('general.recordsPage', { + resultcurrentPage: userData?.result.length, + total: userData?.total, + }) + : $t('general.ofPage', { + current: userData?.result.length, + total: userData?.total, + }) }}
diff --git a/src/pages/03_customer-management/BranchPage.vue b/src/pages/03_customer-management/BranchPage.vue index d7b0e2d0..bf1b8fd7 100644 --- a/src/pages/03_customer-management/BranchPage.vue +++ b/src/pages/03_customer-management/BranchPage.vue @@ -698,10 +698,15 @@ watch(
{{ - $t('general.recordsPage', { - resultcurrentPage: branch?.length, - total: totalBranch, - }) + $q.screen.gt.sm + ? $t('general.recordsPage', { + resultcurrentPage: branch?.length, + total: totalBranch, + }) + : $t('general.ofPage', { + current: branch?.length, + total: totalBranch, + }) }}
diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 4a1dea6e..54f1c77f 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -1749,10 +1749,17 @@ const emptyCreateDialog = ref(false);
{{ - $t('general.recordsPage', { - resultcurrentPage: listCustomer.length, - total: statsCustomerType.PERS + statsCustomerType.CORP, - }) + $q.screen.gt.sm + ? $t('general.recordsPage', { + resultcurrentPage: listCustomer.length, + total: + statsCustomerType.PERS + statsCustomerType.CORP, + }) + : $t('general.ofPage', { + current: listCustomer.length, + total: + statsCustomerType.PERS + statsCustomerType.CORP, + }) }}
@@ -1844,10 +1851,15 @@ const emptyCreateDialog = ref(false);
{{ - $t('general.recordsPage', { - resultcurrentPage: listEmployee.length, - total: employeeStats, - }) + $q.screen.gt.sm + ? $t('general.recordsPage', { + resultcurrentPage: listEmployee.length, + total: employeeStats, + }) + : $t('general.ofPage', { + current: listEmployee.length, + total: employeeStats, + }) }}
diff --git a/src/pages/04_flow-managment/MainPage.vue b/src/pages/04_flow-managment/MainPage.vue index a03c3be7..5e0a8042 100644 --- a/src/pages/04_flow-managment/MainPage.vue +++ b/src/pages/04_flow-managment/MainPage.vue @@ -720,12 +720,19 @@ watch([() => pageState.inputSearch, workflowPageSize], fetchWorkflowList);
{{ - $t('general.recordsPage', { - resultcurrentPage: workflowData.length, - total: pageState.inputSearch - ? workflowData.length - : pageState.total, - }) + $q.screen.gt.sm + ? $t('general.recordsPage', { + resultcurrentPage: workflowData.length, + total: pageState.inputSearch + ? workflowData.length + : pageState.total, + }) + : $t('general.ofPage', { + current: workflowData.length, + total: pageState.inputSearch + ? workflowData.length + : pageState.total, + }) }}
{{ - $t('general.recordsPage', { - resultcurrentPage: data.length, - total: pageState.inputSearch ? data.length : pageState.total, - }) + $q.screen.gt.sm + ? $t('general.recordsPage', { + resultcurrentPage: data.length, + total: pageState.inputSearch + ? data.length + : pageState.total, + }) + : $t('general.ofPage', { + current: data.length, + total: pageState.inputSearch + ? data.length + : pageState.total, + }) }}