Edit valiable and type
This commit is contained in:
parent
377086ff28
commit
d6010bf0f1
4 changed files with 154 additions and 154 deletions
|
|
@ -29,62 +29,62 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "ExamRound",
|
||||
name: "examRound",
|
||||
align: "left",
|
||||
label: "รอบการสอบ",
|
||||
sortable: true,
|
||||
field: "ExamRound",
|
||||
field: "examRound",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "ExamOrder",
|
||||
name: "examOrder",
|
||||
align: "left",
|
||||
label: "ครั้งที่",
|
||||
sortable: true,
|
||||
field: "ExamOrder",
|
||||
field: "examOrder",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "FiscalYear",
|
||||
name: "fiscalYear",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "FiscalYear",
|
||||
field: "fiscalYear",
|
||||
headerStyle: "font-size: 14px",
|
||||
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: "examType",
|
||||
align: "left",
|
||||
label: "ประเภทการสอบ",
|
||||
sortable: false,
|
||||
field: "ExamType",
|
||||
field: "examType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "AccountExpirationDate",
|
||||
name: "accountExpirationDate",
|
||||
align: "left",
|
||||
label: "วันที่บัญชีหมดอายุ",
|
||||
sortable: true,
|
||||
field: "AccountExpirationDate",
|
||||
field: "accountExpirationDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -96,48 +96,48 @@ 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"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
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",
|
||||
examRound: "การสอบแข่งขันเพื่อรับบุคคลทั่วไปเข้ารับราชการ ส่วนการจัดการทั่วไป",
|
||||
examOrder: 1,
|
||||
fiscalYear: 2021,
|
||||
numberofCandidates: 20,
|
||||
examType: 2,
|
||||
accountExpirationDate: "2024-05-21T14:47:04.1785384Z",
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ const redirectToPage = (id: number) => {
|
|||
// เลือกปีงบประมาณ
|
||||
const fiscalyear = ref<number | null>(0);
|
||||
const fiscalyearOP = reactive<DataOption[]>([{ id: 0, name: 'ทั้งหมด' }]);
|
||||
const addedFiscalYearValues: number[] = [];
|
||||
const addedfiscalYearValues: number[] = [];
|
||||
const fiscalYearFilter = async () => {
|
||||
// API
|
||||
// await http
|
||||
|
|
@ -196,21 +196,21 @@ const fiscalYearFilter = async () => {
|
|||
// .finally(async () => {
|
||||
// });
|
||||
for (let data of OriginalData.value) {
|
||||
const year = data.FiscalYear + 543;
|
||||
const year = data.fiscalYear + 543;
|
||||
|
||||
if (fiscalyear.value === null || year > fiscalyear.value) {
|
||||
fiscalyear.value = year;
|
||||
}
|
||||
|
||||
if (!addedFiscalYearValues.includes(year)) {
|
||||
if (!addedfiscalYearValues.includes(year)) {
|
||||
fiscalyearOP.push({ id: year, name: year.toString() });
|
||||
addedFiscalYearValues.push(year);
|
||||
addedfiscalYearValues.push(year);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// เลือกปีงบประมาณตาม API
|
||||
const searchFiscalyear = () => {
|
||||
const searchfiscalyear = () => {
|
||||
console.log('Input value changed:', fiscalyear.value);
|
||||
// API
|
||||
// await http
|
||||
|
|
@ -233,15 +233,15 @@ const resetFilter = () => {
|
|||
};
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const visibleColumns = ref<string[]>(['id', 'ExamRound', 'ExamOrder', 'FiscalYear', 'NumberofCandidates', 'ExamType', 'AccountExpirationDate']) //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const visibleColumns = ref<string[]>(['id', 'examRound', 'examOrder', 'fiscalYear', 'numberofCandidates', 'examType', 'accountExpirationDate']) //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
|
||||
// ครั้งที่สอบ
|
||||
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);
|
||||
if (!examTimeOP.value.includes(data.examOrder)) {
|
||||
examTimeOP.value.push(data.examOrder);
|
||||
}
|
||||
}
|
||||
examTimeOP.value.sort((a, b) => a - b); // เรียงลำดับ
|
||||
|
|
@ -250,16 +250,16 @@ const examTimeFilter = async () => {
|
|||
// ประเภทการสอบ
|
||||
const examType = ref<number | null>(0);
|
||||
const examTypeOP = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
||||
const addedExamTypeValues: number[] = [];
|
||||
const addedexamTypeValues: number[] = [];
|
||||
const examTypeFilter = async () => {
|
||||
for (let data of OriginalData.value) {
|
||||
const examTypeValue = data.ExamType;
|
||||
if (examTypeValue == 1 && !addedExamTypeValues.includes(1)) {
|
||||
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)) {
|
||||
addedexamTypeValues.push(1);
|
||||
} else if (examTypeValue == 2 && !addedexamTypeValues.includes(2)) {
|
||||
examTypeOP.push({ id: 2, name: "สอบแข่งขัน" });
|
||||
addedExamTypeValues.push(2);
|
||||
addedexamTypeValues.push(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -275,7 +275,7 @@ 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 expirationDate = new Date(data.accountExpirationDate);
|
||||
let isExpired = expirationDate < currentDate;
|
||||
|
||||
return { ...data, isExpired };
|
||||
|
|
@ -302,7 +302,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||
<q-select v-model="fiscalyear" label="ปีงบประมาณ" dense clearable emit-value map-options :options="fiscalyearOP"
|
||||
option-value="id" option-label="name" lazy-rules hide-bottom-space :readonly="false" :borderless="false"
|
||||
:outlined="true" :hide-dropdown-icon="false" @update:model-value="searchFiscalyear" />
|
||||
:outlined="true" :hide-dropdown-icon="false" @update:model-value="searchfiscalyear" />
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-6"></div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||
|
|
@ -349,23 +349,23 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
<q-td key="id" :props="props">
|
||||
{{ props.row.id }}
|
||||
</q-td>
|
||||
<q-td key="ExamRound" :props="props">
|
||||
{{ props.row.ExamRound }}
|
||||
<q-td key="examRound" :props="props">
|
||||
{{ props.row.examRound }}
|
||||
</q-td>
|
||||
<q-td key="ExamOrder" :props="props">
|
||||
{{ props.row.ExamOrder }}
|
||||
<q-td key="examOrder" :props="props">
|
||||
{{ props.row.examOrder }}
|
||||
</q-td>
|
||||
<q-td key="FiscalYear" :props="props">
|
||||
{{ props.row.FiscalYear + 543 }}
|
||||
<q-td key="fiscalYear" :props="props">
|
||||
{{ props.row.fiscalYear + 543 }}
|
||||
</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="examType" :props="props">
|
||||
{{ props.row.examType == 1 ? 'คัดเลือก' : 'สอบแข่งขัน' }}
|
||||
</q-td>
|
||||
<q-td key="AccountExpirationDate" :props="props">
|
||||
{{ textDate(props.row.AccountExpirationDate) }}
|
||||
<q-td key="accountExpirationDate" :props="props">
|
||||
{{ textDate(props.row.accountExpirationDate) }}
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -29,62 +29,62 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "ExamRound",
|
||||
name: "examRound",
|
||||
align: "left",
|
||||
label: "รอบการสอบ",
|
||||
sortable: true,
|
||||
field: "ExamRound",
|
||||
field: "examRound",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "ExamOrder",
|
||||
name: "examOrder",
|
||||
align: "left",
|
||||
label: "ครั้งที่",
|
||||
sortable: true,
|
||||
field: "ExamOrder",
|
||||
field: "examOrder",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "FiscalYear",
|
||||
name: "fiscalYear",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "FiscalYear",
|
||||
field: "fiscalYear",
|
||||
headerStyle: "font-size: 14px",
|
||||
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: "examType",
|
||||
align: "left",
|
||||
label: "ประเภทการสอบ",
|
||||
sortable: false,
|
||||
field: "ExamType",
|
||||
field: "examType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "AccountExpirationDate",
|
||||
name: "accountExpirationDate",
|
||||
align: "left",
|
||||
label: "วันที่บัญชีหมดอายุ",
|
||||
sortable: true,
|
||||
field: "AccountExpirationDate",
|
||||
field: "accountExpirationDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -96,48 +96,48 @@ 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"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
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",
|
||||
examRound: "การสอบแข่งขันเพื่อรับบุคคลทั่วไปเข้ารับราชการ ส่วนการจัดการทั่วไป",
|
||||
examOrder: 1,
|
||||
fiscalYear: 2021,
|
||||
numberofCandidates: 20,
|
||||
examType: 2,
|
||||
accountExpirationDate: "2024-05-21T14:47:04.1785384Z",
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ const redirectToPage = (id: number) => {
|
|||
// เลือกปีงบประมาณ
|
||||
const fiscalyear = ref<number | null>(0);
|
||||
const fiscalyearOP = reactive<DataOption[]>([{ id: 0, name: 'ทั้งหมด' }]);
|
||||
const addedFiscalYearValues: number[] = [];
|
||||
const addedfiscalYearValues: number[] = [];
|
||||
const fiscalYearFilter = async () => {
|
||||
// API
|
||||
// await http
|
||||
|
|
@ -196,21 +196,21 @@ const fiscalYearFilter = async () => {
|
|||
// .finally(async () => {
|
||||
// });
|
||||
for (let data of OriginalData.value) {
|
||||
const year = data.FiscalYear + 543;
|
||||
const year = data.fiscalYear + 543;
|
||||
|
||||
if (fiscalyear.value === null || year > fiscalyear.value) {
|
||||
fiscalyear.value = year;
|
||||
}
|
||||
|
||||
if (!addedFiscalYearValues.includes(year)) {
|
||||
if (!addedfiscalYearValues.includes(year)) {
|
||||
fiscalyearOP.push({ id: year, name: year.toString() });
|
||||
addedFiscalYearValues.push(year);
|
||||
addedfiscalYearValues.push(year);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// เลือกปีงบประมาณตาม API
|
||||
const searchFiscalyear = () => {
|
||||
const searchfiscalyear = () => {
|
||||
console.log('Input value changed:', fiscalyear.value);
|
||||
// API
|
||||
// await http
|
||||
|
|
@ -233,15 +233,15 @@ const resetFilter = () => {
|
|||
};
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const visibleColumns = ref<string[]>(['id', 'ExamRound', 'ExamOrder', 'FiscalYear', 'NumberofCandidates', 'ExamType', 'AccountExpirationDate']) //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const visibleColumns = ref<string[]>(['id', 'examRound', 'examOrder', 'fiscalYear', 'numberofCandidates', 'examType', 'accountExpirationDate']) //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
|
||||
// ครั้งที่สอบ
|
||||
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);
|
||||
if (!examTimeOP.value.includes(data.examOrder)) {
|
||||
examTimeOP.value.push(data.examOrder);
|
||||
}
|
||||
}
|
||||
examTimeOP.value.sort((a, b) => a - b); // เรียงลำดับ
|
||||
|
|
@ -250,16 +250,16 @@ const examTimeFilter = async () => {
|
|||
// ประเภทการสอบ
|
||||
const examType = ref<number | null>(0);
|
||||
const examTypeOP = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
||||
const addedExamTypeValues: number[] = [];
|
||||
const addedexamTypeValues: number[] = [];
|
||||
const examTypeFilter = async () => {
|
||||
for (let data of OriginalData.value) {
|
||||
const examTypeValue = data.ExamType;
|
||||
if (examTypeValue == 1 && !addedExamTypeValues.includes(1)) {
|
||||
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)) {
|
||||
addedexamTypeValues.push(1);
|
||||
} else if (examTypeValue == 2 && !addedexamTypeValues.includes(2)) {
|
||||
examTypeOP.push({ id: 2, name: "สอบแข่งขัน" });
|
||||
addedExamTypeValues.push(2);
|
||||
addedexamTypeValues.push(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -275,7 +275,7 @@ 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 expirationDate = new Date(data.accountExpirationDate);
|
||||
let isExpired = expirationDate < currentDate;
|
||||
|
||||
return { ...data, isExpired };
|
||||
|
|
@ -302,7 +302,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||
<q-select v-model="fiscalyear" label="ปีงบประมาณ" dense clearable emit-value map-options :options="fiscalyearOP"
|
||||
option-value="id" option-label="name" lazy-rules hide-bottom-space :readonly="false" :borderless="false"
|
||||
:outlined="true" :hide-dropdown-icon="false" @update:model-value="searchFiscalyear" />
|
||||
:outlined="true" :hide-dropdown-icon="false" @update:model-value="searchfiscalyear" />
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-6"></div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||
|
|
@ -349,23 +349,23 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
<q-td key="id" :props="props">
|
||||
{{ props.row.id }}
|
||||
</q-td>
|
||||
<q-td key="ExamRound" :props="props">
|
||||
{{ props.row.ExamRound }}
|
||||
<q-td key="examRound" :props="props">
|
||||
{{ props.row.examRound }}
|
||||
</q-td>
|
||||
<q-td key="ExamOrder" :props="props">
|
||||
{{ props.row.ExamOrder }}
|
||||
<q-td key="examOrder" :props="props">
|
||||
{{ props.row.examOrder }}
|
||||
</q-td>
|
||||
<q-td key="FiscalYear" :props="props">
|
||||
{{ props.row.FiscalYear + 543 }}
|
||||
<q-td key="fiscalYear" :props="props">
|
||||
{{ props.row.fiscalYear + 543 }}
|
||||
</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="examType" :props="props">
|
||||
{{ props.row.examType == 1 ? 'คัดเลือก' : 'สอบแข่งขัน' }}
|
||||
</q-td>
|
||||
<q-td key="AccountExpirationDate" :props="props">
|
||||
{{ textDate(props.row.AccountExpirationDate) }}
|
||||
<q-td key="accountExpirationDate" :props="props">
|
||||
{{ textDate(props.row.accountExpirationDate) }}
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
// ข้อมูลรายการสอบแข่งขัน/คัดเลือก
|
||||
interface FormPlacementMainData {
|
||||
id: number;
|
||||
ExamRound: string;
|
||||
ExamOrder: number;
|
||||
FiscalYear: number;
|
||||
NumberofCandidates: number;
|
||||
ExamType: number;
|
||||
AccountExpirationDate: string;
|
||||
examRound: string;
|
||||
examOrder: number;
|
||||
fiscalYear: number;
|
||||
numberofCandidates: number;
|
||||
examType: number;
|
||||
accountExpirationDate: string;
|
||||
isExpired?: boolean;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,16 +41,16 @@ export const usePlacementDataStore = defineStore("placement", () => {
|
|||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
|
|
@ -59,16 +59,16 @@ export const usePlacementDataStore = defineStore("placement", () => {
|
|||
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);
|
||||
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);
|
||||
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);
|
||||
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 DataMainUpdate.value = DataMainOrig.value.filter((item) => item.examType == filter_2 && item.isExpired == filter_3);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue