From 0d213400e15a7805b080a74c9614e45e7c5fce52 Mon Sep 17 00:00:00 2001 From: watcharanondh Date: Fri, 9 Jun 2023 15:42:06 +0700 Subject: [PATCH] =?UTF-8?q?Fig=20filter=20=E0=B9=83=E0=B8=AB=E0=B9=89?= =?UTF-8?q?=E0=B8=AA=E0=B8=B1=E0=B8=A1=E0=B8=9E=E0=B8=B1=E0=B8=99=E0=B8=98?= =?UTF-8?q?=E0=B9=8C=E0=B8=81=E0=B8=B1=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exams_korkor/Main.vue} | 365 ++++++------- .../components/exams_sorkorcho/Main.vue | 425 +++++++++++++++ src/modules/05_placement/router.ts | 26 +- src/modules/05_placement/store.ts | 49 +- src/modules/05_placement/views/Main.vue | 491 +----------------- 5 files changed, 631 insertions(+), 725 deletions(-) rename src/modules/05_placement/{views/Domination.vue => components/exams_korkor/Main.vue} (53%) create mode 100644 src/modules/05_placement/components/exams_sorkorcho/Main.vue diff --git a/src/modules/05_placement/views/Domination.vue b/src/modules/05_placement/components/exams_korkor/Main.vue similarity index 53% rename from src/modules/05_placement/views/Domination.vue rename to src/modules/05_placement/components/exams_korkor/Main.vue index 0db669f8d..2b53fb1bb 100644 --- a/src/modules/05_placement/views/Domination.vue +++ b/src/modules/05_placement/components/exams_korkor/Main.vue @@ -1,7 +1,7 @@ @@ -287,165 +297,79 @@ const paginationLabel = (start: string, end: string, total: string) => { รายการสอบแข่งขัน / คัดเลือก
- -
+ +
- +
- +
- +
- +
- +
-
- - +
@@ -456,7 +380,7 @@ const paginationLabel = (start: string, end: string, total: string) => { background-color: #EDEDED; } -.toggle-expired-account{ +.toggle-expired-account { font-size: 12px; font-weight: 400; font-size: 15px; @@ -465,32 +389,37 @@ const paginationLabel = (start: string, end: string, total: string) => { } .icon-color { - color: #4154b3; + color: #4154b3; +} + +.custom-header-table { + max-height: 64vh; + + .q-table tr:nth-child(odd) td { + background: white; } - .custom-header-table { - max-height: 64vh; - .q-table tr:nth-child(odd) td { - background: white; - } - .q-table tr:nth-child(even) td { - background: #f8f8f8; - } - - .q-table thead tr { - background: #ecebeb; - } - - .q-table thead tr th { - position: sticky; - z-index: 1; - } - /* this will be the loading indicator */ - .q-table thead tr:last-child th { - /* height of all previous header rows */ - top: 48px; - } - .q-table thead tr:first-child th { - top: 0; - } + + .q-table tr:nth-child(even) td { + background: #f8f8f8; } + + .q-table thead tr { + background: #ecebeb; + } + + .q-table thead tr th { + position: sticky; + z-index: 1; + } + + /* this will be the loading indicator */ + .q-table thead tr:last-child th { + /* height of all previous header rows */ + top: 48px; + } + + .q-table thead tr:first-child th { + top: 0; + } +} diff --git a/src/modules/05_placement/components/exams_sorkorcho/Main.vue b/src/modules/05_placement/components/exams_sorkorcho/Main.vue new file mode 100644 index 000000000..2b53fb1bb --- /dev/null +++ b/src/modules/05_placement/components/exams_sorkorcho/Main.vue @@ -0,0 +1,425 @@ + + + + + diff --git a/src/modules/05_placement/router.ts b/src/modules/05_placement/router.ts index f4af5d34e..0d6745f2f 100644 --- a/src/modules/05_placement/router.ts +++ b/src/modules/05_placement/router.ts @@ -2,15 +2,25 @@ * Router บรรจุ แต่งตั้ง ย้าย โอน (Placement) */ -const Main = () => import("@/modules/05_placement/views/Main.vue"); +const MainSorkorcho = () => import("@/modules/05_placement/components/exams_sorkorcho/Main.vue"); +const MainSorkorkor = () => import("@/modules/05_placement/components/exams_korkor/Main.vue"); const PlacementDetail = () => import("@/modules/05_placement/components/pass/Detail.vue"); -const Domination = () => import("@/modules/05_placement/views/Domination.vue"); export default [ { path: "/placement", name: "placement", - component: Main, + component: MainSorkorcho, + meta: { + Auth: true, + Key: [7], + Role: "placement", + }, + }, + { + path: "/placement2", + name: "placement2", + component: MainSorkorkor, meta: { Auth: true, Key: [7], @@ -37,15 +47,5 @@ export default [ Role: "placement", }, }, - { - path: "/domination", - name: "domination", - component: Domination, - meta: { - Auth: true, - Key: [7], - Role: "placement", - }, - }, ]; diff --git a/src/modules/05_placement/store.ts b/src/modules/05_placement/store.ts index 1769692af..06308826e 100644 --- a/src/modules/05_placement/store.ts +++ b/src/modules/05_placement/store.ts @@ -1,6 +1,6 @@ import { defineStore } from "pinia"; import { ref } from "vue"; -import type { FormPlacementMainData } from "@/modules/05_placement/interface/request/Main" +import type { FormPlacementMainData } from "@/modules/05_placement/interface/request/Main" export const useProfileDataStore = defineStore("placement", () => { return {}; }); @@ -26,19 +26,60 @@ export const usePlacementDataStore = defineStore("placement", () => { ); } - let DataMainOrig = ref([]) // ข้อมูลหลัก + let DataMainYear = ref([]) // ข้อมูลจำนวนปี + let DataMainOrig = ref([]) // ข้อมูลหลักดั้งเดิม let DataMainUpdate = ref([]) // ข้อมูลเปลี่ยนแปลง + const DataMainYearSet = (val: any) => (DataMainYear.value = val) const DataMain = (val: any) => (DataMainOrig.value = val) - const DataUpdateMain = (val: any) => { + const DataUpdateMain = (filter_1: number | null, filter_2: number | null, filter_3: boolean) => { DataMainUpdate.value = []; - DataMainUpdate.value = val; + if (filter_1 === null && filter_2 === 0 && filter_3 === false) { + // console.log('case 1'); + return DataMainUpdate.value = DataMainOrig.value; + } else if (filter_1 === null && filter_2 === null && filter_3 === false) { + // console.log('case 1.1'); + return DataMainUpdate.value = DataMainOrig.value; + } else if (filter_1 !== null && filter_2 === 0 && filter_3 === false) { + // console.log('case 2'); + return DataMainUpdate.value = DataMainOrig.value.filter((item) => item.ExamOrder === filter_1); + } else if (filter_1 !== null && filter_2 === null && filter_3 === false) { + // console.log('case 2.1'); + return DataMainUpdate.value = DataMainOrig.value.filter((item) => item.ExamOrder === filter_1); + } else if (filter_1 !== null && filter_2 !== 0 && filter_3 === false) { + // console.log('case 2.2'); + return DataMainUpdate.value = DataMainOrig.value.filter((item) => item.ExamOrder === filter_1 && item.ExamType === filter_2); + } else if (filter_1 === null && filter_2 !== 0 && filter_3 === false) { + // console.log('case 3'); + return DataMainUpdate.value = DataMainOrig.value.filter((item) => item.ExamType === filter_2); + } else if (filter_1 === null && filter_2 === 0 && 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) { + // 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) { + // 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) { + // 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) { + // console.log('case 3.5'); + return DataMainUpdate.value = DataMainOrig.value.filter((item) => item.ExamOrder == filter_1 && item.ExamType == filter_2 && item.isExpired == filter_3); + } else if (filter_1 === null && filter_2 !== 0 && filter_3 === true) { + // console.log('case 3.6'); + return DataMainUpdate.value = DataMainOrig.value.filter((item) => item.ExamType == filter_2 && item.isExpired == filter_3); + } + } return { placementData, changePlacementColumns, + DataMainYear, DataMainOrig, DataMainUpdate, + DataMainYearSet, DataMain, DataUpdateMain, }; diff --git a/src/modules/05_placement/views/Main.vue b/src/modules/05_placement/views/Main.vue index 0db669f8d..299da05c1 100644 --- a/src/modules/05_placement/views/Main.vue +++ b/src/modules/05_placement/views/Main.vue @@ -1,496 +1,7 @@ - - - + \ No newline at end of file