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