From c8f682fb38a3fe7ae7d62b3584489a2130a992ed Mon Sep 17 00:00:00 2001 From: AnandaTon <125332905+anandaAiemvong@users.noreply.github.com> Date: Mon, 3 Jul 2023 17:16:37 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/interface/request/main/main.ts | 8 ++ src/modules/08_registryEmployee/router.ts | 30 +++++++ src/modules/08_registryEmployee/store.ts | 83 +++++++++++++++++++ .../08_registryEmployee/views/Main.vue | 0 4 files changed, 121 insertions(+) create mode 100644 src/modules/08_registryEmployee/router.ts create mode 100644 src/modules/08_registryEmployee/store.ts create mode 100644 src/modules/08_registryEmployee/views/Main.vue diff --git a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts index 3941c81f6..faf46e4d3 100644 --- a/src/interface/request/main/main.ts +++ b/src/interface/request/main/main.ts @@ -211,6 +211,14 @@ const menuList = readonly([ path: "insignia", role: "insignia", }, + { + key: 9, + icon: "mdi-medal-outline", + activeIcon: "mdi-medal", + label: "ทะเบียนประวัติลูกจ้าง", + path: "registryEmployee", + role: "registryEmployee", + }, ]); const tabList = readonly([ diff --git a/src/modules/08_registryEmployee/router.ts b/src/modules/08_registryEmployee/router.ts new file mode 100644 index 000000000..f65e37a06 --- /dev/null +++ b/src/modules/08_registryEmployee/router.ts @@ -0,0 +1,30 @@ +/** + * Router ระบบทะเบียนประวัติ}6d0hk' (Registry) + */ + +const Main = () => import("@/modules/08_registryEmployee/views/Main.vue"); +const Detail = () => + import("@/modules/08_registryEmployee/components/Profile.vue"); + +export default [ + { + path: "/registryEmployee", + name: "registryEmployee", + component: Main, + meta: { + Auth: true, + Key: [9], + Role: "registryEmployee", + }, + }, + { + path: "/registryEmployee/:id", + name: "registryEmployeeDetail", + component: Detail, + meta: { + Auth: true, + Key: [9], + Role: "registryEmployee", + }, + }, +]; diff --git a/src/modules/08_registryEmployee/store.ts b/src/modules/08_registryEmployee/store.ts new file mode 100644 index 000000000..8b69ec17a --- /dev/null +++ b/src/modules/08_registryEmployee/store.ts @@ -0,0 +1,83 @@ +import { ref, computed } from "vue"; +import { defineStore } from "pinia"; + +export const useProfileDataStore = defineStore("profile", () => { + interface profile { + main: { columns: String[] }; + education: { columns: String[] }; + oldName: { columns: String[] }; + certicate: { columns: String[] }; + train: { columns: String[] }; + insignia: { columns: String[] }; + coined: { columns: String[] }; + assessment: { columns: String[] }; + salary: { columns: String[] }; + discipline: { columns: String[] }; + leave: { columns: String[] }; + talent: { columns: String[] }; + work: { columns: String[] }; + record: { columns: String[] }; + other: { columns: String[] }; + document: { columns: String[] }; + } + + const birthDate = ref(new Date()); + const retireText = ref(null); + const changeRetireText = (val: string | null) => { + retireText.value = val; + }; + const changeBirth = (val: Date) => { + birthDate.value = val; + }; + const profileData = ref({ + main: { columns: [] }, + education: { columns: [] }, + oldName: { columns: [] }, + certicate: { columns: [] }, + train: { columns: [] }, + insignia: { columns: [] }, + coined: { columns: [] }, + assessment: { columns: [] }, + salary: { columns: [] }, + discipline: { columns: [] }, + leave: { columns: [] }, + talent: { columns: [] }, + work: { columns: [] }, + record: { columns: [] }, + other: { columns: [] }, + document: { columns: [] }, + }); + + const changeProfileColumns = (system: String, val: String[]) => { + if (system == "main") profileData.value.main.columns = val; + if (system == "education") profileData.value.education.columns = val; + if (system == "oldName") profileData.value.oldName.columns = val; + if (system == "certicate") profileData.value.certicate.columns = val; + if (system == "train") profileData.value.train.columns = val; + if (system == "insignia") profileData.value.insignia.columns = val; + if (system == "coined") profileData.value.coined.columns = val; + if (system == "assessment") profileData.value.assessment.columns = val; + if (system == "salary") profileData.value.salary.columns = val; + if (system == "discipline") profileData.value.discipline.columns = val; + if (system == "leave") profileData.value.leave.columns = val; + if (system == "talent") profileData.value.talent.columns = val; + if (system == "work") profileData.value.work.columns = val; + if (system == "record") profileData.value.record.columns = val; + if (system == "other") profileData.value.other.columns = val; + if (system == "document") profileData.value.document.columns = val; + localStorage.setItem("profile", JSON.stringify(profileData.value)); + }; + + if (localStorage.getItem("profile") !== null) { + profileData.value = JSON.parse(localStorage.getItem("profile") || "{}"); + } + + return { + profileData, + changeProfileColumns, + birthDate, + changeBirth, + retireText, + changeRetireText, + }; +}); diff --git a/src/modules/08_registryEmployee/views/Main.vue b/src/modules/08_registryEmployee/views/Main.vue new file mode 100644 index 000000000..e69de29bb