แก้ฟิลเตอร์ จากล่างขึ้นบนถึง พ้นราชการ

This commit is contained in:
setthawutttty 2024-12-03 15:28:53 +07:00
parent 35422c6963
commit e9280ca4f3
21 changed files with 260 additions and 69 deletions

View file

@ -31,6 +31,7 @@ const {
date2Thai,
dateToISO,
findOrgName,
onSearchDataTable,
} = mixin;
const myForm = ref<QForm | null>(null);
@ -120,6 +121,7 @@ const columns = ref<any["columns"]>([
},
]);
const rows = ref<RetirementList[]>([]);
const rowsData = ref<RetirementList[]>([]);
const visibleColumns = ref<string[]>([
"order",
"name",
@ -157,7 +159,7 @@ async function fetchlistprofile(id: string) {
//
if (data.profile !== null) {
rows.value = data.profile.map((e: any) => ({
const listData = data.profile.map((e: any) => ({
id: e.id,
profileId: e.profileId,
order: e.order,
@ -183,6 +185,8 @@ async function fetchlistprofile(id: string) {
child4: e.child4,
child4Id: e.child4Id,
}));
rows.value = listData;
rowsData.value = listData;
}
if (statusReport.value == false) {
@ -407,6 +411,14 @@ function updatemodalPersonal(modal: boolean) {
modalPersonal.value = modal;
}
async function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/** Hook */
onMounted(async () => {
retireld.value = retireld_params.toString();
@ -517,6 +529,7 @@ onMounted(async () => {
placeholder="ค้นหา"
style="max-width: 200px"
class="q-ml-sm"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -549,7 +562,6 @@ onMounted(async () => {
:rows="rows"
:columns="columns"
row-key="order"
:filter="filter.trim()"
:visible-columns="visibleColumns"
no-data-label="ไม่มีข้อมูล"
:pagination-label="paginationLabel"