fix interface
This commit is contained in:
parent
ea173b3809
commit
4b74271f0e
2 changed files with 82 additions and 89 deletions
|
|
@ -14,4 +14,46 @@ interface ResponseObject {
|
||||||
government: String;
|
government: String;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type { ResponseObject };
|
interface ResponesePosType {
|
||||||
|
createdAt: string;
|
||||||
|
id: string;
|
||||||
|
lastUpdateFullName: string;
|
||||||
|
lastUpdatedAt: string;
|
||||||
|
posTypeName: string;
|
||||||
|
posTypeRank: number;
|
||||||
|
posLevels: DataPosLevel[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DataPosLevel {
|
||||||
|
createdAt: string;
|
||||||
|
id: string;
|
||||||
|
lastUpdateFullName: string;
|
||||||
|
lastUpdatedAt: string;
|
||||||
|
posLevelAuthority: string;
|
||||||
|
posLevelName: string;
|
||||||
|
posLevelRank: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ResponesePosition {
|
||||||
|
createdAt: string;
|
||||||
|
id: string;
|
||||||
|
isSpecial: boolean;
|
||||||
|
lastUpdateFullName: string;
|
||||||
|
lastUpdatedAt: string;
|
||||||
|
posLevelId: string;
|
||||||
|
posLevelName: string;
|
||||||
|
posTypeId: string;
|
||||||
|
posTypeName: string;
|
||||||
|
positionArea: string;
|
||||||
|
positionExecutiveField: null;
|
||||||
|
positionField: string;
|
||||||
|
positionIsSelected: boolean;
|
||||||
|
positionName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type {
|
||||||
|
ResponseObject,
|
||||||
|
ResponesePosType,
|
||||||
|
DataPosLevel,
|
||||||
|
ResponesePosition,
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,11 @@ import type {
|
||||||
DataOption2,
|
DataOption2,
|
||||||
UploadType,
|
UploadType,
|
||||||
} from "@/modules/02_organization/interface/index/Main";
|
} from "@/modules/02_organization/interface/index/Main";
|
||||||
|
import type {
|
||||||
|
ResponesePosType,
|
||||||
|
DataPosLevel,
|
||||||
|
ResponesePosition,
|
||||||
|
} from "@/modules/03_recruiting/interface/response/Main";
|
||||||
|
|
||||||
import ProfileTable from "@/modules/03_recruiting/components/Table1.vue";
|
import ProfileTable from "@/modules/03_recruiting/components/Table1.vue";
|
||||||
|
|
||||||
|
|
@ -60,10 +65,6 @@ const dateAnnounce = ref<Date | null>(null); //วันประกาศผล
|
||||||
const dateExam = ref<Date | null>(null); //วันที่สอบ
|
const dateExam = ref<Date | null>(null); //วันที่สอบ
|
||||||
const myFormPayment = ref<any>();
|
const myFormPayment = ref<any>();
|
||||||
const myFormPosition = ref<any>();
|
const myFormPosition = ref<any>();
|
||||||
const positionPathOptions = ref<DataOption2[]>([]);
|
|
||||||
const positionPathFilters = ref<DataOption2[]>([]);
|
|
||||||
const positionLevelOptions = ref<DataOption2[]>([]);
|
|
||||||
const positionLevelFilters = ref<DataOption2[]>([]);
|
|
||||||
const organizationShortName = ref<DataOption2>();
|
const organizationShortName = ref<DataOption2>();
|
||||||
const organizationName = ref<DataOption2>();
|
const organizationName = ref<DataOption2>();
|
||||||
const examTypeOptions = [
|
const examTypeOptions = [
|
||||||
|
|
@ -295,65 +296,6 @@ async function fetchData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* get รายการ ตำแหน่งในสายงาน
|
|
||||||
*/
|
|
||||||
async function fetchPositionPath() {
|
|
||||||
showLoader();
|
|
||||||
await http
|
|
||||||
.get(config.API.positionPath)
|
|
||||||
.then((res) => {
|
|
||||||
const data = res.data.result;
|
|
||||||
let option: DataOption2[] = [];
|
|
||||||
data.map((r: DataOption2) => {
|
|
||||||
option.push({
|
|
||||||
id: r.id.toString(),
|
|
||||||
name: r.name.toString(),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
positionPathOptions.value = option;
|
|
||||||
positionPathFilters.value = option;
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get รายการ ตำแหน่งระดับ
|
|
||||||
*/
|
|
||||||
async function fetchPositionLevel() {
|
|
||||||
showLoader();
|
|
||||||
await http
|
|
||||||
.get(config.API.positionLevel)
|
|
||||||
.then((res) => {
|
|
||||||
const data = res.data.result;
|
|
||||||
let option: DataOption2[] = [];
|
|
||||||
data.map((r: DataOption2) => {
|
|
||||||
option.push({
|
|
||||||
id: r.id.toString(),
|
|
||||||
name: r.name.toString(),
|
|
||||||
level: r.level,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
positionLevelOptions.value = option.filter(
|
|
||||||
(v: DataOption2) => v.level === 0
|
|
||||||
);
|
|
||||||
positionLevelFilters.value = option.filter(
|
|
||||||
(v: DataOption2) => v.level === 0
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ฟังชั่น filter
|
* ฟังชั่น filter
|
||||||
* @param val input
|
* @param val input
|
||||||
|
|
@ -720,28 +662,32 @@ function clearDateAnnounce() {
|
||||||
dateAnnounce.value = null;
|
dateAnnounce.value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const mainDataPosLevel = ref<any[]>([]);
|
const mainDataPosLevel = ref<ResponesePosType[]>([]); //ข้อมูลรายการประเภทตำแหน่ง
|
||||||
const optionPosLevel1 = ref<any[]>([]);
|
const optionPosLevel1 = ref<DataOption2[]>([]); // ตัวเลือกระดับประเภททั่วไป
|
||||||
const filterOptionPosLevel1 = ref<any[]>([]);
|
const filterOptionPosLevel1 = ref<DataOption2[]>([]); //ข้อมูลตัวเลือกระดับประเภททั่วไป
|
||||||
|
const optionPosLevel2 = ref<DataOption2[]>([]); //ตัวเลือกระดับประเภทวิชาการ
|
||||||
const optionPosLevel2 = ref<any[]>([]);
|
const filterOptionPosLevel2 = ref<DataOption2[]>([]); //ข้อมูลตัวเลือกระดับประเภทวิชาการ
|
||||||
const filterOptionPosLevel2 = ref<any[]>([]);
|
const optionPosType1 = ref<DataOption2[]>([]); //ตัวเลือกตำแหน่งของระดับปฏิบัติงาน
|
||||||
|
const filterOptionPosType1 = ref<DataOption2[]>([]); //ข้อมูลตัวเลือกตำแหน่งของระดับปฏิบัติงาน
|
||||||
|
const optionPosType2 = ref<DataOption2[]>([]); //ตัวเลือกตำแหน่งของระดับปฏิบัติการ
|
||||||
|
const filterOptionPosType2 = ref<DataOption2[]>([]); //ข้อมูลตัวเลือกตำแหน่งของระดับปฏิบัติการ
|
||||||
|
|
||||||
|
/** ฟังก์ชันเรียกข้อมูล ประเภทตำแหน่ง*/
|
||||||
async function fetchPositionType() {
|
async function fetchPositionType() {
|
||||||
http
|
http
|
||||||
.get(config.API.orgPosType)
|
.get(config.API.orgPosType)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
mainDataPosLevel.value = res.data.result.filter(
|
mainDataPosLevel.value = res.data.result.filter(
|
||||||
(e: any) => e.posTypeRank <= 2
|
(e: ResponesePosType) => e.posTypeRank <= 2
|
||||||
);
|
);
|
||||||
|
|
||||||
const getDataByRank = (rank: number) => {
|
const getDataByRank = (rank: number) => {
|
||||||
const data =
|
const data =
|
||||||
res.data.result.find((e: any) => e.posTypeRank === rank)?.posLevels ||
|
res.data.result.find((e: ResponesePosType) => e.posTypeRank === rank)
|
||||||
[];
|
?.posLevels || [];
|
||||||
return data
|
return data
|
||||||
.filter((e: any) => e.posLevelRank === 1)
|
.filter((e: DataPosLevel) => e.posLevelRank === 1)
|
||||||
.map((e: any) => ({
|
.map((e: DataPosLevel) => ({
|
||||||
id: e.id.toString(),
|
id: e.id.toString(),
|
||||||
name: e.posLevelName.toString(),
|
name: e.posLevelName.toString(),
|
||||||
level: e.posLevelRank,
|
level: e.posLevelRank,
|
||||||
|
|
@ -761,25 +707,27 @@ async function fetchPositionType() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const optionPosType1 = ref<any[]>([]);
|
/**
|
||||||
const filterOptionPosType1 = ref<any[]>([]);
|
* ฟังก์ชันเรียกข้อมูลตำแหน่ง
|
||||||
|
* @param level ระดับข้องประเภทตำแหน่ง
|
||||||
const optionPosType2 = ref<any[]>([]);
|
*/
|
||||||
const filterOptionPosType2 = ref<any[]>([]);
|
|
||||||
|
|
||||||
function fetchPosition(level: number) {
|
function fetchPosition(level: number) {
|
||||||
http
|
http
|
||||||
.post(config.API.orgPosTypeSearch, {
|
.post(config.API.orgPosTypeSearch, {
|
||||||
posType: mainDataPosLevel.value.find((e: any) => e.posTypeRank === level)
|
posType:
|
||||||
.id,
|
mainDataPosLevel.value?.find(
|
||||||
|
(e: ResponesePosType) => e.posTypeRank === level
|
||||||
|
)?.id ?? null,
|
||||||
posLevel:
|
posLevel:
|
||||||
level === 1 ? optionPosLevel1.value[0].id : optionPosLevel2.value[0].id,
|
level === 1 ? optionPosLevel1.value[0].id : optionPosLevel2.value[0].id,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const option: DataOption2[] = res.data.result.map((r: any) => ({
|
const option: DataOption2[] = res.data.result.map(
|
||||||
id: r.id.toString(),
|
(r: ResponesePosition) => ({
|
||||||
name: r.positionName.toString(),
|
id: r.id.toString(),
|
||||||
}));
|
name: r.positionName.toString(),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
if (level === 1) {
|
if (level === 1) {
|
||||||
optionPosType1.value = option;
|
optionPosType1.value = option;
|
||||||
|
|
@ -794,6 +742,11 @@ function fetchPosition(level: number) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังก์ชันเปลี่ยนประเภทตำแหน่ง
|
||||||
|
* @param val ค่าประเภทตำแหน่ง 0 = ประเภททั่วไป ,1 = ประเภทวิชาการ
|
||||||
|
* @param index ตำแหน่งของข้อมูล
|
||||||
|
*/
|
||||||
function onUpdateHighDegree(val: string, index: string) {
|
function onUpdateHighDegree(val: string, index: string) {
|
||||||
rowsPosition.value[index].position = null;
|
rowsPosition.value[index].position = null;
|
||||||
rowsPosition.value[index].level =
|
rowsPosition.value[index].level =
|
||||||
|
|
@ -817,8 +770,6 @@ onMounted(async () => {
|
||||||
edit.value = false;
|
edit.value = false;
|
||||||
}
|
}
|
||||||
await fetchPositionType();
|
await fetchPositionType();
|
||||||
await fetchPositionPath();
|
|
||||||
await fetchPositionLevel();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue