refactor: show prefix on banner
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 8s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 8s
This commit is contained in:
parent
69f368ede1
commit
a5d73ba1ff
5 changed files with 117 additions and 12 deletions
|
|
@ -610,6 +610,26 @@ export function getEmployeeName(
|
|||
}[opts?.locale || 'eng'];
|
||||
}
|
||||
|
||||
export function setPrefixName(
|
||||
record: {
|
||||
namePrefix: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
firstNameEN: string;
|
||||
lastNameEN: string;
|
||||
},
|
||||
opts?: {
|
||||
locale?: string;
|
||||
},
|
||||
) {
|
||||
const data = record;
|
||||
|
||||
return {
|
||||
['eng']: `${typeof data.namePrefix === 'string' ? useOptionStore().mapOption(data.namePrefix) : ''} ${data.firstNameEN} ${data.lastNameEN}`,
|
||||
['tha']: `${typeof data.namePrefix === 'string' ? useOptionStore().mapOption(data.namePrefix) : ''} ${data.firstName} ${data.lastName}`,
|
||||
}[opts?.locale || 'eng'];
|
||||
}
|
||||
|
||||
export function toCamelCase(text: string): string {
|
||||
return text
|
||||
.replace(/[^a-zA-Z0-9]+(.)/g, (match, chr) => chr.toUpperCase())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue