From f4b7767476401160fb6deb37d57e31b68c12fcaf Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 3 Feb 2026 09:39:38 +0700 Subject: [PATCH 1/6] feat:issue --- src/api/02_organizational/api.organization.ts | 2 + .../07_issues/components/DialogViewIssue.vue | 463 ++++++++++++++++++ src/modules/07_issues/interface/Main.ts | 42 ++ src/modules/07_issues/router.ts | 14 + src/modules/07_issues/store.ts | 52 ++ src/modules/07_issues/views/Main.vue | 327 +++++++++++++ src/router/index.ts | 2 + 7 files changed, 902 insertions(+) create mode 100644 src/modules/07_issues/components/DialogViewIssue.vue create mode 100644 src/modules/07_issues/interface/Main.ts create mode 100644 src/modules/07_issues/router.ts create mode 100644 src/modules/07_issues/store.ts create mode 100644 src/modules/07_issues/views/Main.vue diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index 93d2241c..ae3d06dd 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -113,4 +113,6 @@ export default { viewWorkflow: `${organization}/view-workflow`, keycloakLogSSO: `${organization}/keycloak/log/sso`, + + orgIssues: `${organization}/issues`, }; diff --git a/src/modules/07_issues/components/DialogViewIssue.vue b/src/modules/07_issues/components/DialogViewIssue.vue new file mode 100644 index 00000000..9a667ddf --- /dev/null +++ b/src/modules/07_issues/components/DialogViewIssue.vue @@ -0,0 +1,463 @@ + + + + + diff --git a/src/modules/07_issues/interface/Main.ts b/src/modules/07_issues/interface/Main.ts new file mode 100644 index 00000000..cdb6c7cd --- /dev/null +++ b/src/modules/07_issues/interface/Main.ts @@ -0,0 +1,42 @@ +import type { D } from "@fullcalendar/core/internal-common"; + +interface Options { + label: string; + value: string; +} + +interface IssueData { + codeIssue: string; + createdAt: Date; + createdFullName: string; + createdUserId: string; + description: string; + id: string; + lastUpdateFullName: string; + lastUpdateUserId: string; + lastUpdatedAt: Date; + menu: string; + org: string; + remark: string; + status: "IN_PROGRESS" | "RESOLVED" | "CLOSED" | "NEW"; + system: "mgt" | "user" | "checkin"; + title: string; +} + +interface IssueAttachment { + fileName: string; + path: string; + pathname: string; + title: string; +} + +interface IssueAttachmentWithDownloadUrl extends IssueAttachment { + downloadUrl: string; +} + +export type { + Options, + IssueData, + IssueAttachment, + IssueAttachmentWithDownloadUrl, +}; diff --git a/src/modules/07_issues/router.ts b/src/modules/07_issues/router.ts new file mode 100644 index 00000000..0acbc180 --- /dev/null +++ b/src/modules/07_issues/router.ts @@ -0,0 +1,14 @@ +const Main = () => import("@/modules/07_issues/views/Main.vue"); + +export default [ + { + path: "/issues", + name: "issuesMain", + component: Main, + meta: { + Auth: true, + Key: "REPORT_ORG", + Role: "STAFF", + }, + }, +]; diff --git a/src/modules/07_issues/store.ts b/src/modules/07_issues/store.ts new file mode 100644 index 00000000..efddccdc --- /dev/null +++ b/src/modules/07_issues/store.ts @@ -0,0 +1,52 @@ +import { ref } from "vue"; +import { defineStore } from "pinia"; +import type { Options } from "@/modules/07_issues/interface/Main"; + +export const useIssueStore = defineStore("issue", () => { + const systemOptions = ref([ + { label: "ทั้งหมด", value: "" }, + { label: "ระบบบริหารจัดการ", value: "MGT" }, + { label: "ระบบผู้ใช้งาน", value: "USER" }, + { label: "ระบบลงเวลา", value: "CHECKIN" }, + ]); + + const statusOptions = ref([ + { label: "ทั้งหมด", value: "" }, + { label: "ใหม่", value: "NEW" }, + { label: "กำลังดำเนินการ", value: "IN_PROGRESS" }, + { label: "แก้ไขแล้ว", value: "RESOLVED" }, + { label: "ปิดแล้ว", value: "CLOSED" }, + ]); + + function convertStatus(status: string) { + let val = status.toUpperCase(); + switch (val) { + case "NEW": + return "ใหม่"; + case "IN_PROGRESS": + return "กำลังดำเนินการ"; + case "RESOLVED": + return "แก้ไขแล้ว"; + case "CLOSED": + return "ปิดแล้ว"; + default: + return "-"; + } + } + + function convertSystem(system: string) { + let val = system.toUpperCase(); + switch (val) { + case "MGT": + return "ระบบบริหารจัดการ"; + case "USER": + return "ระบบผู้ใช้งาน"; + case "CHECKIN": + return "ระบบลงเวลา"; + default: + return "-"; + } + } + + return { systemOptions, statusOptions, convertStatus, convertSystem }; +}); diff --git a/src/modules/07_issues/views/Main.vue b/src/modules/07_issues/views/Main.vue new file mode 100644 index 00000000..5832e027 --- /dev/null +++ b/src/modules/07_issues/views/Main.vue @@ -0,0 +1,327 @@ + + + + diff --git a/src/router/index.ts b/src/router/index.ts index 52bcf737..a5ab0eb3 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -12,6 +12,7 @@ import ModuleLogs from "@/modules/03_logs/router"; import ModuleSystem from "@/modules/04_system/router"; import ModuleCommand from "@/modules/05_command/router"; import ModuleWebServices from "@/modules/06_webservices/router"; +import ModeuleIssues from "@/modules/07_issues/router"; // TODO: ใช้หรือไม่? import { authenticated, logout } from "@/plugins/auth"; @@ -50,6 +51,7 @@ const router = createRouter({ ...ModuleSystem, ...ModuleCommand, ...ModuleWebServices, + ...ModeuleIssues, ], }, /** From 1017ef74c013e3b10fc146d92537de024b4d2b81 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 3 Feb 2026 09:51:41 +0700 Subject: [PATCH 2/6] fix:router issue --- src/interface/request/main/main.ts | 8 ++++++++ src/modules/07_issues/router.ts | 5 ++--- src/views/MainLayout.vue | 11 +++-------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts index 7e0ab73d..b409bdbe 100644 --- a/src/interface/request/main/main.ts +++ b/src/interface/request/main/main.ts @@ -182,6 +182,14 @@ const menuList = readonly([ path: "manageWebservices", role: ["SUPER_ADMIN"], }, + { + key: 7, + icon: "mdi-bug", + activeIcon: "mdi-bug", + label: "จัดการปัญหา", + path: "manageIssues", + role: ["SUPER_ADMIN", "ISSUE"], + }, ]); export { menuList }; diff --git a/src/modules/07_issues/router.ts b/src/modules/07_issues/router.ts index 0acbc180..5fd42a25 100644 --- a/src/modules/07_issues/router.ts +++ b/src/modules/07_issues/router.ts @@ -3,12 +3,11 @@ const Main = () => import("@/modules/07_issues/views/Main.vue"); export default [ { path: "/issues", - name: "issuesMain", + name: "manageIssues", component: Main, meta: { Auth: true, - Key: "REPORT_ORG", - Role: "STAFF", + role: ["SUPER_ADMIN", "ISSUE"], }, }, ]; diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 3327b237..aeb7f4bb 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -129,7 +129,7 @@ async function getDataNotification(index: number, type: string) { : e.createdFullName[0], body: e.body ?? "", timereceive: `${date2Thai(e.receiveDate)} ${new Date( - e.receiveDate + e.receiveDate, ).toLocaleTimeString("th-TH", thaiOptions)} น.`, isOpen: e.isOpen, }); @@ -255,7 +255,7 @@ function doLogout() { await logoutSSO(); }, "ยืนยันการออกจากระบบ", - "ต้องการออกจากระบบใช่หรือไม่?" + "ต้องการออกจากระบบใช่หรือไม่?", ); } @@ -379,7 +379,7 @@ watch( notiList.value = updatedNotifications; fetchmsgNoread(); } - } + }, ); const isSsoToken = ref(false); @@ -730,7 +730,6 @@ onUnmounted(() => { v-if=" menuItem.key == 2 || menuItem.key == 0 || - menuItem.key == 7 || menuItem.key == 8 || menuItem.key == 9 || menuItem.key == 10 || @@ -773,7 +772,6 @@ onUnmounted(() => {
{ v-if=" menuItem.key == 2 || menuItem.key == 0 || - menuItem.key == 7 || menuItem.key == 8 || menuItem.key == 9 || menuItem.key == 10 || @@ -942,7 +939,6 @@ onUnmounted(() => {
{ :label="subMenu.label" v-if=" subMenu.key !== 2.0 && - subMenu.key !== 7.1 && subMenu.key !== 12.0 && subMenu.key !== 13.0 " From 05fec39241754ee7c426a37034d8585d5a7c46dc Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Tue, 3 Feb 2026 17:17:08 +0700 Subject: [PATCH 3/6] fix: role get position --- src/views/MainLayout.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index aeb7f4bb..d9b71c84 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -335,6 +335,10 @@ const landingPageUrl = ref(configParam.landingPageUrl); /** ฟังก์ชันเรียกข้อมูลผู้ใช่งาน*/ async function fetchKeycloakPosition() { + const checkRole = + role.value.includes("SUPER_ADMIN") || role.value.includes("ADMIN"); + if (!checkRole) return; + await http .get(config.API.keycloakPosition()) .then(async (res) => { From ce3ac42315e0efd7219d75ad86c1db39cde8963b Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Tue, 3 Feb 2026 17:19:25 +0700 Subject: [PATCH 4/6] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=8A?= =?UTF-8?q?=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B9=80=E0=B8=A1=E0=B8=99=E0=B8=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/interface/request/main/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts index b409bdbe..6697267c 100644 --- a/src/interface/request/main/main.ts +++ b/src/interface/request/main/main.ts @@ -186,7 +186,7 @@ const menuList = readonly([ key: 7, icon: "mdi-bug", activeIcon: "mdi-bug", - label: "จัดการปัญหา", + label: "รายงานปัญหา", path: "manageIssues", role: ["SUPER_ADMIN", "ISSUE"], }, From 790fcc18fbf3613ace5af5fd526a2b4621f2413b Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 4 Feb 2026 12:55:38 +0700 Subject: [PATCH 5/6] fix:add colum email phone --- .../07_issues/components/DialogViewIssue.vue | 474 +++++++++++------- src/modules/07_issues/interface/Main.ts | 2 + src/modules/07_issues/views/Main.vue | 38 +- 3 files changed, 338 insertions(+), 176 deletions(-) diff --git a/src/modules/07_issues/components/DialogViewIssue.vue b/src/modules/07_issues/components/DialogViewIssue.vue index 9a667ddf..c29a07cc 100644 --- a/src/modules/07_issues/components/DialogViewIssue.vue +++ b/src/modules/07_issues/components/DialogViewIssue.vue @@ -51,7 +51,12 @@ const optionsStatus = computed(() => statusOptions.value.filter((item) => item.value !== ""), ); const splitterModel = computed({ - get: () => (isEdit.value ? 70 : 100), + get: () => { + if (!isEdit.value) return 100; + // สำหรับหน้าจอเล็ก ใช้ horizontal splitter และแบ่งเป็น 60:40 + if ($q.screen.lt.md) return 60; + return 70; + }, set: (val: number) => {}, }); @@ -205,187 +210,290 @@ watch(