diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index f2f8f34bb..d8aad98b3 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -195,6 +195,7 @@ export default { orgAssistance: (id: string) => `${orgProfile}/assistance/${id}`, + orgIssues: `${organization}/issues`, // active รักษาการในตำแหน่งตามหน่วยงาน activeActPosition: (id: string) => `${orgPosAct}/${id}`, }; diff --git a/src/components/Dialogs/DialogDebug.vue b/src/components/Dialogs/DialogDebug.vue new file mode 100644 index 000000000..917151c0e --- /dev/null +++ b/src/components/Dialogs/DialogDebug.vue @@ -0,0 +1,410 @@ + + + + + diff --git a/src/modules/22_issues/components/DialogViewIssue.vue b/src/modules/22_issues/components/DialogViewIssue.vue new file mode 100644 index 000000000..1847da42a --- /dev/null +++ b/src/modules/22_issues/components/DialogViewIssue.vue @@ -0,0 +1,463 @@ + + + + + diff --git a/src/modules/22_issues/interface/Main.ts b/src/modules/22_issues/interface/Main.ts new file mode 100644 index 000000000..cdb6c7cd1 --- /dev/null +++ b/src/modules/22_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/22_issues/router.ts b/src/modules/22_issues/router.ts new file mode 100644 index 000000000..df3ef253d --- /dev/null +++ b/src/modules/22_issues/router.ts @@ -0,0 +1,14 @@ +const Main = () => import("@/modules/22_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/22_issues/store.ts b/src/modules/22_issues/store.ts new file mode 100644 index 000000000..f7d19d0a6 --- /dev/null +++ b/src/modules/22_issues/store.ts @@ -0,0 +1,52 @@ +import { ref } from "vue"; +import { defineStore } from "pinia"; +import type { Options } from "@/modules/22_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/22_issues/views/Main.vue b/src/modules/22_issues/views/Main.vue new file mode 100644 index 000000000..31b0209bb --- /dev/null +++ b/src/modules/22_issues/views/Main.vue @@ -0,0 +1,333 @@ + + + + diff --git a/src/router/index.ts b/src/router/index.ts index 3fc48e205..f570ed6ce 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -28,6 +28,7 @@ import ModuleCommand from "@/modules/18_command/router"; import ModulePositionCondition from "@/modules/19_condition/router"; import ModulePositionTemp from "@/modules/20_positionTemp/router"; import ModuleReport from "@/modules/21_report/router"; +import ModuleIssues from "@/modules/22_issues/router"; // TODO: ใช้หรือไม่? import { authenticated, logout } from "@/plugins/auth"; @@ -79,6 +80,7 @@ const router = createRouter({ ...ModulePositionCondition, ...ModulePositionTemp, ...ModuleReport, + ...ModuleIssues, ], }, /** diff --git a/src/stores/positionKeycloak.ts b/src/stores/positionKeycloak.ts new file mode 100644 index 000000000..a285c459c --- /dev/null +++ b/src/stores/positionKeycloak.ts @@ -0,0 +1,60 @@ +import { ref } from "vue"; +import { defineStore } from "pinia"; + +export const usePositionKeycloakStore = defineStore("positionKeycloak", () => { + const dataPositionKeycloak = ref(null); + + function setPositionKeycloak(data: any) { + dataPositionKeycloak.value = data; + } + + function findOrgName(obj: any) { + if (obj) { + let name = + obj.child4 != null && + obj.child4 !== "" && + obj.child3 != null && + obj.child3 !== "" + ? obj.child4 + (obj.child3 ? "/" : "") + : obj.child4 != null && obj.child4 !== "" + ? obj.child4 + : ""; + + name += + obj.child3 != null && + obj.child3 !== "" && + obj.child2 != null && + obj.child2 !== "" + ? obj.child3 + (obj.child2 ? "/" : "") + : obj.child3 != null && obj.child3 !== "" + ? obj.child3 + : ""; + + name += + obj.child2 != null && + obj.child2 !== "" && + obj.child1 != null && + obj.child1 !== "" + ? obj.child2 + (obj.child1 ? "/" : "") + : obj.child2 != null && obj.child2 !== "" + ? obj.child2 + : ""; + + name += + obj.child1 != null && + obj.child1 !== "" && + obj.root != null && + obj.root !== "" + ? obj.child1 + (obj.root ? "/" : "") + : obj.child1 != null && obj.child1 !== "" + ? obj.child1 + : ""; + name += obj.root != null && obj.root !== "" ? obj.root : ""; + return name == "" ? "-" : name; + } else { + return ""; + } + } + + return { dataPositionKeycloak, setPositionKeycloak, findOrgName }; +}); diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 8180cbd86..452e437a4 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -6,6 +6,7 @@ import { storeToRefs } from "pinia"; import { scroll, useQuasar } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import { useMenuDataStore } from "@/stores/menuList"; +import { usePositionKeycloakStore } from "@/stores/positionKeycloak"; import { tokenParsed, logout, @@ -26,6 +27,7 @@ import type { import { tabList, tabListPlacement } from "../interface/request/main/main"; import LoginLinkage from "@/components/LoginLinkage.vue"; +import DialogDebug from "@/components/Dialogs/DialogDebug.vue"; // landing page config url const configParam = { @@ -63,6 +65,7 @@ const modalLoginLinkage = ref(false); //เข้าสู่ระบ // landing page redirect const landingPageUrl = ref(configParam.landingPageUrl); +const modalDebug = ref(false); async function fetchmsgNoread() { await http @@ -524,6 +527,7 @@ async function fetchKeycloakPosition() { .get(config.API.keycloakPosition()) .then(async (res) => { const data = await res.data.result; + usePositionKeycloakStore().setPositionKeycloak(data); if (data.avatarName) { await getImg(data.profileId, data.avatarName); } else { @@ -783,6 +787,21 @@ function onViewDetailNoti(url: string) { + + + + + + แจ้งปัญหาการใช้งานระบบ + + + +