From 762acf46bd26cb4715c8a8c26412f07e569ac8a6 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 21 Aug 2025 15:06:47 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=E0=B9=82=E0=B8=84=E0=B8=A3=E0=B8=87=E0=B8=AA=E0=B8=A3=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=87=20=E0=B9=82=E0=B8=94=E0=B8=A2=E0=B9=84?= =?UTF-8?q?=E0=B8=A1=E0=B9=88=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87=E0=B8=9B?= =?UTF-8?q?=E0=B8=B8=E0=B9=88=E0=B8=A1=E0=B8=AA=E0=B8=B7=E0=B8=9A=E0=B8=97?= =?UTF-8?q?=E0=B8=AD=E0=B8=94=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B9=82=E0=B8=84?= =?UTF-8?q?=E0=B8=A3=E0=B8=87=E0=B8=9B=E0=B8=B1=E0=B8=88=E0=B8=88=E0=B8=B8?= =?UTF-8?q?=E0=B8=9A=E0=B8=B1=E0=B8=99=20=E0=B8=9B=E0=B8=B4=E0=B8=94?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=20sort=20=E0=B8=82=E0=B8=AD?= =?UTF-8?q?=E0=B8=87=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95?= =?UTF-8?q?=E0=B8=B4=E0=B8=95=E0=B8=B3=E0=B9=81=E0=B8=AB=E0=B8=99=E0=B9=88?= =?UTF-8?q?=E0=B8=87=20=E0=B9=81=E0=B8=A5=E0=B8=B0=E0=B9=80=E0=B8=AD?= =?UTF-8?q?=E0=B8=B2=E0=B8=8A=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=84=E0=B8=99?= =?UTF-8?q?=E0=B8=84=E0=B8=A3=E0=B8=AD=E0=B8=87=E0=B8=AD=E0=B8=AD=E0=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DialogHistoryPos.vue | 31 +++++++-------- .../02_organization/components/TableMain.vue | 38 +++++++++++++------ 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/src/modules/02_organization/components/DialogHistoryPos.vue b/src/modules/02_organization/components/DialogHistoryPos.vue index f6b5164fe..26f053d4c 100644 --- a/src/modules/02_organization/components/DialogHistoryPos.vue +++ b/src/modules/02_organization/components/DialogHistoryPos.vue @@ -47,17 +47,17 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, - { - name: "fullname", - align: "left", - label: "ชื่อคนครอง", - sortable: true, - field: "fullname", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, + // { + // name: "fullname", + // align: "left", + // label: "ชื่อคนครอง", + // sortable: true, + // field: "fullname", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // sort: (a: string, b: string) => + // a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + // }, { name: "orgShortName", align: "left", @@ -157,19 +157,14 @@ const columns = ref([ align: "left", label: "วันที่แก้ไข", field: "lastUpdatedAt", - sortable: true, - format(val, row) { + sortable: false, + format(val) { return date2Thai(val); }, headerStyle: "font-size: 14px", style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); -const pagination = ref({ - sortBy: "lastUpdatedAt", -}); /** * function เรียกข้อมูลประวัติตำแหน่ง diff --git a/src/modules/02_organization/components/TableMain.vue b/src/modules/02_organization/components/TableMain.vue index 18fcdbf3c..4d2ece332 100644 --- a/src/modules/02_organization/components/TableMain.vue +++ b/src/modules/02_organization/components/TableMain.vue @@ -72,7 +72,6 @@ const modalSelectPerson = ref(false); //เลือกคนครอ const rowId = ref(""); //id ที่ต้องการกระทำ const actionType = ref(""); //ประเภทการกระทำ const orgShortName = ref(""); //ชื่อย่อหน่วยงาน -const orgRootIdMain = ref(""); //Id สำนัก /** ListMenu Table*/ const listMenu = ref([ { @@ -125,6 +124,32 @@ const listMenu = ref([ }, ]); +/** + * Returns filtered menu items for a given row. + */ +function getMenuItems(row: any) { + if ( + row.positionIsSelected != "ว่าง" && + store.typeOrganizational === "current" + ) { + return listMenu.value.filter( + (item) => + item.type !== "DEL" && + item.type !== "CONDITION" && + item.type !== "INHERIT" + ); + } else if (store.typeOrganizational === "current") { + return listMenu.value.filter((item) => item.type !== "INHERIT"); + } else if ( + row.positionIsSelected != "ว่าง" && + store.typeOrganizational === "draft" + ) { + return listMenu.value.filter((item) => item.type !== "CONDITION"); + } else { + return listMenu.value; + } +} + const baseDocument = ref([ { name: "บัญชี 1", @@ -739,16 +764,7 @@ watch(