jws-frontend/src/components/02_personnel-management/InfoForm.vue

96 lines
2.7 KiB
Vue
Raw Normal View History

2024-04-18 18:27:22 +07:00
<script lang="ts" setup>
import FormAddress from './FormAddress.vue';
defineProps<{
readonly?: boolean;
titleFormAddress?: string;
2024-04-18 18:27:22 +07:00
addressTitle?: string;
addressTitleEN?: string;
2024-04-23 11:13:57 +00:00
noAddress?: boolean;
noPaddingTab?: boolean;
disabledRule?: boolean;
employee?: boolean;
2024-06-28 02:21:21 +00:00
tabsList?: { name: string; label: string }[];
2024-04-18 18:27:22 +07:00
}>();
const address = defineModel('address', { default: '' });
const addressEN = defineModel('addressEN', { default: '' });
const provinceId = defineModel<string | null | undefined>('provinceId');
const districtId = defineModel<string | null | undefined>('districtId');
const subDistrictId = defineModel<string | null | undefined>('subDistrictId');
const zipCode = defineModel<string>('zipCode', { default: '' });
const sameWithEmployer = defineModel<boolean>('sameWithEmployer');
const employeeTab = defineModel<string>('employeeTab');
2024-04-18 18:27:22 +07:00
</script>
<template>
2024-07-25 10:48:04 +00:00
<div class="column full-width full-height">
<div
v-if="tabsList && tabsList.length > 0"
class="row surface-2 q-px-md q-pt-md full-width"
style="border-bottom: 1px solid var(--brand-1)"
>
<q-tabs
2024-07-25 10:48:04 +00:00
inline-label
mobile-arrows
dense
2024-07-25 10:48:04 +00:00
class="app-text-muted cancel-overflow full-width"
v-model="employeeTab"
active-class="active-tab"
indicator-color="transparent"
2024-07-25 10:48:04 +00:00
align="left"
>
<q-tab
v-for="tab in tabsList"
v-bind:key="tab.name"
class="content-tab text-capitalize"
:name="tab.name"
:label="$t(tab.label)"
style="z-index: 999"
/>
</q-tabs>
</div>
<div
2024-07-31 04:35:10 +00:00
class="col full-height q-pa-md full-width"
2024-07-30 09:44:21 +00:00
:class="{ row: $q.screen.gt.sm, column: $q.screen.lt.md }"
>
2024-07-31 04:35:10 +00:00
<div class="col-md-2 q-mr-md" v-if="$slots['person-card']">
<slot name="person-card"></slot>
</div>
2024-07-30 09:44:21 +00:00
<div
2024-07-31 04:35:10 +00:00
class="rounded scroll full-height col full-width"
:class="{
2024-07-30 09:44:21 +00:00
'q-mt-md': $q.screen.lt.md,
}"
2024-04-18 18:27:22 +07:00
>
2024-07-31 04:35:10 +00:00
<div
class="row q-col-gutter-y-md surface-1 rounded bordered"
:class="{ 'q-pa-md': !noPaddingTab }"
>
2024-08-01 08:44:40 +00:00
<slot></slot>
2024-07-30 09:44:21 +00:00
</div>
</div>
2024-04-18 18:27:22 +07:00
</div>
</div>
</template>
<style scoped lang="scss">
.active-tab {
color: var(--brand-1);
background-color: var(--surface-tab);
border-top: 1px solid var(--brand-1);
border-left: 1px solid var(--brand-1);
border-right: 1px solid var(--brand-1);
border-top-left-radius: var(--radius-2);
border-top-right-radius: var(--radius-2);
margin-bottom: -1.5px;
border-bottom: 3px solid var(--surface-tab);
}
.content-tab {
border-top-left-radius: var(--radius-2);
border-top-right-radius: var(--radius-2);
}
</style>