hrms-mgt/src/modules/03_recruiting/interface/index/Main.ts

295 lines
5.8 KiB
TypeScript

import { ref } from "vue";
interface Pagination {
page: number;
rowsPerPage: number;
sortBy?: string;
}
interface DataDateMonthObject {
month: number;
year: number;
}
interface ChangeActive {
name: string;
id: number;
}
//ข้อมูลส่วนตัว
interface Information {
cardid: string | null;
prefix: 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;
religionId: string | null;
tel: string | null;
phone: string | null;
email: string | null;
province: string | null;
provinceId: string | null;
districtId: string | null;
cardIdDate: Date | null;
relationshipId: string | null;
statusId: string | null;
knowledge: string | null;
profileImg: string | null;
}
interface Family {
prefixC: string | null; // couple
prefixIdC: string | null;
firstnameC: string | null;
lastnameC: string | null;
occupationC: string | null;
nationalityC: string | null;
prefixM: string | null; // male
prefixIdM: string | null;
firstnameM: string | null;
lastnameM: string | null;
occupationM: string | null;
nationalityM: string | null;
prefixF: string | null; // female
prefixIdF: string | null;
firstnameF: string | null;
lastnameF: string | null;
occupationF: string | null;
nationalityF: string | null;
same: string | null;
}
interface Occupation {
org: string | null;
pile: string | null;
group: string | null;
salary: number | undefined;
position: string | null;
positionType: string | null;
tel: string | null;
}
interface Contact {
contactPrefixId: string | null;
contactFirstname: string | null;
contactLastname: string | null;
contactRelations: string | null;
contactTel: string | null;
}
interface Education {
educationLevelExamId: string | null;
educationName: string | null;
educationMajor: string | null;
educationLocation: string | null;
educationType: string | null;
educationEndDate: Date;
educationScores: number | null;
educationLevelHighId: string | null;
}
interface Address {
address: string | null;
provinceId: string | null;
districtId: string | null;
subdistrictId: string | null;
code?: number | null;
addressC: string | null;
provinceIdC: string | null;
districtIdC: string | null;
subdistrictIdC: string | null;
codeC?: number | null;
same: string | null;
}
interface DataOption {
id: string;
name: string;
zipCode?: number | null;
}
interface zipCodeOption {
id: string;
name: string;
zipCode: string | null;
}
interface UploadType {
id: string;
fileName: string;
fileSize: number;
fileType: string;
detail: string;
}
interface WebType {
by: string;
thai: string;
eng: string;
descripstion: string;
}
interface AddressWeb {
address: string | null;
provinceId: string | null;
districtId: string | null;
subdistrictId: string | null;
tel: string | null;
code: string | null;
}
interface EnableType {
photo: boolean;
web: boolean;
about: boolean;
}
interface CmsTable {
id: string;
name: string;
link: string;
createdAt: Date;
lastUpdatedAt: Date;
}
interface ExamCard {
id: string;
title: string;
announcementDate: Date;
registerRound: Number;
registerDateStart: Date;
registerDateEnd: Date;
yearly: Date;
}
const defaultAddress = ref<Address>({
address: null,
provinceId: null,
districtId: null,
subdistrictId: null,
// code: ,
addressC: null,
provinceIdC: null,
districtIdC: null,
subdistrictIdC: null,
// codeC: ,
same: "1",
});
const defaultInformation = ref<Information>({
cardid: null,
prefix: null,
prefixId: null,
firstname: null,
lastname: null,
birthDate: new Date(),
genderId: null,
bloodId: null,
nationality: null,
ethnicity: null,
religionId: null,
tel: null,
phone: null,
email: null,
province: null,
cardIdDate: new Date(),
relationshipId: null,
knowledge: null,
districtId: null,
provinceId: null,
statusId: null,
profileImg: null,
});
const defaultFamily = ref<Family>({
prefixC: null,
prefixIdC: null,
firstnameC: null,
lastnameC: null,
occupationC: null,
nationalityC: null,
prefixM: null,
prefixIdM: null,
firstnameM: null,
lastnameM: null,
occupationM: null,
nationalityM: null,
prefixF: null,
prefixIdF: null,
firstnameF: null,
lastnameF: null,
occupationF: null,
nationalityF: null,
same: "0",
});
const defaultOccupation = ref<Occupation>({
org: null,
pile: null,
group: null,
salary: undefined,
position: null,
positionType: null,
tel: null,
});
const defaultContact = ref<Contact>({
contactPrefixId: null,
contactFirstname: null,
contactLastname: null,
contactRelations: null,
contactTel: null,
});
const defaultEducation = ref<Education>({
educationLevelExamId: null,
educationName: null,
educationMajor: null,
educationLocation: null,
educationType: null,
educationEndDate: new Date(),
educationScores: null,
educationLevelHighId: null,
});
async function changeData(system: String, val: any) {
if (system == "information") defaultInformation.value = val;
if (system == "address") defaultAddress.value = val;
if (system == "famliy") defaultFamily.value = val;
if (system == "occupation") defaultOccupation.value = val;
if (system == "contact") defaultContact.value = val;
if (system == "education") defaultEducation.value = val;
}
export {
defaultInformation,
defaultFamily,
defaultAddress,
defaultOccupation,
defaultContact,
defaultEducation,
changeData,
};
export type {
Pagination,
DataOption,
DataDateMonthObject,
ChangeActive,
Information,
Family,
Address,
zipCodeOption,
Occupation,
Contact,
Education,
ExamCard,
UploadType,
WebType,
AddressWeb,
EnableType,
CmsTable,
};