แก้ฟิลเตอร์ จากล่างขึ้นบนถึง พ้นราชการ
This commit is contained in:
parent
35422c6963
commit
e9280ca4f3
21 changed files with 260 additions and 69 deletions
|
|
@ -19,7 +19,7 @@ const dataStore = useDisciplineChannelDataStore();
|
|||
const mainStore = useDisciplineMainStore();
|
||||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogRemove, showLoader, messageError, hideLoader, success } = mixin;
|
||||
const { dialogRemove, showLoader, messageError, hideLoader, success,onSearchDataTable } = mixin;
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const isEdit = ref<boolean>(false);
|
||||
|
|
@ -160,6 +160,14 @@ function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
dataStore.rows = onSearchDataTable(
|
||||
filterKeyword.value,
|
||||
dataStore.rowsData,
|
||||
dataStore.columns ? dataStore.columns : []
|
||||
);
|
||||
}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า เรียกใช้ฟังชั่น*/
|
||||
onMounted(() => {
|
||||
getComplaintChanal();
|
||||
|
|
@ -196,6 +204,7 @@ onMounted(() => {
|
|||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -223,7 +232,6 @@ onMounted(() => {
|
|||
:columns="dataStore.columns"
|
||||
:rows="dataStore.rows"
|
||||
row-key="id"
|
||||
:filter="filterKeyword.trim()"
|
||||
:visible-columns="dataStore.visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ export const useDisciplineChannelDataStore = defineStore(
|
|||
type.value = data;
|
||||
}
|
||||
const rows = ref<ChannelRows[]>([]);
|
||||
const rowsData = ref<ChannelRows[]>([]);
|
||||
|
||||
/**
|
||||
* รับค่าจาก API เก็บไว้ใน rows
|
||||
|
|
@ -51,12 +52,14 @@ export const useDisciplineChannelDataStore = defineStore(
|
|||
*/
|
||||
function fetchData(data: ChannelRows[]) {
|
||||
rows.value = data;
|
||||
rowsData.value = data;
|
||||
}
|
||||
|
||||
return {
|
||||
visibleColumns,
|
||||
columns,
|
||||
rows,
|
||||
rowsData,
|
||||
fetchData,
|
||||
type,
|
||||
getType,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue