From cb52aec394a64e852014fa2c884fe15d2af04d15 Mon Sep 17 00:00:00 2001 From: AnandaTon <125332905+anandaAiemvong@users.noreply.github.com> Date: Wed, 14 Jun 2023 16:10:58 +0700 Subject: [PATCH 1/2] Pinia Store data positionPath --- .../01_metadata/components/position/Path.vue | 70 +++++++------ src/modules/01_metadata/store.ts | 99 +++++++++++++++++++ 2 files changed, 137 insertions(+), 32 deletions(-) diff --git a/src/modules/01_metadata/components/position/Path.vue b/src/modules/01_metadata/components/position/Path.vue index 1e7160b25..4a853ce0e 100644 --- a/src/modules/01_metadata/components/position/Path.vue +++ b/src/modules/01_metadata/components/position/Path.vue @@ -217,7 +217,8 @@ const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); -const { manageData, changeManageColumns } = store; +const { manageData, changeManageColumns, getPositionPath, dataPositionPath } = + store; const rows = ref([]); //list data table const rowsHistory = ref([]); //select data history const rawHistory = ref([]); //raw data history @@ -400,38 +401,43 @@ const $q = useQuasar(); /** * ฟังก์ชัน get data ล่าสุด */ -const fetchData = async () => { +const fetchData = async (load: boolean = false) => { await props.fetchDataComponent(); - rows.value.splice(0); - showLoader(); - await http - .get(config.API.listPositionPathHistory) - .then((res) => { - let data = res.data.result; - version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่ - idVersion.value = data.id; //เลข id ใน mongodb - data.items.map((e: RequestItemsHistoryObject) => { - rows.value.push({ - id: e.id, - name: e.name, - createdAt: e.createdAt, - lastUpdatedAt: e.lastUpdatedAt, - lastUpdateFullName: e.lastUpdateFullName, - isActive: e.isActive, - createdFullName: e.createdFullName, - createdUserId: e.createdUserId, - lastUpdateUserId: e.lastUpdateUserId, - note: e.note, - }); - }); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - updateData.value = false; - hideLoader(); - }); + const result = await getPositionPath(false, load); + version.value = result.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่ + idVersion.value = result.idversion; //เลข id ใน mongodb + rows.value = result.data; + updateData.value = false; + // rows.value.splice(0); + // showLoader(); + // await http + // .get(config.API.listPositionPathHistory) + // .then((res) => { + // let data = res.data.result; + // version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่ + // idVersion.value = data.id; //เลข id ใน mongodb + // data.items.map((e: RequestItemsHistoryObject) => { + // rows.value.push({ + // id: e.id, + // name: e.name, + // createdAt: e.createdAt, + // lastUpdatedAt: e.lastUpdatedAt, + // lastUpdateFullName: e.lastUpdateFullName, + // isActive: e.isActive, + // createdFullName: e.createdFullName, + // createdUserId: e.createdUserId, + // lastUpdateUserId: e.lastUpdateUserId, + // note: e.note, + // }); + // }); + // }) + // .catch((e) => { + // messageError($q, e); + // }) + // .finally(() => { + // updateData.value = false; + // hideLoader(); + // }); }; /** diff --git a/src/modules/01_metadata/store.ts b/src/modules/01_metadata/store.ts index 84269c7dc..01e310555 100644 --- a/src/modules/01_metadata/store.ts +++ b/src/modules/01_metadata/store.ts @@ -13,6 +13,7 @@ import type { RequestItemsHistoryObject as positionEmployeeGroupResponse } from import type { RequestItemsHistoryObject as positionEmployeeLineResponse } from "@/modules/01_metadata/interface/request/positionEmployee/Line"; import type { RequestItemsHistoryObject as positionEmployeeLevelResponse } from "@/modules/01_metadata/interface/request/positionEmployee/Level"; import type { RequestItemsHistoryObject as positionEmployeeStatusResponse } from "@/modules/01_metadata/interface/request/positionEmployee/Status"; +import type { RequestItemsHistoryObject as positionPathResponse } from "@/modules/01_metadata/interface/request/position/Path"; const $q = useQuasar(); const mixin = useCounterMixin(); @@ -37,6 +38,8 @@ export const useManageDataStore = defineStore("manage", () => { const draftPositionEmployeeLevel = ref([]); //list data table const dataPositionEmployeeStatus = ref([]); //list data table const draftPositionEmployeeStatus = ref([]); //list data table + const dataPositionPath = ref([]); //list data table + const draftPositionPath = ref([]); //list data table const storeIdVersion = ref(""); //id data ใน mongodb const storeVersion = ref("published"); //รายการข้อมูลล่าสุดได้เผยแพร่หรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่ @@ -526,6 +529,35 @@ export const useManageDataStore = defineStore("manage", () => { } }; + const getPositionPath = async ( + selector: boolean = false, + newFetch: boolean = false + ) => { + if (dataPositionPath.value.length === 0) { + await fetchPositionPath(true, selector); + return { + data: draftPositionPath.value, + version: storeVersion.value, + idversion: storeIdVersion.value, + }; + } else { + if (newFetch) { + await fetchPositionPath(true, selector); + return { + data: draftPositionPath.value, + version: storeVersion.value, + idversion: storeIdVersion.value, + }; + } else { + return { + data: draftPositionPath.value, + version: storeVersion.value, + idversion: storeIdVersion.value, + }; + } + } + }; + const fetchPrefix = async (loader: boolean, selector: boolean) => { let apiPrefix = ""; if (loader) { @@ -1105,6 +1137,71 @@ export const useManageDataStore = defineStore("manage", () => { }); }; + const fetchPositionPath = async (loader: boolean, selector: boolean) => { + let apiPositionPath = ""; + if (loader) { + showLoader(); + } + if (selector) { + apiPositionPath = config.API.positionPath; + } else { + apiPositionPath = config.API.listPositionPathHistory; + } + await http + .get(apiPositionPath) + .then((res) => { + const data = res.data.result; + let rows: positionPathResponse[] = []; + if (selector) { + data.map((e: positionPathResponse) => { + rows.push({ + id: e.id, + name: e.name, + createdAt: e.createdAt, + lastUpdatedAt: e.lastUpdatedAt, + lastUpdateFullName: e.lastUpdateFullName, + isActive: e.isActive, + createdFullName: e.createdFullName, + createdUserId: e.createdUserId, + lastUpdateUserId: e.lastUpdateUserId, + note: e.note, + }); + }); + } else { + storeVersion.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่ + storeIdVersion.value = data.id; //เลข id ใน mongodb + + data.items.map((e: positionPathResponse) => { + rows.push({ + id: e.id, + name: e.name, + createdAt: e.createdAt, + lastUpdatedAt: e.lastUpdatedAt, + lastUpdateFullName: e.lastUpdateFullName, + isActive: e.isActive, + createdFullName: e.createdFullName, + createdUserId: e.createdUserId, + lastUpdateUserId: e.lastUpdateUserId, + note: e.note, + }); + }); + } + + draftPositionPath.value = rows; + if (loader) { + dataPositionPath.value = rows; + } + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + if (loader) { + hideLoader(); + } + }); + }; + return { dataPrefix, dataInsignia, @@ -1115,6 +1212,7 @@ export const useManageDataStore = defineStore("manage", () => { dataPositionEmployeeLine, dataPositionEmployeeLevel, dataPositionEmployeeStatus, + dataPositionPath, storeIdVersion, storeVersion, manageData, @@ -1130,5 +1228,6 @@ export const useManageDataStore = defineStore("manage", () => { getPositionEmployeeLine, getPositionEmployeeLevel, getPositionEmployeeStatus, + getPositionPath, }; }); From dc5a81716021996247b9b00fbe30c707710707d4 Mon Sep 17 00:00:00 2001 From: watcharanondh Date: Thu, 15 Jun 2023 10:41:27 +0700 Subject: [PATCH 2/2] Add Detail Page exams_other --- .../components/exams_other/Detail.vue | 65 + .../components/exams_other/DialogFooter.vue | 93 ++ .../components/exams_other/DialogHeader.vue | 27 + .../components/exams_other/Education.vue | 1381 +++++++++++++++++ .../exams_other/Information/Address.vue | 834 ++++++++++ .../exams_other/Information/Certicate.vue | 828 ++++++++++ .../exams_other/Information/Information.vue | 992 ++++++++++++ .../exams_other/Information/layout.vue | 51 + .../exams_other/Information/top.vue | 120 ++ .../components/exams_other/Insignia.vue | 1199 ++++++++++++++ .../{exams_korkor => exams_other}/Main.vue | 9 +- .../components/exams_other/Table.vue | 201 +++ .../components/exams_other/profileType.ts | 171 ++ .../components/exams_sorkorcho/Main.vue | 10 +- .../05_placement/interface/index/Main.ts | 25 +- .../05_placement/interface/request/Address.ts | 55 + .../interface/request/Certificate.ts | 31 + .../interface/request/Education.ts | 42 + .../interface/request/Information.ts | 59 + .../interface/request/Insignia.ts | 38 + .../interface/response/Address.ts | 34 + .../interface/response/Certificate.ts | 13 + .../interface/response/Education.ts | 24 + .../interface/response/Information.ts | 23 + .../interface/response/Insignia.ts | 20 + src/modules/05_placement/router.ts | 32 +- src/modules/05_placement/store.ts | 79 +- 27 files changed, 6422 insertions(+), 34 deletions(-) create mode 100644 src/modules/05_placement/components/exams_other/Detail.vue create mode 100644 src/modules/05_placement/components/exams_other/DialogFooter.vue create mode 100644 src/modules/05_placement/components/exams_other/DialogHeader.vue create mode 100644 src/modules/05_placement/components/exams_other/Education.vue create mode 100644 src/modules/05_placement/components/exams_other/Information/Address.vue create mode 100644 src/modules/05_placement/components/exams_other/Information/Certicate.vue create mode 100644 src/modules/05_placement/components/exams_other/Information/Information.vue create mode 100644 src/modules/05_placement/components/exams_other/Information/layout.vue create mode 100644 src/modules/05_placement/components/exams_other/Information/top.vue create mode 100644 src/modules/05_placement/components/exams_other/Insignia.vue rename src/modules/05_placement/components/{exams_korkor => exams_other}/Main.vue (99%) create mode 100644 src/modules/05_placement/components/exams_other/Table.vue create mode 100644 src/modules/05_placement/components/exams_other/profileType.ts create mode 100644 src/modules/05_placement/interface/request/Address.ts create mode 100644 src/modules/05_placement/interface/request/Certificate.ts create mode 100644 src/modules/05_placement/interface/request/Education.ts create mode 100644 src/modules/05_placement/interface/request/Information.ts create mode 100644 src/modules/05_placement/interface/request/Insignia.ts create mode 100644 src/modules/05_placement/interface/response/Address.ts create mode 100644 src/modules/05_placement/interface/response/Certificate.ts create mode 100644 src/modules/05_placement/interface/response/Education.ts create mode 100644 src/modules/05_placement/interface/response/Information.ts create mode 100644 src/modules/05_placement/interface/response/Insignia.ts diff --git a/src/modules/05_placement/components/exams_other/Detail.vue b/src/modules/05_placement/components/exams_other/Detail.vue new file mode 100644 index 000000000..569fd064d --- /dev/null +++ b/src/modules/05_placement/components/exams_other/Detail.vue @@ -0,0 +1,65 @@ + + + + \ No newline at end of file diff --git a/src/modules/05_placement/components/exams_other/DialogFooter.vue b/src/modules/05_placement/components/exams_other/DialogFooter.vue new file mode 100644 index 000000000..9bfa25774 --- /dev/null +++ b/src/modules/05_placement/components/exams_other/DialogFooter.vue @@ -0,0 +1,93 @@ + + diff --git a/src/modules/05_placement/components/exams_other/DialogHeader.vue b/src/modules/05_placement/components/exams_other/DialogHeader.vue new file mode 100644 index 000000000..bf1bff6de --- /dev/null +++ b/src/modules/05_placement/components/exams_other/DialogHeader.vue @@ -0,0 +1,27 @@ + + diff --git a/src/modules/05_placement/components/exams_other/Education.vue b/src/modules/05_placement/components/exams_other/Education.vue new file mode 100644 index 000000000..726596805 --- /dev/null +++ b/src/modules/05_placement/components/exams_other/Education.vue @@ -0,0 +1,1381 @@ + + + + diff --git a/src/modules/05_placement/components/exams_other/Information/Address.vue b/src/modules/05_placement/components/exams_other/Information/Address.vue new file mode 100644 index 000000000..9f49214a1 --- /dev/null +++ b/src/modules/05_placement/components/exams_other/Information/Address.vue @@ -0,0 +1,834 @@ + + + \ No newline at end of file diff --git a/src/modules/05_placement/components/exams_other/Information/Certicate.vue b/src/modules/05_placement/components/exams_other/Information/Certicate.vue new file mode 100644 index 000000000..41663f571 --- /dev/null +++ b/src/modules/05_placement/components/exams_other/Information/Certicate.vue @@ -0,0 +1,828 @@ + + + + diff --git a/src/modules/05_placement/components/exams_other/Information/Information.vue b/src/modules/05_placement/components/exams_other/Information/Information.vue new file mode 100644 index 000000000..2f280eb6c --- /dev/null +++ b/src/modules/05_placement/components/exams_other/Information/Information.vue @@ -0,0 +1,992 @@ + + + \ No newline at end of file diff --git a/src/modules/05_placement/components/exams_other/Information/layout.vue b/src/modules/05_placement/components/exams_other/Information/layout.vue new file mode 100644 index 000000000..6e277187c --- /dev/null +++ b/src/modules/05_placement/components/exams_other/Information/layout.vue @@ -0,0 +1,51 @@ + + + diff --git a/src/modules/05_placement/components/exams_other/Information/top.vue b/src/modules/05_placement/components/exams_other/Information/top.vue new file mode 100644 index 000000000..807a8d143 --- /dev/null +++ b/src/modules/05_placement/components/exams_other/Information/top.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/src/modules/05_placement/components/exams_other/Insignia.vue b/src/modules/05_placement/components/exams_other/Insignia.vue new file mode 100644 index 000000000..e7b8f2624 --- /dev/null +++ b/src/modules/05_placement/components/exams_other/Insignia.vue @@ -0,0 +1,1199 @@ + + + diff --git a/src/modules/05_placement/components/exams_korkor/Main.vue b/src/modules/05_placement/components/exams_other/Main.vue similarity index 99% rename from src/modules/05_placement/components/exams_korkor/Main.vue rename to src/modules/05_placement/components/exams_other/Main.vue index 92f8ea3b1..d1627d0e8 100644 --- a/src/modules/05_placement/components/exams_korkor/Main.vue +++ b/src/modules/05_placement/components/exams_other/Main.vue @@ -170,13 +170,8 @@ onMounted(async () => { }) // ดูรายการสอบแข่งขัน หน้าต่อไป -const redirectToPage = (id: number) => { - router.push({ - name: 'placementDetail', - params: { - id: id - } - }); +const redirectToPage = (id?: number) => { + router.push(`/placement2/detail`); }; // เลือกปีงบประมาณ diff --git a/src/modules/05_placement/components/exams_other/Table.vue b/src/modules/05_placement/components/exams_other/Table.vue new file mode 100644 index 000000000..85c5d5443 --- /dev/null +++ b/src/modules/05_placement/components/exams_other/Table.vue @@ -0,0 +1,201 @@ + + + diff --git a/src/modules/05_placement/components/exams_other/profileType.ts b/src/modules/05_placement/components/exams_other/profileType.ts new file mode 100644 index 000000000..9ba368651 --- /dev/null +++ b/src/modules/05_placement/components/exams_other/profileType.ts @@ -0,0 +1,171 @@ +//interface class array object {name string ,id number} + +import type { childrenFamily } from "@/modules/04_registry/interface/response/Family"; +interface ChangeActive { + name: string; + id: number; +} + +//ข้อมูลส่วนตัว +interface Information { + cardid: string | null; + prefix: string | null; + age: string | null; + prefixId: string | null; + firstname: string | null; + lastname: string | null; + birthDate: Date; + genderId: string | null; + bloodId: string | null; + nationality: string | null; + ethnicity: string | null; + statusId: string | null; + religionId: string | null; + tel: string | null; + employeeType: string | null; + employeeClass: string | null; + profileType: string | null; +} + +interface Family { + prefixC: string | null; // couple + prefixIdC: string | null; + firstnameC: string | null; + lastnameC: string | null; + lastnameCOld: string | null; + occupationC: string | null; + prefixM: string | null; // male + prefixIdM: string | null; + firstnameM: string | null; + lastnameM: string | null; + occupationM: string | null; + prefixF: string | null; // female + prefixIdF: string | null; + firstnameF: string | null; + lastnameF: string | null; + occupationF: string | null; + same: string | null; + childrens: childrenFamily[]; +} + +interface Address { + address: string | null; + provinceId: string | null; + districtId: string | null; + subdistrictId: string | null; + addressC: string | null; + provinceIdC: string | null; + districtIdC: string | null; + subdistrictIdC: string | null; + same: string | null; +} + +interface Goverment { + ocId: string | null; + positionId: string | null; + workId: string | null; + typeId: string | null; + levelId: string | null; + numberId: string | null; + businessId: string | null; + containDate: Date; + workDate: Date; + retireDate: string | null; + absent: number | null; + age: number | null; + ageAll: string | null; + reasonSameDate: string | null; +} + +interface DataOption { + id: string | number; + name: string; + zipCode?: string; +} + +interface zipCodeOption { + id: string; + name: string; + zipCode: string; +} + +const defaultGoverment: Goverment = { + ocId: null, + positionId: null, + workId: null, + typeId: null, + levelId: null, + numberId: null, + businessId: null, + containDate: new Date(), + workDate: new Date(), + retireDate: null, + absent: 0, + age: 0, + ageAll: null, + reasonSameDate: null, +}; + +const defaultAddress: Address = { + address: null, + provinceId: null, + districtId: null, + subdistrictId: null, + addressC: null, + provinceIdC: null, + districtIdC: null, + subdistrictIdC: null, + same: "0", +}; + +const defaultInformation: Information = { + cardid: null, + age: null, + prefix: null, + prefixId: null, + firstname: null, + lastname: null, + birthDate: new Date(), + genderId: null, + bloodId: null, + nationality: null, + ethnicity: null, + statusId: null, + religionId: null, + tel: null, + employeeType: null, + employeeClass: null, + profileType: null, +}; + +const defaultFamily: Family = { + prefixC: null, + prefixIdC: null, + firstnameC: null, + lastnameC: null, + lastnameCOld: null, + occupationC: null, + prefixM: null, + prefixIdM: null, + firstnameM: null, + lastnameM: null, + occupationM: null, + prefixF: null, + prefixIdF: null, + firstnameF: null, + lastnameF: null, + occupationF: null, + same: "0", + childrens: [], +}; + +export { defaultInformation, defaultFamily, defaultAddress, defaultGoverment }; +export type { + ChangeActive, + Information, + Family, + Address, + Goverment, + DataOption, + zipCodeOption, +}; diff --git a/src/modules/05_placement/components/exams_sorkorcho/Main.vue b/src/modules/05_placement/components/exams_sorkorcho/Main.vue index 92f8ea3b1..c4a78ea29 100644 --- a/src/modules/05_placement/components/exams_sorkorcho/Main.vue +++ b/src/modules/05_placement/components/exams_sorkorcho/Main.vue @@ -170,13 +170,9 @@ onMounted(async () => { }) // ดูรายการสอบแข่งขัน หน้าต่อไป -const redirectToPage = (id: number) => { - router.push({ - name: 'placementDetail', - params: { - id: id - } - }); +const redirectToPage = (id?: number) => { + // router.push({ name: 'placementDetail'}); + router.push(`/placement/detail`); }; // เลือกปีงบประมาณ diff --git a/src/modules/05_placement/interface/index/Main.ts b/src/modules/05_placement/interface/index/Main.ts index 2ccb6af46..a6df537f6 100644 --- a/src/modules/05_placement/interface/index/Main.ts +++ b/src/modules/05_placement/interface/index/Main.ts @@ -5,8 +5,10 @@ interface DataOption { disable?: boolean; } -interface Pagination { - rowsPerPage: number; +interface DataOptionInsignia { + id: string; + name: string; + typeName: string; } interface EduOps { @@ -14,6 +16,7 @@ interface EduOps { positionPathOptions: DataOption[]; } + interface InformationOps { prefixOps: DataOption[]; genderOps: DataOption[]; @@ -32,6 +35,13 @@ interface AddressOps { subdistrictCOps: zipCodeOption[]; } +interface InsigniaOps { + insigniaOptions: DataOptionInsignia[]; +} + +interface Pagination { + rowsPerPage: number; +} interface treeTab { id: string; @@ -39,4 +49,13 @@ interface treeTab { children: treeTab[]; } -export type { DataOption, treeTab, InformationOps, AddressOps, Pagination, EduOps }; +export type { + DataOption, + DataOptionInsignia, + treeTab, + InformationOps, + AddressOps, + Pagination, + EduOps, + InsigniaOps +}; diff --git a/src/modules/05_placement/interface/request/Address.ts b/src/modules/05_placement/interface/request/Address.ts new file mode 100644 index 000000000..f8cff7753 --- /dev/null +++ b/src/modules/05_placement/interface/request/Address.ts @@ -0,0 +1,55 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + currentAddress: String | null; + currentDistrictId: String | null; + currentProvinceId: String | null; + currentSubDistrictId: String | null; + currentZipCode: String | null; + registrationAddress: String | null; + registrationDistrictId: String | null; + registrationProvinceId: String | null; + registrationSame: Boolean | null; + registrationSubDistrictId: String | null; + registrationZipCode: String | null; +} + +interface RequestItemsHistoryObject { + currentAddress: String | null; + currentDistrict: String | null; + currentProvince: String | null; + currentSubDistrict: String | null; + currentZipCode: String | null; + registrationAddress: String | null; + registrationDistrict: String | null; + registrationProvince: String | null; + registrationSame: Boolean | null; + registrationSubDistrict: String | null; + registrationZipCode: String | null; + createdFullName: String | null; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { + RequestItemsObject, + Columns, + DataProps, + RequestItemsHistoryObject, +}; diff --git a/src/modules/05_placement/interface/request/Certificate.ts b/src/modules/05_placement/interface/request/Certificate.ts new file mode 100644 index 000000000..a1df312c3 --- /dev/null +++ b/src/modules/05_placement/interface/request/Certificate.ts @@ -0,0 +1,31 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + certificateNo: string; + issuer: string; + issueDate: Date; + expireDate: Date; + certificateType: string; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/05_placement/interface/request/Education.ts b/src/modules/05_placement/interface/request/Education.ts new file mode 100644 index 000000000..eb0270198 --- /dev/null +++ b/src/modules/05_placement/interface/request/Education.ts @@ -0,0 +1,42 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + level: string; + levelId: string; + positionPath: string; + positionPathId: string; + institute: string; + degree: string; + field: string; + gpa: string; + country: string; + duration: string; + durationYear: number; + other: string; + fundName: string; + finishDate: Date; + startDate: number; + endDate: number; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/05_placement/interface/request/Information.ts b/src/modules/05_placement/interface/request/Information.ts new file mode 100644 index 000000000..39aac0621 --- /dev/null +++ b/src/modules/05_placement/interface/request/Information.ts @@ -0,0 +1,59 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + birthDate: Date | null; + bloodGroupId: string | null; + citizenId: string | null; + firstName: string | null; + genderId: string | null; + lastName: string | null; + nationality: string | null; + prefixId: string | null; + race: string | null; + relationshipId: string | null; + religionId: string | null; + telephoneNumber: string | null; + employeeType: string | null; + employeeClass: string | null; +} + +interface RequestItemsHistoryObject { + citizenId: string | null; + prefix: string | null; + firstName: string | null; + lastName: string | null; + birthDate: Date; + gender: string | null; + relationship: string | null; + bloodGroup: string | null; + nationality: string | null; + race: string | null; + religion: string | null; + telephoneNumber: string | null; + createdFullName: string | null; + createdAt: Date; + employeeType: string | null; + employeeClass: string | null; +} + +//columns +interface Columns { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; +} + +export type { + RequestItemsObject, + Columns, + DataProps, + RequestItemsHistoryObject, +}; diff --git a/src/modules/05_placement/interface/request/Insignia.ts b/src/modules/05_placement/interface/request/Insignia.ts new file mode 100644 index 000000000..8fa100368 --- /dev/null +++ b/src/modules/05_placement/interface/request/Insignia.ts @@ -0,0 +1,38 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + insigniaType: string; + insignia: string; + insigniaId: string; + year: number; + no: string; + issue: string; + volumeNo: string; + volume: string; + section: string; + page: string; + receiveDate: Date; + dateAnnounce: Date; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/05_placement/interface/response/Address.ts b/src/modules/05_placement/interface/response/Address.ts new file mode 100644 index 000000000..8769bd1b4 --- /dev/null +++ b/src/modules/05_placement/interface/response/Address.ts @@ -0,0 +1,34 @@ +//ข้อมูล +interface ResponseObject { + currentAddress: string | null; + currentDistrictId: string | null; + currentProvinceId: string | null; + currentSubDistrictId: string | null; + currentZipCode: string | null; + registrationAddress: string | null; + registrationDistrictId: string | null; + registrationProvinceId: string | null; + registrationSame: Boolean | null; + registrationSubDistrictId: string | null; + registrationZipCode: string | null; + createdFullName: string | null; + createdAt: Date; +} + +interface ResponseHistory { + currentAddress: string | null; + currentDistrictId: string | null; + currentProvinceId: string | null; + currentSubDistrictId: string | null; + currentZipCode: string | null; + registrationAddress: string | null; + registrationDistrictId: string | null; + registrationProvinceId: string | null; + registrationSame: string | null; + registrationSubDistrictId: string | null; + registrationZipCode: string | null; + createdFullName: string | null; + createdAt: Date; +} + +export type { ResponseObject, ResponseHistory }; diff --git a/src/modules/05_placement/interface/response/Certificate.ts b/src/modules/05_placement/interface/response/Certificate.ts new file mode 100644 index 000000000..32756682e --- /dev/null +++ b/src/modules/05_placement/interface/response/Certificate.ts @@ -0,0 +1,13 @@ +//ข้อมูล +interface ResponseObject { + id: string; + certificateNo: string; + issuer: string; + issueDate: Date; + expireDate: Date; + certificateType: string; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/modules/05_placement/interface/response/Education.ts b/src/modules/05_placement/interface/response/Education.ts new file mode 100644 index 000000000..7dcd3bdf2 --- /dev/null +++ b/src/modules/05_placement/interface/response/Education.ts @@ -0,0 +1,24 @@ +//ข้อมูล +interface ResponseObject { + id: string; + educationLevel: string; + educationLevelId: string; + positionPath: string; + positionPathId: string; + institute: string; + degree: string; + field: string; + gpa: string; + country: string; + duration: string; + durationYear: number; + other: string; + fundName: string; + finishDate: Date; + startDate: number; + endDate: number; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/modules/05_placement/interface/response/Information.ts b/src/modules/05_placement/interface/response/Information.ts new file mode 100644 index 000000000..ecb93f462 --- /dev/null +++ b/src/modules/05_placement/interface/response/Information.ts @@ -0,0 +1,23 @@ +//ข้อมูล +interface ResponseObject { + birthDate: Date; + bloodGroupId: string | null; + citizenId: string | null; + firstName: string | null; + genderId: string | null; + lastName: string | null; + nationality: string | null; + prefixId: string | null; + race: string | null; + relationshipId: string | null; + religionId: string | null; + telephoneNumber: string | null; + createdFullName: string | null; + createdAt: Date; + age: string | null; + employeeType: string | null; + employeeClass: string | null; + profileType: string | null; +} + +export type { ResponseObject }; diff --git a/src/modules/05_placement/interface/response/Insignia.ts b/src/modules/05_placement/interface/response/Insignia.ts new file mode 100644 index 000000000..d60b4e22d --- /dev/null +++ b/src/modules/05_placement/interface/response/Insignia.ts @@ -0,0 +1,20 @@ +//ข้อมูล +interface ResponseObject { + id: string; + insigniaType: string; + insignia: string; + insigniaId: string; + year: number; + no: string; + issue: string; + volumeNo: string; + volume: string; + section: string; + page: string; + receiveDate: Date; + dateAnnounce: Date; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/modules/05_placement/router.ts b/src/modules/05_placement/router.ts index 0d6745f2f..b59e6fbaf 100644 --- a/src/modules/05_placement/router.ts +++ b/src/modules/05_placement/router.ts @@ -3,8 +3,10 @@ */ const MainSorkorcho = () => import("@/modules/05_placement/components/exams_sorkorcho/Main.vue"); -const MainSorkorkor = () => import("@/modules/05_placement/components/exams_korkor/Main.vue"); const PlacementDetail = () => import("@/modules/05_placement/components/pass/Detail.vue"); +const MainOther = () => import("@/modules/05_placement/components/exams_other/Main.vue"); +const Placement2Detail = () => import("@/modules/05_placement/components/exams_other/Detail.vue"); + export default [ { @@ -17,10 +19,20 @@ export default [ Role: "placement", }, }, + { + path: "/placement/detail", + name: "placementDetail", + component: PlacementDetail, + meta: { + Auth: true, + Key: [7], + Role: "placement", + }, + }, { path: "/placement2", name: "placement2", - component: MainSorkorkor, + component: MainOther, meta: { Auth: true, Key: [7], @@ -28,19 +40,9 @@ export default [ }, }, { - path: "/placement/detail", - name: "placementDetail", - component: PlacementDetail, - meta: { - Auth: true, - Key: [7], - Role: "placement", - }, - }, - { - path: "/placement/detail", - name: "placementDetail", - component: PlacementDetail, + path: "/placement2/detail", + name: "placement2Detail", + component: Placement2Detail, meta: { Auth: true, Key: [7], diff --git a/src/modules/05_placement/store.ts b/src/modules/05_placement/store.ts index cbe54a598..122c3daec 100644 --- a/src/modules/05_placement/store.ts +++ b/src/modules/05_placement/store.ts @@ -1,8 +1,83 @@ import { defineStore } from "pinia"; import { ref } from "vue"; import type { FormPlacementMainData } from "@/modules/05_placement/interface/request/Main" -export const useProfileDataStore = defineStore("placement", () => { - return {}; + +export const useProfileDataStore = defineStore("profile", () => { + interface profile { + main: { columns: String[] }; + education: { 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: [] }, + 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 == "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, + }; }); export const usePlacementDataStore = defineStore("placement", () => { interface placement {