fix:sortBy ,descending
- ทำ sortBy เฉพาะ API ที่มีการทำ paging
This commit is contained in:
parent
4308f8887f
commit
1f18b56fbf
13 changed files with 98 additions and 67 deletions
|
|
@ -44,11 +44,11 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "fullName",
|
name: "firstName",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ชื่อ-นามสกุล",
|
label: "ชื่อ-นามสกุล",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "fullName",
|
field: "firstName",
|
||||||
format(val, row) {
|
format(val, row) {
|
||||||
return `${row.prefix}${row.firstName} ${row.lastName}`;
|
return `${row.prefix}${row.firstName} ${row.lastName}`;
|
||||||
},
|
},
|
||||||
|
|
@ -66,7 +66,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const pagination = ref<PropsTable.Pagination>({
|
const pagination = ref<PropsTable.Pagination>({
|
||||||
sortBy: "createdAt",
|
sortBy: "",
|
||||||
descending: true,
|
descending: true,
|
||||||
page: 1,
|
page: 1,
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
|
|
@ -83,6 +83,10 @@ async function getCommander() {
|
||||||
page: pagination.value.page,
|
page: pagination.value.page,
|
||||||
pageSize: pagination.value.rowsPerPage,
|
pageSize: pagination.value.rowsPerPage,
|
||||||
keycloakId: storeData.formData.keycloakId,
|
keycloakId: storeData.formData.keycloakId,
|
||||||
|
...(pagination.value.sortBy && {
|
||||||
|
sortBy: pagination.value.sortBy,
|
||||||
|
descending: pagination.value.descending,
|
||||||
|
}),
|
||||||
type:
|
type:
|
||||||
storeData.officerType.toLocaleUpperCase() == "OFFICER"
|
storeData.officerType.toLocaleUpperCase() == "OFFICER"
|
||||||
? "officer"
|
? "officer"
|
||||||
|
|
@ -117,7 +121,7 @@ function closeDialog() {
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
selected.value = [];
|
selected.value = [];
|
||||||
pagination.value = {
|
pagination.value = {
|
||||||
sortBy: "createdAt",
|
sortBy: "",
|
||||||
descending: true,
|
descending: true,
|
||||||
page: 1,
|
page: 1,
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ const maxPage = ref<number>(1);
|
||||||
const page = ref<number>(1);
|
const page = ref<number>(1);
|
||||||
const pageSize = ref<number>(10);
|
const pageSize = ref<number>(10);
|
||||||
const total = ref<number>(0);
|
const total = ref<number>(0);
|
||||||
|
const sortBy = ref<string>("dateSendLeave");
|
||||||
|
const descending = ref<boolean>(true);
|
||||||
/** function เรียกข้อมูลการลา*/
|
/** function เรียกข้อมูลการลา*/
|
||||||
async function fetchDataTable() {
|
async function fetchDataTable() {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
|
|
@ -47,6 +49,10 @@ async function fetchDataTable() {
|
||||||
page: page.value.toString(), //*หน้า
|
page: page.value.toString(), //*หน้า
|
||||||
pageSize: pageSize.value.toString(), //*จำนวนแถวต่อหน้า
|
pageSize: pageSize.value.toString(), //*จำนวนแถวต่อหน้า
|
||||||
keyword: filter.value, //keyword ค้นหา
|
keyword: filter.value, //keyword ค้นหา
|
||||||
|
...(sortBy.value && {
|
||||||
|
sortBy: sortBy.value,
|
||||||
|
descending: descending.value,
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveTableList(), body)
|
.post(config.API.leaveTableList(), body)
|
||||||
|
|
@ -141,9 +147,14 @@ async function updateFilterTable(y: number, t: string, s: string, k: string) {
|
||||||
* function updatePagination
|
* function updatePagination
|
||||||
* @param p หน้า
|
* @param p หน้า
|
||||||
* @param ps แถวต่อหน้า
|
* @param ps แถวต่อหน้า
|
||||||
|
* @param s เรียงลำดับตาม
|
||||||
|
* @param d เรียงลำดับจากน้อยไปมาก
|
||||||
*/
|
*/
|
||||||
async function updatePagination(p: number, ps: number) {
|
async function updatePagination(p: number, ps: number, s: string, d: boolean) {
|
||||||
(page.value = p), (pageSize.value = ps);
|
page.value = p;
|
||||||
|
pageSize.value = ps;
|
||||||
|
sortBy.value = s;
|
||||||
|
descending.value = d;
|
||||||
await fetchDataTable();
|
await fetchDataTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -188,6 +199,8 @@ onMounted(async () => {
|
||||||
:pageSize="pageSize"
|
:pageSize="pageSize"
|
||||||
:leaveType="leaveType"
|
:leaveType="leaveType"
|
||||||
:total="total"
|
:total="total"
|
||||||
|
:sortBy="sortBy"
|
||||||
|
:descending="descending"
|
||||||
:isloadingData="isLoading"
|
:isloadingData="isLoading"
|
||||||
>
|
>
|
||||||
<template #columns="props">
|
<template #columns="props">
|
||||||
|
|
@ -215,7 +228,7 @@ onMounted(async () => {
|
||||||
}}
|
}}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td
|
<q-td
|
||||||
key="dateLeave"
|
key="leaveStartDate"
|
||||||
:props="props"
|
:props="props"
|
||||||
@click="onClickView(props.row.id, props.row.status)"
|
@click="onClickView(props.row.id, props.row.status)"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,14 @@ const props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
sortBy: {
|
||||||
|
type: String,
|
||||||
|
default: "dateSendLeave",
|
||||||
|
},
|
||||||
|
descending: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -56,11 +64,10 @@ const table = ref<any>(null);
|
||||||
const currentPage = ref<number>(1);
|
const currentPage = ref<number>(1);
|
||||||
|
|
||||||
const pagination = ref<PropsTable.Pagination>({
|
const pagination = ref<PropsTable.Pagination>({
|
||||||
sortBy: "dateSendLeave",
|
sortBy: props.sortBy,
|
||||||
descending: true,
|
descending: props.descending,
|
||||||
page: 1,
|
page: 1,
|
||||||
rowsPerPage: Number(props.pageSize),
|
rowsPerPage: Number(props.pageSize),
|
||||||
|
|
||||||
rowsNumber: Number(props.total),
|
rowsNumber: Number(props.total),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -94,9 +101,20 @@ function filterTable() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** function updatePagination*/
|
/**
|
||||||
function updatePagination(p: number, ps: number) {
|
* ฟังก์ชันอัปเดตการแบ่งหน้า
|
||||||
emit("update:Pagination", p, ps);
|
* @param p หน้า
|
||||||
|
* @param ps ขนาดหน้า
|
||||||
|
* @param sortBy เรียงลำดับตาม
|
||||||
|
* @param descending เรียงลำดับจากน้อยไปมาก
|
||||||
|
*/
|
||||||
|
function updatePagination(
|
||||||
|
p: number,
|
||||||
|
ps: number,
|
||||||
|
sortBy?: string,
|
||||||
|
descending?: boolean
|
||||||
|
) {
|
||||||
|
emit("update:Pagination", p, ps, sortBy, descending);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -108,7 +126,12 @@ function onTableRequest(requestProps: PropsTable.RequestProps) {
|
||||||
if (!newPagination?.page || !newPagination?.rowsPerPage) return;
|
if (!newPagination?.page || !newPagination?.rowsPerPage) return;
|
||||||
currentPage.value = newPagination.page;
|
currentPage.value = newPagination.page;
|
||||||
pagination.value = { ...newPagination };
|
pagination.value = { ...newPagination };
|
||||||
updatePagination(newPagination.page, newPagination.rowsPerPage);
|
updatePagination(
|
||||||
|
newPagination.page,
|
||||||
|
newPagination.rowsPerPage,
|
||||||
|
newPagination.sortBy,
|
||||||
|
newPagination.descending
|
||||||
|
);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ export const useLeaveStore = defineStore("Leave", () => {
|
||||||
"leaveTypeName",
|
"leaveTypeName",
|
||||||
"dateSendLeave",
|
"dateSendLeave",
|
||||||
"status",
|
"status",
|
||||||
"dateLeave",
|
"leaveStartDate",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
@ -208,7 +208,7 @@ export const useLeaveStore = defineStore("Leave", () => {
|
||||||
name: "no",
|
name: "no",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ลำดับ",
|
label: "ลำดับ",
|
||||||
sortable: true,
|
sortable: false,
|
||||||
field: "no",
|
field: "no",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px; width:5%;",
|
style: "font-size: 14px; width:5%;",
|
||||||
|
|
@ -223,7 +223,7 @@ export const useLeaveStore = defineStore("Leave", () => {
|
||||||
style: "font-size: 14px; width:15%;",
|
style: "font-size: 14px; width:15%;",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "dateLeave",
|
name: "leaveStartDate",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันที่ลา",
|
label: "วันที่ลา",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
|
@ -259,7 +259,6 @@ export const useLeaveStore = defineStore("Leave", () => {
|
||||||
*/
|
*/
|
||||||
function typeConvert(item: string, subitem: any) {
|
function typeConvert(item: string, subitem: any) {
|
||||||
typeLeave.value = convertSubtitle(item);
|
typeLeave.value = convertSubtitle(item);
|
||||||
// }
|
|
||||||
typeId.value = convertId(item);
|
typeId.value = convertId(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,13 +35,13 @@ const props = defineProps({
|
||||||
const emit = defineEmits(["update:pagination"]);
|
const emit = defineEmits(["update:pagination"]);
|
||||||
|
|
||||||
/** ค้นหาคอลัม */
|
/** ค้นหาคอลัม */
|
||||||
const visibleColumns = ref<string[]>(["no", "type_th", "dateSend", "status"]);
|
const visibleColumns = ref<string[]>(["no", "type_th", "lastUpdatedAt", "status"]);
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "no",
|
name: "no",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ลำดับ",
|
label: "ลำดับ",
|
||||||
sortable: true,
|
sortable: false,
|
||||||
field: "no",
|
field: "no",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px; ",
|
style: "font-size: 14px; ",
|
||||||
|
|
@ -50,13 +50,13 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
name: "type_th",
|
name: "type_th",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ระดับที่ยื่นขอ",
|
label: "ระดับที่ยื่นขอ",
|
||||||
sortable: true,
|
sortable: false,
|
||||||
field: "type_th",
|
field: "type_th",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px; ",
|
style: "font-size: 14px; ",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "dateSend",
|
name: "lastUpdatedAt",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันที่ยื่นขอ",
|
label: "วันที่ยื่นขอ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
|
@ -68,7 +68,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
name: "status",
|
name: "status",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "สถานะ",
|
label: "สถานะ",
|
||||||
sortable: true,
|
sortable: false,
|
||||||
field: "status",
|
field: "status",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
name: "no",
|
name: "no",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ลำดับ",
|
label: "ลำดับ",
|
||||||
sortable: true,
|
sortable: false,
|
||||||
field: "no",
|
field: "no",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px; width:5px;",
|
style: "font-size: 14px; width:5px;",
|
||||||
|
|
@ -74,7 +74,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
name: "type",
|
name: "type",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ประเภท",
|
label: "ประเภท",
|
||||||
sortable: true,
|
sortable: false,
|
||||||
field: "type",
|
field: "type",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px; width:15%;",
|
style: "font-size: 14px; width:15%;",
|
||||||
|
|
@ -83,7 +83,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
name: "year",
|
name: "year",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ปีงบประมาณ",
|
label: "ปีงบประมาณ",
|
||||||
sortable: true,
|
sortable: false,
|
||||||
field: "year",
|
field: "year",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const pagination = ref<PropsTable.Pagination>({
|
const pagination = ref<PropsTable.Pagination>({
|
||||||
sortBy: "desc",
|
sortBy: formQuery.value.sortBy,
|
||||||
descending: false,
|
descending: formQuery.value.descending,
|
||||||
page: formQuery.value.page,
|
page: formQuery.value.page,
|
||||||
rowsPerPage: formQuery.value.pageSize,
|
rowsPerPage: formQuery.value.pageSize,
|
||||||
rowsNumber: total.value,
|
rowsNumber: total.value,
|
||||||
|
|
@ -48,6 +48,8 @@ function onTableRequest(requestProps: PropsTable.RequestProps) {
|
||||||
if (!newPagination?.page || !newPagination?.rowsPerPage) return;
|
if (!newPagination?.page || !newPagination?.rowsPerPage) return;
|
||||||
formQuery.value.page = newPagination.page;
|
formQuery.value.page = newPagination.page;
|
||||||
formQuery.value.pageSize = newPagination.rowsPerPage;
|
formQuery.value.pageSize = newPagination.rowsPerPage;
|
||||||
|
formQuery.value.sortBy = newPagination.sortBy;
|
||||||
|
formQuery.value.descending = newPagination.descending;
|
||||||
props?.fetchList?.();
|
props?.fetchList?.();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,7 +98,7 @@ watch(
|
||||||
:key="col.id"
|
:key="col.id"
|
||||||
@click="redirectViewDetail(props.row.id)"
|
@click="redirectViewDetail(props.row.id)"
|
||||||
>
|
>
|
||||||
<div v-if="col.name === 'name'">
|
<div v-if="col.name === 'firstName'">
|
||||||
{{
|
{{
|
||||||
`${props.row.prefix}${props.row.firstname} ${props.row.lastname}`
|
`${props.row.prefix}${props.row.firstname} ${props.row.lastname}`
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,8 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const pagination = ref<PropsTable.Pagination>({
|
const pagination = ref<PropsTable.Pagination>({
|
||||||
sortBy: "desc",
|
sortBy: formQuery.value.sortBy,
|
||||||
descending: false,
|
descending: formQuery.value.descending,
|
||||||
page: formQuery.value.page,
|
page: formQuery.value.page,
|
||||||
rowsPerPage: formQuery.value.pageSize,
|
rowsPerPage: formQuery.value.pageSize,
|
||||||
rowsNumber: total.value,
|
rowsNumber: total.value,
|
||||||
|
|
@ -115,6 +115,8 @@ function onTableRequest(requestProps: PropsTable.RequestProps) {
|
||||||
if (!newPagination?.page || !newPagination?.rowsPerPage) return;
|
if (!newPagination?.page || !newPagination?.rowsPerPage) return;
|
||||||
formQuery.value.page = newPagination.page;
|
formQuery.value.page = newPagination.page;
|
||||||
formQuery.value.pageSize = newPagination.rowsPerPage;
|
formQuery.value.pageSize = newPagination.rowsPerPage;
|
||||||
|
formQuery.value.sortBy = newPagination.sortBy;
|
||||||
|
formQuery.value.descending = newPagination.descending;
|
||||||
props?.fetchList?.();
|
props?.fetchList?.();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -128,6 +130,8 @@ watch(
|
||||||
pagination.value.page = page;
|
pagination.value.page = page;
|
||||||
pagination.value.rowsPerPage = pageSize;
|
pagination.value.rowsPerPage = pageSize;
|
||||||
pagination.value.rowsNumber = total;
|
pagination.value.rowsNumber = total;
|
||||||
|
pagination.value.sortBy = formQuery.value.sortBy;
|
||||||
|
pagination.value.descending = formQuery.value.descending;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -219,7 +223,7 @@ watch(
|
||||||
<q-item-label caption>{{ col.label }}</q-item-label>
|
<q-item-label caption>{{ col.label }}</q-item-label>
|
||||||
|
|
||||||
<q-item-label>
|
<q-item-label>
|
||||||
<div v-if="col.name === 'name'">
|
<div v-if="col.name === 'firstName'">
|
||||||
{{
|
{{
|
||||||
`${props.row.prefix}${props.row.firstname} ${props.row.lastname}`
|
`${props.row.prefix}${props.row.firstname} ${props.row.lastname}`
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -69,11 +69,13 @@ interface FormQuery {
|
||||||
pageSize: number;
|
pageSize: number;
|
||||||
round: string;
|
round: string;
|
||||||
keyword: string;
|
keyword: string;
|
||||||
|
sortBy?: string;
|
||||||
|
descending?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ListTarget {
|
interface ListTarget {
|
||||||
id: string;
|
id: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
createdUserId: string;
|
createdUserId: string;
|
||||||
lastUpdatedAt: string;
|
lastUpdatedAt: string;
|
||||||
lastUpdateUserId: string;
|
lastUpdateUserId: string;
|
||||||
|
|
@ -99,5 +101,5 @@ export type {
|
||||||
FormComment,
|
FormComment,
|
||||||
FormCommentByRole,
|
FormCommentByRole,
|
||||||
FormQuery,
|
FormQuery,
|
||||||
ListTarget
|
ListTarget,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
round: "",
|
round: "",
|
||||||
keyword: "",
|
keyword: "",
|
||||||
|
sortBy: "",
|
||||||
|
descending: false,
|
||||||
});
|
});
|
||||||
const selected = ref([]);
|
const selected = ref([]);
|
||||||
const work = ref<boolean>(false);
|
const work = ref<boolean>(false);
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
format: (v) => date2Thai(v),
|
format: (v) => date2Thai(v),
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "year",
|
name: "year",
|
||||||
|
|
@ -62,8 +60,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
format: (v) => v + 543,
|
format: (v) => v + 543,
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "durationKPI",
|
name: "durationKPI",
|
||||||
|
|
@ -74,8 +70,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
format: (v) => (v == "OCT" ? "รอบที่ 2 ตุลาคม" : "รอบที่ 1 เมษายน"),
|
format: (v) => (v == "OCT" ? "รอบที่ 2 ตุลาคม" : "รอบที่ 1 เมษายน"),
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "evaluationStatus",
|
name: "evaluationStatus",
|
||||||
|
|
@ -86,8 +80,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
format: (v) => store.convertStatus(v),
|
format: (v) => store.convertStatus(v),
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "evaluationResults",
|
name: "evaluationResults",
|
||||||
|
|
@ -98,8 +90,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
format: (v) => store.convertResults(v),
|
format: (v) => store.convertResults(v),
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -147,7 +137,7 @@ const formQuery = reactive({
|
||||||
const isRoundClose = ref<boolean>(false);
|
const isRoundClose = ref<boolean>(false);
|
||||||
|
|
||||||
const pagination = ref<PropsTable.Pagination>({
|
const pagination = ref<PropsTable.Pagination>({
|
||||||
sortBy: "desc",
|
sortBy: "",
|
||||||
descending: false,
|
descending: false,
|
||||||
page: 1,
|
page: 1,
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
|
|
@ -212,6 +202,10 @@ async function fetchList() {
|
||||||
status: formQuery.status === "" ? undefined : formQuery.status,
|
status: formQuery.status === "" ? undefined : formQuery.status,
|
||||||
results: formQuery.results === "" ? undefined : formQuery.results,
|
results: formQuery.results === "" ? undefined : formQuery.results,
|
||||||
year: year.value,
|
year: year.value,
|
||||||
|
...(pagination.value.sortBy && {
|
||||||
|
sortBy: pagination.value.sortBy,
|
||||||
|
descending: pagination.value.descending,
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
await http
|
await http
|
||||||
.get(config.API.kpiEvaluation, {
|
.get(config.API.kpiEvaluation, {
|
||||||
|
|
|
||||||
|
|
@ -28,22 +28,20 @@ const dataListMain = ref<ResEvaluatorAssessor[]>([]);
|
||||||
const roundOp = ref<DataOptions[]>([]);
|
const roundOp = ref<DataOptions[]>([]);
|
||||||
|
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>([
|
||||||
"name",
|
"firstName",
|
||||||
"createdAt",
|
"createdAt",
|
||||||
"evaluationStatus",
|
"evaluationStatus",
|
||||||
"evaluationResults",
|
"evaluationResults",
|
||||||
]);
|
]);
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "name",
|
name: "firstName",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ผู้ขอรับการประเมิน",
|
label: "ผู้ขอรับการประเมิน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "name",
|
field: "firstName",
|
||||||
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: "createdAt",
|
name: "createdAt",
|
||||||
|
|
@ -54,8 +52,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
format: (v) => date2Thai(v),
|
format: (v) => date2Thai(v),
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "evaluationStatus",
|
name: "evaluationStatus",
|
||||||
|
|
@ -66,8 +62,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
format: (v) => store.convertStatus(v),
|
format: (v) => store.convertStatus(v),
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "evaluationResults",
|
name: "evaluationResults",
|
||||||
|
|
@ -78,8 +72,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
format: (v) => store.convertResults(v),
|
format: (v) => store.convertResults(v),
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -147,6 +139,10 @@ async function fetchList() {
|
||||||
? "SUMMARY"
|
? "SUMMARY"
|
||||||
: undefined,
|
: undefined,
|
||||||
reqedit: store.tabMainevaluator === "3" ? "NEW" : undefined,
|
reqedit: store.tabMainevaluator === "3" ? "NEW" : undefined,
|
||||||
|
...(store.formQuery.sortBy && {
|
||||||
|
sortBy: store.formQuery.sortBy,
|
||||||
|
descending: store.formQuery.descending,
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
await http
|
await http
|
||||||
|
|
|
||||||
|
|
@ -59,21 +59,13 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
name: "detail",
|
name: "detail",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "รายละเอียด",
|
label: "รายละเอียด",
|
||||||
sortable: false,
|
sortable: true,
|
||||||
field: "detail",
|
field: "detail",
|
||||||
format: (v) => (v ? v : "-"),
|
format: (v) => (v ? v : "-"),
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// name: "document",
|
|
||||||
// align: "center",
|
|
||||||
// label: "หลักฐานอ้างอิง",
|
|
||||||
// sortable: false,
|
|
||||||
// field: "document",
|
|
||||||
// headerStyle: "font-size: 14px",
|
|
||||||
// style: "font-size: 14px",
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
name: "status",
|
name: "status",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -88,7 +80,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
name: "remark",
|
name: "remark",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "หมายเหตุ ",
|
label: "หมายเหตุ ",
|
||||||
sortable: false,
|
sortable: true,
|
||||||
field: "remark",
|
field: "remark",
|
||||||
format: (v) => (v ? v : "-"),
|
format: (v) => (v ? v : "-"),
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue