refactor: misc
This commit is contained in:
parent
c22e3a4c52
commit
18efaa48b6
10 changed files with 214 additions and 68 deletions
|
|
@ -55,6 +55,7 @@ const userStore = useUserStore();
|
|||
const branchStore = useBranchStore();
|
||||
const adrressStore = useAddressStore();
|
||||
const { data: userData } = storeToRefs(userStore);
|
||||
const apiBaseUrl = import.meta.env.VITE_API_BASE_URL;
|
||||
|
||||
const defaultFormData = {
|
||||
provinceId: null,
|
||||
|
|
@ -656,7 +657,7 @@ async function assignFormData(idEdit: string) {
|
|||
}
|
||||
|
||||
userCode.value = foundUser.code;
|
||||
urlProfile.value = foundUser.profileImageUrl;
|
||||
urlProfile.value = `${apiBaseUrl}/user/${foundUser.id}/image`;
|
||||
|
||||
isEdit.value = true;
|
||||
profileSubmit.value = true;
|
||||
|
|
@ -1166,50 +1167,35 @@ watch(
|
|||
<div class="row items-center" style="flex-wrap: nowrap">
|
||||
<div style="display: flex">
|
||||
<div class="q-mr-md">
|
||||
<q-avatar
|
||||
size="md"
|
||||
style="
|
||||
background: linear-gradient(
|
||||
135deg,
|
||||
rgba(43, 137, 223, 1) 0%,
|
||||
rgba(230, 51, 81, 1) 100%
|
||||
);
|
||||
"
|
||||
>
|
||||
<q-avatar size="md">
|
||||
<q-img
|
||||
v-if="props.row.gender !== ''"
|
||||
class="text-center"
|
||||
:ratio="1"
|
||||
:src="
|
||||
props.row.profileImageUrl
|
||||
? props.row.profileImageUrl
|
||||
: props.row.userRole.includes('system')
|
||||
? '/img-admin.png'
|
||||
: props.row.gender === 'male'
|
||||
? '/no-img-man.png'
|
||||
: '/no-img-female.png'
|
||||
"
|
||||
:src="`${apiBaseUrl}/user/${props.row.id}/image`"
|
||||
>
|
||||
<template #error>
|
||||
<q-img
|
||||
v-if="
|
||||
props.row.gender === 'male' ||
|
||||
props.row.gender === 'female'
|
||||
"
|
||||
:src="
|
||||
props.row.gender === 'male'
|
||||
? '/no-img-man.png'
|
||||
: '/no-img-female.png'
|
||||
"
|
||||
/>
|
||||
<div
|
||||
class="no-padding full-width full-height flex items-center justify-center"
|
||||
:style="`${props.row.gender ? 'background: white' : 'background: linear-gradient(135deg,rgba(43, 137, 223, 1) 0%, rgba(230, 51, 81, 1) 100%);'}`"
|
||||
>
|
||||
<q-img
|
||||
v-if="props.row.gender"
|
||||
:src="
|
||||
props.row.gender === 'male'
|
||||
? '/no-img-man.png'
|
||||
: '/no-img-female.png'
|
||||
"
|
||||
/>
|
||||
<q-icon
|
||||
v-else
|
||||
size="sm"
|
||||
name="mdi-account-outline"
|
||||
style="color: white"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</q-img>
|
||||
<q-icon
|
||||
v-else
|
||||
size="sm"
|
||||
name="mdi-account-outline"
|
||||
style="color: white"
|
||||
/>
|
||||
|
||||
<q-badge
|
||||
class="absolute-bottom-right no-padding"
|
||||
style="
|
||||
|
|
@ -1496,7 +1482,49 @@ watch(
|
|||
@toggle-status="
|
||||
triggerChangeStatus(props.row.id, props.row.status)
|
||||
"
|
||||
/>
|
||||
>
|
||||
<template #img>
|
||||
<q-img
|
||||
class="text-center"
|
||||
:ratio="1"
|
||||
:src="`${apiBaseUrl}/user/${props.row.id}/image`"
|
||||
style="
|
||||
object-fit: cover;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
"
|
||||
>
|
||||
<template #error>
|
||||
<div
|
||||
class="no-padding full-width full-height flex items-center justify-center"
|
||||
style="
|
||||
background: linear-gradient(
|
||||
135deg,
|
||||
rgba(43, 137, 223, 1) 0%,
|
||||
rgba(230, 51, 81, 1) 100%
|
||||
);
|
||||
"
|
||||
>
|
||||
<q-img
|
||||
v-if="props.row.gender"
|
||||
:src="
|
||||
props.row.gender === 'male'
|
||||
? '/no-img-man.png'
|
||||
: '/no-img-female.png'
|
||||
"
|
||||
/>
|
||||
<q-icon
|
||||
v-else
|
||||
size="lg"
|
||||
name="mdi-account-outline"
|
||||
style="color: white"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</q-img>
|
||||
</template>
|
||||
</PersonCard>
|
||||
</div>
|
||||
</template>
|
||||
</q-table>
|
||||
|
|
|
|||
|
|
@ -680,8 +680,8 @@ const emptyCreateDialog = ref(false);
|
|||
? customerStats.map((v) => ({
|
||||
count:
|
||||
v.name === 'CORP'
|
||||
? statsCustomerType?.CORP ?? 0
|
||||
: statsCustomerType?.PERS ?? 0,
|
||||
? (statsCustomerType?.CORP ?? 0)
|
||||
: (statsCustomerType?.PERS ?? 0),
|
||||
label:
|
||||
v.name === 'CORP'
|
||||
? 'customerLegalEntity'
|
||||
|
|
@ -2352,7 +2352,7 @@ const emptyCreateDialog = ref(false);
|
|||
</template>
|
||||
</ImageUploadDialog>
|
||||
|
||||
<!-- ลูกจ้าง -->
|
||||
<!-- ลูกจ้าง edit employee -->
|
||||
<DrawerInfo
|
||||
hide-action
|
||||
v-model:drawer-open="employeeFormState.drawerModal"
|
||||
|
|
@ -2425,13 +2425,21 @@ const emptyCreateDialog = ref(false);
|
|||
active
|
||||
use-toggle
|
||||
color="white"
|
||||
icon="mdi-account-plus-outline"
|
||||
icon="mdi-account-outline"
|
||||
bg-color="linear-gradient(135deg, rgba(43,137,223,1) 0%, rgba(230,51,81,1) 100%)"
|
||||
v-model:current-tab="employeeFormState.currentTab"
|
||||
v-model:toggle-status="currentFromDataEmployee.status"
|
||||
v-model:cover-url="employeeFormState.profileUrl"
|
||||
fallback-cover="/images/employee-banner.png"
|
||||
:img="employeeFormState.profileUrl"
|
||||
:title="
|
||||
employeeFormState.currentEmployee
|
||||
? $i18n.locale === 'en-US'
|
||||
? `${employeeFormState.currentEmployee.firstNameEN} ${employeeFormState.currentEmployee.lastNameEN}`
|
||||
: `${employeeFormState.currentEmployee.firstName} ${employeeFormState.currentEmployee.lastName}`
|
||||
: '-'
|
||||
"
|
||||
:caption="currentFromDataEmployee.code"
|
||||
:img="employeeFormState.profileUrl || '/images/employee-avatar.png'"
|
||||
:tabs-list="[
|
||||
{ name: 'personalInfo', label: 'personalInfo' },
|
||||
{ name: 'healthCheck', label: 'healthCheck' },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue