refactor: add props branch virtual

This commit is contained in:
Thanaphon Frappet 2024-11-29 10:16:51 +07:00
parent 89f67265b6
commit 3679de69f1
2 changed files with 11 additions and 7 deletions

View file

@ -27,6 +27,7 @@ defineEmits<{
type ExclusiveProps = {
selectFirstValue?: boolean;
branchVirtual?: boolean;
};
const props = defineProps<SelectProps<typeof getList> & ExclusiveProps>();
@ -80,12 +81,14 @@ function setDefaultValue() {
:option="
selectOptions.map((v) => {
const ret = {
label: (
{
['eng']: [v.nameEN, `(${v.code})`].join(' '),
['tha']: [v.name, `(${v.code})`].join(' '),
} as const
)[$i18n.locale],
label:
`${branchVirtual ? $t('branch.card.branchVirtual') : ''}` +
(
{
['eng']: [v.nameEN, `(${v.code})`].join(' '),
['tha']: [v.name, `(${v.code})`].join(' '),
} as const
)[$i18n.locale],
value: v.id,
};
return ret;