Merge branch 'dev-chiangmai' into warunee-dev
# Conflicts: # src/api/05_placement/api.placement.ts
This commit is contained in:
commit
34a82cf5ec
11 changed files with 1089 additions and 813 deletions
|
|
@ -437,7 +437,7 @@ const fetchHistory = async () => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,17 +1,24 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref, useAttrs } from "vue";
|
||||
import { onMounted, reactive, ref, useAttrs, watchEffect } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useQuasar } from "quasar";
|
||||
import type { FormPlacementMainData } from "@/modules/05_placement/interface/request/Main";
|
||||
import type { DataOption } from "@/modules/05_placement/interface/index/Main";
|
||||
import type {
|
||||
DataOption,
|
||||
DataOption1,
|
||||
} from "@/modules/05_placement/interface/index/Main";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { usePlacementDataStore } from "@/modules/05_placement/store";
|
||||
import router from "@/router";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const DataStore = usePlacementDataStore();
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { dateText } = mixin;
|
||||
|
||||
const { dateText, messageError } = mixin;
|
||||
const selectedFiscalYear = ref(0);
|
||||
// แปลงเวลา ค.ศ ให้เป็น พ.ศ
|
||||
const textDate = (value: Date) => {
|
||||
return dateText(value);
|
||||
|
|
@ -58,22 +65,33 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "numberofCandidates",
|
||||
name: "numberOfCandidates",
|
||||
align: "left",
|
||||
label: "จำนวนผู้สอบได้",
|
||||
sortable: false,
|
||||
field: "numberofCandidates",
|
||||
field: "numberOfCandidates",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examType",
|
||||
name: "examTypeName",
|
||||
align: "left",
|
||||
label: "ประเภทการสอบ",
|
||||
sortable: false,
|
||||
field: "examType",
|
||||
field: "examTypeName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "accountStartDate",
|
||||
align: "left",
|
||||
label: "วันที่เริ่มคำสั่ง",
|
||||
sortable: true,
|
||||
field: "accountStartDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -93,140 +111,93 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows = ref<FormPlacementMainData[]>([
|
||||
{
|
||||
id: 1,
|
||||
examRound:
|
||||
"การสอบแข่งขันเพื่อรับบุคคลทั่วไปเข้ารับราชการ ส่วนการจัดการทั่วไป",
|
||||
examOrder: 3,
|
||||
fiscalYear: 2023,
|
||||
numberofCandidates: 8,
|
||||
examType: 1,
|
||||
accountExpirationDate: "2023-02-28T14:47:04.1785384Z",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
examRound:
|
||||
"การสอบแข่งขันเพื่อรับบุคคลทั่วไปเข้ารับราชการ ส่วนการจัดการทั่วไป",
|
||||
examOrder: 2,
|
||||
fiscalYear: 2023,
|
||||
numberofCandidates: 12,
|
||||
examType: 1,
|
||||
accountExpirationDate: "2023-02-28T14:47:04.1785384Z",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
examRound:
|
||||
"การสอบแข่งขันเพื่อรับบุคคลทั่วไปเข้ารับราชการ ส่วนการจัดการทั่วไป",
|
||||
examOrder: 2,
|
||||
fiscalYear: 2023,
|
||||
numberofCandidates: 20,
|
||||
examType: 1,
|
||||
accountExpirationDate: "2023-01-31T14:47:04.1785384Z",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
examRound:
|
||||
"การสอบแข่งขันเพื่อรับบุคคลทั่วไปเข้ารับราชการ ส่วนการจัดการทั่วไป",
|
||||
examOrder: 2,
|
||||
fiscalYear: 2022,
|
||||
numberofCandidates: 16,
|
||||
examType: 2,
|
||||
accountExpirationDate: "2023-11-30T14:47:04.1785384Z",
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
examRound:
|
||||
"การสอบแข่งขันเพื่อรับบุคคลทั่วไปเข้ารับราชการ ส่วนการจัดการทั่วไป",
|
||||
examOrder: 1,
|
||||
fiscalYear: 2021,
|
||||
numberofCandidates: 20,
|
||||
examType: 2,
|
||||
accountExpirationDate: "2024-05-21T14:47:04.1785384Z",
|
||||
},
|
||||
]);
|
||||
const rows = ref<FormPlacementMainData[]>([]);
|
||||
const yearValue = ref<number>(0); // เพิ่มตัวแปรในโมดูล
|
||||
|
||||
let OriginalData = ref<FormPlacementMainData[]>([]);
|
||||
let UpdataData = ref<FormPlacementMainData[]>([]);
|
||||
|
||||
const OriginalDataFetch = async () => {
|
||||
// API
|
||||
// await http
|
||||
// .get(config.API.// ตัวอย่าง)
|
||||
// .then((res: any) => {
|
||||
// })
|
||||
// .catch((e: any) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// });
|
||||
await DataStore.DataMain(rows.value);
|
||||
OriginalData.value = await DataStore.DataMainOrig;
|
||||
UpdataData.value = OriginalData.value;
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await OriginalDataFetch();
|
||||
fiscalYearFilter();
|
||||
examTimeFilter();
|
||||
examTypeFilter();
|
||||
await expiredAccountFilter();
|
||||
searchFilterTable();
|
||||
watchEffect(() => {
|
||||
rows.value = OriginalData.value;
|
||||
});
|
||||
|
||||
// ดูรายการสอบแข่งขัน หน้าต่อไป
|
||||
const redirectToPage = (id?: number) => {
|
||||
// router.push({ name: 'placementDetail'});
|
||||
router.push(`/placement/detail`);
|
||||
};
|
||||
|
||||
// เลือกปีงบประมาณ
|
||||
const fiscalyear = ref<number | null>(0);
|
||||
const fiscalyearOP = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
||||
const addedfiscalYearValues: number[] = [];
|
||||
const fiscalYearFilter = async () => {
|
||||
// API
|
||||
// await http
|
||||
// .get(config.API.// ตัวอย่าง)
|
||||
// .then((res: any) => {
|
||||
// DataStore.DataMainYearSet(rows.value);
|
||||
// fiscalyearOP.value = DataStore.DataMainYearGet;
|
||||
// })
|
||||
// .catch((e: any) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// });
|
||||
for (let data of OriginalData.value) {
|
||||
const year = data.fiscalYear + 543;
|
||||
|
||||
if (fiscalyear.value === null || year > fiscalyear.value) {
|
||||
fiscalyear.value = year;
|
||||
}
|
||||
|
||||
if (!addedfiscalYearValues.includes(year)) {
|
||||
fiscalyearOP.push({ id: year, name: year.toString() });
|
||||
addedfiscalYearValues.push(year);
|
||||
}
|
||||
const OriginalDataFetch = async (year: number) => {
|
||||
yearValue.value = year;
|
||||
try {
|
||||
const response = await http.get(config.API.MainDetail(year));
|
||||
const apiData = response.data.result;
|
||||
console.log(`🚀 ข้อมูลจากการ get (${year})`, apiData);
|
||||
await DataStore.DataMain(apiData);
|
||||
OriginalData.value = await DataStore.DataMainOrig;
|
||||
UpdataData.value = OriginalData.value.filter(
|
||||
(data) => data.fiscalYear === year
|
||||
);
|
||||
} catch (error) {
|
||||
messageError($q, error);
|
||||
}
|
||||
};
|
||||
|
||||
// เลือกปีงบประมาณตาม API
|
||||
const searchfiscalyear = () => {
|
||||
console.log("Input value changed:", fiscalyear.value);
|
||||
// API
|
||||
// await http
|
||||
// .get(config.API.// ตัวอย่าง)
|
||||
// .then((res: any) => {
|
||||
// })
|
||||
// .catch((e: any) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// });
|
||||
// ดูรายการสอบแข่งขัน หน้าต่อไป
|
||||
const redirectToPage = (examId?: number) => {
|
||||
router.push(`/placement/pass/${examId}`);
|
||||
};
|
||||
|
||||
// ค้นหาในตาราง
|
||||
//-------------------|เลือกปีงบประมาณ|-----------------------//
|
||||
const fiscalyear = ref<number>(0);
|
||||
const fiscalyearOP = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
||||
const addedfiscalYearValues: number[] = [];
|
||||
const fiscalYearFilter = async () => {
|
||||
try {
|
||||
const response = await http.get(config.API.yearOptions());
|
||||
const dataOptions = response.data.result;
|
||||
fiscalyearOP.push(...dataOptions);
|
||||
|
||||
let maxYear = 0;
|
||||
for (let data of dataOptions) {
|
||||
if (data.id > maxYear) {
|
||||
maxYear = data.id;
|
||||
}
|
||||
}
|
||||
|
||||
fiscalyear.value = maxYear;
|
||||
|
||||
// อัพเดตค่าของ selectedFiscalYear
|
||||
selectedFiscalYear.value = fiscalyear.value;
|
||||
|
||||
// โหลดข้อมูลใหม่เมื่อตัวเลือกปีเปลี่ยนแปลง
|
||||
await OriginalDataFetch(selectedFiscalYear.value);
|
||||
} catch (e) {
|
||||
messageError($q, e);
|
||||
}
|
||||
};
|
||||
|
||||
//-------------------|เลือกปีงบประมาณตาม API|--------------------//
|
||||
interface YearOption {
|
||||
id: number;
|
||||
name: number;
|
||||
}
|
||||
|
||||
const searchfiscalyear = async () => {
|
||||
try {
|
||||
const res = await http.get(config.API.yearOptions());
|
||||
const dataOptions: YearOption[] = res.data.result;
|
||||
if (fiscalyear.value === 0) {
|
||||
await OriginalDataFetch(0);
|
||||
} else {
|
||||
const selectedYearObject = dataOptions.find(
|
||||
(option: YearOption) => option.id === fiscalyear.value
|
||||
);
|
||||
OriginalDataFetch(fiscalyear.value);
|
||||
|
||||
if (selectedYearObject) {
|
||||
} else {
|
||||
console.log("No Selected Year Object");
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
messageError($q, e);
|
||||
}
|
||||
};
|
||||
|
||||
//-------------------|ค้นหาในตาราง|-----------------//
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
const resetFilter = () => {
|
||||
|
|
@ -235,62 +206,76 @@ const resetFilter = () => {
|
|||
};
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const visibleColumns = ref<string[]>([
|
||||
const visibleColumns = ref<any[]>([
|
||||
"id",
|
||||
"examRound",
|
||||
"examOrder",
|
||||
"fiscalYear",
|
||||
"numberofCandidates",
|
||||
"examType",
|
||||
"numberOfCandidates",
|
||||
"examTypeValue",
|
||||
"examTypeName",
|
||||
"accountStartDate",
|
||||
"accountExpirationDate",
|
||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
]);
|
||||
|
||||
//-------------------|ครั้งที่สอบ|------------------------------//
|
||||
const examTime = ref<number | string>("all");
|
||||
const examTimeOP = reactive<DataOption1[]>([]);
|
||||
const addedExamTimeValues: Set<number> = new Set();
|
||||
|
||||
// ครั้งที่สอบ
|
||||
const examTime = ref<number | null>(null);
|
||||
const examTimeOP = ref<number[]>([]);
|
||||
const examTimeFilter = async () => {
|
||||
for (let data of OriginalData.value) {
|
||||
if (!examTimeOP.value.includes(data.examOrder)) {
|
||||
examTimeOP.value.push(data.examOrder);
|
||||
examTimeOP.push({ id: "all", name: "ทั้งหมด" });
|
||||
|
||||
for (const data of OriginalData.value) {
|
||||
const examOrder = data.examOrder;
|
||||
if (examOrder !== null && !addedExamTimeValues.has(examOrder)) {
|
||||
examTimeOP.push({ id: examOrder.toString(), name: examOrder.toString() });
|
||||
addedExamTimeValues.add(examOrder);
|
||||
}
|
||||
}
|
||||
examTimeOP.value.sort((a, b) => a - b); // เรียงลำดับ
|
||||
examTimeOP.sort((a, b) => {
|
||||
if (a.id === "all") return -1; // ให้ตัวเลือก "ทั้งหมด" อยู่ด้านหน้า
|
||||
if (b.id === "all") return 1;
|
||||
return Number(a.id) - Number(b.id);
|
||||
}); // เรียงลำดับตาม id ที่แปลงเป็นตัวเลข
|
||||
};
|
||||
|
||||
// ประเภทการสอบ
|
||||
const examType = ref<number | null>(0);
|
||||
const examTypeOP = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
||||
const addedexamTypeValues: number[] = [];
|
||||
const examTypeFilter = async () => {
|
||||
for (let data of OriginalData.value) {
|
||||
const examTypeValue = data.examType;
|
||||
if (examTypeValue == 1 && !addedexamTypeValues.includes(1)) {
|
||||
examTypeOP.push({ id: 1, name: "คัดเลือก" });
|
||||
addedexamTypeValues.push(1);
|
||||
} else if (examTypeValue == 2 && !addedexamTypeValues.includes(2)) {
|
||||
examTypeOP.push({ id: 2, name: "สอบแข่งขัน" });
|
||||
addedexamTypeValues.push(2);
|
||||
const examType = ref<string | null>("all");
|
||||
const examTypeOP = ref<DataOption1[]>([{ id: "all", name: "ทั้งหมด" }]);
|
||||
const addedExamTypeValues: Set<string> = new Set();
|
||||
const examTypeFilter = () => {
|
||||
for (const data of OriginalData.value) {
|
||||
const examTypeName = data.examTypeName;
|
||||
const examTypeValue = data.examTypeValue;
|
||||
if (examTypeName && !addedExamTypeValues.has(examTypeName)) {
|
||||
examTypeOP.value.push({
|
||||
id: examTypeValue,
|
||||
name: examTypeName,
|
||||
});
|
||||
addedExamTypeValues.add(examTypeName);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//--------------|ฟิลเตอร์|--------------------------------------//
|
||||
const searchFilterTable = async () => {
|
||||
// console.log('Input value changed:', examTime.value, examType.value, expiredAccount.value);
|
||||
await DataStore.DataUpdateMain(
|
||||
examTime.value,
|
||||
examType.value,
|
||||
expiredAccount.value
|
||||
);
|
||||
UpdataData.value = DataStore.DataMainUpdate;
|
||||
if (examType.value !== undefined && examType.value !== null) {
|
||||
await DataStore.DataUpdateMain(
|
||||
examTime.value,
|
||||
examType.value,
|
||||
expiredAccount.value
|
||||
);
|
||||
UpdataData.value = DataStore.DataMainUpdate;
|
||||
}
|
||||
};
|
||||
|
||||
// บัญชีหมดอายุ
|
||||
//----------------|บัญชีหมดอายุ|-----------------------------//
|
||||
const expiredAccount = ref<boolean>(false);
|
||||
const expiredAccountFilter = async () => {
|
||||
const currentDate = new Date();
|
||||
const updatedRows = OriginalData.value.map((data) => {
|
||||
let expirationDate = new Date(data.accountExpirationDate);
|
||||
let isExpired = expirationDate < currentDate;
|
||||
let isExpired = currentDate > expirationDate;
|
||||
|
||||
return { ...data, isExpired };
|
||||
});
|
||||
|
|
@ -298,7 +283,7 @@ const expiredAccountFilter = async () => {
|
|||
};
|
||||
|
||||
const paging = ref<boolean>(true);
|
||||
const pagination = ref({
|
||||
const pagination = ref({
|
||||
sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
|
|
@ -308,6 +293,13 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
onMounted(async () => {
|
||||
await fiscalYearFilter();
|
||||
examTimeFilter();
|
||||
await examTypeFilter();
|
||||
expiredAccountFilter();
|
||||
await searchFilterTable();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -315,7 +307,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
รายการสอบแข่งขัน / คัดเลือก
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pa-md">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="row q-col-gutter-md">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<q-select
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
|
|
@ -421,8 +413,10 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
</q-card>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
{{ rows }}
|
||||
<q-table
|
||||
ref="table"
|
||||
:row="rows"
|
||||
:columns="columns"
|
||||
:rows="UpdataData"
|
||||
:filter="filterKeyword"
|
||||
|
|
@ -454,7 +448,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
@click="redirectToPage(props.row.id)"
|
||||
>
|
||||
<q-td key="id" :props="props">
|
||||
{{ props.row.id }}
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="examRound" :props="props">
|
||||
{{ props.row.examRound }}
|
||||
|
|
@ -463,13 +457,16 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
{{ props.row.examOrder }}
|
||||
</q-td>
|
||||
<q-td key="fiscalYear" :props="props">
|
||||
{{ props.row.fiscalYear + 543 }}
|
||||
{{ props.row.fiscalYear }}
|
||||
</q-td>
|
||||
<q-td key="numberofCandidates" :props="props">
|
||||
{{ props.row.numberofCandidates }}
|
||||
<q-td key="numberOfCandidates" :props="props">
|
||||
{{ props.row.numberOfCandidates }}
|
||||
</q-td>
|
||||
<q-td key="examType" :props="props">
|
||||
{{ props.row.examType == 1 ? "คัดเลือก" : "สอบแข่งขัน" }}
|
||||
<q-td key="examTypeName" :props="props">
|
||||
{{ props.row.examTypeName }}
|
||||
</q-td>
|
||||
<q-td key="accountStartDate" :props="props">
|
||||
{{ textDate(props.row.accountStartDate) }}
|
||||
</q-td>
|
||||
<q-td key="accountExpirationDate" :props="props">
|
||||
{{ textDate(props.row.accountExpirationDate) }}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { defineAsyncComponent } from "@vue/runtime-core";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRouter ,useRoute} from "vue-router";
|
||||
import cardTop from "@/modules/05_placement/components/pass/StatCard.vue";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
let roleAdmin = ref<boolean>(false);
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const examId = route.params.examId;
|
||||
const year = ref<string>("2566");
|
||||
const round = ref<string>("1");
|
||||
const title = ref<string>("การสอบแข่งขันเพื่อรับบุคคลทั่วไปเข้ารับราชการ");
|
||||
|
|
@ -15,14 +18,38 @@ const AddTablePosition = defineAsyncComponent(
|
|||
() => import("@/modules/05_placement/components/pass/Table.vue")
|
||||
);
|
||||
const stat = ref<any>({
|
||||
total: 5,
|
||||
unContain: 1,
|
||||
prepareContain: 3,
|
||||
contain: 1,
|
||||
total: 0,
|
||||
unContain: 0,
|
||||
prepareContain: 0,
|
||||
contain: 0,
|
||||
disclaim: 0,
|
||||
});
|
||||
|
||||
const getStat = async () => {
|
||||
const examIdString = Array.isArray(examId) ? examId[0] : examId;
|
||||
|
||||
try {
|
||||
const res = await http.get(config.API.getStatCard(examIdString));
|
||||
const statCard = res.data.result;
|
||||
|
||||
// อัปเดตค่าในตัวแปร stat
|
||||
stat.value = {
|
||||
total: statCard.total,
|
||||
unContain: statCard.unContain,
|
||||
prepareContain: statCard.prepareContain,
|
||||
contain: statCard.contain,
|
||||
disclaim: statCard.disclaim,
|
||||
};
|
||||
|
||||
console.log("🚀 ~ file: Table.vue:96 ~ getStatCard ~ data:", statCard);
|
||||
} catch (error) {
|
||||
console.error("Error retrieving data:", error);
|
||||
// จัดการข้อผิดพลาดที่เกิดขึ้นในการรับข้อมูล
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await getStat()
|
||||
if (keycloak.tokenParsed != null) {
|
||||
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,15 +1,20 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { ref, watch } from "vue";
|
||||
import DialogHeader from "@/modules/05_placement/components/pass/DialogHeader.vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import DialogFooter from "@/modules/05_placement/components/pass/DialogFooter.vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { CheckboxItem } from "@/modules/05_placement/interface/index/Main";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const modal = ref<boolean>();
|
||||
const { success } = mixin;
|
||||
const { success, showLoader, hideLoader, date2Thai, modalConfirm } = mixin;
|
||||
const save = ref<boolean>(true);
|
||||
|
||||
const fullName = ref<any>()
|
||||
|
||||
const props = defineProps({
|
||||
Modal: Boolean,
|
||||
close: {
|
||||
|
|
@ -25,15 +30,55 @@ const props = defineProps({
|
|||
default: () => console.log("not function"),
|
||||
},
|
||||
});
|
||||
const rows = ref<any[]>([
|
||||
{
|
||||
university: props.getdetail.university || "-",
|
||||
degree: props.getdetail.degree || "-",
|
||||
major: props.getdetail.major || "-",
|
||||
graduation: "2022-01-01",
|
||||
},
|
||||
|
||||
]);
|
||||
// const getDetailbyId = (props.getdetail) => {
|
||||
// showLoader();
|
||||
|
||||
// // ดึงข้อมูล personalId จาก API ก่อน
|
||||
// try {
|
||||
// const response = await http.get(config.API.personalId(id));
|
||||
// const personalId = response.data.personalId;
|
||||
|
||||
// // เมื่อได้รับ personalId แล้วให้ดึงข้อมูลอื่นๆ จาก API
|
||||
// const organizationResponse = await http.get(config.API.organizationName(personalId));
|
||||
// const data = organizationResponse.data.result;
|
||||
|
||||
// // อัปเดตข้อมูลบนหน้า UI จากข้อมูลที่ได้รับ
|
||||
// uid.value = data.personalId;
|
||||
// idCard.value = data.idCard;
|
||||
// fullName.value = "tee";
|
||||
// dateOfBirth.value = new Date(data.dateOfBirth).toLocaleDateString();
|
||||
// gender.value = data.gender;
|
||||
// address.value = data.address;
|
||||
// education.value = data.education;
|
||||
// pointA.value = data.pointA;
|
||||
// pointB.value = data.pointB;
|
||||
// pointC.value = data.pointC;
|
||||
// pointTotalA.value = data.pointTotalA;
|
||||
// pointTotalB.value = data.pointTotalB;
|
||||
// pointTotalC.value = data.pointTotalC;
|
||||
// point.value = data.point;
|
||||
// pointTotal.value = data.pointTotal;
|
||||
// examNumber.value = data.examNumber;
|
||||
// examRound.value = data.examRound;
|
||||
// pass.value = data.pass;
|
||||
// isProperty.value = data.isProperty;
|
||||
// } catch (error) {
|
||||
// messageError($q, error);
|
||||
// } finally {
|
||||
// hideLoader();
|
||||
// }
|
||||
|
||||
// };
|
||||
|
||||
const rows = ref<any[]>([
|
||||
]);
|
||||
//--------------------(แปลงวันที่เป็นไทย)------------------------------------//
|
||||
// const graduationDate = new Date(graduationExample);
|
||||
// rows.value[0].graduation = date2Thai(graduationDate, false, false);
|
||||
|
||||
//--------------------------------------------------------------------//
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "university",
|
||||
|
|
@ -76,86 +121,112 @@ const columns = ref<QTableProps["columns"]>([
|
|||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const myForm = ref<any>();
|
||||
const checkValidate = ref<boolean>(false);
|
||||
const selection = ref<number[]>([]);
|
||||
const myForm = ref<any>([]);
|
||||
const personalForm = ref<any>([]);
|
||||
const selection = ref<any>([]);
|
||||
|
||||
|
||||
const checkboxItems: CheckboxItem[] = [
|
||||
{ id: 1, label: "ไม่เป็นผู้ดำรงตำแหน่งทางการเมือง" },
|
||||
{
|
||||
id: 2,
|
||||
label:
|
||||
"ไม่เป็นคนไร้ความสามารถ คนเสมือนไร้ความสามารถ คนวิกลจริตหรือจิตฟั่นเฟือน ไม่สมประกอบหรือเป็นโรคตามที่กำหนดในกฎ ก.พ.",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
label:
|
||||
"ไม่เป็นผู้อยู่ในระหว่างถูกสั่งพักราชการหรือถูกสั่งให้ออกจากราชการไว้ก่อนตามพระราชบัญญัตินี้ หรือตามกฎหมายอื่น",
|
||||
},
|
||||
{ id: 4, label: "ไม่เป็นผู้บกพร่องในศีลธรรมอันดีจนเป็นที่รังเกียจของสังคม" },
|
||||
{
|
||||
id: 5,
|
||||
label:
|
||||
"ไม่เป็นกรรมการหรือผู้ดำรงตำแหน่งที่รับผิดชอบในการบริหารพรรคการเมือง หรือเจ้าหน้าที่ในพรรคการเมือง",
|
||||
},
|
||||
{ id: 6, label: "ไม่เป็นบุคคลล้มละลาย" },
|
||||
{
|
||||
id: 7,
|
||||
label:
|
||||
"ไม่เป็นผู้เคยต้องรับโทษจำคุกโดยคำพิพากษาถึงที่สุดให้จำคุกเพราะกระทำความผิดทางอาญา เว้นแต่เป็นโทษสำหรับความผิดที่ใด้กระทำโดยประมาทหรือความผิดลหุโทษ",
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
label:
|
||||
"ไม่เป็นผู้เคยถูกลงโทษให้ออก ปลดออก หรือไล่ออกจากรัฐวิสาหกิจ หรือ หน่วยงานอื่นของรัฐ",
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
label:
|
||||
"เป็นผู้เคยถูลงโทษให้ออก หรือปลดออก เพราะกระทำผิตวินัยตามพระราชบัญญัตินี้ หรือตามกฎหมายอื่น",
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
label:
|
||||
"เป็นผู้เคยถูกลงโทษไล่ออก เพราะกระทำผิดวินัยตามพระราชบัญญัตินี้ หรือตามกฎหมายอื่น",
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
label:
|
||||
"เป็นผู้เคยกระทำการทุจริตในการสอบเข้ารับราชการ หรือเข้าปฏิบัติงานใน หน่วยงานของรัฐ",
|
||||
},
|
||||
];
|
||||
const $q = useQuasar();
|
||||
|
||||
function isRequired(val: any): boolean | string {
|
||||
return !!val || "กรุณาเลือกไฟล์เอกสารหลักฐาน";
|
||||
}
|
||||
const validateData = () => {
|
||||
const selectedIds = selection.value;
|
||||
const selectedItems = checkboxItems.filter((item) =>
|
||||
selectedIds.includes(item.id)
|
||||
);
|
||||
|
||||
watch(props, () => {
|
||||
if (props.Modal === true) {
|
||||
console.log(props.getdetail);
|
||||
fetchData();
|
||||
}
|
||||
});
|
||||
|
||||
const validateData = () => {
|
||||
const selectedIds = personalForm.value.isProperty;
|
||||
|
||||
const selectedItems = personalForm.value.isProperty.filter(
|
||||
(item) => item.value === true
|
||||
// selectedIds.includes(item.value)
|
||||
);
|
||||
return (
|
||||
selectedItems.length > 0 && selectedItems.length === selectedIds.length
|
||||
selectedItems.length > 0 || selectedItems.length === selectedIds.length
|
||||
);
|
||||
};
|
||||
|
||||
const ClickSave = () => {
|
||||
const isValid = validateData();
|
||||
|
||||
if (isValid) {
|
||||
console.log(selection.value);
|
||||
console.log("rerer", props.Modal);
|
||||
props.close();
|
||||
props.validate();
|
||||
selection.value = [];
|
||||
// props.close();
|
||||
// props.validate();
|
||||
// putpersonalForm();
|
||||
modalConfirm(
|
||||
$q,
|
||||
"การยืนยัน",
|
||||
"ยืนยันการบันทึกการคัดกรองคุณสมบัติ",
|
||||
putpersonalForm
|
||||
);
|
||||
} else {
|
||||
success($q, "กรอกให้ครบ");
|
||||
console.log();
|
||||
}
|
||||
};
|
||||
const fetchData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.getDatapersonal("0a846508-4932-40de-9a9e-5b519492217c"))
|
||||
.then((res) => {
|
||||
personalForm.value = res.data.result;
|
||||
personalForm.value.education.map((e) => {
|
||||
rows.value.push({
|
||||
university: e.name,
|
||||
degree: e.degree,
|
||||
major: e.field,
|
||||
graduation: e.finishDate,
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log("e", e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const formBmaofficer = (val: string) => {
|
||||
switch (val) {
|
||||
case "officer":
|
||||
return "ขรก.กทม. สามัญ";
|
||||
break;
|
||||
case "employee_perm":
|
||||
return "ลูกจ้างประจำ";
|
||||
break;
|
||||
case "employee_temp":
|
||||
return "ลูกจ้างชั่วคราว";
|
||||
break;
|
||||
default:
|
||||
"";
|
||||
}
|
||||
};
|
||||
|
||||
const close = async () => {
|
||||
props.close();
|
||||
selection.value = [];
|
||||
rows.value = [];
|
||||
};
|
||||
const putpersonalForm = async () => {
|
||||
await http
|
||||
.put(
|
||||
config.API.putProperty("0a846508-4932-40de-9a9e-5b519492217c"),
|
||||
personalForm.value.isProperty
|
||||
)
|
||||
.then((res) => {
|
||||
success($q, res.data.message);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
props.close();
|
||||
props.validate();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
|
|
@ -164,7 +235,7 @@ const close = async () => {
|
|||
<q-form ref="myForm">
|
||||
<div class="row">
|
||||
<DialogHeader
|
||||
:title="`รายละเอียดของ ${props.getdetail.fullName}`"
|
||||
:title="`รายละเอียดของ ${personalForm.fullName}`"
|
||||
@click="close"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -176,7 +247,10 @@ const close = async () => {
|
|||
<div class="row items-center q-pa-xs header-text">
|
||||
ข้อมูลทั่วไป
|
||||
<span class="check-officer"
|
||||
><q-icon name="mdi-check" /> ข้าราชการฯ กทม</span
|
||||
><q-icon
|
||||
name="mdi-check"
|
||||
v-if="personalForm.bmaofficer !== null && ''"
|
||||
/>{{ formBmaofficer(personalForm.bmaofficer) }}</span
|
||||
>
|
||||
</div>
|
||||
<div class="row q-pa-xs">
|
||||
|
|
@ -186,10 +260,10 @@ const close = async () => {
|
|||
</div>
|
||||
<div class="col-4 sub-text">
|
||||
<div class="q-pb-md">
|
||||
{{ props.getdetail.profileID }}
|
||||
{{ personalForm.idCard }}
|
||||
</div>
|
||||
<div>
|
||||
{{ props.getdetail.dateOfBirth }}
|
||||
{{ date2Thai(personalForm.dateOfBirth) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2 header-sub-text">
|
||||
|
|
@ -198,10 +272,10 @@ const close = async () => {
|
|||
</div>
|
||||
<div class="col-3 sub-text">
|
||||
<div class="q-pb-md">
|
||||
{{ props.getdetail.fullName }}
|
||||
{{ personalForm.fullName }}
|
||||
</div>
|
||||
<div>
|
||||
{{ props.getdetail.gender }}
|
||||
{{ personalForm.gender }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -213,7 +287,7 @@ const close = async () => {
|
|||
<div class="row q-pa-xs">
|
||||
<div class="col-3 header-sub-text">ที่อยู่</div>
|
||||
<div class="col-9 sub-text">
|
||||
{{ props.getdetail.address }}
|
||||
{{ personalForm.address }}
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
@ -231,6 +305,7 @@ const close = async () => {
|
|||
virtual-scroll
|
||||
:virtual-scroll-sticky-size-start="48"
|
||||
dense
|
||||
hide-bottom
|
||||
>
|
||||
</q-table>
|
||||
</q-card>
|
||||
|
|
@ -252,31 +327,31 @@ const close = async () => {
|
|||
<div class="col-4 q-pa-xs">
|
||||
<div class="header-sub-text-exam-2">คะแนนที่ได้</div>
|
||||
<div class="sub-text-exam">
|
||||
{{ props.getdetail.scoreResult.scoreAFull }}
|
||||
{{ personalForm.pointTotalA }}
|
||||
</div>
|
||||
<div class="sub-text-exam">
|
||||
{{ props.getdetail.scoreResult.scoreBFull }}
|
||||
{{ personalForm.pointTotalB }}
|
||||
</div>
|
||||
<div class="sub-text-exam">
|
||||
{{ props.getdetail.scoreResult.scoreCFull }}
|
||||
{{ personalForm.pointTotalC }}
|
||||
</div>
|
||||
<div class="sub-text-exam">
|
||||
{{ props.getdetail.scoreResult.scoreSumFull }}
|
||||
{{ personalForm.pointTotal }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 q-pa-xs header-sub-text-exam-2">
|
||||
<div class="header-sub-text-exam-2">ผลการสอบ</div>
|
||||
<div class="sub-text-exam">
|
||||
{{ props.getdetail.scoreResult.scoreA }}
|
||||
{{ personalForm.pointA }}
|
||||
</div>
|
||||
<div class="sub-text-exam">
|
||||
{{ props.getdetail.scoreResult.scoreB }}
|
||||
{{ personalForm.pointB }}
|
||||
</div>
|
||||
<div class="sub-text-exam">
|
||||
{{ props.getdetail.scoreResult.scoreC }}
|
||||
{{ personalForm.pointC }}
|
||||
</div>
|
||||
<div class="sub-text-exam">
|
||||
{{ props.getdetail.scoreResult.scoreSum }}
|
||||
{{ personalForm.point }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -292,10 +367,10 @@ const close = async () => {
|
|||
</div>
|
||||
<div class="col-5 sub-text-exam">
|
||||
<div class="q-pb-sm">
|
||||
{{ props.getdetail.scoreResult.examResult }}
|
||||
{{ personalForm.pass }}
|
||||
</div>
|
||||
<div class="q-pb-sm">{{ props.getdetail.number }}</div>
|
||||
<div class="q-pb-sm">{{ props.getdetail.examCount }}</div>
|
||||
<div class="q-pb-sm">{{ personalForm.examNumber }}</div>
|
||||
<div class="q-pb-sm">{{ personalForm.examRound }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -308,12 +383,16 @@ const close = async () => {
|
|||
<div class="col-12 row items-center q-pa-sm header-text">
|
||||
การคัดกรองคุณสมบัติ
|
||||
</div>
|
||||
<div v-for="item of checkboxItems" :key="item.id" class="q-pa-sm">
|
||||
<div
|
||||
v-for="(item, index) of personalForm.isProperty"
|
||||
:key="index"
|
||||
class="q-pa-sm"
|
||||
>
|
||||
<q-checkbox
|
||||
size="xs"
|
||||
v-model="selection"
|
||||
:val="item.id"
|
||||
:label="item.label"
|
||||
v-model="item.value"
|
||||
:val="item.value"
|
||||
:label="item.name"
|
||||
keep-color
|
||||
color="teal"
|
||||
:rules="[isRequired]"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
import type { zipCodeOption } from "../../components/PersonalDetail/profileType";
|
||||
interface DataOption {
|
||||
id: number | string;
|
||||
name: string;
|
||||
id: number|null;
|
||||
name:string|null;
|
||||
disable?: boolean;
|
||||
}
|
||||
interface DataOption1 {
|
||||
id: string|null;
|
||||
name:string|null;
|
||||
disable?: boolean;
|
||||
}
|
||||
|
||||
interface DataOptionInsignia {
|
||||
id: string;
|
||||
name: string;
|
||||
|
|
@ -61,6 +65,7 @@ export type {
|
|||
AddressOps,
|
||||
Pagination,
|
||||
EduOps,
|
||||
DataOption1,
|
||||
InsigniaOps,
|
||||
CheckboxItem,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,8 +4,10 @@ interface FormPlacementMainData {
|
|||
examRound: string;
|
||||
examOrder: number;
|
||||
fiscalYear: number;
|
||||
numberofCandidates: number;
|
||||
examType: number;
|
||||
numberOfCandidates: number;
|
||||
examTypeValue:string;
|
||||
examTypeName: string;
|
||||
accountStartDate: string;
|
||||
accountExpirationDate: string;
|
||||
isExpired?: boolean;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
interface TableName {
|
||||
profileID: string;
|
||||
personalId: string;
|
||||
position: number;
|
||||
fullName: string;
|
||||
dateOfBirth: string;
|
||||
|
|
@ -7,14 +7,20 @@ interface TableName {
|
|||
ExamOrder: number;
|
||||
unitId: string;
|
||||
UnitGroup: string;
|
||||
positionNumber:string;
|
||||
positionPath:string;
|
||||
Unit: string;
|
||||
ReportingDate: string; //วันที่รายงานตัว
|
||||
BMAOfficer: string;
|
||||
Status: string;
|
||||
reportingDate: string; //วันที่รายงานตัว
|
||||
bmaOfficer: string;
|
||||
statusId: string;
|
||||
checkList: any;
|
||||
address: string;
|
||||
university: string;
|
||||
degree: string;
|
||||
disclaim: string;
|
||||
profilePhoto:string;
|
||||
organizationName:string;
|
||||
organizationShortName:string;
|
||||
major: string;
|
||||
remark: string;
|
||||
number: number;
|
||||
|
|
@ -31,5 +37,19 @@ interface TableName {
|
|||
examResult: string;
|
||||
};
|
||||
}
|
||||
|
||||
export type { TableName };
|
||||
interface PartialTableName {
|
||||
personalId: string;
|
||||
fullName: string;
|
||||
idCard: string;
|
||||
profilePhoto: string;
|
||||
organizationName: string;
|
||||
organizationShortName: string;
|
||||
positionNumber: string;
|
||||
positionPath: string;
|
||||
reportingDate: string;
|
||||
bmaOfficer: string;
|
||||
number: number;
|
||||
statusId: string;
|
||||
disclaim: string;
|
||||
}
|
||||
export type { TableName ,PartialTableName};
|
||||
|
|
@ -43,7 +43,7 @@ export default [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: "/placement/detail",
|
||||
path: "/placement/pass/:examId",
|
||||
name: "placementDetail",
|
||||
component: PlacementDetail,
|
||||
meta: {
|
||||
|
|
|
|||
|
|
@ -104,77 +104,77 @@ export const usePlacementDataStore = defineStore("placement", () => {
|
|||
(DataMainYear.value = val);
|
||||
const DataMain = (val: FormPlacementMainData[]) => (DataMainOrig.value = val);
|
||||
const DataUpdateMain = (
|
||||
filter_1: number | null,
|
||||
filter_2: number | null,
|
||||
filter_1: number | string,
|
||||
filter_2: string | null,
|
||||
filter_3: boolean
|
||||
) => {
|
||||
DataMainUpdate.value = [];
|
||||
if (filter_1 === null && filter_2 === 0 && filter_3 === false) {
|
||||
if (filter_1 === "all" && filter_2 === "all" && filter_3 === false) {
|
||||
// console.log('case 1');
|
||||
// return DataMainUpdate.value = DataMainOrig.value; อันเก่า
|
||||
return (DataMainUpdate.value = DataMainOrig.value.filter(
|
||||
(item) => item.isExpired === filter_3
|
||||
));
|
||||
} else if (filter_1 === null && filter_2 === null && filter_3 === false) {
|
||||
} else if (filter_1 === "all" && filter_2 === "all" && filter_3 === false) {
|
||||
// console.log('case 1.1');
|
||||
return (DataMainUpdate.value = DataMainOrig.value.filter(
|
||||
(item) => item.isExpired === filter_3
|
||||
));
|
||||
} else if (filter_1 !== null && filter_2 === 0 && filter_3 === false) {
|
||||
} else if (filter_1 !== "all" && filter_2 === "all" && filter_3 === false) {
|
||||
// console.log('case 2');
|
||||
return (DataMainUpdate.value = DataMainOrig.value.filter(
|
||||
(item) => item.examOrder === filter_1 && item.isExpired === filter_3
|
||||
));
|
||||
} else if (filter_1 !== null && filter_2 === null && filter_3 === false) {
|
||||
} else if (filter_1 !== "all" && filter_2 === "all" && filter_3 === false) {
|
||||
// console.log('case 2.1');
|
||||
return (DataMainUpdate.value = DataMainOrig.value.filter(
|
||||
(item) => item.examOrder === filter_1 && item.isExpired === filter_3
|
||||
));
|
||||
} else if (filter_1 !== null && filter_2 !== 0 && filter_3 === false) {
|
||||
} else if (filter_1 !== "all" && filter_2 !== "all" && filter_3 === false) {
|
||||
// console.log('case 2.2');
|
||||
return (DataMainUpdate.value = DataMainOrig.value.filter(
|
||||
(item) =>
|
||||
item.examOrder === filter_1 &&
|
||||
item.examType === filter_2 &&
|
||||
item.examTypeValue === filter_2 &&
|
||||
item.isExpired === filter_3
|
||||
));
|
||||
} else if (filter_1 === null && filter_2 !== 0 && filter_3 === false) {
|
||||
} else if (filter_1 === "all" && filter_2 !== "all" && filter_3 === false) {
|
||||
// console.log('case 3');
|
||||
return (DataMainUpdate.value = DataMainOrig.value.filter(
|
||||
(item) => item.examType === filter_2 && item.isExpired === filter_3
|
||||
(item) => item.examTypeValue === filter_2 && item.isExpired === filter_3
|
||||
));
|
||||
} else if (filter_1 === null && filter_2 === 0 && filter_3 === true) {
|
||||
} else if (filter_1 === "all" && filter_2 === "all" && filter_3 === true) {
|
||||
// console.log('case 3.1');
|
||||
return (DataMainUpdate.value = DataMainOrig.value.filter(
|
||||
(item) => item.isExpired === filter_3
|
||||
));
|
||||
} else if (filter_1 === null && filter_2 === null && filter_3 === true) {
|
||||
} else if (filter_1 === "all" && filter_2 === "all" && filter_3 === true) {
|
||||
// console.log('case 3.2');
|
||||
return (DataMainUpdate.value = DataMainOrig.value.filter(
|
||||
(item) => item.isExpired === filter_3
|
||||
));
|
||||
} else if (filter_1 !== null && filter_2 === 0 && filter_3 === true) {
|
||||
} else if (filter_1 !== "all" && filter_2 === "all" && filter_3 === true) {
|
||||
// console.log('case 3.3');
|
||||
return (DataMainUpdate.value = DataMainOrig.value.filter(
|
||||
(item) => item.examOrder == filter_1 && item.isExpired == filter_3
|
||||
));
|
||||
} else if (filter_1 !== null && filter_2 === null && filter_3 === true) {
|
||||
} else if (filter_1 !== "all" && filter_2 === "all" && filter_3 === true) {
|
||||
// console.log('case 3.4');
|
||||
return (DataMainUpdate.value = DataMainOrig.value.filter(
|
||||
(item) => item.examOrder == filter_1 && item.isExpired == filter_3
|
||||
));
|
||||
} else if (filter_1 !== null && filter_2 !== 0 && filter_3 === true) {
|
||||
} else if (filter_1 !== "all" && filter_2 !== "all" && filter_3 === true) {
|
||||
// console.log('case 3.5');
|
||||
return (DataMainUpdate.value = DataMainOrig.value.filter(
|
||||
(item) =>
|
||||
item.examOrder == filter_1 &&
|
||||
item.examType == filter_2 &&
|
||||
item.examTypeValue == filter_2 &&
|
||||
item.isExpired == filter_3
|
||||
));
|
||||
} else if (filter_1 === null && filter_2 !== 0 && filter_3 === true) {
|
||||
} else if (filter_1 === "all" && filter_2 !== "all" && filter_3 === true) {
|
||||
// console.log('case 3.6');
|
||||
return (DataMainUpdate.value = DataMainOrig.value.filter(
|
||||
(item) => item.examType == filter_2 && item.isExpired == filter_3
|
||||
(item) => item.examTypeValue == filter_2 && item.isExpired == filter_3
|
||||
));
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue