ทะเบียนประวัติ ==> sort

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-02-26 16:52:43 +07:00
parent ec57059dc3
commit 0e5e7ac5be
22 changed files with 194 additions and 72 deletions

View file

@ -49,7 +49,6 @@ const visibleColumns = ref<string[]>([
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columns = ref<QTableProps["columns"]>([
{
name: "educationLevel",
@ -237,13 +236,16 @@ const columns = ref<QTableProps["columns"]>([
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
format: (v) => date2Thai(v),
format: (v) => date2Thai(v, false, true),
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const pagination = ref({
sortBy: "lastUpdatedAt",
});
const columnsHistory = ref<QTableProps["columns"]>([
{
@ -434,14 +436,13 @@ const columnsHistory = ref<QTableProps["columns"]>([
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
format: (v) => date2Thai(v),
format: (v) => date2Thai(v, false, true),
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const visibleColumnsHistory = ref<string[]>([
"educationLevel",
"institute",
@ -569,6 +570,7 @@ onMounted(async () => {
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
:virtual-scroll-sticky-size-start="48"
v-model:pagination="pagination"
>
<template v-slot:header="props">
<q-tr :props="props">
@ -589,7 +591,7 @@ onMounted(async () => {
{{ props.row.status ? props.row.status : "-" }}
</div>
<div v-else>
{{ col.value ? col.value:'-' }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>