refactor: ปรับ ui เปลี่ยนหน้า

This commit is contained in:
Net 2024-07-04 14:55:09 +07:00
parent 8316d61201
commit 7fd7df5a1b

View file

@ -1403,9 +1403,38 @@ watch(inputSearchProductAndService, async () => {
<template v-else> <template v-else>
<div <div
v-if="productMode === 'group'" v-if="productMode === 'group'"
class="flex justify-between q-pt-xl" class="flex items-center justify-between q-pt-xl"
> >
<div class="app-text-muted"> <div class="col-4">
<div class="row items-center">
<div class="app-text-muted" style="width: 80px">
{{ $t('showing') }}
</div>
<div>
<q-btn-dropdown dense unelevated :label="pageSizeGroup">
<q-list>
<q-item
v-for="v in [10, 30, 50, 100, 500, 1000]"
clickable
v-close-popup
@click="
async () => {
pageSizeGroup = v;
await fetchListGroups();
}
"
>
<q-item-section>
<q-item-label>{{ v }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
</div>
</div>
<div class="col-4 row justify-center app-text-muted">
{{ {{
$t('recordsPage', { $t('recordsPage', {
resultcurrentPage: productGroup?.length, resultcurrentPage: productGroup?.length,
@ -1413,6 +1442,8 @@ watch(inputSearchProductAndService, async () => {
}) })
}} }}
</div> </div>
<div class="col-4 row justify-end">
<PaginationComponent <PaginationComponent
v-model:current-page="currentPageGroup" v-model:current-page="currentPageGroup"
v-model:max-page="maxPageGroup" v-model:max-page="maxPageGroup"
@ -1424,12 +1455,42 @@ watch(inputSearchProductAndService, async () => {
" "
/> />
</div> </div>
</div>
<div <div
v-if="productMode === 'type'" v-if="productMode === 'type'"
class="flex justify-between q-pt-xl" class="flex justify-between q-pt-xl"
> >
<div class="app-text-muted"> <div class="col-4">
<div class="row items-center">
<div class="app-text-muted" style="width: 80px">
{{ $t('showing') }}
</div>
<div>
<q-btn-dropdown dense unelevated :label="pageSizeType">
<q-list>
<q-item
v-for="v in [10, 30, 50, 100, 500, 1000]"
clickable
v-close-popup
@click="
async () => {
pageSizeType = v;
await fetchListType();
}
"
>
<q-item-section>
<q-item-label>{{ v }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
</div>
</div>
<div class="col-4 row justify-center app-text-muted">
{{ {{
$t('recordsPage', { $t('recordsPage', {
resultcurrentPage: productType?.length, resultcurrentPage: productType?.length,
@ -1437,6 +1498,7 @@ watch(inputSearchProductAndService, async () => {
}) })
}} }}
</div> </div>
<div class="col-4 row justify-end">
<PaginationComponent <PaginationComponent
v-model:current-page="currentPageType" v-model:current-page="currentPageType"
v-model:max-page="maxPageType" v-model:max-page="maxPageType"
@ -1448,6 +1510,7 @@ watch(inputSearchProductAndService, async () => {
" "
/> />
</div> </div>
</div>
</template> </template>
</div> </div>
<div <div
@ -1706,7 +1769,40 @@ watch(inputSearchProductAndService, async () => {
</div> </div>
</div> </div>
<div class="row justify-between q-pb-md q-px-lg"> <div class="row justify-between q-pb-md q-px-lg">
<div class="app-text-muted"> <div class="col-4">
<div class="row items-center">
<div class="app-text-muted" style="width: 80px">
{{ $t('showing') }}
</div>
<div>
<q-btn-dropdown
dense
unelevated
:label="pageSizeServiceAndProduct"
>
<q-list>
<q-item
v-for="v in [10, 30, 50, 100, 500, 1000]"
clickable
v-close-popup
@click="
async () => {
pageSizeServiceAndProduct = v;
await fetchListOfProductAndService();
}
"
>
<q-item-section>
<q-item-label>{{ v }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
</div>
</div>
<div class="col-4 row justify-center app-text-muted">
{{ {{
$t('recordsPage', { $t('recordsPage', {
resultcurrentPage: resultcurrentPage:
@ -1719,6 +1815,7 @@ watch(inputSearchProductAndService, async () => {
}) })
}} }}
</div> </div>
<div class="col-4 row justify-end">
<PaginationComponent <PaginationComponent
v-model:current-page="currentPageServiceAndProduct" v-model:current-page="currentPageServiceAndProduct"
v-model:max-page="maxPageServiceAndProduct" v-model:max-page="maxPageServiceAndProduct"
@ -1733,6 +1830,7 @@ watch(inputSearchProductAndService, async () => {
</div> </div>
</div> </div>
</div> </div>
</div>
<FormDialog <FormDialog
v-model:modal="dialogInputForm" v-model:modal="dialogInputForm"