แก้ฟิลเตอร์ จากล่างขึ้นบนถึง พ้นราชการ
This commit is contained in:
parent
35422c6963
commit
e9280ca4f3
21 changed files with 260 additions and 69 deletions
|
|
@ -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,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue