diff --git a/src/components/information/Address.vue b/src/components/information/Address.vue new file mode 100644 index 000000000..525e7ad64 --- /dev/null +++ b/src/components/information/Address.vue @@ -0,0 +1,873 @@ + + diff --git a/src/components/information/Assessment.vue b/src/components/information/Assessment.vue new file mode 100644 index 000000000..981e8cc44 --- /dev/null +++ b/src/components/information/Assessment.vue @@ -0,0 +1,981 @@ + + + + diff --git a/src/components/information/Certicate.vue b/src/components/information/Certicate.vue new file mode 100644 index 000000000..1de0eea25 --- /dev/null +++ b/src/components/information/Certicate.vue @@ -0,0 +1,829 @@ + + + + diff --git a/src/components/information/Coin.vue b/src/components/information/Coin.vue new file mode 100644 index 000000000..8e676419e --- /dev/null +++ b/src/components/information/Coin.vue @@ -0,0 +1,840 @@ + + + + diff --git a/src/components/information/DialogFooter.vue b/src/components/information/DialogFooter.vue new file mode 100644 index 000000000..c7b6623b4 --- /dev/null +++ b/src/components/information/DialogFooter.vue @@ -0,0 +1,135 @@ + + diff --git a/src/components/information/DialogHeader.vue b/src/components/information/DialogHeader.vue new file mode 100644 index 000000000..8aa03351d --- /dev/null +++ b/src/components/information/DialogHeader.vue @@ -0,0 +1,27 @@ + + diff --git a/src/components/information/DialogHistory.vue b/src/components/information/DialogHistory.vue new file mode 100644 index 000000000..7c08e3043 --- /dev/null +++ b/src/components/information/DialogHistory.vue @@ -0,0 +1,45 @@ + + diff --git a/src/components/information/Discipline.vue b/src/components/information/Discipline.vue new file mode 100644 index 000000000..493163918 --- /dev/null +++ b/src/components/information/Discipline.vue @@ -0,0 +1,943 @@ + + + + diff --git a/src/components/information/Document.vue b/src/components/information/Document.vue new file mode 100644 index 000000000..0484fbf68 --- /dev/null +++ b/src/components/information/Document.vue @@ -0,0 +1,270 @@ + + diff --git a/src/components/information/Education.vue b/src/components/information/Education.vue new file mode 100644 index 000000000..811f60920 --- /dev/null +++ b/src/components/information/Education.vue @@ -0,0 +1,1566 @@ + + + + diff --git a/src/components/information/Family.vue b/src/components/information/Family.vue new file mode 100644 index 000000000..e2e89fc9a --- /dev/null +++ b/src/components/information/Family.vue @@ -0,0 +1,1511 @@ + + diff --git a/src/components/information/Government.vue b/src/components/information/Government.vue new file mode 100644 index 000000000..30e7a13be --- /dev/null +++ b/src/components/information/Government.vue @@ -0,0 +1,763 @@ + + diff --git a/src/components/information/Image.vue b/src/components/information/Image.vue new file mode 100644 index 000000000..30efcc2a7 --- /dev/null +++ b/src/components/information/Image.vue @@ -0,0 +1,365 @@ + + + diff --git a/src/components/information/Information.vue b/src/components/information/Information.vue new file mode 100644 index 000000000..a8a17d386 --- /dev/null +++ b/src/components/information/Information.vue @@ -0,0 +1,1136 @@ + + diff --git a/src/components/information/Insignia.vue b/src/components/information/Insignia.vue new file mode 100644 index 000000000..8591e027f --- /dev/null +++ b/src/components/information/Insignia.vue @@ -0,0 +1,1343 @@ + + + + diff --git a/src/components/information/Leave.vue b/src/components/information/Leave.vue new file mode 100644 index 000000000..13588c243 --- /dev/null +++ b/src/components/information/Leave.vue @@ -0,0 +1,1270 @@ + + + + diff --git a/src/components/information/OldName.vue b/src/components/information/OldName.vue new file mode 100644 index 000000000..98021b07e --- /dev/null +++ b/src/components/information/OldName.vue @@ -0,0 +1,973 @@ + + + + diff --git a/src/components/information/Other.vue b/src/components/information/Other.vue new file mode 100644 index 000000000..6a360745d --- /dev/null +++ b/src/components/information/Other.vue @@ -0,0 +1,619 @@ + + + diff --git a/src/components/information/Record.vue b/src/components/information/Record.vue new file mode 100644 index 000000000..e6a1f5115 --- /dev/null +++ b/src/components/information/Record.vue @@ -0,0 +1,826 @@ + + + + diff --git a/src/components/information/Salary.vue b/src/components/information/Salary.vue new file mode 100644 index 000000000..4db908a90 --- /dev/null +++ b/src/components/information/Salary.vue @@ -0,0 +1,2070 @@ + + + + diff --git a/src/components/information/SalaryEmployee.vue b/src/components/information/SalaryEmployee.vue new file mode 100644 index 000000000..97856d8eb --- /dev/null +++ b/src/components/information/SalaryEmployee.vue @@ -0,0 +1,2014 @@ + + + + diff --git a/src/components/information/SalaryEmployeeTemp.vue b/src/components/information/SalaryEmployeeTemp.vue new file mode 100644 index 000000000..7e2be28a6 --- /dev/null +++ b/src/components/information/SalaryEmployeeTemp.vue @@ -0,0 +1,2044 @@ + + + + diff --git a/src/components/information/Table.vue b/src/components/information/Table.vue new file mode 100644 index 000000000..387fc9069 --- /dev/null +++ b/src/components/information/Table.vue @@ -0,0 +1,215 @@ + + + diff --git a/src/components/information/TableProfile.vue b/src/components/information/TableProfile.vue new file mode 100644 index 000000000..df25354eb --- /dev/null +++ b/src/components/information/TableProfile.vue @@ -0,0 +1,694 @@ + + + diff --git a/src/components/information/Talent.vue b/src/components/information/Talent.vue new file mode 100644 index 000000000..607eee424 --- /dev/null +++ b/src/components/information/Talent.vue @@ -0,0 +1,683 @@ + + + diff --git a/src/components/information/Train.vue b/src/components/information/Train.vue new file mode 100644 index 000000000..d85fb0b5c --- /dev/null +++ b/src/components/information/Train.vue @@ -0,0 +1,1128 @@ + + + + diff --git a/src/components/information/Work.vue b/src/components/information/Work.vue new file mode 100644 index 000000000..a27025825 --- /dev/null +++ b/src/components/information/Work.vue @@ -0,0 +1,907 @@ + + + + diff --git a/src/components/information/interface/index/Main.ts b/src/components/information/interface/index/Main.ts new file mode 100644 index 000000000..fe165e2b9 --- /dev/null +++ b/src/components/information/interface/index/Main.ts @@ -0,0 +1,84 @@ +import type { zipCodeOption } from "../../components/profileType"; +interface Pagination { + rowsPerPage: number; +} + +interface DataOption { + id: string; + name: string; + disable?: boolean; +} + +interface DataOptionLeave { + id: string; + name: string; + totalLeave: number; +} + +interface DataOptionInsignia { + id: string; + name: string; + typeName: string; +} + +interface treeTab { + id: string; + label: string; + children: treeTab[]; +} + +interface InformationOps { + prefixOps: DataOption[]; + prefixOldOps: DataOption[]; + genderOps: DataOption[]; + bloodOps: DataOption[]; + statusOps: DataOption[]; + religionOps: DataOption[]; + employeeClassOps: DataOption[]; + employeeTypeOps: DataOption[]; +} + +interface OldNameOps { + prefixOps: DataOption[]; + statusOps: DataOption[]; +} + +interface AddressOps { + provinceOps: DataOption[]; + districtOps: DataOption[]; + districtCOps: DataOption[]; + subdistrictOps: zipCodeOption[]; + subdistrictCOps: zipCodeOption[]; +} + +interface FamilyOps { + prefixOps: DataOption[]; +} + +interface EduOps { + levelOptions: DataOption[]; + positionPathOptions: DataOption[]; +} + +interface InsigniaOps { + insigniaOptions: DataOptionInsignia[]; +} + +interface DisciplineOps { + levelOptions: DataOption[]; +} + +export type { + Pagination, + DataOption, + DataOptionInsignia, + treeTab, + InformationOps, + OldNameOps, + AddressOps, + FamilyOps, + EduOps, + InsigniaOps, + DisciplineOps, + DataOptionLeave, +}; diff --git a/src/components/information/interface/profileType.ts b/src/components/information/interface/profileType.ts new file mode 100644 index 000000000..ab3b28b22 --- /dev/null +++ b/src/components/information/interface/profileType.ts @@ -0,0 +1,187 @@ +//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 | null; + 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; + citizenIdC: string | null; + liveC: string | null; + prefixM: string | null; // male + prefixIdM: string | null; + firstnameM: string | null; + lastnameM: string | null; + occupationM: string | null; + citizenIdM: string | null; + liveM: string | null; + prefixF: string | null; // female + prefixIdF: string | null; + firstnameF: string | null; + lastnameF: string | null; + occupationF: string | null; + citizenIdF: string | null; + liveF: 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; + positionPathSide: string | null; + positionLine: string | null; + positionType: string | null; + positionLevel: string | null; + numberId: string | null; + positionExecutive: string | null; + positionExecutiveSide: 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; + name: string; + zipCode?: string; +} + +interface zipCodeOption { + id: string; + name: string; + zipCode: string; +} + +const defaultGoverment: Goverment = { + ocId: null, + positionId: null, + positionPathSide: null, + positionLine: null, + positionType: null, + positionLevel: null, + numberId: null, + positionExecutive: null, + positionExecutiveSide: 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: null, + 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, + citizenIdC: null, + liveC: "1", + prefixM: null, + prefixIdM: null, + firstnameM: null, + lastnameM: null, + occupationM: null, + citizenIdM: null, + liveM: "1", + prefixF: null, + prefixIdF: null, + firstnameF: null, + lastnameF: null, + occupationF: null, + citizenIdF: null, + liveF: "1", + same: "0", + childrens: [], +}; + +export { defaultInformation, defaultFamily, defaultAddress, defaultGoverment }; +export type { + ChangeActive, + Information, + Family, + Address, + Goverment, + DataOption, + zipCodeOption, +}; diff --git a/src/components/information/interface/request/Address.ts b/src/components/information/interface/request/Address.ts new file mode 100644 index 000000000..f8cff7753 --- /dev/null +++ b/src/components/information/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/components/information/interface/request/Assessment.ts b/src/components/information/interface/request/Assessment.ts new file mode 100644 index 000000000..58bcb2a51 --- /dev/null +++ b/src/components/information/interface/request/Assessment.ts @@ -0,0 +1,34 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + point1Total: number; + point1: number; + point2Total: number; + point2: number; + pointSumTotal: number; + pointSum: number; + name: string; + date: 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/components/information/interface/request/Certificate.ts b/src/components/information/interface/request/Certificate.ts new file mode 100644 index 000000000..a1df312c3 --- /dev/null +++ b/src/components/information/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/components/information/interface/request/Coin.ts b/src/components/information/interface/request/Coin.ts new file mode 100644 index 000000000..583338641 --- /dev/null +++ b/src/components/information/interface/request/Coin.ts @@ -0,0 +1,31 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + issuer: string; + detail: string; + issueDate: Date; + refCommandNo: string; + refCommandDate: Date | null; + 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/components/information/interface/request/Discipline.ts b/src/components/information/interface/request/Discipline.ts new file mode 100644 index 000000000..0cc0906c7 --- /dev/null +++ b/src/components/information/interface/request/Discipline.ts @@ -0,0 +1,32 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + level: string; + detail: string; + unStigma: string; + refCommandNo: string; + refCommandDate: Date | null; + date: 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/components/information/interface/request/Document.ts b/src/components/information/interface/request/Document.ts new file mode 100644 index 000000000..9e1c21855 --- /dev/null +++ b/src/components/information/interface/request/Document.ts @@ -0,0 +1,19 @@ +//ข้อมูล +interface RequestItemsObject { + name: String; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns }; diff --git a/src/components/information/interface/request/Education.ts b/src/components/information/interface/request/Education.ts new file mode 100644 index 000000000..28624d8d2 --- /dev/null +++ b/src/components/information/interface/request/Education.ts @@ -0,0 +1,45 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + level: string; + levelId: string; + positionPath: string; + isEducation: boolean; + institute: string; + degree: string; + field: string; + gpa: string; + country: string; + duration: string; + durationYear: number; + other: string; + fundName: string; + isDate: string | null; + finishDate: Date; + startDate: number; + endDate: number; + startDate2: Date; + endDate2: 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/components/information/interface/request/Family.ts b/src/components/information/interface/request/Family.ts new file mode 100644 index 000000000..334f2e81b --- /dev/null +++ b/src/components/information/interface/request/Family.ts @@ -0,0 +1,29 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + date: Date; + status: string; + level: string; + refNo: string; + refDate: 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/components/information/interface/request/Government.ts b/src/components/information/interface/request/Government.ts new file mode 100644 index 000000000..3ef47a218 --- /dev/null +++ b/src/components/information/interface/request/Government.ts @@ -0,0 +1,55 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + date: Date; + status: string; + level: string; + refNo: string; + refDate: Date; +} + +interface RequestItemsHistoryObject { + oc: string | null; + position: string | null; + positionPathSide: string | null; + posNo: string | null; + positionLine: string | null; + positionType: string | null; + positionLevel: string | null; + positionExecutive: string | null; + positionExecutiveSide: string | null; + dateAppoint: Date; + dateStart: Date; + retireDate: string | null; + govAge: string | null; + govAgeAbsent: string | null; + govAgePlus: string | null; + reasonSameDate: 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/components/information/interface/request/Information.ts b/src/components/information/interface/request/Information.ts new file mode 100644 index 000000000..39aac0621 --- /dev/null +++ b/src/components/information/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/components/information/interface/request/Insignia.ts b/src/components/information/interface/request/Insignia.ts new file mode 100644 index 000000000..f017b879d --- /dev/null +++ b/src/components/information/interface/request/Insignia.ts @@ -0,0 +1,40 @@ +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; + refCommandNo: string; + refCommandDate: Date | null; + 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/components/information/interface/request/Leave.ts b/src/components/information/interface/request/Leave.ts new file mode 100644 index 000000000..9693d517c --- /dev/null +++ b/src/components/information/interface/request/Leave.ts @@ -0,0 +1,42 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + typeLeave: string; + dateStartLeave: Date; + dateEndLeave: Date; + numLeave: number; + sumLeave: number; + totalLeave: number; + status: string; + reason: string; + typeLeaveId: string; +} + +//ข้อมูล +interface RequestItemsTotalObject { + typeLeaveId: string; + typeLeave: string; + totalLeave: number; + limitLeave: string; + remainLeave: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps, RequestItemsTotalObject }; diff --git a/src/components/information/interface/request/Main.ts b/src/components/information/interface/request/Main.ts new file mode 100644 index 000000000..9cf5c79b9 --- /dev/null +++ b/src/components/information/interface/request/Main.ts @@ -0,0 +1,49 @@ +//ข้อมูล +interface RequestItemsObject { + id: number; + fullname: String; + fullnameOld: String; + avatar: String; + citizenId: String; + oc: String; + position: String; + positionPathSide: String; + numberPosition: String | null; + positionLine: String; + positionType: String; + govAge: number; + positionLevel: String; + positionExecutive: String | null; + positionExecutiveSide: String | null; + refSalary: String; + positionEmployeePosition: String | null; + positionEmployeePositionSide: String | null; + positionEmployeeLevel: String | null; + positionEmployeeGroup: String | null; + dateAppoint: Date | string | null; + dateStart: Date | string | null; + createdAt: Date | string | null; + salaryDate: Date | string | null; + leaveReason: String; + age: String; + amount: String; + insignia: String; + insigniaLast: String; + isLeave: String; + leaveDateOrder: Date | string | null; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns }; diff --git a/src/components/information/interface/request/OldName.ts b/src/components/information/interface/request/OldName.ts new file mode 100644 index 000000000..0fde7fa45 --- /dev/null +++ b/src/components/information/interface/request/OldName.ts @@ -0,0 +1,32 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + prefix: string; + prefixId: string; + firstName: string; + lastName: string; + status: string; + file: string | null; + 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/components/information/interface/request/Other.ts b/src/components/information/interface/request/Other.ts new file mode 100644 index 000000000..90339caaa --- /dev/null +++ b/src/components/information/interface/request/Other.ts @@ -0,0 +1,28 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + date: Date; + detail: 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/components/information/interface/request/Record.ts b/src/components/information/interface/request/Record.ts new file mode 100644 index 000000000..b40baaf49 --- /dev/null +++ b/src/components/information/interface/request/Record.ts @@ -0,0 +1,31 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + date: Date; + detail: string; + reference: string; + refCommandNo: string; + refCommandDate: Date | null; + 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/components/information/interface/request/Salary.ts b/src/components/information/interface/request/Salary.ts new file mode 100644 index 000000000..2f3977809 --- /dev/null +++ b/src/components/information/interface/request/Salary.ts @@ -0,0 +1,90 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +interface DataPropsEmployee { + row: RequestItemsEmployee; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + date: Date; + amount: number; + positionSalaryAmount: number; + mouthSalaryAmount: number; + oc: string; + ocId: string; + position: string; + positionId: string; + posNo: string; + posNoId: string; + positionLine: string; + positionLineId: string; + positionPathSide: string; + positionPathSideId: string; + positionType: string; + positionTypeId: string; + positionLevel: string; + positionLevelId: string; + positionExecutive: string; + positionExecutiveId: string; + positionExecutiveSide: string; + positionExecutiveSideId: string; + salaryClass: string; + salaryRef: string; + refCommandNo: string; + // refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +interface RequestItemsEmployee { + amount: number; + createdAt: Date; + createdFullName: string; + date: Date; + id: string; + mouthSalaryAmount: number; + oc: string | null; + ocId: string; + posNo: string | null; + posNoId: string | null; + posNoEmployee: string | null; + positionEmployeeGroup: string | null; + positionEmployeeGroupId: string | null; + positionEmployeeLevel: string | null; + positionEmployeeLevelId: string | null; + positionEmployeePosition: string | null; + positionEmployeePositionId: string | null; + positionEmployeePositionSide: string | null; + positionEmployeePositionSideId: string | null; + positionSalaryAmount: number; + salaryClass: string | null; + salaryRef: string | null; + refCommandNo: string; + // refCommandDate: Date | null; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { + RequestItemsObject, + Columns, + DataProps, + RequestItemsEmployee, + DataPropsEmployee, +}; diff --git a/src/components/information/interface/request/Talent.ts b/src/components/information/interface/request/Talent.ts new file mode 100644 index 000000000..b66341543 --- /dev/null +++ b/src/components/information/interface/request/Talent.ts @@ -0,0 +1,30 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + field: string; + detail: string; + remark: string; + reference: 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/components/information/interface/request/Train.ts b/src/components/information/interface/request/Train.ts new file mode 100644 index 000000000..6f0956578 --- /dev/null +++ b/src/components/information/interface/request/Train.ts @@ -0,0 +1,36 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + name: string; + topic: string; + yearly: number; + place: string; + duration: string; + department: string; + numberOrder: string; + dateOrder: Date; + startDate: Date; + endDate: 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/components/information/interface/request/Work.ts b/src/components/information/interface/request/Work.ts new file mode 100644 index 000000000..58d2730cd --- /dev/null +++ b/src/components/information/interface/request/Work.ts @@ -0,0 +1,32 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + dateStart: Date; + dateEnd: Date; + detail: string; + reference: string; + refCommandNo: string; + refCommandDate: Date | null; + 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/components/information/interface/response/Address.ts b/src/components/information/interface/response/Address.ts new file mode 100644 index 000000000..8769bd1b4 --- /dev/null +++ b/src/components/information/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/components/information/interface/response/Assessment.ts b/src/components/information/interface/response/Assessment.ts new file mode 100644 index 000000000..af1f8598a --- /dev/null +++ b/src/components/information/interface/response/Assessment.ts @@ -0,0 +1,16 @@ +//ข้อมูล +interface ResponseObject { + id: string; + point1Total: number; + point1: number; + point2Total: number; + point2: number; + pointSumTotal: number; + pointSum: number; + name: string; + date: Date; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Certificate.ts b/src/components/information/interface/response/Certificate.ts new file mode 100644 index 000000000..32756682e --- /dev/null +++ b/src/components/information/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/components/information/interface/response/Coin.ts b/src/components/information/interface/response/Coin.ts new file mode 100644 index 000000000..578dcbb5e --- /dev/null +++ b/src/components/information/interface/response/Coin.ts @@ -0,0 +1,13 @@ +//ข้อมูล +interface ResponseObject { + id: string; + issuer: string; + detail: string; + issueDate: Date; + refCommandNo: string; + refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Discipline.ts b/src/components/information/interface/response/Discipline.ts new file mode 100644 index 000000000..bb6ca4262 --- /dev/null +++ b/src/components/information/interface/response/Discipline.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseObject { + id: string; + level: string; + detail: string; + unStigma: string; + refCommandNo: string; + refCommandDate: Date; + date: Date; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Document.ts b/src/components/information/interface/response/Document.ts new file mode 100644 index 000000000..4365fe380 --- /dev/null +++ b/src/components/information/interface/response/Document.ts @@ -0,0 +1,6 @@ +//ข้อมูล +interface ResponseObject { + name: String; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Education.ts b/src/components/information/interface/response/Education.ts new file mode 100644 index 000000000..86bda975c --- /dev/null +++ b/src/components/information/interface/response/Education.ts @@ -0,0 +1,27 @@ +//ข้อมูล +interface ResponseObject { + id: string; + educationLevel: string; + educationLevelId: string; + positionPath: string; + isEducation: boolean; + institute: string; + degree: string; + field: string; + gpa: string; + country: string; + duration: string; + durationYear: number; + other: string; + fundName: string; + isDate: string | null; + finishDate: Date; + startDate: number; + endDate: number; + startDate2: Date; + endDate2: Date; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Family.ts b/src/components/information/interface/response/Family.ts new file mode 100644 index 000000000..04dc4b363 --- /dev/null +++ b/src/components/information/interface/response/Family.ts @@ -0,0 +1,64 @@ +//ข้อมูล +interface ResponseObject { + couple: Boolean | null; + couplePrefixId: string | null; + coupleFirstName: string | null; + coupleLastName: string | null; + coupleLastNameOld: string | null; + coupleCareer: string | null; + coupleLive: Boolean | null; + coupleCitizenId: string | null; + fatherPrefixId: string | null; + fatherFirstName: string | null; + fatherLastName: string | null; + fatherCareer: string | null; + fatherLive: Boolean | null; + fatherCitizenId: string | null; + motherPrefixId: string | null; + motherFirstName: string | null; + motherLastName: string | null; + motherCareer: string | null; + motherLive: Boolean | null; + motherCitizenId: string | null; + createdFullName: string | null; + createdAt: Date; + childrens: childrenFamily[]; +} + +interface ResponseHistory { + couple: string | null; + couplePrefixId: string | null; + coupleFirstName: string | null; + coupleLastName: string | null; + coupleLastNameOld: string | null; + coupleCareer: string | null; + coupleLive: string | null; + coupleCitizenId: string | null; + fatherPrefixId: string | null; + fatherFirstName: string | null; + fatherLastName: string | null; + fatherCareer: string | null; + fatherLive: string | null; + fatherCitizenId: string | null; + motherPrefixId: string | null; + motherFirstName: string | null; + motherLastName: string | null; + motherCareer: string | null; + motherLive: string | null; + motherCitizenId: string | null; + createdFullName: string | null; + createdAt: Date; + childrens: childrenFamily[]; +} + +interface childrenFamily { + id: string; + childrenPrefixId: string | null; + childrenFirstName: string | null; + childrenLastName: string | null; + childrenCareer: string | null; + childrenLive: string | null; + childrenCitizenId: string | null; +} + +export type { ResponseObject, childrenFamily, ResponseHistory }; diff --git a/src/components/information/interface/response/Government.ts b/src/components/information/interface/response/Government.ts new file mode 100644 index 000000000..69a4ef3aa --- /dev/null +++ b/src/components/information/interface/response/Government.ts @@ -0,0 +1,23 @@ +//ข้อมูล +interface ResponseObject { + oc: string | null; + positionExecutive: string | null; + positionExecutiveSide: string | null; + dateAppoint: Date | string; + dateStart: Date | string; + govAge: string | null; + govAgeAbsent: number | null; + govAgePlus: number | null; + positionLevel: string | null; + posNo: string | null; + position: string | null; + positionPathSide: string | null; + retireDate: string | null; + positionType: string | null; + positionLine: string | null; + createdFullName: string | null; + createdAt: Date; + reasonSameDate: string | null; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Information.ts b/src/components/information/interface/response/Information.ts new file mode 100644 index 000000000..cd0008734 --- /dev/null +++ b/src/components/information/interface/response/Information.ts @@ -0,0 +1,24 @@ +//ข้อมูล +interface ResponseObject { + changeName: boolean | null; + 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/components/information/interface/response/Insignia.ts b/src/components/information/interface/response/Insignia.ts new file mode 100644 index 000000000..4d26152a0 --- /dev/null +++ b/src/components/information/interface/response/Insignia.ts @@ -0,0 +1,22 @@ +//ข้อมูล +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; + refCommandNo: string; + refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Leave.ts b/src/components/information/interface/response/Leave.ts new file mode 100644 index 000000000..f5eb18b13 --- /dev/null +++ b/src/components/information/interface/response/Leave.ts @@ -0,0 +1,22 @@ +//ข้อมูล +interface ResponseObject { + id: string; + typeLeave: string; + dateStartLeave: Date; + dateEndLeave: Date; + numLeave: number; + sumLeave: number; + totalLeave: number; + status: string; + reason: string; + typeLeaveId: string; +} +interface ResponseTotalObject { + typeLeaveId: string; + typeLeave: string; + totalLeave: number; + limitLeave: string; + remainLeave: string; +} + +export type { ResponseObject, ResponseTotalObject }; diff --git a/src/components/information/interface/response/Main.ts b/src/components/information/interface/response/Main.ts new file mode 100644 index 000000000..28d372484 --- /dev/null +++ b/src/components/information/interface/response/Main.ts @@ -0,0 +1,37 @@ +//ข้อมูล +interface ResponseObject { + id: number; + fullname: String; + fullnameOld: String; + avatar: String; + citizenId: String; + oc: String; + position: String; + positionPathSide: String; + posNo: String | null; + posNoEmployee: String | null; + positionLine: String; + positionType: String; + govAge: number; + positionLevel: String; + positionExecutive: String | null; + positionExecutiveSide: String | null; + refSalary: String; + positionEmployeePosition: String | null; + positionEmployeePositionSide: String | null; + positionEmployeeLevel: String | null; + positionEmployeeGroup: String | null; + dateAppoint: Date | null; + dateStart: Date | null; + createdAt: Date | null; + salaryDate: Date | null; + leaveReason: string; + age: String; + amount: String; + insignia: String; + insigniaLast: String; + isLeave: boolean; + leaveDateOrder: Date | null; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/OldName.ts b/src/components/information/interface/response/OldName.ts new file mode 100644 index 000000000..f908976a1 --- /dev/null +++ b/src/components/information/interface/response/OldName.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseObject { + id: string; + prefix: string; + prefixId: string; + firstName: string; + lastName: string; + status: string; + file: string | null; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Other.ts b/src/components/information/interface/response/Other.ts new file mode 100644 index 000000000..7bce7e100 --- /dev/null +++ b/src/components/information/interface/response/Other.ts @@ -0,0 +1,10 @@ +//ข้อมูล +interface ResponseObject { + id: string; + date: Date; + detail: string; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Record.ts b/src/components/information/interface/response/Record.ts new file mode 100644 index 000000000..2ed425be7 --- /dev/null +++ b/src/components/information/interface/response/Record.ts @@ -0,0 +1,13 @@ +//ข้อมูล +interface ResponseObject { + id: string; + date: Date; + detail: string; + reference: string; + refCommandNo: string; + refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Salary.ts b/src/components/information/interface/response/Salary.ts new file mode 100644 index 000000000..dbf255081 --- /dev/null +++ b/src/components/information/interface/response/Salary.ts @@ -0,0 +1,61 @@ +//ข้อมูล +interface ResponseObject { + id: string; + date: Date; + amount: number; + positionSalaryAmount: number; + mouthSalaryAmount: number; + oc: string; + ocId: string; + position: string; + positionId: string; + posNo: string; + posNoId: string; + positionLine: string; + positionLineId: string; + positionPathSide: string; + positionPathSideId: string; + positionType: string; + positionTypeId: string; + positionLevel: string; + positionLevelId: string; + positionExecutive: string; + positionExecutiveId: string; + positionExecutiveSide: string; + positionExecutiveSideId: string; + salaryClass: string; + salaryRef: string; + refCommandNo: string; + // refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +interface ResponseObjectEmployee { + amount: number; + createdAt: Date; + createdFullName: string; + date: Date; + id: string; + mouthSalaryAmount: number; + oc: string | null; + ocId: string; + posNo: string | null; + posNoId: string | null; + posNoEmployee: string | null; + positionEmployeeGroup: string | null; + positionEmployeeGroupId: string | null; + positionEmployeeLevel: string | null; + positionEmployeeLevelId: string | null; + positionEmployeePosition: string | null; + positionEmployeePositionId: string | null; + positionEmployeePositionSide: string | null; + positionEmployeePositionSideId: string | null; + positionSalaryAmount: number; + salaryClass: string | null; + salaryRef: string | null; + refCommandNo: string; + // refCommandDate: Date | null; +} + +export type { ResponseObject, ResponseObjectEmployee }; diff --git a/src/components/information/interface/response/Talent.ts b/src/components/information/interface/response/Talent.ts new file mode 100644 index 000000000..35bddad2d --- /dev/null +++ b/src/components/information/interface/response/Talent.ts @@ -0,0 +1,12 @@ +//ข้อมูล +interface ResponseObject { + id: string; + field: string; + detail: string; + remark: string; + reference: string; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Train.ts b/src/components/information/interface/response/Train.ts new file mode 100644 index 000000000..6cd0ebda2 --- /dev/null +++ b/src/components/information/interface/response/Train.ts @@ -0,0 +1,18 @@ +//ข้อมูล +interface ResponseObject { + id: string; + name: string; + topic: string; + yearly: number; + place: string; + duration: string; + department: string; + numberOrder: string; + dateOrder: Date; + startDate: Date; + endDate: Date; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Work.ts b/src/components/information/interface/response/Work.ts new file mode 100644 index 000000000..fb269cf17 --- /dev/null +++ b/src/components/information/interface/response/Work.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseObject { + id: string; + dateStart: Date; + dateEnd: Date; + detail: string; + reference: string; + refCommandNo: string; + refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/store/main.ts b/src/components/information/interface/store/main.ts new file mode 100644 index 000000000..6d0452d09 --- /dev/null +++ b/src/components/information/interface/store/main.ts @@ -0,0 +1,30 @@ +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[] }; +} + +interface DataOption { + id: string; + name: string; + zipCode?: string; +} + +interface Pagination { + rowsPerPage: number; +} + +export type { Profile, DataOption, Pagination }; diff --git a/src/components/information/store/store.ts b/src/components/information/store/store.ts new file mode 100644 index 000000000..7c30f2495 --- /dev/null +++ b/src/components/information/store/store.ts @@ -0,0 +1,70 @@ +import { ref } from "vue"; +import { defineStore } from "pinia"; +import type { Profile } from "@/components/information/interface/store/main"; + +export const useComponentProfileDataStore = defineStore( + "componentProfile", + () => { + const profile = "profile"; + const birthDate = ref(new Date()); + const retireText = ref(null); + 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 changeRetireText = (val: string | null) => { + retireText.value = val; + }; + const changeBirth = (val: Date) => { + birthDate.value = val; + }; + + 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/components/information/top.vue b/src/components/information/top.vue new file mode 100644 index 000000000..416a8f049 --- /dev/null +++ b/src/components/information/top.vue @@ -0,0 +1,199 @@ + + + diff --git a/src/modules/01_metadata/components/Calendar.vue b/src/modules/01_metadata/components/Calendar.vue index b4868aef5..43c1c831d 100644 --- a/src/modules/01_metadata/components/Calendar.vue +++ b/src/modules/01_metadata/components/Calendar.vue @@ -121,7 +121,8 @@ color="red" @click="cancelClick()" label="ยกเลิกแก้ไข" - > - @@ -221,7 +216,6 @@ import type { DataDateListsObject, TabsObject, } from "@/modules/01_metadata/interface/request/Calendar"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ dateYear: { @@ -241,8 +235,6 @@ const props = defineProps({ }, }); -const store = useDataStore(); -const { loaderPage } = store; const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง const { success, diff --git a/src/modules/01_metadata/components/insignia/Insignia.vue b/src/modules/01_metadata/components/insignia/Insignia.vue index 6710add80..fa149da94 100644 --- a/src/modules/01_metadata/components/insignia/Insignia.vue +++ b/src/modules/01_metadata/components/insignia/Insignia.vue @@ -289,7 +289,6 @@ import type { import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/insignia/Insignia"; import type { DataOption } from "@/modules/01_metadata/interface/index/Main"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -298,8 +297,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/insignia/InsigniaType.vue b/src/modules/01_metadata/components/insignia/InsigniaType.vue index ec4d62557..7e4105f79 100644 --- a/src/modules/01_metadata/components/insignia/InsigniaType.vue +++ b/src/modules/01_metadata/components/insignia/InsigniaType.vue @@ -190,7 +190,6 @@ import type { } from "@/modules/01_metadata/interface/request/insignia/InsigniaType"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/insignia/InsigniaType"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -199,8 +198,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/organization/Agency.vue b/src/modules/01_metadata/components/organization/Agency.vue index b6b52f80e..fd9ece75d 100644 --- a/src/modules/01_metadata/components/organization/Agency.vue +++ b/src/modules/01_metadata/components/organization/Agency.vue @@ -190,7 +190,6 @@ import type { } from "@/modules/01_metadata/interface/request/organization/Agency"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/Agency"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -199,8 +198,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/organization/Fax.vue b/src/modules/01_metadata/components/organization/Fax.vue index 11a675e39..0b20d8d82 100644 --- a/src/modules/01_metadata/components/organization/Fax.vue +++ b/src/modules/01_metadata/components/organization/Fax.vue @@ -190,7 +190,6 @@ import type { } from "@/modules/01_metadata/interface/request/organization/Fax"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/Fax"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -199,8 +198,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/organization/GovernmentAgency.vue b/src/modules/01_metadata/components/organization/GovernmentAgency.vue index fef75a7f7..79dd31c96 100644 --- a/src/modules/01_metadata/components/organization/GovernmentAgency.vue +++ b/src/modules/01_metadata/components/organization/GovernmentAgency.vue @@ -190,7 +190,6 @@ import type { } from "@/modules/01_metadata/interface/request/organization/GovernmentAgency"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/GovernmentAgency"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -199,8 +198,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/organization/Level.vue b/src/modules/01_metadata/components/organization/Level.vue index 38b3efe00..df36d79ea 100644 --- a/src/modules/01_metadata/components/organization/Level.vue +++ b/src/modules/01_metadata/components/organization/Level.vue @@ -190,7 +190,6 @@ import type { } from "@/modules/01_metadata/interface/request/organization/Level"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/Level"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -199,8 +198,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/organization/Organization.vue b/src/modules/01_metadata/components/organization/Organization.vue index 4e5b34c58..e88a52e75 100644 --- a/src/modules/01_metadata/components/organization/Organization.vue +++ b/src/modules/01_metadata/components/organization/Organization.vue @@ -202,7 +202,6 @@ import type { } from "@/modules/01_metadata/interface/request/organization/Organization"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/Organization"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -211,8 +210,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/organization/ShortName.vue b/src/modules/01_metadata/components/organization/ShortName.vue index 10d6ade7a..10e543aff 100644 --- a/src/modules/01_metadata/components/organization/ShortName.vue +++ b/src/modules/01_metadata/components/organization/ShortName.vue @@ -243,7 +243,6 @@ import type { } from "@/modules/01_metadata/interface/request/organization/ShortName"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/ShortName"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -252,8 +251,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/organization/Status.vue b/src/modules/01_metadata/components/organization/Status.vue index cb94b07cd..bc875cec7 100644 --- a/src/modules/01_metadata/components/organization/Status.vue +++ b/src/modules/01_metadata/components/organization/Status.vue @@ -190,7 +190,6 @@ import type { } from "@/modules/01_metadata/interface/request/organization/Status"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/Status"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -199,8 +198,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/organization/TelExternal.vue b/src/modules/01_metadata/components/organization/TelExternal.vue index 677bc905a..7873c89f6 100644 --- a/src/modules/01_metadata/components/organization/TelExternal.vue +++ b/src/modules/01_metadata/components/organization/TelExternal.vue @@ -190,7 +190,6 @@ import type { } from "@/modules/01_metadata/interface/request/organization/TelExternal"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/TelExternal"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -199,8 +198,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/organization/TelInternal.vue b/src/modules/01_metadata/components/organization/TelInternal.vue index 61365f3d8..cbe4f7e7a 100644 --- a/src/modules/01_metadata/components/organization/TelInternal.vue +++ b/src/modules/01_metadata/components/organization/TelInternal.vue @@ -190,7 +190,6 @@ import type { } from "@/modules/01_metadata/interface/request/organization/TelInternal"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/TelInternal"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -199,8 +198,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/organization/Type.vue b/src/modules/01_metadata/components/organization/Type.vue index e078fcfe6..bd3883926 100644 --- a/src/modules/01_metadata/components/organization/Type.vue +++ b/src/modules/01_metadata/components/organization/Type.vue @@ -190,7 +190,6 @@ import type { } from "@/modules/01_metadata/interface/request/organization/Type"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/Type"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -199,8 +198,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/person/Blood.vue b/src/modules/01_metadata/components/person/Blood.vue index 96e057c6a..3b7094181 100644 --- a/src/modules/01_metadata/components/person/Blood.vue +++ b/src/modules/01_metadata/components/person/Blood.vue @@ -194,7 +194,6 @@ import type { } from "@/modules/01_metadata/interface/request/person/Blood"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Blood"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -203,8 +202,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/person/District.vue b/src/modules/01_metadata/components/person/District.vue index ec0f5a9e8..440904a37 100644 --- a/src/modules/01_metadata/components/person/District.vue +++ b/src/modules/01_metadata/components/person/District.vue @@ -13,25 +13,20 @@ > กลับ -
การจัดการข้อมูลเขต
- + - +
([]); //list data table const rowsHistory = ref([]); //select data history const rawHistory = ref([]); //raw data history diff --git a/src/modules/01_metadata/components/person/Education.vue b/src/modules/01_metadata/components/person/Education.vue index 7c2499371..b951bdc04 100644 --- a/src/modules/01_metadata/components/person/Education.vue +++ b/src/modules/01_metadata/components/person/Education.vue @@ -191,7 +191,6 @@ import type { } from "@/modules/01_metadata/interface/request/person/Education"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Education"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -200,8 +199,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/person/Gender.vue b/src/modules/01_metadata/components/person/Gender.vue index 2f29725dd..ad3a88fc5 100644 --- a/src/modules/01_metadata/components/person/Gender.vue +++ b/src/modules/01_metadata/components/person/Gender.vue @@ -191,7 +191,6 @@ import type { } from "@/modules/01_metadata/interface/request/person/Gender"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Gender"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -200,8 +199,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/person/Prefix.vue b/src/modules/01_metadata/components/person/Prefix.vue index f3e08a01b..47d43e96a 100644 --- a/src/modules/01_metadata/components/person/Prefix.vue +++ b/src/modules/01_metadata/components/person/Prefix.vue @@ -191,7 +191,6 @@ import type { } from "@/modules/01_metadata/interface/request/person/Prefix"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Prefix"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -200,8 +199,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/person/Province.vue b/src/modules/01_metadata/components/person/Province.vue index 3d30440fa..155d85c66 100644 --- a/src/modules/01_metadata/components/person/Province.vue +++ b/src/modules/01_metadata/components/person/Province.vue @@ -204,7 +204,7 @@ import type { import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Province"; import HistoryTable from "@/components/TableHistory.vue"; import { useRouter } from "vue-router"; -import { useDataStore } from "@/stores/data"; + const props = defineProps({ fetchDataComponent: { type: Function, @@ -212,8 +212,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; //ขึ้นหน้า load ขณะเรียก api const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/person/Relationship.vue b/src/modules/01_metadata/components/person/Relationship.vue index f38aae780..2bc318e44 100644 --- a/src/modules/01_metadata/components/person/Relationship.vue +++ b/src/modules/01_metadata/components/person/Relationship.vue @@ -191,7 +191,6 @@ import type { } from "@/modules/01_metadata/interface/request/person/Relationship"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Relationship"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -200,8 +199,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/person/Religion.vue b/src/modules/01_metadata/components/person/Religion.vue index 302b6084f..4ff8f724e 100644 --- a/src/modules/01_metadata/components/person/Religion.vue +++ b/src/modules/01_metadata/components/person/Religion.vue @@ -191,7 +191,6 @@ import type { } from "@/modules/01_metadata/interface/request/person/Religion"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Religion"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -200,8 +199,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/person/SubDistrict.vue b/src/modules/01_metadata/components/person/SubDistrict.vue index 8b12362b3..7ebd6b9da 100644 --- a/src/modules/01_metadata/components/person/SubDistrict.vue +++ b/src/modules/01_metadata/components/person/SubDistrict.vue @@ -14,19 +14,21 @@ กลับ -
การจัดการข้อมูลแขวง/ตำบล
+
+ การจัดการข้อมูลแขวง/ตำบล +
- - + +
@@ -254,14 +256,13 @@ import type { import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/SubDistrict"; import HistoryTable from "@/components/TableHistory.vue"; import { useRoute, useRouter } from "vue-router"; -import { useDataStore } from "@/stores/data"; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); -const dataStore = useDataStore(); + const { manageData, changeManageColumns, changeManageCurrentTab } = store; -const { loaderPage } = dataStore; //ขึ้นหน้า load ขณะเรียก api + const rows = ref([]); //list data table const rowsHistory = ref([]); //select data history const rawHistory = ref([]); //raw data history diff --git a/src/modules/01_metadata/components/position/Executive.vue b/src/modules/01_metadata/components/position/Executive.vue index e1b406282..7092c58f6 100644 --- a/src/modules/01_metadata/components/position/Executive.vue +++ b/src/modules/01_metadata/components/position/Executive.vue @@ -191,7 +191,6 @@ import type { } from "@/modules/01_metadata/interface/request/position/Executive"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/Executive"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -200,8 +199,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/position/ExecutiveSide.vue b/src/modules/01_metadata/components/position/ExecutiveSide.vue index a601a0d88..1e3ef0106 100644 --- a/src/modules/01_metadata/components/position/ExecutiveSide.vue +++ b/src/modules/01_metadata/components/position/ExecutiveSide.vue @@ -203,7 +203,6 @@ import type { } from "@/modules/01_metadata/interface/request/position/ExecutiveSide"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/ExecutiveSide"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -212,8 +211,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/position/Level.vue b/src/modules/01_metadata/components/position/Level.vue index d9c908026..d72c3cd0d 100644 --- a/src/modules/01_metadata/components/position/Level.vue +++ b/src/modules/01_metadata/components/position/Level.vue @@ -254,7 +254,6 @@ import type { } from "@/modules/01_metadata/interface/request/position/Level"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/Level"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -263,8 +262,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/position/Line.vue b/src/modules/01_metadata/components/position/Line.vue index 71b36a8a7..ebbd22007 100644 --- a/src/modules/01_metadata/components/position/Line.vue +++ b/src/modules/01_metadata/components/position/Line.vue @@ -191,7 +191,6 @@ import type { } from "@/modules/01_metadata/interface/request/position/Line"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/Line"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -200,8 +199,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/position/Path.vue b/src/modules/01_metadata/components/position/Path.vue index ec99114dd..8b32a18e4 100644 --- a/src/modules/01_metadata/components/position/Path.vue +++ b/src/modules/01_metadata/components/position/Path.vue @@ -203,7 +203,6 @@ import type { } from "@/modules/01_metadata/interface/request/position/Path"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/Path"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -212,8 +211,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/position/PathSide.vue b/src/modules/01_metadata/components/position/PathSide.vue index 25f500cfb..60f58c4d2 100644 --- a/src/modules/01_metadata/components/position/PathSide.vue +++ b/src/modules/01_metadata/components/position/PathSide.vue @@ -203,7 +203,6 @@ import type { } from "@/modules/01_metadata/interface/request/position/PathSide"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/PathSide"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -212,8 +211,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/position/Status.vue b/src/modules/01_metadata/components/position/Status.vue index 8c9bd287e..b7552d0cf 100644 --- a/src/modules/01_metadata/components/position/Status.vue +++ b/src/modules/01_metadata/components/position/Status.vue @@ -191,7 +191,6 @@ import type { } from "@/modules/01_metadata/interface/request/position/Status"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/Status"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -200,8 +199,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/position/Type.vue b/src/modules/01_metadata/components/position/Type.vue index 34b069487..ff1dd7eee 100644 --- a/src/modules/01_metadata/components/position/Type.vue +++ b/src/modules/01_metadata/components/position/Type.vue @@ -191,7 +191,6 @@ import type { } from "@/modules/01_metadata/interface/request/position/Type"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/Type"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -200,8 +199,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/positionEmployee/Group.vue b/src/modules/01_metadata/components/positionEmployee/Group.vue index 7d8f70425..2413b12f4 100644 --- a/src/modules/01_metadata/components/positionEmployee/Group.vue +++ b/src/modules/01_metadata/components/positionEmployee/Group.vue @@ -190,7 +190,6 @@ import type { } from "@/modules/01_metadata/interface/request/positionEmployee/Group"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/positionEmployee/Group"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -199,8 +198,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/positionEmployee/Level.vue b/src/modules/01_metadata/components/positionEmployee/Level.vue index e13ba6cdc..6953be8e3 100644 --- a/src/modules/01_metadata/components/positionEmployee/Level.vue +++ b/src/modules/01_metadata/components/positionEmployee/Level.vue @@ -190,7 +190,6 @@ import type { } from "@/modules/01_metadata/interface/request/positionEmployee/Level"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/positionEmployee/Level"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -199,8 +198,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/positionEmployee/Line.vue b/src/modules/01_metadata/components/positionEmployee/Line.vue index 5baf19592..57852b3df 100644 --- a/src/modules/01_metadata/components/positionEmployee/Line.vue +++ b/src/modules/01_metadata/components/positionEmployee/Line.vue @@ -190,7 +190,6 @@ import type { } from "@/modules/01_metadata/interface/request/positionEmployee/Line"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/positionEmployee/Line"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -199,8 +198,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/positionEmployee/Position.vue b/src/modules/01_metadata/components/positionEmployee/Position.vue index fabc8e0b6..c076f80e5 100644 --- a/src/modules/01_metadata/components/positionEmployee/Position.vue +++ b/src/modules/01_metadata/components/positionEmployee/Position.vue @@ -202,7 +202,6 @@ import type { } from "@/modules/01_metadata/interface/request/positionEmployee/Position"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/positionEmployee/Position"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -211,8 +210,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/positionEmployee/PositionSide.vue b/src/modules/01_metadata/components/positionEmployee/PositionSide.vue index 6e5a6bbbb..81d5d9ba1 100644 --- a/src/modules/01_metadata/components/positionEmployee/PositionSide.vue +++ b/src/modules/01_metadata/components/positionEmployee/PositionSide.vue @@ -202,7 +202,6 @@ import type { } from "@/modules/01_metadata/interface/request/positionEmployee/PositionSide"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/positionEmployee/PositionSide"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -211,8 +210,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/components/positionEmployee/Status.vue b/src/modules/01_metadata/components/positionEmployee/Status.vue index 240deb801..b3b358ccc 100644 --- a/src/modules/01_metadata/components/positionEmployee/Status.vue +++ b/src/modules/01_metadata/components/positionEmployee/Status.vue @@ -190,7 +190,6 @@ import type { } from "@/modules/01_metadata/interface/request/positionEmployee/Status"; import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/positionEmployee/Status"; import HistoryTable from "@/components/TableHistory.vue"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ fetchDataComponent: { @@ -199,8 +198,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const mixin = useCounterMixin(); const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); diff --git a/src/modules/01_metadata/views/Main.vue b/src/modules/01_metadata/views/Main.vue index 72230ca57..56a9d318f 100644 --- a/src/modules/01_metadata/views/Main.vue +++ b/src/modules/01_metadata/views/Main.vue @@ -396,7 +396,6 @@ import insigniaType from "@/modules/01_metadata/components/insignia/InsigniaType import { useCounterMixin } from "@/stores/mixin"; import { useManageDataStore } from "@/modules/01_metadata/store"; -import { useDataStore } from "@/stores/data"; import type { DataSumCalendarObject, @@ -409,8 +408,6 @@ const $q = useQuasar(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง const { genColor15, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; //ขึ้นหน้า load ขณะเรียก api const visible = ref(true); //เปิดปิด card สรุปข้อมูล const link = ref(store.manageData.link); //เลือก tab หลัก diff --git a/src/modules/01_metadata/views/MainCalendar.vue b/src/modules/01_metadata/views/MainCalendar.vue index 1240daf0d..1c7b7f887 100644 --- a/src/modules/01_metadata/views/MainCalendar.vue +++ b/src/modules/01_metadata/views/MainCalendar.vue @@ -217,12 +217,8 @@ - @@ -314,12 +310,8 @@ - @@ -335,7 +327,7 @@ import { reactive, ref, watch } from "vue"; import http from "@/plugins/http"; import config from "@/app.config"; import { useQuasar } from "quasar"; -import { useDataStore } from "@/stores/data"; + import { useCounterMixin } from "@/stores/mixin"; import { useManageDataStore } from "@/modules/01_metadata/store"; import type { @@ -354,7 +346,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง const { success, @@ -366,7 +357,7 @@ const { showLoader, hideLoader, } = mixin; -const { loaderPage } = dataStore; //รอโหลด + const store = useManageDataStore(); const $q = useQuasar(); //ใช้ noti quasar const currentTab = ref( diff --git a/src/modules/02_organizational/components/AddMappingPositions.vue b/src/modules/02_organizational/components/AddMappingPositions.vue index 32a3e6c6f..2f531fe58 100644 --- a/src/modules/02_organizational/components/AddMappingPositions.vue +++ b/src/modules/02_organizational/components/AddMappingPositions.vue @@ -432,15 +432,19 @@ import type { DataOption } from "@/modules/02_organizational/interface/index/Mai import HistoryTable from "@/components/TableHistory.vue"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useDataStore } from "@/stores/data"; -import type { QTableProps } from "quasar"; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; +import type { QTableProps } from "quasar"; const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); -const { success, modalConfirm, modalError, modalDelete } = mixin; +const { + success, + modalConfirm, + modalError, + modalDelete, + showLoader, + hideLoader, +} = mixin; const { date2Thai } = mixin; const store = useOrganizationalDataStore(); const { organizationalData, changeOrganizationalColumns } = store; @@ -843,7 +847,7 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => { }); onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchPosition(); await fetchData(); await fetchHistory(); @@ -853,7 +857,7 @@ onMounted(async () => { * ฟังก์ชัน get data ล่าสุด */ const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.getPostionMasterDraft(true)) .then((res) => { @@ -897,7 +901,7 @@ const fetchData = async () => { }) .finally(() => { // updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -905,7 +909,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - // loaderPage(true); + // showLoader(); // await http // .get(config.API.listxxxxxxxxPublishedHistory) // .then((res) => { @@ -937,7 +941,7 @@ const fetchHistory = async () => { // statusCode.value = e.response.data.status; // }) // .finally(async () => { - // loaderPage(false); + // hideLoader(); // }); }; @@ -945,7 +949,7 @@ const fetchHistory = async () => { * get รายการ ตำแหน่ง */ const fetchPosition = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.position) .then((res) => { @@ -1036,7 +1040,7 @@ const fetchPosition = async () => { }) .catch((e: any) => {}) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1185,7 +1189,7 @@ const clickSave = async () => { */ const saveData = async () => { modal.value = false; - loaderPage(true); + showLoader(); await http .post(config.API.getPositionMaster, { positionTypeId: positionTypeId.value, @@ -1218,7 +1222,7 @@ const saveData = async () => { */ const editData = async () => { modal.value = false; - loaderPage(true); + showLoader(); await http .put(config.API.getPositionMasterId(positionMasterId.value), { positionMasterId: positionMasterId.value, @@ -1252,7 +1256,7 @@ const editData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .put(config.API.getPositionMasterSync) .then((res) => { @@ -1265,7 +1269,7 @@ const clearPublishedData = async () => { statusCode.value = e.response.data.status; }) .finally(async () => { - loaderPage(false); + hideLoader(); await fetchHistory(); await fetchData(); }); @@ -1277,7 +1281,7 @@ const clearPublishedData = async () => { */ const publishedData = async () => { // editvisible.value = false; - loaderPage(true); + showLoader(); await http .put(config.API.getPositionMasterPublish) .then((res) => { @@ -1287,7 +1291,7 @@ const publishedData = async () => { statusCode.value = e.response.data.status; }) .finally(async () => { - loaderPage(false); + hideLoader(); await fetchData(); }); }; @@ -1383,7 +1387,7 @@ const clickAdd = () => { * @param row ข้อมูล row ที่ดูประวัติการแก้ไข */ const clickHistory = async (row: RequestItemsObject) => { - loaderPage(true); + showLoader(); await http .get(config.API.getPositionMasterHistoryId(row.id)) .then((res) => { @@ -1427,7 +1431,7 @@ const clickHistory = async (row: RequestItemsObject) => { }) .finally(async () => { modalHistory.value = true; - loaderPage(false); + hideLoader(); }); }; @@ -1470,7 +1474,7 @@ const clickIsActive = async (val: string, status: boolean) => { }) .onOk(async () => { // edit.value = false; - loaderPage(true); + showLoader(); await http .delete(config.API.getPositionMasterId(val) + `?Id=${val}`) .then((res) => { diff --git a/src/modules/02_organizational/components/Tree/MappingPositions.vue b/src/modules/02_organizational/components/Tree/MappingPositions.vue index 5e4889322..a0ce10254 100644 --- a/src/modules/02_organizational/components/Tree/MappingPositions.vue +++ b/src/modules/02_organizational/components/Tree/MappingPositions.vue @@ -374,7 +374,8 @@ import { ref, defineAsyncComponent, watch, onMounted } from "vue"; import { useQuasar, QForm } from "quasar"; import type { PropType } from "vue"; -import { useDataStore } from "@/stores/data"; + +import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; import type { DataOption } from "../../interface/index/Main"; @@ -382,8 +383,9 @@ import type { DataOption } from "../../interface/index/Main"; const ddNoResultMsg = defineAsyncComponent( () => import("@/components/DropDownNoResultMsg.vue") ); //แสดงข้อความเมื่อ Dropdown Filter ไม่เจอข้อมูล -const dataStore = useDataStore(); -const { loaderPage } = dataStore; + +const mixin = useCounterMixin(); +const { showLoader, hideLoader } = mixin; const $q = useQuasar(); // show dialog const emit = defineEmits(["update:positions", "update:formprops"]); const props = defineProps({ @@ -430,12 +432,12 @@ const positionFilter = ref>([]); //for DropDown const position = ref>([]); //for DropDown onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchPositionMaster(); }); const fetchPositionMaster = async () => { - loaderPage(true); + showLoader(); await http // .get(config.API.getPostionMasterDraft(false)) .get(config.API.getPostionMaster(false)) @@ -476,7 +478,7 @@ const fetchPositionMaster = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/02_organizational/components/Tree/OrganizationDialog.vue b/src/modules/02_organizational/components/Tree/OrganizationDialog.vue index a0c3f66f7..506d9e096 100644 --- a/src/modules/02_organizational/components/Tree/OrganizationDialog.vue +++ b/src/modules/02_organizational/components/Tree/OrganizationDialog.vue @@ -333,8 +333,9 @@ import type { GovermentOption, } from "../../interface/index/Main"; import { log } from "console"; -import { useDataStore } from "@/stores/data"; + // import { organizationSet } from "../interface/index/Main"; +import { useCounterMixin } from "@/stores/mixin"; const props = defineProps({ organizprops: Array as PropType, @@ -343,8 +344,9 @@ const props = defineProps({ const emit = defineEmits(["update:organizprops", "update:formprops"]); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; +const mixin = useCounterMixin(); +const { showLoader, hideLoader } = mixin; + const $q = useQuasar(); // show dialog const myForm = ref(null); @@ -381,7 +383,7 @@ const organizationAgencyCode = ref([]); const organizationAgencyCodeFilter = ref([]); onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchOrganizationOri(); await fetchOrganizationAgencyCode(); await fetchOrganizationGovernmentCode(); @@ -400,7 +402,7 @@ onMounted(async () => { * หน่วยงาน */ const fetchOrganizationOri = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organization) .then((res) => { @@ -416,14 +418,14 @@ const fetchOrganizationOri = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * รหัสหน่วยงาน */ const fetchOrganizationAgencyCode = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationCode) .then((res) => { @@ -445,14 +447,14 @@ const fetchOrganizationAgencyCode = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * รหัสส่วนราชการ */ const fetchOrganizationGovernmentCode = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationShortName) .then((res) => { @@ -474,14 +476,14 @@ const fetchOrganizationGovernmentCode = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; // /** // * ชื่อย่อหน่วยงาน // */ // const fetchOrganizationShortName = async () => { -// loaderPage(true); +// showLoader(); // await http // .get(config.API.organizationShortName) // .then((res) => { @@ -503,14 +505,14 @@ const fetchOrganizationGovernmentCode = async () => { // console.log(e); // }) // .finally(() => { -// loaderPage(false); +// hideLoader(); // }); // }; /** * หน่วยงานต้นสังกัด */ const fetchOrganizationAgency = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationHistoryAgency("หน่วยงาน")) .then((res) => { @@ -529,14 +531,14 @@ const fetchOrganizationAgency = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * ส่วนราชการต้นสังกัด */ const fetchOrganizationGovernmentAgency = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationHistoryAgency("ส่วนราชการ")) .then((res) => { @@ -555,14 +557,14 @@ const fetchOrganizationGovernmentAgency = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * ประเภทหน่วยงาน */ const fetchOrganizationType = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationType) .then((res) => { @@ -578,14 +580,14 @@ const fetchOrganizationType = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * ระดับหน่วยงาน */ const fetchOrganizationLevel = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationLevel) .then((res) => { @@ -601,14 +603,14 @@ const fetchOrganizationLevel = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * เบอร์ติดต่อภายใน */ const fetchOrganizationTelInternal = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationTelInternal) .then((res) => { @@ -624,14 +626,14 @@ const fetchOrganizationTelInternal = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * เบอร์ติดต่อภายนอก */ const fetchOrganizationTelExternal = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationTelExternal) .then((res) => { @@ -647,14 +649,14 @@ const fetchOrganizationTelExternal = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * เบอร์โทรสาร */ const fetchOrganizationFax = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationFax) .then((res) => { @@ -670,7 +672,7 @@ const fetchOrganizationFax = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -772,7 +774,7 @@ const addOrganizationItem = async () => { const fetchAgencyCode = async (val: string, item: OrganizaOption) => { let option: GovermentOption[] = []; - loaderPage(true); + showLoader(); await http .get(config.API.organizationGovernmentCode(val)) .then((res) => { @@ -792,14 +794,14 @@ const fetchAgencyCode = async (val: string, item: OrganizaOption) => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); return option; }; const fetchGovernmentCode = async (val: string, item: OrganizaOption) => { let option: GovermentOption[] = []; - loaderPage(true); + showLoader(); await http .get(config.API.organizationAgencyCode(val)) .then((res) => { @@ -819,7 +821,7 @@ const fetchGovernmentCode = async (val: string, item: OrganizaOption) => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); return option; }; diff --git a/src/modules/02_organizational/components/Tree/OrganizationDialogAddEdit.vue b/src/modules/02_organizational/components/Tree/OrganizationDialogAddEdit.vue index eddae0331..383e9a953 100644 --- a/src/modules/02_organizational/components/Tree/OrganizationDialogAddEdit.vue +++ b/src/modules/02_organizational/components/Tree/OrganizationDialogAddEdit.vue @@ -310,9 +310,13 @@ import type { GovermentOption, } from "../../interface/index/Main"; import { log } from "console"; -import { useDataStore } from "@/stores/data"; + import type { EnumStringMember } from "@babel/types"; // import { organizationSet } from "../interface/index/Main"; +import { useCounterMixin } from "@/stores/mixin"; + +const mixin = useCounterMixin(); +const { showLoader, hideLoader } = mixin; const props = defineProps({ organizprops: Object as PropType, @@ -323,8 +327,6 @@ const props = defineProps({ }, }); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const emit = defineEmits(["update:organizprops", "update:formprops"]); const $q = useQuasar(); // show dialog @@ -393,7 +395,7 @@ const organization = ref({ emit("update:organizprops", organization.value); onMounted(async () => { - loaderPage(false); + hideLoader(); // await fillOrgEdit(); //มาแค่ตรง selector(q-select) await fetchOrganizationOri(); // await fetchOrganizationShortName(); @@ -427,7 +429,7 @@ const getClass = (val: boolean) => { * @param node node that you want to edit data */ const fillOrgEdit = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.getOrgDraft(props.org.organizationId)) .then((res) => { @@ -499,7 +501,7 @@ const fillOrgEdit = async () => { console.log(e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); console.log("success"); }; @@ -508,7 +510,7 @@ const fillOrgEdit = async () => { * หน่วยงาน */ const fetchOrganizationOri = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organization) .then((res) => { @@ -524,14 +526,14 @@ const fetchOrganizationOri = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * รหัสหน่วยงาน */ const fetchOrganizationAgencyCode = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationCode) .then((res) => { @@ -553,14 +555,14 @@ const fetchOrganizationAgencyCode = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * รหัสส่วนราชการ */ const fetchOrganizationGovernmentCode = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationShortName) .then((res) => { @@ -585,14 +587,14 @@ const fetchOrganizationGovernmentCode = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; // /** // * ชื่อย่อหน่วยงาน // */ // const fetchOrganizationShortName = async () => { -// loaderPage(true); +// showLoader(); // await http // .get(config.API.organizationShortName) // .then((res) => { @@ -614,14 +616,14 @@ const fetchOrganizationGovernmentCode = async () => { // console.log(e); // }) // .finally(() => { -// loaderPage(false); +// hideLoader(); // }); // }; /** * หน่วยงานต้นสังกัด */ const fetchOrganizationAgency = async () => { - loaderPage(true); + showLoader(); await http // .get(config.API.organizationAgency) .get(config.API.listOrganizationHistoryAgency("หน่วยงาน")) @@ -641,14 +643,14 @@ const fetchOrganizationAgency = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * ส่วนราชการต้นสังกัด */ const fetchOrganizationGovernmentAgency = async () => { - loaderPage(true); + showLoader(); await http // .get(config.API.organizationGovernmentAgency) .get(config.API.listOrganizationHistoryAgency("ส่วนราชการ")) @@ -669,14 +671,14 @@ const fetchOrganizationGovernmentAgency = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * ประเภทหน่วยงาน */ const fetchOrganizationType = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationType) .then((res) => { @@ -692,7 +694,7 @@ const fetchOrganizationType = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -700,7 +702,7 @@ const fetchOrganizationType = async () => { * สถานะหน่วยงาน */ const fetchOrganizationStatus = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationStatus) .then((res) => { @@ -716,7 +718,7 @@ const fetchOrganizationStatus = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -724,7 +726,7 @@ const fetchOrganizationStatus = async () => { * ระดับหน่วยงาน */ const fetchOrganizationLevel = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationLevel) .then((res) => { @@ -740,14 +742,14 @@ const fetchOrganizationLevel = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * เบอร์ติดต่อภายใน */ const fetchOrganizationTelInternal = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationTelInternal) .then((res) => { @@ -763,14 +765,14 @@ const fetchOrganizationTelInternal = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * เบอร์ติดต่อภายนอก */ const fetchOrganizationTelExternal = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationTelExternal) .then((res) => { @@ -786,14 +788,14 @@ const fetchOrganizationTelExternal = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * เบอร์โทรสาร */ const fetchOrganizationFax = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationFax) .then((res) => { @@ -809,13 +811,13 @@ const fetchOrganizationFax = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchAgencyCode = async (val: string, item: OrganizaOption) => { let option: GovermentOption[] = []; - loaderPage(true); + showLoader(); await http .get(config.API.organizationGovernmentCode(val)) .then((res) => { @@ -835,14 +837,14 @@ const fetchAgencyCode = async (val: string, item: OrganizaOption) => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); return option; }; const fetchGovernmentCode = async (val: string, item: OrganizaOption) => { let option: GovermentOption[] = []; - loaderPage(true); + showLoader(); await http .get(config.API.organizationAgencyCode(val)) .then((res) => { @@ -862,7 +864,7 @@ const fetchGovernmentCode = async (val: string, item: OrganizaOption) => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); return option; }; diff --git a/src/modules/02_organizational/views/MainOrgChart.vue b/src/modules/02_organizational/views/MainOrgChart.vue index 6b3b16408..ffdd432d9 100644 --- a/src/modules/02_organizational/views/MainOrgChart.vue +++ b/src/modules/02_organizational/views/MainOrgChart.vue @@ -6,8 +6,13 @@ import config from "@/app.config"; import { OrgChart } from "bma-org-chart"; import "bma-org-chart/org-chart.css"; +import { useCounterMixin } from "@/stores/mixin"; import chartData from "@/assets/orgChartData"; + +const mixin = useCounterMixin(); +const { showLoader, hideLoader } = mixin; + const dataSource = ref(chartData); // const dataSource = ref() // ข้อมูล Chart @@ -21,8 +26,6 @@ const savePDF = () => { chartRef.value.savePDF(); }; -const loader = ref(false); //รอโหลด - onMounted(async () => { await fetchTreeRoot(); await fetchOrgChart(); @@ -32,7 +35,7 @@ onMounted(async () => { * อ่าน Root ของข้อมูลทั้งหมดก่อน */ const fetchTreeRoot = async () => { - loader.value = true; + showLoader(); let urlRequest = config.API.chartGetTreeRoot; await http .get(urlRequest) @@ -45,12 +48,12 @@ const fetchTreeRoot = async () => { console.log(e); }) .finally(() => { - loader.value = false; + hideLoader(); }); }; const fetchOrgChart = async () => { - loader.value = true; + showLoader(); let urlRequest = config.API.chartGetOrg(rootOrgID.value); await http .get(urlRequest) @@ -65,7 +68,7 @@ const fetchOrgChart = async () => { console.log(e); }) .finally(() => { - loader.value = false; + hideLoader(); }); }; @@ -111,7 +114,6 @@ const refreshChart = async (data: any) => {
- diff --git a/src/modules/02_organizational/views/MainTree.vue b/src/modules/02_organizational/views/MainTree.vue index 9d5441556..c81ff4cbe 100644 --- a/src/modules/02_organizational/views/MainTree.vue +++ b/src/modules/02_organizational/views/MainTree.vue @@ -820,7 +820,7 @@ import http from "@/plugins/http"; import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; import type { OrganizaOption } from "../interface/index/Main"; -import { useDataStore } from "@/stores/data"; + // import manageApiErrorMsg from "@/global/user_response_msg"; import HistoryTable from "@/components/TableHistory.vue"; import type { QTableProps } from "quasar"; @@ -857,11 +857,10 @@ const filterHistory = ref(""); //search data table history const modalHistory = ref(false); //modal ประวัติการแก้ไขข้อมูล //Global Variable -const store = useDataStore(); + const mixin = useCounterMixin(); -const { loaderPage } = store; //แสดง load windows ขณะเรียก api -const { success, messageError, dialogMessage } = mixin; +const { success, messageError, dialogMessage, showLoader, hideLoader } = mixin; //Notification Component Variable const $q = useQuasar(); // show dialog @@ -1029,7 +1028,7 @@ const loadJsonTree = async (fileName: string) => { manageApiErrorMsg(e); }) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; @@ -1051,12 +1050,12 @@ const loadFileServer = async (node: any) => { manageApiErrorMsg(e); }) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; const isTreeHasDraft = async () => { - // loaderPage(true); + // showLoader(); let orgHasDraft = false; let orgPoHasDraft = false; await http @@ -1072,7 +1071,7 @@ const isTreeHasDraft = async () => { messageError($q, e); }) .finally(() => { - // loaderPage(false); + // hideLoader(); }); await http @@ -1088,7 +1087,7 @@ const isTreeHasDraft = async () => { messageError($q, e); }) .finally(() => { - // loaderPage(false); + // hideLoader(); }); if (orgHasDraft || orgPoHasDraft) { @@ -1103,7 +1102,7 @@ const isTreeHasDraft = async () => { */ const fetchTreeRoot = async (isDraft: boolean) => { // console.log(isDraft); - loaderPage(true); + showLoader(); console.log("Call API14 GetTreeRoot"); isShowEditTree.value = isDraft; // to show same tree that we fetch let request = ""; @@ -1130,7 +1129,7 @@ const fetchTreeRoot = async (isDraft: boolean) => { // messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); if (isDraft) { // ถ้าไม่ต้องการให้แตก node root on first load ก็ไม่ต้องใส่ // ต้องอยู่ตรงนี้ ถ้าอยู่ตรง .then จะ error คาดว่ามันทำงานก่อนที่ tree จะ render เสร็จ แต่ก็อาจจะไม่ใช่ @@ -1148,7 +1147,7 @@ const fetchTreeRoot = async (isDraft: boolean) => { const fetchChildrenByParentId = async (node: any) => { // console.log(isDraft); console.log("Call API4"); - loaderPage(true); + showLoader(); let request = ""; if (isShowEditTree.value) { request = config.API.getDraftTreeNode(node.organizationId, node.keyId); @@ -1168,12 +1167,12 @@ const fetchChildrenByParentId = async (node: any) => { manageApiErrorMsg(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchPublishFile = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.getPublishFileHistory) .then((res) => { @@ -1191,7 +1190,7 @@ const fetchPublishFile = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -1207,7 +1206,7 @@ const onLazyLoad = (node: any) => { */ console.log("Call LazyLoad"); await fetchChildrenByParentId(node.node); - /** loaderPage(true); + /** showLoader(); let request = ""; if (isShowEditTree.value) { request = config.API.getDraftTreeNode( @@ -1244,7 +1243,7 @@ const onLazyLoad = (node: any) => { // messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); });*/ node.done(node.node.children); //return ค่าให้ q-tree generate children @@ -1299,7 +1298,7 @@ const apiDeleteOrg = () => { // console.log("isShowEditTree", isShowEditTree.value); setTimeout(async () => { //delay for lazyLoad to be able to tricker again - loaderPage(true); + showLoader(); isShowEditTree.value = true; await http .delete(config.API.delTreeOrgDraft(delStructureId.value)) @@ -1318,7 +1317,7 @@ const apiDeleteOrg = () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); await isTreeHasDraft(); }); }, 20); @@ -1347,7 +1346,7 @@ const apiDeletePosition = () => { isShowEditTree.value = false; setTimeout(async () => { //delay for lazyLoad to be able to tricker again - loaderPage(true); + showLoader(); isShowEditTree.value = true; await http .delete(config.API.delTreePositionDraft(delStructureId.value)) @@ -1364,7 +1363,7 @@ const apiDeletePosition = () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); await isTreeHasDraft(); }); }, 20); @@ -1377,7 +1376,7 @@ const apiDeletePosition = () => { * ฟังก์ชัน clear data แบบร่าง */ const deleteDraft = async () => { - loaderPage(true); + showLoader(); await http .put(config.API.delTreeOrgPoDraft) .then((res) => { @@ -1389,7 +1388,7 @@ const deleteDraft = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); router.go(0); await isTreeHasDraft(); }); @@ -1399,7 +1398,7 @@ const deleteDraft = async () => { * ฟังก์ชันเผยแพร่แบบร่าง */ const publishDraft = async () => { - loaderPage(true); + showLoader(); await http .put(config.API.publishOrgPoDraft) .then((res) => { @@ -1425,7 +1424,7 @@ const publishDraft = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); await isTreeHasDraft(); }); }; @@ -1536,7 +1535,7 @@ const addStructure = async (node: any) => { }); // console.log(node.organizationId); console.log("Call API1"); - loaderPage(true); + showLoader(); isShowEditTree.value = true; //ต้องกลับมาแสดง editTree อีกครั้ง & trigger lazyLoad โดย setExpanded await http .post(config.API.addTreeDraft, { @@ -1557,7 +1556,7 @@ const addStructure = async (node: any) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); popupAddOrganization.value = false; await isTreeHasDraft(); @@ -1589,7 +1588,7 @@ const editOrgStructure = async (node: any) => { if (organizCheck == true) { // console.log(node.organizationId); console.log("Call API13"); - loaderPage(true); + showLoader(); isShowEditTree.value = true; //end prepare for tricker LazyLoad await http .put(config.API.editTreeOrgDraft(node.organizationId), { @@ -1629,7 +1628,7 @@ const editOrgStructure = async (node: any) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); popupEditSelectedOrganization.value = false; await isTreeHasDraft(); }); @@ -1655,7 +1654,7 @@ const editPositionStructure = async (node: any) => { if (positionCheck == true) { console.log("Call API3"); - loaderPage(true); + showLoader(); isShowEditTree.value = true; //end prepare for tricker LazyLoad await http .put(config.API.editTreePositionDraft(node.organizationPositionId), { @@ -1680,7 +1679,7 @@ const editPositionStructure = async (node: any) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); popupEditSelectedPosition.value = false; await isTreeHasDraft(); }); @@ -1696,7 +1695,7 @@ const clickHistory = async () => { modalHistory.value = true; // rowsHistory.value = rawHistory.value.filter((f: any) => f.id == row.id); - loaderPage(true); + showLoader(); await http .get(config.API.getTreeHistory) .then((res) => { @@ -1722,7 +1721,7 @@ const clickHistory = async () => { // messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/02_organizational/views/MainTreeEmployee.vue b/src/modules/02_organizational/views/MainTreeEmployee.vue index dd56b1aa5..8278e3329 100644 --- a/src/modules/02_organizational/views/MainTreeEmployee.vue +++ b/src/modules/02_organizational/views/MainTreeEmployee.vue @@ -674,15 +674,13 @@ import type { import type { Pagination } from "@/modules/03_recruiting/interface/index/Main"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useDataStore } from "@/stores/data"; -import type { QTableProps } from "quasar"; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; +import type { QTableProps } from "quasar"; const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); -const { date2Thai, success, modalError, messageError } = mixin; +const { date2Thai, success, modalError, messageError, showLoader, hideLoader } = + mixin; const store = useOrganizationalDataStore(); const { organizationalData, changeOrganizationalColumns } = store; const initialPagination = ref({ @@ -893,7 +891,7 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => { }); onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchOrganization(); await fetchOrganizationAgency(); await fetchOrganizationGovernmentAgency(); @@ -906,7 +904,7 @@ onMounted(async () => { * ฟังก์ชัน get data ล่าสุด */ const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationEmployee) .then((res) => { @@ -1008,7 +1006,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1016,7 +1014,7 @@ const fetchData = async () => { * get รายการ โครงสร้าง */ const fetchOrganization = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationMain) .then((res) => { @@ -1075,7 +1073,7 @@ const fetchOrganization = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1083,7 +1081,7 @@ const fetchOrganization = async () => { * หน่วยงานต้นสังกัด */ const fetchOrganizationAgency = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationHistoryAgency("หน่วยงาน")) .then((res) => { @@ -1102,7 +1100,7 @@ const fetchOrganizationAgency = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1110,7 +1108,7 @@ const fetchOrganizationAgency = async () => { * ส่วนราชการต้นสังกัด */ const fetchOrganizationGovernmentAgency = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationHistoryAgency("ส่วนราชการ")) .then((res) => { @@ -1129,7 +1127,7 @@ const fetchOrganizationGovernmentAgency = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1137,7 +1135,7 @@ const fetchOrganizationGovernmentAgency = async () => { * รหัสหน่วยงาน */ const fetchOrganizationAgencyCode = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationCode) .then((res) => { @@ -1158,13 +1156,13 @@ const fetchOrganizationAgencyCode = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchAgencyCode = async (val: string) => { let option: GovermentOption[] = []; - loaderPage(true); + showLoader(); await http .get(config.API.organizationAgencyCode(val)) .then((res) => { @@ -1184,7 +1182,7 @@ const fetchAgencyCode = async (val: string) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); return option; }; @@ -1193,7 +1191,7 @@ const fetchAgencyCode = async (val: string) => { * get รายการ ตำแหน่ง */ const fetchPosition = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.positionEmployee) .then((res) => { @@ -1285,7 +1283,7 @@ const fetchPosition = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1309,7 +1307,7 @@ const clickSave = async () => { */ const saveData = async () => { modal.value = false; - loaderPage(true); + showLoader(); await http .post(config.API.organizationEmployee, { organizationOrganizationId: organizationOrganizationId.value, @@ -1361,7 +1359,7 @@ const saveData = async () => { */ const editData = async () => { modal.value = false; - loaderPage(true); + showLoader(); await http .put(config.API.organizationEmployeeId(id.value), { organizationOrganizationId: organizationOrganizationId.value, @@ -1426,7 +1424,7 @@ const clickDelete = (id: string) => { }; const deleteData = async (id: string) => { - loaderPage(true); + showLoader(); await http .delete(config.API.organizationEmployeeId(id)) .then((res) => { @@ -1436,7 +1434,7 @@ const deleteData = async (id: string) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); await fetchData(); }); }; diff --git a/src/modules/02_organizational/views/ManageReport2.vue b/src/modules/02_organizational/views/ManageReport2.vue index 7e73944a7..c8a146dc6 100644 --- a/src/modules/02_organizational/views/ManageReport2.vue +++ b/src/modules/02_organizational/views/ManageReport2.vue @@ -108,7 +108,7 @@ import { onMounted, computed, ref, watch } from "vue"; import { useQuasar, QForm } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import { useRouter, useRoute } from "vue-router"; -import { useDataStore } from "@/stores/data"; + import TableReport from "@/modules/02_organizational/components/TableReport.vue"; import type { Columns } from "@/modules/02_organizational/interface/index/Main"; import http from "@/plugins/http"; @@ -116,13 +116,12 @@ import config from "@/app.config"; import type { treeTab } from "@/modules/04_registry/interface/index/Main"; import type { ResponseTree } from "@/modules/02_organizational/interface/response/Mapping"; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); const router = useRouter(); const route = useRoute(); -const { date2Thai, success, dateToISO, modalError } = mixin; +const { date2Thai, success, dateToISO, modalError, showLoader, hideLoader } = + mixin; const filter = ref(""); //search data table const visibleColumns = ref([]); @@ -273,7 +272,7 @@ onMounted(async () => { }); const nodeTree = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.profileOrganizRoot) .then((res: any) => { @@ -292,7 +291,7 @@ const nodeTree = async () => { }) .catch((e: any) => {}) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -306,7 +305,7 @@ const clickTree = () => { }; const onHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.report2HistoryId(selected.value)) .then((res) => { @@ -329,13 +328,13 @@ const onHistory = async () => { ); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; const doSearch = async () => { //ทำไว้แล้ว เหลือ ใส่ type - loaderPage(true); + showLoader(); await http .get(config.API.report2TreeId(selected.value)) .then((res) => { @@ -370,7 +369,7 @@ const doSearch = async () => { }) .catch((e) => {}) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -386,7 +385,7 @@ const onConfirm = async () => { ok: "ยืนยัน", persistent: true, }).onOk(async () => { - loaderPage(true); + showLoader(); await http .get(config.API.report2DoneId(selected.value)) .then((res) => { @@ -394,7 +393,7 @@ const onConfirm = async () => { }) .catch((e) => {}) .finally(async () => { - loaderPage(false); + hideLoader(); await doSearch(); }); }); diff --git a/src/modules/02_organizational/views/ManageReport2Add.vue b/src/modules/02_organizational/views/ManageReport2Add.vue index bb0d3e27b..ea5e8c89a 100644 --- a/src/modules/02_organizational/views/ManageReport2Add.vue +++ b/src/modules/02_organizational/views/ManageReport2Add.vue @@ -574,7 +574,7 @@ import { onMounted, computed, ref, watch } from "vue"; import { useQuasar } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import { useRouter, useRoute } from "vue-router"; -import { useDataStore } from "@/stores/data"; + import TableReport from "@/modules/02_organizational/components/TableReport.vue"; import DialogHeader from "@/modules/02_organizational/components/DialogHeader.vue"; import DialogFooter from "@/modules/02_organizational/components/DialogFooter.vue"; @@ -585,13 +585,11 @@ import type { RequestReport2 } from "@/modules/02_organizational/interface/reque import http from "@/plugins/http"; import config from "@/app.config"; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); const router = useRouter(); const route = useRoute(); -const { date2Thai, success, dateToISO } = mixin; +const { date2Thai, success, dateToISO, showLoader, hideLoader } = mixin; const id = ref(""); const myForm = ref(null); //form data input @@ -669,10 +667,10 @@ const sideWorkOPfilter = ref([]); const levelOPfilter = ref([]); onMounted(async () => { - loaderPage(false); + hideLoader(); if (route.params.id != undefined) { id.value = route.params.id.toString(); - loaderPage(true); + showLoader(); await fetchGoverment(); // await fetchAgency(); @@ -685,12 +683,12 @@ onMounted(async () => { await fetchLevel(); await fetchData(); - loaderPage(false); + hideLoader(); } }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.report2Id(id.value)) .then(async (res) => { @@ -750,7 +748,7 @@ const fetchData = async () => { }) .catch((e) => {}) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -766,7 +764,7 @@ const checkSave = async () => { const saveData = async () => { // console.log(myData.value); - loaderPage(true); + showLoader(); const body: RequestReport2 = { organizationShortNameId: myData.value.goverment2, organizationOrganizationId: myData.value.agency2, @@ -787,7 +785,7 @@ const saveData = async () => { }) .catch((e) => {}) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -797,7 +795,7 @@ const clickBack = () => { //รหัสส่วนราชการ const fetchGoverment = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.organizationShortName) .then((res) => { @@ -823,12 +821,12 @@ const fetchGoverment = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; const updateGoverment = async (id: string) => { - // loaderPage(true); + // showLoader(); await http .get(config.API.getPositionMasterPositionNumberId(id)) .then((res) => { @@ -917,13 +915,13 @@ const updateGoverment = async (id: string) => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; // //ตำแหน่งเลขที่ const fetchPositionNum = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.getPositionMasterPositionNumber) .then((res) => { @@ -937,13 +935,13 @@ const fetchPositionNum = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; //ตำแหน่งประเภท const fetchCategory = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.positionType) .then((res) => { @@ -957,13 +955,13 @@ const fetchCategory = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; //ตำแหน่งทางการบริหาร const fetchPositionManage = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.positionExecutive) .then((res) => { @@ -977,13 +975,13 @@ const fetchPositionManage = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; //ด้านทางบริหาร const fetchSideManage = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.positionExecutiveSide) .then((res) => { @@ -997,13 +995,13 @@ const fetchSideManage = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; //ตำแหน่งในสายงาน const fetchPositionWork = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.positionPath) .then((res) => { @@ -1017,13 +1015,13 @@ const fetchPositionWork = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; //ด้าน/สาขา const fetchSideWork = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.positionSide) .then((res) => { @@ -1037,13 +1035,13 @@ const fetchSideWork = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; //ระดับตำแหน่ง const fetchLevel = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.positionLevel) .then((res) => { @@ -1057,7 +1055,7 @@ const fetchLevel = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; diff --git a/src/modules/02_organizational/views/ManageReport2History.vue b/src/modules/02_organizational/views/ManageReport2History.vue index ae8be4187..89983c82d 100644 --- a/src/modules/02_organizational/views/ManageReport2History.vue +++ b/src/modules/02_organizational/views/ManageReport2History.vue @@ -336,7 +336,7 @@ import { onMounted, ref } from "vue"; import { useCounterMixin } from "@/stores/mixin"; import { useRouter, useRoute } from "vue-router"; import { useQuasar } from "quasar"; -import { useDataStore } from "@/stores/data"; + import http from "@/plugins/http"; import config from "@/app.config"; import type { @@ -344,14 +344,12 @@ import type { ResponseHistoryHead, } from "@/modules/02_organizational/interface/response/Mapping"; -const dataStore = useDataStore(); const $q = useQuasar(); // show dia const mixin = useCounterMixin(); const router = useRouter(); const route = useRoute(); -const { loaderPage } = dataStore; -const { date2Thai, success, dateToISO } = mixin; +const { date2Thai, success, dateToISO, showLoader, hideLoader } = mixin; const id = ref(""); const previous = ref(false); const next = ref(false); @@ -360,7 +358,7 @@ const historyHead = ref([]); const historyData = ref([]); onMounted(async () => { - loaderPage(false); + hideLoader(); if (route.params.id != undefined) { id.value = route.params.id.toString(); @@ -386,7 +384,7 @@ const clickPreviousNext = async (page: string) => { }; const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.report2HistoryId(id.value)) .then((res) => { @@ -402,7 +400,7 @@ const fetchHistory = async () => { }) .catch((e) => {}) .finally(async () => { - loaderPage(false); + hideLoader(); if (historyHead.value.length > 1) { next.value = true; previous.value = false; @@ -414,7 +412,7 @@ const fetchHistory = async () => { }; const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get( config.API.report2HistoryDetailId( @@ -455,7 +453,7 @@ const fetchData = async () => { }) .catch((e) => {}) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/02_organizational/views/Report.vue b/src/modules/02_organizational/views/Report.vue index 4e8b2998a..ccc0d7cc5 100644 --- a/src/modules/02_organizational/views/Report.vue +++ b/src/modules/02_organizational/views/Report.vue @@ -1,116 +1,98 @@ diff --git a/src/modules/03_recruiting/components/Address.vue b/src/modules/03_recruiting/components/Address.vue index 4ee38e840..7d58fa270 100644 --- a/src/modules/03_recruiting/components/Address.vue +++ b/src/modules/03_recruiting/components/Address.vue @@ -245,7 +245,6 @@ import HeaderTop from "@/modules/03_recruiting/components/top.vue"; import { useRoute } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ provinceOptions: { @@ -266,15 +265,14 @@ const route = useRoute(); const candidateId = ref(route.params.candidateId.toString()); const edit = ref(true); const myform = ref({}); -const loader = ref(false); + const districtOptions = ref([]); const districtCOptions = ref([]); const subdistrictOptions = ref([]); const subdistrictCOptions = ref([]); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; + const mixin = useCounterMixin(); -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; const emit = defineEmits(["update:form"]); watch(myform, async (count: any, prevCount: any) => { @@ -319,7 +317,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -362,7 +360,7 @@ const selectSubDistrict = (e: string, name: string) => { }; const fetchDistrict = async (id: string, position: string) => { - loader.value = true; + showLoader(); await http .get(config.API.listDistrict(id)) .then((res) => { @@ -381,12 +379,12 @@ const fetchDistrict = async (id: string, position: string) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchSubDistrict = async (id: string, position: string) => { - loader.value = true; + showLoader(); await http .get(config.API.listSubDistrict(id)) .then((res) => { @@ -409,7 +407,7 @@ const fetchSubDistrict = async (id: string, position: string) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/components/Career.vue b/src/modules/03_recruiting/components/Career.vue index ea833743b..a77a38f83 100644 --- a/src/modules/03_recruiting/components/Career.vue +++ b/src/modules/03_recruiting/components/Career.vue @@ -202,7 +202,6 @@ import Table from "@/modules/03_recruiting/components/TableCan.vue"; import DialogHeader from "@/modules/03_recruiting/components/DialogHeader.vue"; import DialogFooter from "@/modules/03_recruiting/components/DialogFooter.vue"; import { useRoute } from "vue-router"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ status: { @@ -229,7 +228,7 @@ const modalEdit = ref(false); //modal ที่แสดงใช้ส const rawItem = ref(); //ข้อมูลเดิมที่เลือกใน row นั้น const rowIndex = ref(0); //indexข้อมูลเดิมที่เลือกใน row นั้น const previous = ref(); //แสดงปุ่มดูข้อมูลก่อนหน้า -const dataStore = useDataStore(); + const next = ref(); //แสดงปุ่มดูข้อมูลต่อไป const editRow = ref(false); //เช็คมีการแก้ไขข้อมูล const checkValidate = ref(false); //validate data ผ่านหรือไม่ @@ -237,8 +236,8 @@ const route = useRoute(); const candidateId = ref(route.params.candidateId.toString()); const rows = ref([]); const filter = ref(""); //search data table -const { messageError } = mixin; -const { loaderPage } = dataStore; +const { messageError, showLoader, hideLoader } = mixin; + const visibleColumns = ref([]); examData.career.columns.length == 0 @@ -318,7 +317,7 @@ onMounted(async () => { }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateCareer(candidateId.value)) .then((res) => { @@ -336,7 +335,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -415,7 +414,7 @@ const checkDelete = (row: RequestItemsObject) => { */ const clickDeleteRow = async () => { if (rawItem.value != null) { - loaderPage(true); + showLoader(); await http .delete(config.API.candidateAdminCareer(rawItem.value.id)) .then(() => { @@ -451,7 +450,7 @@ const clickSave = async () => { * บันทึกเพิ่มข้อมูล */ const saveData = async () => { - loaderPage(true); + showLoader(); await http .post(config.API.candidateAdminCareer(candidateId.value), { name: location.value, @@ -477,7 +476,7 @@ const saveData = async () => { * บันทึกแก้ไขข้อมูล */ const editData = async () => { - loaderPage(true); + showLoader(); await http .put(config.API.candidateAdminCareer(id.value), { name: location.value, diff --git a/src/modules/03_recruiting/components/Document.vue b/src/modules/03_recruiting/components/Document.vue index 03ab790a9..ff6e9a764 100644 --- a/src/modules/03_recruiting/components/Document.vue +++ b/src/modules/03_recruiting/components/Document.vue @@ -146,7 +146,7 @@ import HeaderTop from "@/modules/03_recruiting/components/top.vue"; import http from "@/plugins/http"; import config from "@/app.config"; import { useRoute } from "vue-router"; -import { useDataStore } from "@/stores/data"; + import type { UploadType } from "@/modules/03_recruiting/interface/index/Main"; import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; @@ -161,14 +161,13 @@ const $q = useQuasar(); const route = useRoute(); const candidateId = ref(route.params.candidateId.toString()); const uploader = ref(); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; + const edit = ref(props.status == "checkRegister"); const name = ref(""); const files = ref([]); const file = ref([]); const mixin = useCounterMixin(); -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; onMounted(async () => { await getData(); @@ -180,7 +179,7 @@ const fileAdd = async (val: any) => { }; const getData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateUpload(candidateId.value)) .then((res) => { @@ -191,7 +190,7 @@ const getData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -199,7 +198,7 @@ const deleteData = async (id: string) => { const params = { documentId: id, }; - loaderPage(true); + showLoader(); await http .delete(config.API.candidateUpload(candidateId.value), { params, @@ -211,7 +210,7 @@ const deleteData = async (id: string) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); await getData(); }); }; @@ -223,7 +222,7 @@ const uploadData = async () => { }); const formData = new FormData(); formData.append("", newFile); - loaderPage(true); + showLoader(); await http .put(config.API.candidateUpload(candidateId.value), formData) .then((res) => { @@ -233,7 +232,7 @@ const uploadData = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); name.value = ""; uploader.value.reset(); await getData(); diff --git a/src/modules/03_recruiting/components/Education.vue b/src/modules/03_recruiting/components/Education.vue index b7f73f24e..c55d7a4bf 100644 --- a/src/modules/03_recruiting/components/Education.vue +++ b/src/modules/03_recruiting/components/Education.vue @@ -193,7 +193,7 @@ import { useQuasar } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useDataStore } from "@/stores/data"; + import { useExamDataStore } from "@/modules/03_recruiting/store"; import type { RequestItemsObject, @@ -238,9 +238,8 @@ const editRow = ref(false); //เช็คมีการแก้ไ const checkValidate = ref(false); //validate data ผ่านหรือไม่ const rows = ref([]); const route = useRoute(); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; -const { messageError } = mixin; + +const { messageError, showLoader, hideLoader } = mixin; const candidateId = ref(route.params.candidateId.toString()); const filter = ref(""); //search data table @@ -324,7 +323,7 @@ onMounted(async () => { }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateEducation(candidateId.value)) .then((res) => { @@ -343,12 +342,12 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetcheducationLevel = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.educationLevel) .then((res) => { @@ -363,7 +362,7 @@ const fetcheducationLevel = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -444,7 +443,7 @@ const checkDelete = (row: RequestItemsObject) => { */ const clickDeleteRow = async () => { if (rawItem.value != null) { - loaderPage(true); + showLoader(); await http .delete(config.API.candidateAdminEducation(rawItem.value.id)) .then(() => { @@ -480,7 +479,7 @@ const clickSave = async () => { * บันทึกเพิ่มข้อมูล */ const saveData = async () => { - loaderPage(true); + showLoader(); await http .post(config.API.candidateAdminEducation(candidateId.value), { educationLevelId: educationLevelId.value, @@ -506,7 +505,7 @@ const saveData = async () => { * บันทึกแก้ไขข้อมูล */ const editData = async () => { - loaderPage(true); + showLoader(); await http .put(config.API.candidateAdminEducation(id.value), { educationLevelId: educationLevelId.value, diff --git a/src/modules/03_recruiting/components/ExamFinished.vue b/src/modules/03_recruiting/components/ExamFinished.vue index 99060e6f1..4deab82d5 100644 --- a/src/modules/03_recruiting/components/ExamFinished.vue +++ b/src/modules/03_recruiting/components/ExamFinished.vue @@ -113,7 +113,7 @@ import { onMounted, ref } from "vue"; import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useDataStore } from "@/stores/data"; + import { useQuasar } from "quasar"; const props = defineProps({ @@ -129,9 +129,8 @@ const props = defineProps({ const $q = useQuasar(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { messageError, date2Thai } = mixin; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; +const { messageError, date2Thai, showLoader, hideLoader } = mixin; + const fullName = ref(""); const examNumber = ref(""); const citizenId = ref(""); @@ -152,7 +151,7 @@ onMounted(async () => { }); const fetchCard = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateCard(props.candidateId)) .then((res) => { @@ -194,7 +193,7 @@ const fetchCard = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/components/Family.vue b/src/modules/03_recruiting/components/Family.vue index 7d0f903d9..6dc72adc8 100644 --- a/src/modules/03_recruiting/components/Family.vue +++ b/src/modules/03_recruiting/components/Family.vue @@ -282,7 +282,7 @@ import { import HeaderTop from "@/modules/03_recruiting/components/top.vue"; import { useRoute } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; -import { useDataStore } from "@/stores/data"; + import { useQuasar } from "quasar"; const props = defineProps({ @@ -300,10 +300,9 @@ const props = defineProps({ }, }); const $q = useQuasar(); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; + const mixin = useCounterMixin(); -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; const edit = ref(true); const myform = ref({}); const route = useRoute(); @@ -324,7 +323,7 @@ onMounted(async () => { }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateFamily(candidateId.value)) .then((res) => { @@ -351,7 +350,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/components/Information.vue b/src/modules/03_recruiting/components/Information.vue index cf1bc5f3c..9c289d913 100644 --- a/src/modules/03_recruiting/components/Information.vue +++ b/src/modules/03_recruiting/components/Information.vue @@ -403,7 +403,6 @@ import HeaderTop from "@/modules/03_recruiting/components/top.vue"; import { useRoute } from "vue-router"; import keycloak from "@/plugins/keycloak"; import { useQuasar } from "quasar"; -import { useDataStore } from "@/stores/data"; const props = defineProps({ prefixOptions: { @@ -438,9 +437,8 @@ const edit = ref(true); const myform = ref({}); const img = ref(""); const fileProfile = ref([]); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; -const { messageError } = mixin; + +const { messageError, showLoader, hideLoader } = mixin; const emit = defineEmits(["update:form"]); @@ -463,7 +461,7 @@ onMounted(async () => { }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateInformation(candidateId.value)) .then((res) => { @@ -494,12 +492,12 @@ const fetchData = async () => { keycloak.tokenParsed == null ? "" : keycloak.tokenParsed.family_name; }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchImgData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateProfile(candidateId.value)) .then((res) => { @@ -510,7 +508,7 @@ const fetchImgData = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -542,7 +540,7 @@ const selectProvince = (val: string) => { }; const fetchDistrict = async (id: string) => { - loaderPage(true); + showLoader(); await http .get(config.API.listDistrict(id)) .then((res) => { @@ -557,7 +555,7 @@ const fetchDistrict = async (id: string) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/components/Occupation.vue b/src/modules/03_recruiting/components/Occupation.vue index fce1b52a6..f80810242 100644 --- a/src/modules/03_recruiting/components/Occupation.vue +++ b/src/modules/03_recruiting/components/Occupation.vue @@ -260,7 +260,7 @@ import { } from "@/modules/03_recruiting/interface/index/Main"; import HeaderTop from "@/modules/03_recruiting/components/top.vue"; import { useRoute } from "vue-router"; -import { useDataStore } from "@/stores/data"; + import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; @@ -280,10 +280,9 @@ const edit = ref(true); const myform = ref({}); const route = useRoute(); const candidateId = ref(route.params.candidateId.toString()); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; + const mixin = useCounterMixin(); -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; const emit = defineEmits(["update:form"]); @@ -300,7 +299,7 @@ onMounted(async () => { }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateOccupation(candidateId.value)) .then((res) => { @@ -327,7 +326,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/components/Profile.vue b/src/modules/03_recruiting/components/Profile.vue index 0d70ca2d0..8914ba286 100644 --- a/src/modules/03_recruiting/components/Profile.vue +++ b/src/modules/03_recruiting/components/Profile.vue @@ -21,7 +21,11 @@
- +
@@ -56,7 +60,7 @@ import Occupation from "@/modules/03_recruiting/components/Occupation.vue"; import Education from "@/modules/03_recruiting/components/Education.vue"; import Career from "@/modules/03_recruiting/components/Career.vue"; import Document from "@/modules/03_recruiting/components/Document.vue"; -import { useDataStore } from "@/stores/data"; + import { useQuasar } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; @@ -84,8 +88,7 @@ const props = defineProps({ }); const $q = useQuasar(); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; + const prefixOptions = ref([]); const relationshipOptions = ref([]); const provinceOptions = ref([]); @@ -94,7 +97,7 @@ const formAddress = ref({}); const formFamily = ref({}); const formOccupation = ref({}); const mixin = useCounterMixin(); -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; const emit = defineEmits([ "update:formInformation", @@ -120,14 +123,14 @@ watch(formOccupation, async (count: Object, prevCount: Object) => { }); onMounted(() => { - loaderPage(false); + hideLoader(); fetchPrefix(); fetchRelationship(); fetchProvince(); }); const fetchPrefix = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.prefix) .then((res) => { @@ -142,12 +145,12 @@ const fetchPrefix = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchRelationship = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.relationship) .then((res) => { @@ -162,12 +165,12 @@ const fetchRelationship = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchProvince = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.province) .then((res) => { @@ -182,7 +185,7 @@ const fetchProvince = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/components/TableCandidate.vue b/src/modules/03_recruiting/components/TableCandidate.vue index 717b31e44..da528e9b1 100644 --- a/src/modules/03_recruiting/components/TableCandidate.vue +++ b/src/modules/03_recruiting/components/TableCandidate.vue @@ -149,7 +149,7 @@ diff --git a/src/modules/03_recruiting/views/01_compete/Period.vue b/src/modules/03_recruiting/views/01_compete/Period.vue index 6ba96b5e6..596fc4af5 100644 --- a/src/modules/03_recruiting/views/01_compete/Period.vue +++ b/src/modules/03_recruiting/views/01_compete/Period.vue @@ -1,408 +1,362 @@ diff --git a/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue b/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue index fc0d44ffb..d1ddda8e6 100644 --- a/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue +++ b/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue @@ -806,15 +806,14 @@ import type { } from "@/modules/02_organizational/interface/index/Main"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useDataStore } from "@/stores/data"; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; + + const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); const router = useRouter(); const route = useRoute(); -const { date2Thai, success, dateToISO, notifyError } = mixin; +const { date2Thai, success, dateToISO, notifyError, showLoader, hideLoader } = mixin; const myForm = ref(null); //form data input const name = ref(""); const note = ref(""); @@ -925,7 +924,7 @@ watch(organizationName, (count: DataOption, prevCount: DataOption) => { }); onMounted(async () => { - loaderPage(false); + hideLoader(); if (route.params.id != undefined) { edit.value = true; id.value = route.params.id.toString(); @@ -940,7 +939,7 @@ const clickBack = () => { }; const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.getPeriodById(id.value)) .then((res) => { @@ -992,7 +991,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1019,7 +1018,7 @@ const uploadDocData = async () => { fileDocDataUpload.value.forEach((file: any) => { formData.append("", file); }); - loaderPage(true); + showLoader(); await http .put(config.API.periodRecruitDoc(id.value), formData) .then((res) => {}) @@ -1027,7 +1026,7 @@ const uploadDocData = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); success($q, "บันทึกข้อมูลสำเร็จ"); clickBack(); }); @@ -1043,7 +1042,7 @@ const uploadImgData = async () => { fileImgDataUpload.value.forEach((file: any) => { formData.append("", file); }); - loaderPage(true); + showLoader(); await http .put(config.API.periodRecruitImg(id.value), formData) .then((res) => {}) @@ -1051,7 +1050,7 @@ const uploadImgData = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); } }; @@ -1132,7 +1131,7 @@ const sendData = () => { }; const deleteDocData = async (docId: string) => { - loaderPage(true); + showLoader(); await http .delete(config.API.periodDeleteDoc(docId)) .then(async () => { @@ -1142,12 +1141,12 @@ const deleteDocData = async (docId: string) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; const deleteImgData = async (docId: string) => { - loaderPage(true); + showLoader(); await http .delete(config.API.periodDeleteImg(docId)) .then(async () => { @@ -1157,12 +1156,12 @@ const deleteImgData = async (docId: string) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; const addData = async () => { - loaderPage(true); + showLoader(); await http .post(config.API.savePeriod, sendData()) .then(async (res) => { @@ -1175,12 +1174,12 @@ const addData = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; const editData = async (id: string) => { - loaderPage(true); + showLoader(); await http .put(config.API.editPeriod(id), sendData()) .then(async () => { @@ -1191,7 +1190,7 @@ const editData = async (id: string) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/views/02_qualify/DisableDetail.vue b/src/modules/03_recruiting/views/02_qualify/DisableDetail.vue index 91b22c7ed..774081eb1 100644 --- a/src/modules/03_recruiting/views/02_qualify/DisableDetail.vue +++ b/src/modules/03_recruiting/views/02_qualify/DisableDetail.vue @@ -121,15 +121,14 @@ import { ref, onMounted } from "vue"; import { useRouter, useRoute } from "vue-router"; import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period"; import Table from "@/modules/03_recruiting/components/Table.vue"; -import { useDataStore } from "@/stores/data"; + import http from "@/plugins/http"; import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; const $q = useQuasar(); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; + const year = ref("2566"); const round = ref("1"); const name = ref(""); @@ -140,7 +139,7 @@ const pass = ref(0); const notpass = ref(0); const importId = ref(route.params.id as string); // Period Import Id const mixin = useCounterMixin(); -const { messageError, success } = mixin; +const { messageError, success, showLoader, hideLoader } = mixin; const filter = ref(""); //search data table const visibleColumns = ref([ "examID", @@ -328,12 +327,12 @@ const clickDetail = (examID: string) => { }; onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchData(); }); const downloadExam = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.exportDisableExam(importId.value), { responseType: "blob", @@ -349,12 +348,12 @@ const downloadExam = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const downloadPassExam = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.exportDisablePassExam(importId.value), { responseType: "blob", @@ -370,12 +369,12 @@ const downloadPassExam = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const downloadPassResultExam = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.exportDisablePassResultExam(importId.value), { responseType: "blob", @@ -391,12 +390,12 @@ const downloadPassResultExam = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchData = async () => { - loaderPage(true); + showLoader(); await http .post(config.API.getDisableExamResultById(importId.value), { examAttribute: "", @@ -427,7 +426,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -442,7 +441,7 @@ const candidateToPlacement = async () => { persistent: true, }) .onOk(async () => { - loaderPage(true); + showLoader(); await http .get(config.API.periodDisableToPlacement(importId.value)) .then((res) => { @@ -452,7 +451,7 @@ const candidateToPlacement = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); router.go(-1); }); }) diff --git a/src/modules/03_recruiting/views/02_qualify/DisableDetailEx.vue b/src/modules/03_recruiting/views/02_qualify/DisableDetailEx.vue index 2908324fb..60d5f3982 100644 --- a/src/modules/03_recruiting/views/02_qualify/DisableDetailEx.vue +++ b/src/modules/03_recruiting/views/02_qualify/DisableDetailEx.vue @@ -237,19 +237,19 @@ import type { QTableProps } from "quasar"; import { ref, onMounted } from "vue"; import { useRouter, useRoute } from "vue-router"; -import { useDataStore } from "@/stores/data"; + import http from "@/plugins/http"; import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; const $q = useQuasar(); -const dataStore = useDataStore(); + const router = useRouter(); const route = useRoute(); const mixin = useCounterMixin(); -const { messageError } = mixin; -const { loaderPage } = dataStore; +const { messageError, showLoader, hideLoader } = mixin; + const date = ref(); const profile_id = ref(""); const birthdate = ref(""); @@ -289,7 +289,7 @@ onMounted(async () => { }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.getDisableExamDetail(importId.value, examId.value)) .then((res) => { @@ -328,12 +328,12 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const downloadScore = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.downloadDisableScoreReport(importId.value, examId.value), { responseType: "blob", @@ -349,12 +349,12 @@ const downloadScore = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const downloadCertificate = async () => { - loaderPage(true); + showLoader(); await http .get( config.API.downloadDisableExamReport(importId.value, examId.value, 2), @@ -373,7 +373,7 @@ const downloadCertificate = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue b/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue index ccb021623..bf72c934b 100644 --- a/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue +++ b/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue @@ -1,406 +1,360 @@ diff --git a/src/modules/03_recruiting/views/02_qualify/DisablePeriodAdd.vue b/src/modules/03_recruiting/views/02_qualify/DisablePeriodAdd.vue index 8630c1005..1b1b106cc 100644 --- a/src/modules/03_recruiting/views/02_qualify/DisablePeriodAdd.vue +++ b/src/modules/03_recruiting/views/02_qualify/DisablePeriodAdd.vue @@ -669,15 +669,20 @@ import type { } from "@/modules/02_organizational/interface/index/Main"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useDataStore } from "@/stores/data"; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); const router = useRouter(); const route = useRoute(); -const { date2Thai, success, dateToISO, notifyError, messageError } = mixin; +const { + date2Thai, + success, + dateToISO, + notifyError, + messageError, + showLoader, + hideLoader, +} = mixin; const myForm = ref(null); //form data input const name = ref(""); const note = ref(""); @@ -725,7 +730,7 @@ onMounted(async () => { if (route.params.id != undefined) { edit.value = true; id.value = route.params.id.toString(); - loaderPage(false); + hideLoader(); await fetchData(); } else { edit.value = false; @@ -737,7 +742,7 @@ const clickBack = () => { }; const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.getDisablePeriodById(id.value)) .then((res) => { @@ -774,7 +779,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -829,7 +834,7 @@ const sendData = () => { }; const addData = async () => { - loaderPage(true); + showLoader(); await http .post(config.API.saveDisablePeriod, sendData()) .then(async (res) => { @@ -844,12 +849,12 @@ const addData = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; const editData = async (id: string) => { - loaderPage(true); + showLoader(); await http .put(config.API.editDisablePeriod(id), sendData()) .then(async () => { @@ -862,7 +867,7 @@ const editData = async (id: string) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -889,7 +894,7 @@ const uploadImgData = async () => { fileImgDataUpload.value.forEach((file: any) => { formData.append("", file); }); - loaderPage(true); + showLoader(); await http .put(config.API.periodExamImg(id.value), formData) .then((res) => {}) @@ -897,7 +902,7 @@ const uploadImgData = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); } }; @@ -906,7 +911,7 @@ const deleteDocData = async (docId: string) => { const params = { documentId: docId, }; - loaderPage(true); + showLoader(); await http .delete(config.API.periodExamDoc(id.value.toString()), { params, @@ -919,7 +924,7 @@ const deleteDocData = async (docId: string) => { }) .finally(async () => { await fetchData(); - loaderPage(false); + hideLoader(); }); }; @@ -950,7 +955,7 @@ const uploadDocData = async () => { fileDocDataUpload.value.forEach((file: any) => { formData.append("", file); }); - loaderPage(true); + showLoader(); await http .put(config.API.periodExamDoc(id.value), formData) .then((res) => {}) @@ -958,7 +963,7 @@ const uploadDocData = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); } else { clickBack(); diff --git a/src/modules/03_recruiting/views/02_qualify/ExamForm.vue b/src/modules/03_recruiting/views/02_qualify/ExamForm.vue index 1f8ee5efa..1ba95a2f0 100644 --- a/src/modules/03_recruiting/views/02_qualify/ExamForm.vue +++ b/src/modules/03_recruiting/views/02_qualify/ExamForm.vue @@ -138,14 +138,11 @@ import { useRoute, useRouter } from "vue-router"; import { useQuasar } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useDataStore } from "@/stores/data"; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const router = useRouter(); const $q = useQuasar(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { success, dateToISO, messageError } = mixin; +const { success, dateToISO, messageError, showLoader, hideLoader } = mixin; const route = useRoute(); const examId = ref(route.params.examId.toString()); const candidateId = ref(route.params.candidateId.toString()); @@ -163,7 +160,7 @@ onMounted(async () => { }); const fetchStatus = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateId(candidateId.value)) .then((res) => { @@ -174,12 +171,12 @@ const fetchStatus = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; const confirm = async (status: boolean, reason: string) => { - loaderPage(true); + showLoader(); await http .put(config.API.candidateCheckRegister(candidateId.value), { status: status, @@ -190,14 +187,14 @@ const confirm = async (status: boolean, reason: string) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); success($q, "ตรวจสอบข้อมูลสำเร็จ"); router.push(`/qualify/manage/${examId.value}`); }); }; const reject = async (reason: string) => { - loaderPage(true); + showLoader(); await http .put(config.API.candidateRejectRegister(candidateId.value), { reason: reason, @@ -207,7 +204,7 @@ const reject = async (reason: string) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); success($q, "ตรวจสอบข้อมูลสำเร็จ"); router.push(`/qualify/manage/${examId.value}`); }); @@ -253,7 +250,7 @@ const clickSave = async () => { type.value = defaultOccupation.value.employee; if (defaultOccupation.value.status == "other") type.value = defaultOccupation.value.other; - loaderPage(true); + showLoader(); await http .post(config.API.candidateId(candidateId.value), { prefixId: defaultInformation.value.prefixId, @@ -329,7 +326,7 @@ const clickSave = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); } }); diff --git a/src/modules/03_recruiting/views/02_qualify/Manage.vue b/src/modules/03_recruiting/views/02_qualify/Manage.vue index 6702dd063..479849cb3 100644 --- a/src/modules/03_recruiting/views/02_qualify/Manage.vue +++ b/src/modules/03_recruiting/views/02_qualify/Manage.vue @@ -55,17 +55,16 @@ import { useCounterMixin } from "@/stores/mixin"; import type { Pagination } from "@/modules/03_recruiting/interface/index/Main"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useDataStore } from "@/stores/data"; + import type { RequestPeriodExam } from "@/modules/03_recruiting/interface/request/Period"; import type { ResponsePeriodExam } from "@/modules/03_recruiting/interface/response/Period"; import { useQuasar } from "quasar"; const $q = useQuasar(); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; + const router = useRouter(); const mixin = useCounterMixin(); -const { date2Thai, messageError } = mixin; +const { date2Thai, messageError, showLoader, hideLoader } = mixin; const rows = ref([]); const initialPagination = ref({ rowsPerPage: 0, @@ -163,12 +162,12 @@ const columns = ref([ ]); onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchData(); }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.periodExamType("exam")) .then((res) => { @@ -223,7 +222,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/views/02_qualify/Payment.vue b/src/modules/03_recruiting/views/02_qualify/Payment.vue index 3891cea5f..6e276cc1f 100644 --- a/src/modules/03_recruiting/views/02_qualify/Payment.vue +++ b/src/modules/03_recruiting/views/02_qualify/Payment.vue @@ -278,17 +278,14 @@ import { useQuasar } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useDataStore } from "@/stores/data"; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const filePayment = ref([]); const bank = ref([]); const fee = ref(); const $q = useQuasar(); const router = useRouter(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { success, messageError } = mixin; +const { success, messageError, showLoader, hideLoader } = mixin; const route = useRoute(); const examId = ref(route.params.examId.toString()); const candidateId = ref(route.params.candidateId.toString()); @@ -308,13 +305,13 @@ const props = defineProps({ }); onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchPaymentExam(); await fetchData(); }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidatePayment(candidateId.value)) .then((res) => { @@ -325,12 +322,12 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchPaymentExam = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.periodExamPayment(examId.value)) .then((res) => { @@ -342,12 +339,12 @@ const fetchPaymentExam = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; const confirm = async (status: boolean, reason: string) => { - loaderPage(true); + showLoader(); await http .put(config.API.candidateCheckPayment(candidateId.value), { status: status, @@ -358,7 +355,7 @@ const confirm = async (status: boolean, reason: string) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); success($q, "ตรวจสอบข้อมูลชำระเงินสำเร็จ"); router.push(`/qualify/manage/${examId.value}`); }); diff --git a/src/modules/03_recruiting/views/02_qualify/Period.vue b/src/modules/03_recruiting/views/02_qualify/Period.vue index 724d935ef..5e860fef2 100644 --- a/src/modules/03_recruiting/views/02_qualify/Period.vue +++ b/src/modules/03_recruiting/views/02_qualify/Period.vue @@ -94,15 +94,20 @@ import type { Pagination } from "@/modules/03_recruiting/interface/index/Main"; import Table from "@/modules/03_recruiting/components/Table.vue"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useDataStore } from "@/stores/data"; + import { useRouter } from "vue-router"; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); const router = useRouter(); -const { date2Thai, success, typeCategoryExam, messageError } = mixin; +const { + date2Thai, + success, + typeCategoryExam, + messageError, + showLoader, + hideLoader, +} = mixin; const filter = ref(""); //search data table const initialPagination = ref({ rowsPerPage: 0, @@ -205,12 +210,12 @@ const columns = ref([ ]); onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchData(); }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.periodExamType("all")) .then((res) => { @@ -292,7 +297,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -322,7 +327,7 @@ const clickAdd = () => { }; const deleteData = async (id: string) => { - loaderPage(true); + showLoader(); await http .delete(config.API.periodExamId(id)) .then((res) => { @@ -332,7 +337,7 @@ const deleteData = async (id: string) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); await fetchData(); }); }; diff --git a/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue b/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue index 83381a653..90be47bd8 100644 --- a/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue +++ b/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue @@ -986,16 +986,15 @@ import type { } from "@/modules/02_organizational/interface/index/Main"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useDataStore } from "@/stores/data"; + import ProfileTable from "@/modules/04_registry/components/Table.vue"; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); const router = useRouter(); const route = useRoute(); -const { date2Thai, success, dateToISO, messageError } = mixin; +const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } = + mixin; const myForm = ref(null); //form data input const name = ref(""); const note = ref(""); @@ -1137,7 +1136,7 @@ watch(organizationName, (count: DataOption, prevCount: DataOption) => { }); onMounted(async () => { - loaderPage(false); + hideLoader(); if (route.params.id != undefined) { edit.value = true; id.value = route.params.id.toString(); @@ -1160,7 +1159,7 @@ const clickBack = () => { }; const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.periodExamId(id.value)) .then((res) => { @@ -1239,7 +1238,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1247,7 +1246,7 @@ const fetchData = async () => { * get รายการ รหัสหน่วยงาน */ const fetchOrganizationShortName = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationShortName) .then((res) => { @@ -1265,7 +1264,7 @@ const fetchOrganizationShortName = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1273,7 +1272,7 @@ const fetchOrganizationShortName = async () => { * get รายการ หน่วยงาน */ const fetchOrganizationOrganization = async (val: string) => { - loaderPage(true); + showLoader(); await http .get(config.API.organization) .then((res) => { @@ -1291,7 +1290,7 @@ const fetchOrganizationOrganization = async (val: string) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1299,7 +1298,7 @@ const fetchOrganizationOrganization = async (val: string) => { * get รายการ ตำแหน่งในสายงาน */ const fetchPositionPath = async (val: string) => { - loaderPage(true); + showLoader(); await http .get(config.API.positionPath) .then((res) => { @@ -1317,7 +1316,7 @@ const fetchPositionPath = async (val: string) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1410,7 +1409,7 @@ const sendData = () => { }; const addData = async () => { - loaderPage(true); + showLoader(); await http .post(config.API.periodExam, sendData()) .then(async (res) => { @@ -1425,12 +1424,12 @@ const addData = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; const editData = async (id: string) => { - loaderPage(true); + showLoader(); await http .put(config.API.periodExamId(id), sendData()) .then(async (res) => { @@ -1443,7 +1442,7 @@ const editData = async (id: string) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -1470,13 +1469,13 @@ const uploadDocData = async () => { fileDocDataUpload.value.forEach((file: any) => { formData.append("", file); }); - loaderPage(true); + showLoader(); await http .put(config.API.periodExamDoc(id.value), formData) .then((res) => {}) .catch((e) => {}) .finally(async () => { - loaderPage(false); + hideLoader(); }); } else { clickBack(); @@ -1506,13 +1505,13 @@ const uploadImgData = async () => { fileImgDataUpload.value.forEach((file: any) => { formData.append("", file); }); - loaderPage(true); + showLoader(); await http .put(config.API.periodExamImg(id.value), formData) .then((res) => {}) .catch((e) => {}) .finally(async () => { - loaderPage(false); + hideLoader(); }); } }; @@ -1521,7 +1520,7 @@ const deleteDocData = async (docId: string) => { const params = { documentId: docId, }; - loaderPage(true); + showLoader(); await http .delete(config.API.periodExamDoc(id.value.toString()), { params, diff --git a/src/modules/03_recruiting/views/02_qualify/manageDetail.vue b/src/modules/03_recruiting/views/02_qualify/manageDetail.vue index 91a8195ee..f6c7b6e85 100644 --- a/src/modules/03_recruiting/views/02_qualify/manageDetail.vue +++ b/src/modules/03_recruiting/views/02_qualify/manageDetail.vue @@ -37,7 +37,9 @@
-
+
{{ @@ -282,7 +285,7 @@ import { useCounterMixin } from "@/stores/mixin"; import type { Pagination } from "@/modules/03_recruiting/interface/index/Main"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useDataStore } from "@/stores/data"; + import TableCandidate from "@/modules/03_recruiting/components/TableCandidate.vue"; import ExamFinished from "@/modules/03_recruiting/components/ExamFinished.vue"; import type { DataNumObject } from "@/modules/01_metadata/interface/request/Calendar"; @@ -290,9 +293,15 @@ import { useQuasar } from "quasar"; const $q = useQuasar(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { genColor15, dateToISO, date2Thai, messageError } = mixin; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; +const { + genColor15, + dateToISO, + date2Thai, + messageError, + showLoader, + hideLoader, +} = mixin; + const router = useRouter(); const route = useRoute(); const status = ref("all"); @@ -483,7 +492,7 @@ watch(status, (count: String, prevCount: String) => { }); onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchDataCom(); }); @@ -502,7 +511,7 @@ const fetchDataCom = async () => { }; const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateOfPeriodExam(status.value, examId.value)) .then((res) => { @@ -530,12 +539,12 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchPeriodExam = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.periodExamStatus(examId.value)) .then((res) => { @@ -550,7 +559,7 @@ const fetchPeriodExam = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -559,7 +568,7 @@ const fetchPeriodExam = async () => { */ const fetchDataSummary = async () => { dataNum.value = []; - loaderPage(true); + showLoader(); await http .get(config.API.countDashbordPeriodExam(examId.value)) .then((res) => { @@ -577,12 +586,12 @@ const fetchDataSummary = async () => { dataNum.value = []; }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const downloadFileDashboard = async () => { - loaderPage(true); + showLoader(); await http .put( config.API.periodExamDownloadDashboard(examId.value), @@ -606,7 +615,7 @@ const downloadFileDashboard = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/views/03_editor/index.vue b/src/modules/03_recruiting/views/03_editor/index.vue index 8f372fe5e..167e0c0be 100644 --- a/src/modules/03_recruiting/views/03_editor/index.vue +++ b/src/modules/03_recruiting/views/03_editor/index.vue @@ -571,14 +571,13 @@ import http from "@/plugins/http"; import config from "@/app.config"; import HeaderTop from "@/modules/04_registry/components/Information/top.vue"; import ProfileTable from "@/modules/04_registry/components/Table.vue"; -import { useDataStore } from "@/stores/data"; + import { useQuasar } from "quasar"; const $q = useQuasar(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const store = useDataStore(); -const { loaderPage } = store; -const { date2Thai, messageError } = mixin; + +const { date2Thai, messageError, showLoader, hideLoader } = mixin; const previous = ref(false); const next = ref(false); const addDialog = ref(false); @@ -870,7 +869,7 @@ const saveEdit = async () => { }; const saveDataAgency = async (data: DataLink[]) => { - loaderPage(true); + showLoader(); await http .post(config.API.cmsAgency, data) .then((res) => {}) @@ -883,7 +882,7 @@ const saveDataAgency = async (data: DataLink[]) => { }; const saveDataGoverment = async (data: DataLink[]) => { - loaderPage(true); + showLoader(); await http .post(config.API.cmsGoverment, data) @@ -897,7 +896,7 @@ const saveDataGoverment = async (data: DataLink[]) => { }; const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.cms) .then((res) => { @@ -952,12 +951,12 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const takeLogo = async () => { - loaderPage(true); + showLoader(); const formData = new FormData(); formData.append("FileData", imageFileLogo.value); await http @@ -974,7 +973,7 @@ const takeLogo = async () => { }; const takeBanner = async () => { - loaderPage(true); + showLoader(); const formData = new FormData(); formData.append("FileData", imageFile.value); await http @@ -999,7 +998,7 @@ const sendDataDetail = async () => { description: web.value.descripstion, shortName: web.value.by, }; - loaderPage(true); + showLoader(); await http .post(config.API.cmsDeatail, data) .then((res) => {}) @@ -1026,7 +1025,7 @@ const sendDataAbout = async () => { zipCode: address.value.code, telephone: address.value.tel, }; - loaderPage(true); + showLoader(); await http .post(config.API.cmsAbout, data) .then((res) => {}) @@ -1042,7 +1041,7 @@ const sendDataAbout = async () => { }; const fetchProvince = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.province) .then((res) => { @@ -1057,13 +1056,13 @@ const fetchProvince = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchDistrict = async (id: string | null) => { - if (id !== null) { - loaderPage(true); + if (id !== null && id != "") { + showLoader(); await http .get(config.API.listDistrict(id)) .then((res) => { @@ -1078,14 +1077,14 @@ const fetchDistrict = async (id: string | null) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); } }; const fetchSubDistrict = async (id: string | null) => { - if (id !== null) { - loaderPage(true); + if (id !== null && id != "") { + showLoader(); await http .get(config.API.listSubDistrict(id)) .then((res) => { @@ -1104,7 +1103,7 @@ const fetchSubDistrict = async (id: string | null) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); } }; diff --git a/src/modules/04_registry/components/Assessment.vue b/src/modules/04_registry/components/Assessment.vue index 5d42ad985..981e8cc44 100644 --- a/src/modules/04_registry/components/Assessment.vue +++ b/src/modules/04_registry/components/Assessment.vue @@ -308,7 +308,7 @@ import { onMounted, ref, watch } from "vue"; import { useRoute } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; import { useProfileDataStore } from "@/modules/04_registry/store"; -import { useDataStore } from "@/stores/data"; + import ProfileTable from "@/modules/04_registry/components/Table.vue"; import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue"; import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue"; @@ -338,10 +338,10 @@ const props = defineProps({ const $q = useQuasar(); const store = useProfileDataStore(); const { profileData, changeProfileColumns } = store; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; + const mixin = useCounterMixin(); -const { date2Thai, success, dateToISO, messageError } = mixin; +const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } = + mixin; const route = useRoute(); const id = ref(""); const name = ref(); @@ -598,7 +598,7 @@ onMounted(async () => { const fetchData = async () => { if (profileId.value) { - loaderPage(true); + showLoader(); await http .get(config.API.profileAssessmentId(profileId.value)) .then((res) => { @@ -624,7 +624,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); } }; @@ -717,7 +717,7 @@ const clickSave = async () => { */ const saveData = async () => { if (profileId.value) { - loaderPage(true); + showLoader(); await http .post(config.API.profileAssessmentId(profileId.value), { id: id.value, @@ -747,7 +747,7 @@ const saveData = async () => { * บันทึกแก้ไขข้อมูล */ const editData = async () => { - loaderPage(true); + showLoader(); await http .put(config.API.profileAssessmentId(id.value), { id: id.value, @@ -784,7 +784,7 @@ const clickDelete = async () => { persistent: true, }) .onOk(async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.profileAssessmentId(id.value)) .then((res) => { @@ -901,7 +901,7 @@ const clickEditRow = () => { const clickHistory = async (row: RequestItemsObject) => { tittleHistory.value = "ประวัติแก้ไขผลการประเมินการปฏิบัติราชการ"; modalHistory.value = true; - loaderPage(true); + showLoader(); await http .get(config.API.profileAssessmentHisId(row.id)) .then((res) => { @@ -927,7 +927,7 @@ const clickHistory = async (row: RequestItemsObject) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/04_registry/components/Coin.vue b/src/modules/04_registry/components/Coin.vue index a478b85b7..f189eff8b 100644 --- a/src/modules/04_registry/components/Coin.vue +++ b/src/modules/04_registry/components/Coin.vue @@ -264,7 +264,7 @@ import { onMounted, ref, watch } from "vue"; import { useRoute } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; import { useProfileDataStore } from "@/modules/04_registry/store"; -import { useDataStore } from "@/stores/data"; + import ProfileTable from "@/modules/04_registry/components/Table.vue"; import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue"; import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue"; @@ -294,10 +294,10 @@ const props = defineProps({ const $q = useQuasar(); const store = useProfileDataStore(); const { profileData, changeProfileColumns } = store; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; + const mixin = useCounterMixin(); -const { date2Thai, success, dateToISO, messageError } = mixin; +const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } = + mixin; const route = useRoute(); const id = ref(""); const issuer = ref(); @@ -490,7 +490,7 @@ onMounted(async () => { const fetchData = async () => { if (profileId.value) { - loaderPage(true); + showLoader(); await http .get(config.API.profileHonorId(profileId.value)) .then((res) => { @@ -514,7 +514,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); } }; @@ -604,7 +604,7 @@ const clickSave = async () => { */ const saveData = async () => { if (profileId.value) { - loaderPage(true); + showLoader(); await http .post(config.API.profileHonorId(profileId.value), { id: id.value, @@ -632,7 +632,7 @@ const saveData = async () => { * บันทึกแก้ไขข้อมูล */ const editData = async () => { - loaderPage(true); + showLoader(); await http .put(config.API.profileHonorId(id.value), { id: id.value, @@ -667,7 +667,7 @@ const clickDelete = async () => { persistent: true, }) .onOk(async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.profileHonorId(id.value)) .then((res) => { @@ -781,7 +781,7 @@ const clickHistory = async (row: RequestItemsObject) => { ? "ประวัติแก้ไขประกาศลูกจ้างดีเด่น" : "ประวัติแก้ไขประกาศเกียรติคุณ"; modalHistory.value = true; - loaderPage(true); + showLoader(); await http .get(config.API.profileHonorHisId(row.id)) .then((res) => { @@ -805,7 +805,7 @@ const clickHistory = async (row: RequestItemsObject) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/04_registry/components/Discipline.vue b/src/modules/04_registry/components/Discipline.vue index ae43a8383..b2c4f2bc0 100644 --- a/src/modules/04_registry/components/Discipline.vue +++ b/src/modules/04_registry/components/Discipline.vue @@ -278,7 +278,7 @@ import { onMounted, ref, watch } from "vue"; import { useRoute } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; import { useProfileDataStore } from "@/modules/04_registry/store"; -import { useDataStore } from "@/stores/data"; + import ProfileTable from "@/modules/04_registry/components/Table.vue"; import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue"; import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue"; @@ -307,10 +307,10 @@ const props = defineProps({ const $q = useQuasar(); const store = useProfileDataStore(); const { profileData, changeProfileColumns } = store; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; + const mixin = useCounterMixin(); -const { date2Thai, success, dateToISO, messageError } = mixin; +const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } = + mixin; const route = useRoute(); const id = ref(""); const level = ref(); @@ -590,7 +590,7 @@ const filterSelector = (val: string, update: Function, refData: string) => { const fetchData = async () => { if (profileId.value) { - loaderPage(true); + showLoader(); await http .get(config.API.profileDisId(profileId.value)) .then((res) => { @@ -615,7 +615,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); } }; @@ -706,7 +706,7 @@ const clickSave = async () => { */ const saveData = async () => { if (profileId.value) { - loaderPage(true); + showLoader(); await http .post(config.API.profileDisId(profileId.value), { id: id.value, @@ -735,7 +735,7 @@ const saveData = async () => { * บันทึกแก้ไขข้อมูล */ const editData = async () => { - loaderPage(true); + showLoader(); await http .put(config.API.profileDisId(id.value), { id: id.value, @@ -771,7 +771,7 @@ const clickDelete = async () => { persistent: true, }) .onOk(async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.profileDisId(id.value)) .then((res) => { @@ -883,7 +883,7 @@ const clickEditRow = () => { */ const clickHistory = async (row: RequestItemsObject) => { modalHistory.value = true; - loaderPage(true); + showLoader(); await http .get(config.API.profileDisHisId(row.id)) .then((res) => { @@ -908,7 +908,7 @@ const clickHistory = async (row: RequestItemsObject) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/04_registry/components/Document.vue b/src/modules/04_registry/components/Document.vue index 4b6bfe21b..f9f5f32fb 100644 --- a/src/modules/04_registry/components/Document.vue +++ b/src/modules/04_registry/components/Document.vue @@ -138,7 +138,7 @@ import { onMounted, computed, ref, watch } from "vue"; import { useQuasar, QForm } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import { useRoute } from "vue-router"; -import { useDataStore } from "@/stores/data"; + import HeaderTop from "@/modules/04_registry/components/Information/top.vue"; import http from "@/plugins/http"; import config from "@/app.config"; @@ -156,12 +156,10 @@ const props = defineProps({ }); const emit = defineEmits(["update:statusEdit"]); -const dataStore = useDataStore(); -const { loaderPage } = dataStore; const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); const route = useRoute(); -const { success, messageError } = mixin; +const { success, messageError, showLoader, hideLoader } = mixin; const profileId = ref( route.params.id ? route.params.id.toString() : "" ); @@ -177,7 +175,7 @@ onMounted(async () => { const getData = async () => { if (profileId.value) { - loaderPage(true); + showLoader(); await http .get(config.API.profilePaperId(profileId.value)) .then((res) => { @@ -188,13 +186,13 @@ const getData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); } }; const deleteData = async (id: string) => { - loaderPage(true); + showLoader(); await http .delete(config.API.profilePaperId(id)) .then((res) => { @@ -219,7 +217,7 @@ const uploadData = async () => { formData.append("avatar", newFile); formData.append("moss", "newFile"); console.log(formData); - loaderPage(true); + showLoader(); await http .post(config.API.profilePaperId(profileId.value), formData) .then((res) => { diff --git a/src/modules/04_registry/components/Education.vue b/src/modules/04_registry/components/Education.vue index e3c38afce..75756891b 100644 --- a/src/modules/04_registry/components/Education.vue +++ b/src/modules/04_registry/components/Education.vue @@ -582,7 +582,7 @@ import { onMounted, ref, watch } from "vue"; import { useRoute } from "vue-router"; import { useProfileDataStore } from "@/modules/04_registry/store"; import { useCounterMixin } from "@/stores/mixin"; -import { useDataStore } from "@/stores/data"; + import ProfileTable from "@/modules/04_registry/components/Table.vue"; import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue"; import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue"; @@ -609,10 +609,10 @@ const props = defineProps({ const $q = useQuasar(); const store = useProfileDataStore(); const { profileData, changeProfileColumns } = store; -const dataStore = useDataStore(); -const { loaderPage } = dataStore; + const mixin = useCounterMixin(); -const { success, dateToISO, date2Thai, messageError } = mixin; +const { success, dateToISO, date2Thai, messageError, showLoader, hideLoader } = + mixin; const route = useRoute(); const id = ref(""); const levelId = ref(); @@ -1047,7 +1047,7 @@ onMounted(async () => { }); const fetchLevel = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.educationLevel) .then((res) => { @@ -1063,12 +1063,12 @@ const fetchLevel = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchPositionPath = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.positionPath) .then((res) => { @@ -1085,7 +1085,7 @@ const fetchPositionPath = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1113,7 +1113,7 @@ const filterSelector = (val: any, update: Function, refData: string) => { const fetchData = async () => { if (profileId.value) { - loaderPage(true); + showLoader(); await http .get(config.API.profileEduId(profileId.value)) .then((res) => { @@ -1150,7 +1150,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); } }; @@ -1258,7 +1258,7 @@ const saveData = async () => { // (r: any) => r.id == isEducation.value // ); if (profileId.value) { - loaderPage(true); + showLoader(); await http .post(config.API.profileEduId(profileId.value), { id: id.value, @@ -1308,7 +1308,7 @@ const editData = async () => { // const filterPositionPath = OpsFilter.value.positionPathOptions.filter( // (r: any) => r.id == isEducation.value // ); - loaderPage(true); + showLoader(); await http .put(config.API.profileEduId(id.value), { id: id.value, @@ -1359,7 +1359,7 @@ const clickDelete = async () => { persistent: true, }) .onOk(async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.profileEduId(id.value)) .then((res) => { @@ -1493,7 +1493,7 @@ const clickEditRow = () => { */ const clickHistory = async (row: RequestItemsObject) => { modalHistory.value = true; - loaderPage(true); + showLoader(); await http .get(config.API.profileEduHisId(row.id)) .then((res) => { @@ -1530,7 +1530,7 @@ const clickHistory = async (row: RequestItemsObject) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/04_registry/components/Information/Address.vue b/src/modules/04_registry/components/Information/Address.vue index 8b8ffbf67..95c6d657e 100644 --- a/src/modules/04_registry/components/Information/Address.vue +++ b/src/modules/04_registry/components/Information/Address.vue @@ -289,7 +289,7 @@ + +> diff --git a/src/modules/05_placement/components/Receive/receiveMain.vue b/src/modules/05_placement/components/Receive/receiveMain.vue index 9dd3924d4..007a3b7e8 100644 --- a/src/modules/05_placement/components/Receive/receiveMain.vue +++ b/src/modules/05_placement/components/Receive/receiveMain.vue @@ -292,6 +292,10 @@ const closeModalTree = async () => { // await getTable(); modalTree.value = false; }; + +const nextPage = (id: string) => { + router.push(`/receive/${id}`); +};