ปรับการทำงาน paging ของสรรหา (รายชื่อคัดเลือก)
This commit is contained in:
parent
7f3ed1368b
commit
c13d22f704
2 changed files with 308 additions and 101 deletions
|
|
@ -1,19 +1,51 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="q-px-md q-pb-md">
|
<div class="q-px-md q-pb-md">
|
||||||
<q-card bordered flat class="col-12 row q-py-sm items-center bg-grey-1" v-show="statusPayment">
|
<q-card
|
||||||
|
bordered
|
||||||
|
flat
|
||||||
|
class="col-12 row q-py-sm items-center bg-grey-1"
|
||||||
|
v-show="statusPayment"
|
||||||
|
>
|
||||||
<div class="col-12 row q-col-gutter-sm">
|
<div class="col-12 row q-col-gutter-sm">
|
||||||
<span class="text-subtitle1">{{ titleText }}</span>
|
<span class="text-subtitle1">{{ titleText }}</span>
|
||||||
<q-select dense outlined :model-value="inputvisibleFilter" :options="optionsFilter" option-value="id"
|
<q-select
|
||||||
option-label="name" map-options class="col-xs-12 col-sm-3" label="สถานะ" emit-value
|
dense
|
||||||
@update:model-value="updateVisibleFilter" v-if="optionsFilter != undefined && optionsFilter.length > 0" />
|
outlined
|
||||||
<q-file v-model="files" dense :label="setSeat == false ? 'อัปโหลดที่นั่งสอบ' : 'อัปโหลดคะแนนสอบ'" outlined
|
:model-value="inputvisibleFilter"
|
||||||
use-chips multiple class="col-xs-12 col-sm-4" v-if="statusPayment">
|
:options="optionsFilter"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
map-options
|
||||||
|
class="col-xs-12 col-sm-3"
|
||||||
|
label="สถานะ"
|
||||||
|
emit-value
|
||||||
|
@update:model-value="updateVisibleFilter"
|
||||||
|
v-if="optionsFilter != undefined && optionsFilter.length > 0"
|
||||||
|
/>
|
||||||
|
<q-file
|
||||||
|
v-model="files"
|
||||||
|
dense
|
||||||
|
:label="setSeat == false ? 'อัปโหลดที่นั่งสอบ' : 'อัปโหลดคะแนนสอบ'"
|
||||||
|
outlined
|
||||||
|
use-chips
|
||||||
|
multiple
|
||||||
|
class="col-xs-12 col-sm-4"
|
||||||
|
v-if="statusPayment"
|
||||||
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon name="attach_file" color="blue" />
|
<q-icon name="attach_file" color="blue" />
|
||||||
</template>
|
</template>
|
||||||
</q-file>
|
</q-file>
|
||||||
<div>
|
<div>
|
||||||
<q-btn size="md" icon="mdi-upload" round flat color="blue" v-if="statusPayment" @click="uploadFile">
|
<q-btn
|
||||||
|
size="md"
|
||||||
|
icon="mdi-upload"
|
||||||
|
round
|
||||||
|
flat
|
||||||
|
color="blue"
|
||||||
|
v-if="statusPayment"
|
||||||
|
@click="uploadFile"
|
||||||
|
>
|
||||||
<q-tooltip v-if="setSeat == false">อัปโหลดที่นั่งสอบ</q-tooltip>
|
<q-tooltip v-if="setSeat == false">อัปโหลดที่นั่งสอบ</q-tooltip>
|
||||||
<q-tooltip v-if="setSeat == true">อัปโหลดคะแนนสอบ</q-tooltip>
|
<q-tooltip v-if="setSeat == true">อัปโหลดคะแนนสอบ</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -22,15 +54,33 @@
|
||||||
</q-card>
|
</q-card>
|
||||||
<div class="col-12 row q-py-sm items-center q-col-gutter-sm">
|
<div class="col-12 row q-py-sm items-center q-col-gutter-sm">
|
||||||
<div class="col-xs-12 col-sm-3" v-show="!statusPayment">
|
<div class="col-xs-12 col-sm-3" v-show="!statusPayment">
|
||||||
<q-select dense outlined :model-value="inputvisibleFilter" :options="optionsFilter" option-value="id"
|
<q-select
|
||||||
option-label="name" map-options class="" label="สถานะ" emit-value @update:model-value="updateVisibleFilter"
|
dense
|
||||||
v-if="optionsFilter != undefined && optionsFilter.length > 0" />
|
outlined
|
||||||
|
:model-value="inputvisibleFilter"
|
||||||
|
:options="optionsFilter"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
map-options
|
||||||
|
class=""
|
||||||
|
label="สถานะ"
|
||||||
|
emit-value
|
||||||
|
@update:model-value="updateVisibleFilter"
|
||||||
|
v-if="optionsFilter != undefined && optionsFilter.length > 0"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<q-btn size="md" icon="mdi-playlist-check" round flat color="primary" @click="candidateCheckProfileDialog"
|
<q-btn
|
||||||
|
size="md"
|
||||||
|
icon="mdi-playlist-check"
|
||||||
|
round
|
||||||
|
flat
|
||||||
|
color="primary"
|
||||||
|
@click="candidateCheckProfileDialog"
|
||||||
:disabled="attrs.rows.filter((r: any) => r.status == 'checkRegister').length == 0 ||
|
:disabled="attrs.rows.filter((r: any) => r.status == 'checkRegister').length == 0 ||
|
||||||
selected.length == 0
|
selected.length == 0
|
||||||
">
|
"
|
||||||
|
>
|
||||||
<q-tooltip>ตรวจสอบข้อมูล/ได้รับใบสมัครแล้ว</q-tooltip>
|
<q-tooltip>ตรวจสอบข้อมูล/ได้รับใบสมัครแล้ว</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -42,11 +92,21 @@
|
||||||
<q-item clickable v-close-popup @click="downloadFileDashboard">
|
<q-item clickable v-close-popup @click="downloadFileDashboard">
|
||||||
<q-item-section>ดาวน์โหลดสรุปข้อมูลสมัครสอบ</q-item-section>
|
<q-item-section>ดาวน์โหลดสรุปข้อมูลสมัครสอบ</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item clickable v-close-popup @click.stop.prevent="clickCandidateList()">
|
<q-item
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click.stop.prevent="clickCandidateList()"
|
||||||
|
>
|
||||||
<q-item-section>ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ</q-item-section>
|
<q-item-section>ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item clickable v-close-popup @click.stop.prevent="clickPassExam()">
|
<q-item
|
||||||
<q-item-section>ดาวน์โหลดรายชื่อผู้สอบคัดเลือกได้</q-item-section>
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click.stop.prevent="clickPassExam()"
|
||||||
|
>
|
||||||
|
<q-item-section
|
||||||
|
>ดาวน์โหลดรายชื่อผู้สอบคัดเลือกได้</q-item-section
|
||||||
|
>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item clickable v-close-popup @click="downloadFile()">
|
<q-item clickable v-close-popup @click="downloadFile()">
|
||||||
<q-item-section>ดาวน์โหลดจัดการรายชื่อผู้สมัคร</q-item-section>
|
<q-item-section>ดาวน์โหลดจัดการรายชื่อผู้สมัคร</q-item-section>
|
||||||
|
|
@ -59,8 +119,15 @@
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<q-btn size="md" icon="mdi-content-save-move-outline" round flat color="indigo"
|
<q-btn
|
||||||
v-if="statusPayment && setSeat == true" @click="candidateToPlacement">
|
size="md"
|
||||||
|
icon="mdi-content-save-move-outline"
|
||||||
|
round
|
||||||
|
flat
|
||||||
|
color="indigo"
|
||||||
|
v-if="statusPayment && setSeat == true"
|
||||||
|
@click="candidateToPlacement"
|
||||||
|
>
|
||||||
<q-tooltip>บรรจุผู้ผ่านการคัดเลือก</q-tooltip>
|
<q-tooltip>บรรจุผู้ผ่านการคัดเลือก</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -68,29 +135,77 @@
|
||||||
<div class="items-center gt-xs" style="display: flex">
|
<div class="items-center gt-xs" style="display: flex">
|
||||||
<!-- ค้นหาข้อความใน table -->
|
<!-- ค้นหาข้อความใน table -->
|
||||||
<!-- @keydown.enter.prevent:model-value="updateInput" -->
|
<!-- @keydown.enter.prevent:model-value="updateInput" -->
|
||||||
<q-input :model-value="inputfilter" @keydown.enter.prevent="submitInput" @update:model-value="updateInput"
|
<q-input
|
||||||
ref="filterRef" standout dense outlined debounce="300" placeholder="ค้นหา" style="max-width: 200px"
|
:model-value="inputfilter"
|
||||||
class="q-ml-sm">
|
@keydown.enter.prevent="submitInput"
|
||||||
|
@update:model-value="updateInput"
|
||||||
|
ref="filterRef"
|
||||||
|
standout
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
debounce="300"
|
||||||
|
placeholder="ค้นหา"
|
||||||
|
style="max-width: 200px"
|
||||||
|
class="q-ml-sm"
|
||||||
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon v-if="inputfilter == ''" name="search" />
|
<q-icon v-if="inputfilter == ''" name="search" />
|
||||||
<q-icon v-if="inputfilter !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
|
<q-icon
|
||||||
|
v-if="inputfilter !== ''"
|
||||||
|
name="clear"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="resetFilter"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
<!-- แสดงคอลัมน์ใน table -->
|
<!-- แสดงคอลัมน์ใน table -->
|
||||||
<q-select :model-value="inputvisible" @update:model-value="updateVisible" :display-value="$q.lang.table.columns"
|
<q-select
|
||||||
multiple outlined dense :options="attrs.columns" options-dense option-value="name" map-options emit-value
|
:model-value="inputvisible"
|
||||||
style="min-width: 150px" class="q-ml-sm" />
|
@update:model-value="updateVisible"
|
||||||
|
:display-value="$q.lang.table.columns"
|
||||||
|
multiple
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
:options="attrs.columns"
|
||||||
|
options-dense
|
||||||
|
option-value="name"
|
||||||
|
map-options
|
||||||
|
emit-value
|
||||||
|
style="min-width: 150px"
|
||||||
|
class="q-ml-sm"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-table ref="table" flat bordered class="custom-header-table" v-bind="attrs" virtual-scroll
|
<q-table
|
||||||
:virtual-scroll-sticky-size-start="48" dense :pagination="initialPagination"
|
ref="table"
|
||||||
:rows-per-page-options="paging == true ? [25, 50, 100, 500] : []" row-key="id" selection="multiple"
|
flat
|
||||||
v-model:selected="selected" @update:pagination="updatePagination" :filter="false">
|
bordered
|
||||||
|
class="custom-header-table"
|
||||||
|
v-bind="attrs"
|
||||||
|
virtual-scroll
|
||||||
|
:virtual-scroll-sticky-size-start="48"
|
||||||
|
dense
|
||||||
|
:pagination="initialPagination"
|
||||||
|
:rows-per-page-options="paging == true ? [25, 50, 100, 500] : []"
|
||||||
|
row-key="id"
|
||||||
|
selection="multiple"
|
||||||
|
v-model:selected="selected"
|
||||||
|
@update:pagination="updatePagination"
|
||||||
|
:filter="false"
|
||||||
|
>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
ทั้งหมด {{ props.total }} รายการ
|
ทั้งหมด {{ props.total }} รายการ
|
||||||
<q-pagination v-model="currentPage" active-color="primary" color="dark" :max-pages="5" size="sm" boundary-links
|
<q-pagination
|
||||||
direction-links :max="props.maxPage < 1 ? 1 : props.maxPage"></q-pagination>
|
v-model="currentPage"
|
||||||
|
active-color="primary"
|
||||||
|
color="dark"
|
||||||
|
:max-pages="5"
|
||||||
|
size="sm"
|
||||||
|
boundary-links
|
||||||
|
direction-links
|
||||||
|
:max="Number(props.maxPage)"
|
||||||
|
></q-pagination>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
|
|
@ -101,8 +216,12 @@
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
</q-th>
|
</q-th>
|
||||||
<q-th auto-width v-if="editvisible == true || nextPageVisible == true || history == true
|
<q-th
|
||||||
" />
|
auto-width
|
||||||
|
v-if="
|
||||||
|
editvisible == true || nextPageVisible == true || history == true
|
||||||
|
"
|
||||||
|
/>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template #body="props">
|
<template #body="props">
|
||||||
|
|
@ -168,19 +287,19 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
pageSize: {
|
pageSize: {
|
||||||
type: Number,
|
type: Number,
|
||||||
defualt: 25
|
defualt: 25,
|
||||||
},
|
},
|
||||||
page: {
|
page: {
|
||||||
type: Number,
|
type: Number,
|
||||||
defualt: 1
|
defualt: 1,
|
||||||
},
|
},
|
||||||
maxPage: {
|
maxPage: {
|
||||||
type: Number,
|
type: Number,
|
||||||
defualt: 1
|
defualt: 1,
|
||||||
},
|
},
|
||||||
total: {
|
total: {
|
||||||
type: Number,
|
type: Number,
|
||||||
defualt: 0
|
defualt: 0,
|
||||||
},
|
},
|
||||||
nornmalData: {
|
nornmalData: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|
@ -232,17 +351,6 @@ const props = defineProps({
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => console.log("not function"),
|
default: () => console.log("not function"),
|
||||||
},
|
},
|
||||||
changePage: {
|
|
||||||
type: Function,
|
|
||||||
default: () => console.log("not function"),
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Pagination - page & change page & get new data
|
|
||||||
const currentPage = ref<number>(1)
|
|
||||||
watch(currentPage, () => {
|
|
||||||
console.log(currentPage.value)
|
|
||||||
props.changePage(currentPage.value, props.pageSize, true);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Pagination - initial pagination
|
// Pagination - initial pagination
|
||||||
|
|
@ -253,10 +361,24 @@ const initialPagination = ref<any>({
|
||||||
rowsPerPage: props.pageSize,
|
rowsPerPage: props.pageSize,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Pagination - update rowsPerPage
|
// Pagination - page & change page & get new data
|
||||||
|
const currentPage = ref<number>(1);
|
||||||
|
watch(
|
||||||
|
[() => currentPage.value, () => initialPagination.value.rowsPerPage],
|
||||||
|
() => {
|
||||||
|
emit(
|
||||||
|
"update:change-page",
|
||||||
|
currentPage.value,
|
||||||
|
initialPagination.value.rowsPerPage,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Pagination - update rowsPerPage
|
||||||
async function updatePagination(newPagination: any) {
|
async function updatePagination(newPagination: any) {
|
||||||
props.changePage(1, newPagination.rowsPerPage, true);
|
initialPagination.value = newPagination;
|
||||||
initialPagination.value = newPagination
|
currentPage.value = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
|
|
@ -265,6 +387,7 @@ const emit = defineEmits([
|
||||||
"update:editvisible",
|
"update:editvisible",
|
||||||
"update:titleText",
|
"update:titleText",
|
||||||
"update:inputvisibleFilter",
|
"update:inputvisibleFilter",
|
||||||
|
"update:change-page",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const updateInput = async (value: any) => {
|
const updateInput = async (value: any) => {
|
||||||
|
|
@ -274,8 +397,8 @@ const updateInput = async (value: any) => {
|
||||||
// search & get new data by keyword
|
// search & get new data by keyword
|
||||||
const submitInput = () => {
|
const submitInput = () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
props.changePage(1, props.pageSize);
|
emit("update:change-page", 1, initialPagination.value.rowsPerPage);
|
||||||
currentPage.value = 1
|
currentPage.value = 1;
|
||||||
}, 500);
|
}, 500);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -326,8 +449,8 @@ const candidateToPlacement = async () => {
|
||||||
router.go(-1);
|
router.go(-1);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.onCancel(() => { })
|
.onCancel(() => {})
|
||||||
.onDismiss(() => { });
|
.onDismiss(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
const uploadDataSeat = async () => {
|
const uploadDataSeat = async () => {
|
||||||
|
|
@ -490,8 +613,8 @@ const resetFilter = () => {
|
||||||
filterRef.value.focus();
|
filterRef.value.focus();
|
||||||
|
|
||||||
// clear keyword & get new data
|
// clear keyword & get new data
|
||||||
props.changePage(1, props.pageSize);
|
emit("update:change-page", 1, initialPagination.value.rowsPerPage);
|
||||||
currentPage.value = 1
|
currentPage.value = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
const downloadFileDashboard = async () => {
|
const downloadFileDashboard = async () => {
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,35 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="toptitle text-dark col-12 row items-center">
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" @click="router.go(-1)" />
|
<q-btn
|
||||||
|
icon="mdi-arrow-left"
|
||||||
|
unelevated
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
color="primary"
|
||||||
|
class="q-mr-sm"
|
||||||
|
@click="router.go(-1)"
|
||||||
|
/>
|
||||||
{{ name }}
|
{{ name }}
|
||||||
{{
|
{{
|
||||||
`ครั้งที่${round == null ? "" : round}/${yearly == null ? "" : yearly + 543
|
`ครั้งที่${round == null ? "" : round}/${
|
||||||
}`
|
yearly == null ? "" : yearly + 543
|
||||||
|
}`
|
||||||
}}
|
}}
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-btn @click="visible = !visible" dense round size="13px" :style="visible == false
|
<q-btn
|
||||||
|
@click="visible = !visible"
|
||||||
|
dense
|
||||||
|
round
|
||||||
|
size="13px"
|
||||||
|
:style="
|
||||||
|
visible == false
|
||||||
? 'transform: rotate(90deg);transition-duration: 0.8s;'
|
? 'transform: rotate(90deg);transition-duration: 0.8s;'
|
||||||
: 'transform: rotate(0);transition-duration: 0.8s;'
|
: 'transform: rotate(0);transition-duration: 0.8s;'
|
||||||
" icon="mdi-pin" flat></q-btn>
|
"
|
||||||
|
icon="mdi-pin"
|
||||||
|
flat
|
||||||
|
></q-btn>
|
||||||
</div>
|
</div>
|
||||||
<q-slide-transition>
|
<q-slide-transition>
|
||||||
<q-card class="row col-12 q-mb-sm" v-show="visible">
|
<q-card class="row col-12 q-mb-sm" v-show="visible">
|
||||||
|
|
@ -20,16 +39,23 @@
|
||||||
<div class="col-12 row">
|
<div class="col-12 row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="row col-12 q-col-gutter-sm fit">
|
<div class="row col-12 q-col-gutter-sm fit">
|
||||||
<div style="width: 25%" v-for="(num, index) in dataNum" :key="index">
|
<div
|
||||||
|
style="width: 25%"
|
||||||
|
v-for="(num, index) in dataNum"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
<q-card bordered flat class="row fit cardNum items-center">
|
<q-card bordered flat class="row fit cardNum items-center">
|
||||||
<div class="col-12 row items-center q-pa-sm">
|
<div class="col-12 row items-center q-pa-sm">
|
||||||
<div :class="'col-12 text-h5 text-weight-bold text-' +
|
<div
|
||||||
`${num.color}`
|
:class="
|
||||||
">
|
'col-12 text-h5 text-weight-bold text-' +
|
||||||
|
`${num.color}`
|
||||||
|
"
|
||||||
|
>
|
||||||
{{
|
{{
|
||||||
num.count != null
|
num.count != null
|
||||||
? num.count.toLocaleString("en-US")
|
? num.count.toLocaleString("en-US")
|
||||||
: ""
|
: ""
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 text-dark ellipsis">
|
<div class="col-12 text-dark ellipsis">
|
||||||
|
|
@ -46,27 +72,57 @@
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-slide-transition>
|
</q-slide-transition>
|
||||||
<q-card flat bordered class="col-12 q-pt-sm">
|
<q-card flat bordered class="col-12 q-pt-sm">
|
||||||
<TableCandidate style="max-height: 80vh" :rows="rows" :columns="columns" :filter="filter"
|
<TableCandidate
|
||||||
:visible-columns="visibleColumns" v-model:inputfilter="filter" v-model:inputvisible="visibleColumns"
|
style="max-height: 80vh"
|
||||||
v-model:inputvisibleFilter="status" v-model:optionsFilter="optionsStatus" :nornmalData="true" :paging="true"
|
:rows="rows"
|
||||||
:titleText="''" :statusPayment="statusPayment" :setSeat="setSeat" :fetchData="fetchDataCom" :history="true"
|
:columns="columns"
|
||||||
:page-size="pageSize" :total="total" :page="page" :changePage="changePage" :max-page="maxPage">
|
:filter="filter"
|
||||||
|
:visible-columns="visibleColumns"
|
||||||
|
v-model:inputfilter="filter"
|
||||||
|
v-model:inputvisible="visibleColumns"
|
||||||
|
v-model:inputvisibleFilter="status"
|
||||||
|
v-model:optionsFilter="optionsStatus"
|
||||||
|
:nornmalData="true"
|
||||||
|
:paging="true"
|
||||||
|
:titleText="''"
|
||||||
|
:statusPayment="statusPayment"
|
||||||
|
:setSeat="setSeat"
|
||||||
|
:fetchData="fetchDataCom"
|
||||||
|
:history="true"
|
||||||
|
:page-size="pageSize"
|
||||||
|
:total="total"
|
||||||
|
:page="page"
|
||||||
|
@update:change-page="changePage"
|
||||||
|
:max-page="maxPage"
|
||||||
|
>
|
||||||
<template #columns="props">
|
<template #columns="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td auto-width>
|
<q-td auto-width>
|
||||||
<q-checkbox v-model="props.selected" />
|
<q-checkbox v-model="props.selected" />
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props"
|
<q-td
|
||||||
@click="viewDetail(props.row.id, props.row.status)">
|
v-for="col in props.cols"
|
||||||
|
:key="col.name"
|
||||||
|
:props="props"
|
||||||
|
@click="viewDetail(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
<div v-if="col.name == 'no'" class="table_ellipsis">
|
<div v-if="col.name == 'no'" class="table_ellipsis">
|
||||||
{{ ((page-1) * pageSize) + props.rowIndex + 1 }}
|
{{ (page - 1) * pageSize + props.rowIndex + 1 }}
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name == 'fullname'">
|
<div v-else-if="col.name == 'fullname'">
|
||||||
<div class="row col-12 items-center">
|
<div class="row col-12 items-center">
|
||||||
<img v-if="props.row.avatar == ''" src="@/assets/avatar_user.jpg" class="q-mr-sm col-4"
|
<img
|
||||||
style="width: 28px; height: 28px; border-radius: 50%" />
|
v-if="props.row.avatar == ''"
|
||||||
<img v-else :src="props.row.avatar" class="q-mr-sm col-4"
|
src="@/assets/avatar_user.jpg"
|
||||||
style="width: 28px; height: 28px; border-radius: 50%" />
|
class="q-mr-sm col-4"
|
||||||
|
style="width: 28px; height: 28px; border-radius: 50%"
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
v-else
|
||||||
|
:src="props.row.avatar"
|
||||||
|
class="q-mr-sm col-4"
|
||||||
|
style="width: 28px; height: 28px; border-radius: 50%"
|
||||||
|
/>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<div class="text-weight-medium">
|
<div class="text-weight-medium">
|
||||||
{{ props.row.fullname }}
|
{{ props.row.fullname }}
|
||||||
|
|
@ -99,13 +155,17 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name == 'status'" :class="props.row.status == 'checkRegister' ||
|
<div
|
||||||
props.row.status == 'checkPayment' ||
|
v-else-if="col.name == 'status'"
|
||||||
props.row.status == 'checkSeat' ||
|
:class="
|
||||||
props.row.status == 'checkPoint'
|
props.row.status == 'checkRegister' ||
|
||||||
? 'text-blue'
|
props.row.status == 'checkPayment' ||
|
||||||
: ''
|
props.row.status == 'checkSeat' ||
|
||||||
">
|
props.row.status == 'checkPoint'
|
||||||
|
? 'text-blue'
|
||||||
|
: ''
|
||||||
|
"
|
||||||
|
>
|
||||||
{{ statusCandidate(props.row.status) }}
|
{{ statusCandidate(props.row.status) }}
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name == 'registerDate'" class="table_ellipsis">
|
<div v-else-if="col.name == 'registerDate'" class="table_ellipsis">
|
||||||
|
|
@ -116,8 +176,16 @@
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td auto-width>
|
<q-td auto-width>
|
||||||
<q-btn color="primary" flat dense round size="14px" icon="mdi-file-chart-outline"
|
<q-btn
|
||||||
v-if="props.row.status == 'done'" @click="clickPointRow(props.row)">
|
color="primary"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
round
|
||||||
|
size="14px"
|
||||||
|
icon="mdi-file-chart-outline"
|
||||||
|
v-if="props.row.status == 'done'"
|
||||||
|
@click="clickPointRow(props.row)"
|
||||||
|
>
|
||||||
<q-tooltip>ผลสอบ</q-tooltip>
|
<q-tooltip>ผลสอบ</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
@ -130,7 +198,14 @@
|
||||||
<q-card-section class="row items-center q-py-sm">
|
<q-card-section class="row items-center q-py-sm">
|
||||||
<div class="text-bold">ใบทานสอบข้อมูล</div>
|
<div class="text-bold">ใบทานสอบข้อมูล</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-btn icon="close" unelevated round dense v-close-popup style="color: #ff8080; background-color: #ffdede" />
|
<q-btn
|
||||||
|
icon="close"
|
||||||
|
unelevated
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
v-close-popup
|
||||||
|
style="color: #ff8080; background-color: #ffdede"
|
||||||
|
/>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section class="row items-center">
|
<q-card-section class="row items-center">
|
||||||
|
|
@ -394,25 +469,34 @@ const fetchDataCom = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
// paging
|
// paging
|
||||||
const page = ref<number>(1)
|
const page = ref<number>(1);
|
||||||
const pageSize = ref<number>(25)
|
const pageSize = ref<number>(25);
|
||||||
const total = ref<number>(0)
|
const total = ref<number>(0);
|
||||||
const maxPage = ref<number>(1)
|
const maxPage = ref<number>(1);
|
||||||
|
|
||||||
async function changePage(pageVal: number, pageSizeVal: number, loading: boolean = false) {
|
async function changePage(
|
||||||
page.value = await pageVal
|
pageVal: number,
|
||||||
pageSize.value = await pageSizeVal
|
pageSizeVal: number,
|
||||||
fetchData(loading)
|
loading: boolean = false
|
||||||
|
) {
|
||||||
|
page.value = await pageVal;
|
||||||
|
pageSize.value = await pageSizeVal;
|
||||||
|
fetchData(loading);
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetchData = async (loading: boolean = true) => {
|
const fetchData = async (loading: boolean = true) => {
|
||||||
loading === true ?? showLoader()
|
loading === true ?? showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.candidateOfPeriodExam(status.value, examId.value) + `?page=${page.value}&pageSize=${pageSize.value}&keyword=${filter.value}`)
|
.get(
|
||||||
|
config.API.candidateOfPeriodExam(status.value, examId.value) +
|
||||||
|
`?page=${page.value}&pageSize=${pageSize.value}&keyword=${filter.value}`
|
||||||
|
)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
total.value = data.total
|
total.value = data.total;
|
||||||
maxPage.value = await Math.ceil(data.total / pageSize.value)
|
maxPage.value = await Math.ceil(data.total / pageSize.value);
|
||||||
|
maxPage.value = maxPage.value < 1 ? 1 : maxPage.value;
|
||||||
|
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
data.data.map((r: any) => {
|
data.data.map((r: any) => {
|
||||||
rows.value.push({
|
rows.value.push({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue