feat: add prefix and middlename field
This commit is contained in:
parent
2479d5facf
commit
4d14dd22c3
3 changed files with 22 additions and 5 deletions
|
|
@ -10,11 +10,12 @@ import {
|
||||||
} from 'src/utils/datetime';
|
} from 'src/utils/datetime';
|
||||||
import { ref, onMounted, watch } from 'vue';
|
import { ref, onMounted, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { capitalize } from 'vue';
|
||||||
|
|
||||||
const { locale } = useI18n();
|
const { locale } = useI18n();
|
||||||
const optionStore = useOptionStore();
|
const optionStore = useOptionStore();
|
||||||
const prefixName = defineModel<string>('prefixName');
|
const prefixName = defineModel<string | null>('prefixName');
|
||||||
const prefixNameEN = defineModel<string>('prefixNameEn');
|
const prefixNameEN = defineModel<string | null>('prefixNameEn');
|
||||||
const firstName = defineModel<string>('firstName');
|
const firstName = defineModel<string>('firstName');
|
||||||
const lastName = defineModel<string>('lastName');
|
const lastName = defineModel<string>('lastName');
|
||||||
const firstNameEN = defineModel<string>('firstNameEn');
|
const firstNameEN = defineModel<string>('firstNameEn');
|
||||||
|
|
@ -24,8 +25,8 @@ const email = defineModel<string>('email');
|
||||||
const gender = defineModel<string>('gender');
|
const gender = defineModel<string>('gender');
|
||||||
const birthDate = defineModel<Date | string | null>('birthDate');
|
const birthDate = defineModel<Date | string | null>('birthDate');
|
||||||
const nationality = defineModel<string>('nationality');
|
const nationality = defineModel<string>('nationality');
|
||||||
const midName = defineModel<string>('midName');
|
const midName = defineModel<string | null>('midName');
|
||||||
const midNameEn = defineModel<string>('midNameEn');
|
const midNameEn = defineModel<string | null>('midNameEn');
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
dense?: boolean;
|
dense?: boolean;
|
||||||
|
|
@ -195,7 +196,7 @@ watch(
|
||||||
:disable="!readonly"
|
:disable="!readonly"
|
||||||
class="col-1"
|
class="col-1"
|
||||||
:label="$t('formDialogInputPrefixName')"
|
:label="$t('formDialogInputPrefixName')"
|
||||||
v-model="prefixNameEN"
|
:model-value="capitalize(prefixNameEn || '')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
|
|
|
||||||
|
|
@ -207,8 +207,11 @@ const formData = ref<UserCreate>({
|
||||||
registrationNo: null,
|
registrationNo: null,
|
||||||
lastNameEN: '',
|
lastNameEN: '',
|
||||||
lastName: '',
|
lastName: '',
|
||||||
|
middleNameEN: '',
|
||||||
|
middleName: '',
|
||||||
firstNameEN: '',
|
firstNameEN: '',
|
||||||
firstName: '',
|
firstName: '',
|
||||||
|
namePrefix: null,
|
||||||
userRole: '',
|
userRole: '',
|
||||||
userType: '',
|
userType: '',
|
||||||
profileImage: null,
|
profileImage: null,
|
||||||
|
|
@ -601,8 +604,11 @@ async function assignFormData(idEdit: string) {
|
||||||
registrationNo: foundUser.registrationNo,
|
registrationNo: foundUser.registrationNo,
|
||||||
lastNameEN: foundUser.lastNameEN,
|
lastNameEN: foundUser.lastNameEN,
|
||||||
lastName: foundUser.lastName,
|
lastName: foundUser.lastName,
|
||||||
|
middleNameEN: foundUser.middleNameEN,
|
||||||
|
middleName: foundUser.middleName,
|
||||||
firstNameEN: foundUser.firstNameEN,
|
firstNameEN: foundUser.firstNameEN,
|
||||||
firstName: foundUser.firstName,
|
firstName: foundUser.firstName,
|
||||||
|
namePrefix: foundUser.namePrefix,
|
||||||
userRole: foundUser.userRole,
|
userRole: foundUser.userRole,
|
||||||
userType: foundUser.userType,
|
userType: foundUser.userType,
|
||||||
username: foundUser.username,
|
username: foundUser.username,
|
||||||
|
|
@ -1678,6 +1684,10 @@ watch(
|
||||||
id="info-personal"
|
id="info-personal"
|
||||||
v-model:first-name="formData.firstName"
|
v-model:first-name="formData.firstName"
|
||||||
v-model:last-name="formData.lastName"
|
v-model:last-name="formData.lastName"
|
||||||
|
v-model:mid-name="formData.middleName"
|
||||||
|
v-model:mid-name-en="formData.middleNameEN"
|
||||||
|
v-model:prefix-name="formData.namePrefix"
|
||||||
|
v-model:prefix-name-en="formData.namePrefix"
|
||||||
v-model:first-name-en="formData.firstNameEN"
|
v-model:first-name-en="formData.firstNameEN"
|
||||||
v-model:last-name-en="formData.lastNameEN"
|
v-model:last-name-en="formData.lastNameEN"
|
||||||
v-model:telephone-no="formData.telephoneNo"
|
v-model:telephone-no="formData.telephoneNo"
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,11 @@ export type User = {
|
||||||
address: string;
|
address: string;
|
||||||
lastNameEN: string;
|
lastNameEN: string;
|
||||||
lastName: string;
|
lastName: string;
|
||||||
|
middleNameEN?: string | null;
|
||||||
|
middleName?: string | null;
|
||||||
firstNameEN: string;
|
firstNameEN: string;
|
||||||
firstName: string;
|
firstName: string;
|
||||||
|
namePrefix?: string | null;
|
||||||
id: string;
|
id: string;
|
||||||
profileImageUrl: string;
|
profileImageUrl: string;
|
||||||
code: string;
|
code: string;
|
||||||
|
|
@ -70,8 +73,11 @@ export type UserCreate = {
|
||||||
registrationNo?: string | null;
|
registrationNo?: string | null;
|
||||||
lastNameEN: string;
|
lastNameEN: string;
|
||||||
lastName: string;
|
lastName: string;
|
||||||
|
middleNameEN?: string | null;
|
||||||
|
middleName?: string | null;
|
||||||
firstNameEN: string;
|
firstNameEN: string;
|
||||||
firstName: string;
|
firstName: string;
|
||||||
|
namePrefix?: string | null;
|
||||||
userRole: string;
|
userRole: string;
|
||||||
userType: string;
|
userType: string;
|
||||||
username: string;
|
username: string;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue