sort สรรหา
This commit is contained in:
parent
383176f5be
commit
136754e910
10 changed files with 35 additions and 9 deletions
|
|
@ -325,6 +325,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
const filter = defineModel<string>("filter", { required: true });
|
const filter = defineModel<string>("filter", { required: true });
|
||||||
|
const sortBy = defineModel<string>("sortBy");
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||||
|
|
@ -337,7 +338,7 @@ const modalPublish = ref<boolean>(false);
|
||||||
const modalDelete = ref<boolean>(false);
|
const modalDelete = ref<boolean>(false);
|
||||||
|
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
sortBy: "desc",
|
sortBy: sortBy.value ? sortBy.value : "desc",
|
||||||
descending: false,
|
descending: false,
|
||||||
page: 1,
|
page: 1,
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,10 @@ import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||||
const attrs = ref<any>(useAttrs());
|
const attrs = ref<any>(useAttrs());
|
||||||
const table = ref<any>(null);
|
const table = ref<any>(null);
|
||||||
const filterRef = ref<any>(null);
|
const filterRef = ref<any>(null);
|
||||||
const initialPagination = ref<Pagination>({
|
|
||||||
rowsPerPage: 0,
|
|
||||||
});
|
|
||||||
const filter = defineModel<string>("filter", { required: true });
|
const filter = defineModel<string>("filter", { required: true });
|
||||||
|
const pagination = defineModel<Pagination>('pagination',{required:true})
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
onSearch: Function,
|
onSearch: Function,
|
||||||
count: Number,
|
count: Number,
|
||||||
|
|
@ -175,7 +175,7 @@ function resetFilter() {
|
||||||
:virtual-scroll-sticky-size-start="48"
|
:virtual-scroll-sticky-size-start="48"
|
||||||
dense
|
dense
|
||||||
:pagination-label="paginationLabel"
|
:pagination-label="paginationLabel"
|
||||||
:pagination="initialPagination"
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[0]"
|
:rows-per-page-options="[0]"
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
interface Pagination {
|
interface Pagination {
|
||||||
rowsPerPage: number;
|
rowsPerPage: number;
|
||||||
|
sortBy: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DataDateMonthObject {
|
interface DataDateMonthObject {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import { useQuasar } from "quasar";
|
||||||
import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period";
|
import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period";
|
||||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
|
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
@ -20,6 +21,10 @@ const mixin = useCounterMixin();
|
||||||
const { messageError, success, showLoader, hideLoader, onSearchDataTable } =
|
const { messageError, success, showLoader, hideLoader, onSearchDataTable } =
|
||||||
mixin;
|
mixin;
|
||||||
|
|
||||||
|
const initialPagination = ref<Pagination>({
|
||||||
|
rowsPerPage: 0,
|
||||||
|
sortBy: "year",
|
||||||
|
});
|
||||||
const year = ref<string>("");
|
const year = ref<string>("");
|
||||||
const round = ref<string>("");
|
const round = ref<string>("");
|
||||||
const name = ref<string>("");
|
const name = ref<string>("");
|
||||||
|
|
@ -475,6 +480,7 @@ onMounted(async () => {
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
v-model:inputfilter="filter"
|
v-model:inputfilter="filter"
|
||||||
v-model:inputvisible="visibleColumns"
|
v-model:inputvisible="visibleColumns"
|
||||||
|
v-model:pagination="initialPagination"
|
||||||
:nornmalData="false"
|
:nornmalData="false"
|
||||||
:conclude="true"
|
:conclude="true"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import { useQuasar } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||||
|
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { onSearchDataTable } = mixin;
|
const { onSearchDataTable } = mixin;
|
||||||
|
|
@ -15,6 +16,10 @@ const $q = useQuasar(); // show dialog
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const file = ref<boolean>(true);
|
const file = ref<boolean>(true);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
|
const initialPagination = ref<Pagination>({
|
||||||
|
rowsPerPage: 0,
|
||||||
|
sortBy: "year",
|
||||||
|
});
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>([
|
||||||
"no",
|
"no",
|
||||||
"year",
|
"year",
|
||||||
|
|
@ -156,6 +161,7 @@ function onSearch() {
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
v-model:inputfilter="filter"
|
v-model:inputfilter="filter"
|
||||||
v-model:inputvisible="visibleColumns"
|
v-model:inputvisible="visibleColumns"
|
||||||
|
v-model:pagination="initialPagination"
|
||||||
:nornmalData="false"
|
:nornmalData="false"
|
||||||
>
|
>
|
||||||
<template #columns="props">
|
<template #columns="props">
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ const rows = ref<ResponseRecruitPeriod[]>([]);
|
||||||
const rowsData = ref<ResponseRecruitPeriod[]>([]);
|
const rowsData = ref<ResponseRecruitPeriod[]>([]);
|
||||||
const initialPagination = ref<Pagination>({
|
const initialPagination = ref<Pagination>({
|
||||||
rowsPerPage: 0,
|
rowsPerPage: 0,
|
||||||
|
sortBy: "year",
|
||||||
});
|
});
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>([
|
||||||
"no",
|
"no",
|
||||||
|
|
@ -99,6 +100,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
field: "year",
|
field: "year",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
|
sort: (a: number, b: number) => b - a,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "examCount",
|
name: "examCount",
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ import config from "@/app.config";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period";
|
import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period";
|
||||||
|
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||||
|
|
||||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
|
|
||||||
|
|
@ -23,6 +25,10 @@ const { messageError, success, showLoader, hideLoader, onSearchDataTable } =
|
||||||
const year = ref<string>("2566");
|
const year = ref<string>("2566");
|
||||||
const round = ref<string>("1");
|
const round = ref<string>("1");
|
||||||
const name = ref<string>("");
|
const name = ref<string>("");
|
||||||
|
const initialPagination = ref<Pagination>({
|
||||||
|
rowsPerPage: 0,
|
||||||
|
sortBy: "examID",
|
||||||
|
});
|
||||||
|
|
||||||
const count = ref<number>(0);
|
const count = ref<number>(0);
|
||||||
const pass = ref<number>(0);
|
const pass = ref<number>(0);
|
||||||
|
|
@ -410,6 +416,7 @@ onMounted(async () => {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
v-model:filter="filter"
|
v-model:filter="filter"
|
||||||
:onSearch="onSearch"
|
:onSearch="onSearch"
|
||||||
|
:pagination="initialPagination"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
v-model:inputfilter="filter"
|
v-model:inputfilter="filter"
|
||||||
v-model:inputvisible="visibleColumns"
|
v-model:inputvisible="visibleColumns"
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ const textTittleScore = ref<string>("");
|
||||||
const textTittleCandidate = ref<string>("");
|
const textTittleCandidate = ref<string>("");
|
||||||
const initialPagination = ref<Pagination>({
|
const initialPagination = ref<Pagination>({
|
||||||
rowsPerPage: 0,
|
rowsPerPage: 0,
|
||||||
|
sortBy: "year",
|
||||||
});
|
});
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>([
|
||||||
"no",
|
"no",
|
||||||
|
|
@ -105,6 +106,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
format(val, row) {
|
format(val, row) {
|
||||||
return `${row.year + 543}`;
|
return `${row.year + 543}`;
|
||||||
},
|
},
|
||||||
|
sort: (a: number, b: number) => b - a,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "examCount",
|
name: "examCount",
|
||||||
|
|
@ -442,7 +444,7 @@ onMounted(async () => {
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
v-model:inputfilter="filter"
|
v-model:inputfilter="filter"
|
||||||
v-model:inputvisible="visibleColumns"
|
v-model:inputvisible="visibleColumns"
|
||||||
:pagination="initialPagination"
|
v-model:pagination="initialPagination"
|
||||||
:nornmalData="true"
|
:nornmalData="true"
|
||||||
:add="clickAdd"
|
:add="clickAdd"
|
||||||
:paging="true"
|
:paging="true"
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ const rows = ref<ResponsePeriodExam[]>([]);
|
||||||
const rowsData = ref<ResponsePeriodExam[]>([]);
|
const rowsData = ref<ResponsePeriodExam[]>([]);
|
||||||
const initialPagination = ref<Pagination>({
|
const initialPagination = ref<Pagination>({
|
||||||
rowsPerPage: 0,
|
rowsPerPage: 0,
|
||||||
|
sortBy: "dateRegister",
|
||||||
});
|
});
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>([
|
||||||
|
|
@ -90,8 +91,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
field: "dateRegister",
|
field: "dateRegister",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "datePayment",
|
name: "datePayment",
|
||||||
|
|
@ -228,6 +227,7 @@ onMounted(async () => {
|
||||||
:pagination="initialPagination"
|
:pagination="initialPagination"
|
||||||
:nornmalData="true"
|
:nornmalData="true"
|
||||||
:paging="true"
|
:paging="true"
|
||||||
|
:sortBy="'dateRegister'"
|
||||||
name="qualify"
|
name="qualify"
|
||||||
>
|
>
|
||||||
<template #columns="props">
|
<template #columns="props">
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,12 @@ const {
|
||||||
messageError,
|
messageError,
|
||||||
showLoader,
|
showLoader,
|
||||||
hideLoader,
|
hideLoader,
|
||||||
onSearchDataTable
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const initialPagination = ref<Pagination>({
|
const initialPagination = ref<Pagination>({
|
||||||
rowsPerPage: 0,
|
rowsPerPage: 0,
|
||||||
|
sortBy: "dateRegister",
|
||||||
});
|
});
|
||||||
const examData = ref<ResponsePeriodExam[]>([]);
|
const examData = ref<ResponsePeriodExam[]>([]);
|
||||||
const examDataData = ref<ResponsePeriodExam[]>([]);
|
const examDataData = ref<ResponsePeriodExam[]>([]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue