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(