fix: stat card scroll

This commit is contained in:
puriphatt 2024-07-04 04:14:41 +00:00
parent 39fc15167c
commit 93af8ce47b
5 changed files with 65 additions and 58 deletions

View file

@ -22,7 +22,7 @@ const props = withDefaults(
<div
class="row full-width"
style="gap: var(--size-4)"
:class="{ 'justify-between': $q.screen.lt.md, dark, 'no-wrap': nowrap }"
:class="{ dark, 'no-wrap': nowrap }"
>
<AppBox
v-for="v in props.branch"

View file

@ -424,8 +424,10 @@ watch(locale, () => {
<template>
<div class="column full-height no-wrap">
<div class="surface-1 bordered rounded q-pa-md q-mb-md scroll">
<StatCard label-i18n :branch="stats" :dark="$q.dark.isActive" nowrap />
<div class="surface-1 bordered rounded q-mb-md scroll">
<div class="q-ma-md" style="display: inline-block">
<StatCard label-i18n :branch="stats" :dark="$q.dark.isActive" nowrap />
</div>
</div>
<div

View file

@ -547,20 +547,22 @@ watch(inputSearch, async () => await fetchUserList());
{{ selectorLabel === '' ? '' : $t(selectorLabel) }}
</div>
<div class="q-px-md scroll">
<StatCardComponent
v-if="sortedUserStats"
:branch="
sortedUserStats.map((v) => ({
count: v.count,
label: $i18n.locale === 'en-US' ? v.nameEN : v.name,
color: v.isHeadOffice ? 'pink' : 'purple',
}))
"
:dark="$q.dark.isActive"
nowrap
class="q-mb-md"
/>
<div class="scroll">
<div class="q-mx-md" style="display: inline-block">
<StatCardComponent
v-if="sortedUserStats"
:branch="
sortedUserStats.map((v) => ({
count: v.count,
label: $i18n.locale === 'en-US' ? v.nameEN : v.name,
color: v.isHeadOffice ? 'pink' : 'purple',
}))
"
:dark="$q.dark.isActive"
nowrap
class="q-mb-md"
/>
</div>
</div>
</div>
</div>

View file

@ -1354,42 +1354,44 @@ watch([inputSearch, currentStatus], async () => {
}}
</div>
<div class="q-px-md scroll">
<StatCardComponent
v-if="customerStats && selectorLabel === 'EMPLOYER'"
labelI18n
:branch="
customerStats.map((v) => ({
count:
v.name === 'CORP'
? statsCustomerType?.CORP ?? 0
: statsCustomerType?.PERS ?? 0,
label:
v.name === 'CORP'
? 'customerLegalEntity'
: 'customerNaturalPerson',
color: v.name === 'CORP' ? 'purple' : 'green',
}))
"
:dark="$q.dark.isActive"
nowrap
class="q-mb-md"
/>
<div class="scroll">
<div class="q-mx-md" style="display: inline-block">
<StatCardComponent
v-if="customerStats && selectorLabel === 'EMPLOYER'"
labelI18n
:branch="
customerStats.map((v) => ({
count:
v.name === 'CORP'
? statsCustomerType?.CORP ?? 0
: statsCustomerType?.PERS ?? 0,
label:
v.name === 'CORP'
? 'customerLegalEntity'
: 'customerNaturalPerson',
color: v.name === 'CORP' ? 'purple' : 'green',
}))
"
:dark="$q.dark.isActive"
nowrap
class="q-mb-md"
/>
<StatCardComponent
v-if="customerStats && selectorLabel === 'EMPLOYEE'"
labelI18n
:branch="[
{
label: 'EMPLOYEE',
count: statsEmployee,
color: 'pink',
},
]"
:dark="$q.dark.isActive"
nowrap
class="q-mb-md"
/>
<StatCardComponent
v-if="customerStats && selectorLabel === 'EMPLOYEE'"
labelI18n
:branch="[
{
label: 'EMPLOYEE',
count: statsEmployee,
color: 'pink',
},
]"
:dark="$q.dark.isActive"
nowrap
class="q-mb-md"
/>
</div>
</div>
</div>
</div>

View file

@ -1146,14 +1146,15 @@ watch(inputSearchProductAndService, async () => {
</div>
</div>
<AppBox
<div
v-if="productMode === 'group' || productMode === 'type'"
bordered
style="overflow-x: scroll"
class="q-mb-md"
class="q-mb-md bordered rounded surface-1 scroll"
>
<StatCard label-i18n :branch="stat" :dark="$q.dark.isActive" nowrap />
</AppBox>
<div class="q-ma-md" style="display: inline-block">
<StatCard label-i18n :branch="stat" :dark="$q.dark.isActive" nowrap />
</div>
</div>
<div
v-if="productMode === 'group' || productMode === 'type'"
class="surface-1 col bordered rounded q-pa-md scroll"