From a7d64d0fb8ee72775fc813833fcf79e7537180dd Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 16 Jun 2026 14:01:51 +0700 Subject: [PATCH 1/7] refactor(permission): display positionIsSelected --- src/modules/02_users/stores/permissions.ts | 38 +++++++++++++ .../02_users/views/03_permissionsView.vue | 53 +++++-------------- .../02_users/views/05_responsIbilities.vue | 22 +++++--- 3 files changed, 66 insertions(+), 47 deletions(-) diff --git a/src/modules/02_users/stores/permissions.ts b/src/modules/02_users/stores/permissions.ts index 8ced0821..b6b5c3ea 100644 --- a/src/modules/02_users/stores/permissions.ts +++ b/src/modules/02_users/stores/permissions.ts @@ -1,8 +1,45 @@ import { defineStore } from "pinia"; import { ref } from "vue"; +import type { NodeTree } from "../interface/response/Main"; export const usePermissionsStore = defineStore("permissions", () => { const typeOrganizational = ref("current"); + const defaultOrganizationalNode = { + labelName: "หน่วยงานทั้งหมด", + orgCode: "", + orgLevel: 0, + orgName: "", + orgRevisionId: "", + orgRootName: "", + orgTreeCode: "", + orgTreeFax: "", + orgTreeId: "", + orgTreeName: "หน่วยงานทั้งหมด", + orgTreeOrder: 0, + orgTreePhoneEx: "", + orgTreePhoneIn: "", + orgTreeRank: "", + orgTreeRankSub: "", + orgTreeShortName: "", + responsibility: "", + totalPosition: 0, + totalPositionCurrentUse: 0, + totalPositionCurrentVacant: 0, + totalPositionNextUse: 0, + totalPositionNextVacant: 0, + totalRootPosition: 0, + totalRootPositionCurrentUse: 0, + totalRootPositionCurrentVacant: 0, + totalRootPositionNextUse: 0, + totalRootPositionNextVacant: 0, + children: [] as NodeTree[], + isOfficer: false, + orgRootDnaId: "", + orgChild1DnaId: "", + orgChild2DnaId: "", + orgChild3DnaId: "", + orgChild4DnaId: "", + }; const activeId = ref(""); const draftId = ref(""); @@ -10,5 +47,6 @@ export const usePermissionsStore = defineStore("permissions", () => { typeOrganizational, activeId, draftId, + defaultOrganizationalNode, }; }); diff --git a/src/modules/02_users/views/03_permissionsView.vue b/src/modules/02_users/views/03_permissionsView.vue index ca1b5412..4626ffa3 100644 --- a/src/modules/02_users/views/03_permissionsView.vue +++ b/src/modules/02_users/views/03_permissionsView.vue @@ -33,44 +33,7 @@ const { showLoader, hideLoader, messageError, success, dialogRemove } = /** Tree*/ const filter = ref(""); // ค้นหาข้อมูลโครงาสร้าง -const nodes = ref>([ - { - labelName: "หน่วยงานทั้งหมด", - orgCode: "", - orgLevel: 0, - orgName: "", - orgRevisionId: "", - orgRootName: "", - orgTreeCode: "", - orgTreeFax: "", - orgTreeId: "", - orgTreeName: "หน่วยงานทั้งหมด", - orgTreeOrder: 0, - orgTreePhoneEx: "", - orgTreePhoneIn: "", - orgTreeRank: "", - orgTreeRankSub: "", - orgTreeShortName: "", - responsibility: "", - totalPosition: 0, - totalPositionCurrentUse: 0, - totalPositionCurrentVacant: 0, - totalPositionNextUse: 0, - totalPositionNextVacant: 0, - totalRootPosition: 0, - totalRootPositionCurrentUse: 0, - totalRootPositionCurrentVacant: 0, - totalRootPositionNextUse: 0, - totalRootPositionNextVacant: 0, - children: [] as NodeTree[], - isOfficer: false, - orgRootDnaId: "", - orgChild1DnaId: "", - orgChild2DnaId: "", - orgChild3DnaId: "", - orgChild4DnaId: "", - }, -]); // ข้อมูลโครงสร้าง +const nodes = ref>([store.defaultOrganizationalNode]); // ข้อมูลโครงสร้าง const lazy = ref(nodes); const expanded = ref([]); // แสดงข้อมูลในโหนดที่เลือก const nodeId = ref(""); // id โหนด @@ -295,6 +258,8 @@ async function fetchDataTree(id: string) { const isSuperAdmin = tokenParsedData.value.includes("SUPER_ADMIN"); if (!isSuperAdmin) { nodes.value = []; + } else { + nodes.value = [store.defaultOrganizationalNode]; } showLoader(); await http @@ -626,7 +591,7 @@ onMounted(async () => {
{ table-class="text-grey-9" row-key="id" dense - hide-bottom bordered separator="vertical" class="custom-header-table-expand" @@ -847,6 +811,15 @@ onMounted(async () => {
{{ props.rowIndex + 1 }}
+ +
+ {{ col.value ? col.value : "-" }} + +
{ reqMaster.page = 1; fetchDataTable(reqMaster.id, reqMaster.revisionId, reqMaster.type); - } + }, ); onMounted(async () => { @@ -559,7 +559,7 @@ onMounted(async () => {
{ fetchDataTable( reqMaster.id, reqMaster.revisionId, - reqMaster.type + reqMaster.type, ) " > @@ -681,7 +681,7 @@ onMounted(async () => { round @click.prevent=" onOpenModalPersonal( - props.row.profileIdCurrentHolder + props.row.profileIdCurrentHolder, ) " > @@ -786,6 +786,14 @@ onMounted(async () => {
{{ props.rowIndex + 1 }}
+
+ {{ col.value ? col.value : "-" }} + +
{ fetchDataTable( reqMaster.id, reqMaster.revisionId, - reqMaster.type + reqMaster.type, ) " > From 215124bb5903bb367476e1fce64e0df55fb755a9 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 16 Jun 2026 14:03:58 +0700 Subject: [PATCH 2/7] refactor(responsibilities): table hide-bottom --- src/modules/02_users/views/05_responsIbilities.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/02_users/views/05_responsIbilities.vue b/src/modules/02_users/views/05_responsIbilities.vue index 2f7e9b93..617bfcf3 100644 --- a/src/modules/02_users/views/05_responsIbilities.vue +++ b/src/modules/02_users/views/05_responsIbilities.vue @@ -758,7 +758,7 @@ onMounted(async () => { table-class="text-grey-9" row-key="id" dense - hide-bottom + bordered separator="vertical" class="custom-header-table-expand" From 9c43137034b6afb0cdd6a31a7514647a451699b6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 16 Jun 2026 14:04:30 +0700 Subject: [PATCH 3/7] fix --- src/modules/02_users/views/05_responsIbilities.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/02_users/views/05_responsIbilities.vue b/src/modules/02_users/views/05_responsIbilities.vue index 617bfcf3..3fb48dd6 100644 --- a/src/modules/02_users/views/05_responsIbilities.vue +++ b/src/modules/02_users/views/05_responsIbilities.vue @@ -758,7 +758,6 @@ onMounted(async () => { table-class="text-grey-9" row-key="id" dense - bordered separator="vertical" class="custom-header-table-expand" From 59355bd368f9bff4d8b7c545777dc5deb97061db Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 23 Jun 2026 14:20:57 +0700 Subject: [PATCH 4/7] feat(notification): add delete notification feature --- src/views/MainLayout.vue | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 0907b056..1323e86e 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -114,7 +114,7 @@ async function getDataNotification(index: number, type: string) { .get(config.API.msgNotificate + `?page=${index}&pageSize=${15}`) .then((res) => { const response = res.data.result.data; - totalInbox.value = res.data.result.total; + totalInbox.value = res.data.result.total || 0; let list: notiType[] = []; if (type === "DEL") { notiList.value = []; @@ -405,6 +405,26 @@ onBeforeMount(async () => { } }); +function handleDeleteNotification() { + dialogRemove( + $q, + async () => { + try { + showLoader(); + await http.delete(config.API.msgNotificate); + await getDataNotification(1, "DEL"); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (error) { + messageError($q, error); + } finally { + hideLoader(); + } + }, + "ยืนยันการลบข้อมูล", + "ต้องการยืนยันการลบรายการแจ้งเตือนทั้งหมดใช่หรือไม่?", + ); +} + /** * เมื่อเริ่มต้นโปรแกรมให้ฟัง event resize และ function myEventHandler * set function myEventHandler เพราะ state ยังไม่เซ็ท , state เซ็ทเมื่อ หน้าจอเริ่ม ขยับหน้าจอ @@ -510,6 +530,17 @@ onUnmounted(() => {
ทั้งหมด {{ totalInbox }} ข้อความ
+ + ลบการแจ้งเตือนทั้งหมด +
Date: Tue, 23 Jun 2026 15:57:21 +0700 Subject: [PATCH 5/7] refactor(notification): update icon and text display --- src/views/MainLayout.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 1323e86e..3227fa45 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -420,8 +420,8 @@ function handleDeleteNotification() { hideLoader(); } }, - "ยืนยันการลบข้อมูล", - "ต้องการยืนยันการลบรายการแจ้งเตือนทั้งหมดใช่หรือไม่?", + "ยืนยันการล้างการแจ้งเตือนทั้งหมด", + "ต้องการยืนยันการล้างการแจ้งเตือนทั้งหมดทั้งหมดใช่หรือไม่?", ); } @@ -535,11 +535,11 @@ onUnmounted(() => { flat dense round - color="red" - icon="delete" + color="grey-7" + icon="mdi-trash-can-outline" @click.stop.prevent="handleDeleteNotification" > - ลบการแจ้งเตือนทั้งหมด + ล้างการแจ้งเตือนทั้งหมด
From e00d3aaddb9eb2c6ad6361a2ad143f377ff9b08e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 23 Jun 2026 16:21:02 +0700 Subject: [PATCH 6/7] fix --- src/views/MainLayout.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 3227fa45..a6b038e2 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -421,7 +421,7 @@ function handleDeleteNotification() { } }, "ยืนยันการล้างการแจ้งเตือนทั้งหมด", - "ต้องการยืนยันการล้างการแจ้งเตือนทั้งหมดทั้งหมดใช่หรือไม่?", + "ต้องการยืนยันการล้างการแจ้งเตือนทั้งหมดใช่หรือไม่?", ); } From 2e84247ae68e0032c0754039384a6a88dc76c2f8 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 25 Jun 2026 21:54:13 +0700 Subject: [PATCH 7/7] fix ui noti --- src/views/MainLayout.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index a6b038e2..6aea2a37 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -421,7 +421,7 @@ function handleDeleteNotification() { } }, "ยืนยันการล้างการแจ้งเตือนทั้งหมด", - "ต้องการยืนยันการล้างการแจ้งเตือนทั้งหมดใช่หรือไม่?", + `ต้องการล้างการแจ้งเตือนทั้งหมด (${totalInbox.value} รายการ) ใช่หรือไม่? การกระทำนี้ไม่สามารถย้อนกลับได้`, ); } @@ -534,9 +534,13 @@ onUnmounted(() => { v-if="totalInbox !== 0" flat dense - round - color="grey-7" + no-caps + size="12px" + color="red-7" icon="mdi-trash-can-outline" + label="ล้างทั้งหมด" + class="q-ml-sm" + aria-label="ล้างการแจ้งเตือนทั้งหมด" @click.stop.prevent="handleDeleteNotification" > ล้างการแจ้งเตือนทั้งหมด