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, ], }, /**