From cea8ce51aeeeb7cd54a1f60e96c9686a3b050cbd Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Mon, 28 Apr 2025 21:06:23 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87?= =?UTF-8?q?=E0=B8=9C=E0=B8=A5=E0=B8=9A=E0=B8=A3=E0=B8=A3=E0=B8=88=E0=B8=B8?= =?UTF-8?q?=20=E0=B9=80=E0=B8=A1=E0=B8=99=E0=B8=B9=E0=B8=AD=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=99=E0=B9=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../05_placement/views/08_otherMain.vue | 22 ++++++----- src/stores/mixin.ts | 37 +++++++++++++++++++ 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/src/modules/05_placement/views/08_otherMain.vue b/src/modules/05_placement/views/08_otherMain.vue index dee9d9d81..3dd11dfbe 100644 --- a/src/modules/05_placement/views/08_otherMain.vue +++ b/src/modules/05_placement/views/08_otherMain.vue @@ -30,6 +30,7 @@ const { date2Thai, dialogRemove, onSearchDataTable, + findChildNameHtml, } = useCounterMixin(); const modal = ref(false); @@ -130,7 +131,7 @@ const columns = ref([ sortable: true, field: "organizationPositionReturn", format(val, row) { - return row.organizationPositionOld.replace(/\n/g, " "); + return row.organizationPositionReturn.replace(/\n/g, " "); }, headerStyle: "font-size: 14px", style: "font-size: 14px", @@ -480,29 +481,27 @@ onMounted(() => {
- {{ - props.row.position !== null ? props.row.position : "" - }}{{ + + {{ + props.row.position !== null ? props.row.position : "" }}{{ props.row.posLevelName !== null ? `${props.row.posLevelName}` : "" }} -
-
- {{ props.row.root !== null ? props.row.root : "-" }} {{ - props.row.rootShortName !== null - ? `(${props.row.rootShortName})` + props.row.nodeShortName !== null + ? `(${props.row.nodeShortName}${props.row.posMasterNo})` : "" }}
-
+ +
+ {{ findChildNameHtml(props.row) }}
diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts index 9f2051d52..012210fdc 100644 --- a/src/stores/mixin.ts +++ b/src/stores/mixin.ts @@ -1228,6 +1228,42 @@ export const useCounterMixin = defineStore("mixin", () => { } } + function findChildNameHtml(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 findPosMasterNoOld(obj: any) { if (obj) { let shortName = @@ -1391,5 +1427,6 @@ export const useCounterMixin = defineStore("mixin", () => { findOrgNameHtml, findOrgNameOldHtml, findOrgChildNameHtml, + findChildNameHtml, }; });