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

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

@ -58,6 +58,7 @@ export const useRoundDataStore = defineStore("roundWorkStore", () => {
/** ข้อมูลในตาราง */
const rows = ref<dataRowRound[]>([]);
const rowsData = ref<dataRowRound[]>([]);
/**
* Function API map
* @param data API
@ -85,12 +86,14 @@ export const useRoundDataStore = defineStore("roundWorkStore", () => {
};
});
rows.value = datalist;
rowsData.value = datalist;
}
return {
visibleColumns,
columns,
rows,
rowsData,
fetchData,
};
});

View file

@ -17,7 +17,7 @@ const attrs = ref<any>(useAttrs());
const mixin = useCounterMixin();
const dataStore = useRoundDataStore();
const { fetchData } = dataStore;
const { showLoader, hideLoader, messageError, dialogRemove, success } = mixin;
const { showLoader, hideLoader, messageError, dialogRemove, success,onSearchDataTable } = mixin;
const modal = ref<boolean>(false);
const isRead = ref<boolean>(false);
@ -113,6 +113,14 @@ const pagination = ref({
rowsPerPage: 10,
});
function onSearch() {
dataStore.rows = onSearchDataTable(
filterKeyword.value,
dataStore.rowsData,
dataStore.columns ? dataStore.columns : []
);
}
/** Hook*/
onMounted(async () => {
await fetchListRound();
@ -150,6 +158,7 @@ onMounted(async () => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -177,7 +186,6 @@ onMounted(async () => {
ref="table"
:columns="dataStore.columns"
:rows="dataStore.rows"
:filter="filterKeyword.trim()"
row-key="interrogated"
flat
bordered