refactor: show namePrefix

This commit is contained in:
Thanaphon Frappet 2024-10-28 19:56:41 +07:00
parent d072ed015a
commit 0672b67cbf

View file

@ -10,9 +10,11 @@ import {
UndoButton,
} from 'components/button';
import { useI18n } from 'vue-i18n';
import useOptionStore from 'stores/options';
const { locale } = useI18n();
const optionStore = useOptionStore();
const optionsBranch = defineModel<{ id: string; name: string }[]>(
'optionsBranch',
{ default: [] },
@ -166,9 +168,10 @@ defineEmits<{
? scope.opt.registerNameEN
: scope.opt.registerName
: $i18n.locale === 'eng'
? `${scope.opt.firstNameEN} ${scope.opt.lastNameEN}` ||
? `${optionStore.mapOption(scope.opt.namePrefix)} ${scope.opt.firstNameEN} ${scope.opt.lastNameEN}` ||
'-'
: `${optionStore.mapOption(scope.opt.namePrefix)} ${scope.opt.firstName} ${scope.opt.lastName}` ||
'-'
: `${scope.opt.firstName} ${scope.opt.lastName}` || '-'
}}
({{ scope.opt.code }})
</span>
@ -223,8 +226,10 @@ defineEmits<{
? scope.opt.registerNameEN
: scope.opt.registerName
: $i18n.locale === 'eng'
? `${scope.opt.firstNameEN} ${scope.opt.lastNameEN}` || '-'
: `${scope.opt.firstName} ${scope.opt.lastName}` || '-'
? `${optionStore.mapOption(scope.opt.namePrefix)} ${scope.opt.firstNameEN} ${scope.opt.lastNameEN}` ||
'-'
: `${optionStore.mapOption(scope.opt.namePrefix)} ${scope.opt.firstName} ${scope.opt.lastName}` ||
'-'
}}
({{ scope.opt.code }})
</div>