แก้ space ขึ้นบรรทัดใหม่ เเก้คำ พ้นราชการ

This commit is contained in:
setthawutttty 2025-03-19 17:41:35 +07:00
parent 90ed596dec
commit b8f971e251
23 changed files with 377 additions and 170 deletions

View file

@ -1064,6 +1064,42 @@ export const useCounterMixin = defineStore("mixin", () => {
}
}
function findOrgChildName(obj: any) {
if (obj) {
let name =
obj.orgChild4Name != null && obj.orgChild3Name != null
? obj.orgChild4Name + " "
: obj.orgChild4Name != null
? obj.orgChild4Name
: "";
name +=
obj.orgChild3Name != null && obj.orgChild2Name != null
? obj.orgChild3Name + " "
: obj.orgChild3Name !== null
? obj.orgChild3Name
: "";
name +=
obj.orgChild2Name != null && obj.orgChild1Name != null
? obj.orgChild2Name + " "
: obj.orgChild2Name != null
? obj.orgChild2Name
: "";
name +=
obj.orgChild1Name != null && obj.orgRootName != null
? obj.orgChild1Name + " "
: obj.orgChild1Name != null
? obj.orgChild1Name
: "";
name += obj.orgRootName != null ? obj.orgRootName : "";
return name == "" ? "-" : name;
} else {
return "";
}
}
function findPosMasterNo(obj: any) {
if (obj) {
let shortName =
@ -1084,6 +1120,114 @@ export const useCounterMixin = defineStore("mixin", () => {
}
}
function findOrgNameHtml(obj: any) {
if (obj) {
let name =
obj.child4 != null && obj.child3 != null
? obj.child4 + (obj.child3 ? "\n" : "")
: obj.child4 != null
? obj.child4
: "";
name +=
obj.child3 != null && obj.child2 != null
? obj.child3 + (obj.child2 ? "\n" : "")
: obj.child3 !== null
? obj.child3
: "";
name +=
obj.child2 != null && obj.child1 != null
? obj.child2 + (obj.child1 ? "\n" : "")
: obj.child2 != null
? obj.child2
: "";
name +=
obj.child1 != null && obj.root != null
? obj.child1 + (obj.root ? "\n" : "")
: obj.child1 != null
? obj.child1
: "";
name += obj.root != null ? obj.root : "";
return name == "" ? "-" : name;
} else {
return "";
}
}
function findOrgNameOldHtml(obj: any) {
if (obj) {
let name =
obj.child4Old != null && obj.child3Old != null
? obj.child4Old + (obj.child3Old ? "\n" : "")
: obj.child4Old != null
? obj.child4Old
: "";
name +=
obj.child3Old != null && obj.child2Old != null
? obj.child3Old + (obj.child2Old ? "\n" : "")
: obj.child3Old !== null
? obj.child3Old
: "";
name +=
obj.child2Old != null && obj.child1Old != null
? obj.child2Old + (obj.child1Old ? "\n" : "")
: obj.child2Old != null
? obj.child2Old
: "";
name +=
obj.child1Old != null && obj.rootOld != null
? obj.child1Old + (obj.rootOld ? "\n" : "")
: obj.child1Old != null
? obj.child1Old
: "";
name += obj.rootOld != null ? obj.rootOld : "";
return name == "" ? "-" : name;
} else {
return "";
}
}
function findOrgChildNameHtml(obj: any) {
if (obj) {
let name =
obj.orgChild4Name != null && obj.orgChild3Name != null
? obj.orgChild4Name + (obj.orgChild3Name ? "\n" : "")
: obj.orgChild4Name != null
? obj.orgChild4Name
: "";
name +=
obj.orgChild3Name != null && obj.orgChild2Name != null
? obj.orgChild3Name + (obj.orgChild2Name ? "\n" : "")
: obj.orgChild3Name !== null
? obj.orgChild3Name
: "";
name +=
obj.orgChild2Name != null && obj.orgChild1Name != null
? obj.orgChild2Name + (obj.orgChild1Name ? "\n" : "")
: obj.orgChild2Name != null
? obj.orgChild2Name
: "";
name +=
obj.orgChild1Name != null && obj.orgRootName != null
? obj.orgChild1Name + (obj.orgRootName ? "\n" : "")
: obj.orgChild1Name != null
? obj.orgChild1Name
: "";
name += obj.orgRootName != null ? obj.orgRootName : "";
return name == "" ? "-" : name;
} else {
return "";
}
}
function findPosMasterNoOld(obj: any) {
if (obj) {
let shortName =
@ -1104,6 +1248,11 @@ export const useCounterMixin = defineStore("mixin", () => {
}
}
function textTranForm(val: string) {
return (val.match(/[^()\s]+(?:\s*\([^()]+\))?|\([^()]+\)/g) || []).join(
"\n"
);
}
function pathRegistryEmp(routeName: string) {
return routeName
? routeName === "registryNewByid"
@ -1232,6 +1381,7 @@ export const useCounterMixin = defineStore("mixin", () => {
diffDay,
findOrgName,
findOrgNameOld,
findOrgChildName,
findPosMasterNo,
findPosMasterNoOld,
pathRegistryEmp,
@ -1243,5 +1393,9 @@ export const useCounterMixin = defineStore("mixin", () => {
convertDateToAPI,
convertDatetimeToAPI,
findOrgNameHtml,
findOrgNameOldHtml,
findOrgChildNameHtml,
textTranForm
};
});