fix: สรรหา ปรับ pagin /โครงสร้าง ปิดดาวโหลดได้เเค่ root ปรับข้อความ

This commit is contained in:
setthawutttty 2025-09-10 11:08:18 +07:00
parent e4bdf45beb
commit 8263697759
8 changed files with 162 additions and 58 deletions

View file

@ -22,15 +22,19 @@ const { messageError, success, showLoader, hideLoader, onSearchDataTable } =
mixin;
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
page:1,
rowsPerPage: 10,
sortBy: "year",
});
const year = ref<string>("");
const round = ref<string>("");
const name = ref<string>("");
const count = ref<number>(0);
const totalList = ref<number>(0);
const pass = ref<number>(0);
const notpass = ref<number>(0);
const missed_exam = ref<number>(0);
const other = ref<number>(0);
const rows = ref<any[]>([]);
const rowsData = ref<any[]>([]);
const importId = ref<string>(route.params.id as string); // Period Import Id
@ -352,6 +356,8 @@ async function fetchData() {
.post(config.API.getExamResultById(importId.value), {
examAttribute: "",
examResult: "",
page:initialPagination.value.page,
pageSize:initialPagination.value.rowsPerPage,
})
.then((res) => {
let header = res.data.result.header;
@ -359,6 +365,11 @@ async function fetchData() {
count.value = header.count;
pass.value = header.pass;
notpass.value = header.notpass;
missed_exam.value = header.missed_exam;
other.value = header.other;
totalList.value = Math.ceil(
header.count / initialPagination.value.rowsPerPage
);
if (period != null) {
name.value = period.name;
round.value = period.order;
@ -483,6 +494,8 @@ onMounted(async () => {
:count="count"
:pass="pass"
:notpass="notpass"
:missed_exam="missed_exam"
:other="other"
:rows="rows"
:columns="columns"
v-model:filter="filter"
@ -490,9 +503,11 @@ onMounted(async () => {
:visible-columns="visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="visibleColumns"
v-model:totalList="totalList"
v-model:pagination="initialPagination"
:nornmalData="false"
:conclude="true"
:fetchData="fetchData"
>
<template #columns="props">
<q-tr :props="props" class="cursor-pointer">

View file

@ -64,6 +64,7 @@ const textTittleResult = ref<string>("");
const rows = ref<ResponseRecruitPeriod[]>([]);
const rowsData = ref<ResponseRecruitPeriod[]>([]);
const initialPagination = ref<Pagination>({
page: 0,
rowsPerPage: 0,
sortBy: "year",
});
@ -646,7 +647,7 @@ onMounted(async () => {
<q-tooltip>นำเขาไฟลสมครสอบ</q-tooltip>
</q-btn>
<div v-else>
{{ col.value }}
{{ col.value.toLocaleString() }}
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
@ -693,7 +694,7 @@ onMounted(async () => {
<q-tooltip>นำเขาไฟลญชรวมคะแนน</q-tooltip>
</q-btn>
<div v-else>
{{ props.row.score.scoreCount }}
{{ props.row.score.scoreCount.toLocaleString() }}
<q-btn
:disable="props.row.examCount == 0"
flat
@ -730,7 +731,7 @@ onMounted(async () => {
<q-tooltip>นำเขาไฟลผลการสอบ (ญชรายช)</q-tooltip>
</q-btn>
<div v-else>
{{ props.row.score.resultCount }}
{{ props.row.score.resultCount.toLocaleString() }}
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
dense

View file

@ -26,6 +26,7 @@ const year = ref<string>("2566");
const round = ref<string>("1");
const name = ref<string>("");
const initialPagination = ref<Pagination>({
page: 1,
rowsPerPage: 0,
sortBy: "examID",
});
@ -33,6 +34,10 @@ const initialPagination = ref<Pagination>({
const count = ref<number>(0);
const pass = ref<number>(0);
const notpass = ref<number>(0);
const missed_exam = ref<number>(0);
const other = ref<number>(0);
const totalList = ref<number>(0);
const importId = ref<string>(route.params.id as string); // Period Import Id
const filter = ref<string>(""); //search data table
@ -293,6 +298,8 @@ async function fetchData() {
.post(config.API.getDisableExamResultById(importId.value), {
examAttribute: "",
examResult: "",
page: initialPagination.value.page,
pageSize: initialPagination.value.rowsPerPage,
})
.then((res) => {
var _data = res.data.result;
@ -300,7 +307,11 @@ async function fetchData() {
count.value = header.count;
pass.value = header.pass;
notpass.value = header.notpass;
missed_exam.value = header.missed_exam;
other.value = header.other;
totalList.value = Math.ceil(
header.count / initialPagination.value.rowsPerPage
);
const data = res.data.result.data;
let result: RecruitDetailResponse[] = [];
if (data.length > 0) {
@ -422,6 +433,9 @@ onMounted(async () => {
:count="count"
:pass="pass"
:notpass="notpass"
:missed_exam="missed_exam"
:other="other"
v-model:totalList="totalList"
:rows="rows"
:columns="columns"
v-model:filter="filter"
@ -432,6 +446,7 @@ onMounted(async () => {
v-model:inputvisible="visibleColumns"
:nornmalData="false"
:conclude="true"
:fetchData="fetchData"
>
<template #columns="props">
<q-tr :props="props" class="cursor-pointer">

View file

@ -50,7 +50,7 @@ async function fetchData() {
await http
.get(config.API.getDisableExamDetail(importId.value, examId.value))
.then((res) => {
let data = res.data.result.data;
let data = res.data.result;
if (data != null) {
profile_id.value = data.profileID;
examID.value = data.examID;
@ -82,7 +82,7 @@ async function fetchData() {
scoreD.value = data.scoreResult.scoreD;
}
} else {
dialogMessageNotify($q, "แข่งขัน ไม่พบข้อมูล");
dialogMessageNotify($q, "คัดเลือก ไม่พบข้อมูล");
}
})
.catch((e) => {

View file

@ -595,7 +595,7 @@ onMounted(async () => {
<q-tooltip>นำเขาไฟลสมครสอบ</q-tooltip>
</q-btn>
<div v-else>
{{ col.value }}
{{ col.value.toLocaleString() }}
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
@ -642,7 +642,7 @@ onMounted(async () => {
<q-tooltip>นำเขาไฟลผลคะแนนสอบ</q-tooltip>
</q-btn>
<div v-else>
{{ col.value }}
{{ props.row.score.scoreCount.toLocaleString() }}
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
dense
@ -676,7 +676,7 @@ onMounted(async () => {
<q-tooltip>นำเขาไฟลผลการสอบ (ญชรายช)</q-tooltip>
</q-btn>
<div v-else>
{{ props.row.score.resultCount }}
{{ props.row.score.resultCount.toLocaleString() }}
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
dense