แก้ฟิลเตอร์ จากล่างขึ้นบนถึง พ้นราชการ
This commit is contained in:
parent
35422c6963
commit
e9280ca4f3
21 changed files with 260 additions and 69 deletions
|
|
@ -23,7 +23,14 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
const $q = useQuasar();
|
||||
const dataStore = useEvaluateDirectorDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, showLoader, hideLoader, dialogRemove, success } = mixin;
|
||||
const {
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogRemove,
|
||||
success,
|
||||
onSearchDataTable,
|
||||
} = mixin;
|
||||
|
||||
const modalDetail = ref<boolean>(false); //แสดงรายละเอียด
|
||||
const directorId = ref<string>(""); //id กรรมการ
|
||||
|
|
@ -104,6 +111,14 @@ function resetFilter() {
|
|||
}
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
dataStore.rows = onSearchDataTable(
|
||||
filterKeyword.value,
|
||||
dataStore.rowsData,
|
||||
dataStore.columns ? dataStore.columns : []
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
dataStore.rows = [];
|
||||
getList();
|
||||
|
|
@ -137,6 +152,7 @@ onMounted(() => {
|
|||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -163,7 +179,6 @@ onMounted(() => {
|
|||
<d-table
|
||||
:columns="dataStore.columns"
|
||||
:rows="dataStore.rows"
|
||||
:filter="filterKeyword.trim()"
|
||||
row-key="tb-list"
|
||||
flat
|
||||
bordered
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import { useEvaluateMeetingDataStore } from "@/modules/12_evaluatePersonal/store
|
|||
const $q = useQuasar();
|
||||
const dataStore = useEvaluateMeetingDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, showLoader, hideLoader, dialogRemove, success } = mixin;
|
||||
const { messageError, showLoader, hideLoader, dialogRemove, success,onSearchDataTable } = mixin;
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลรายการการประชุม
|
||||
|
|
@ -78,6 +78,14 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
function onSearch() {
|
||||
dataStore.rows = onSearchDataTable(
|
||||
filterKeyword.value,
|
||||
dataStore.rowsData,
|
||||
dataStore.columns ? dataStore.columns : []
|
||||
);
|
||||
}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
|
|
@ -111,6 +119,7 @@ onMounted(() => {
|
|||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -137,7 +146,6 @@ onMounted(() => {
|
|||
<d-table
|
||||
:columns="dataStore.columns"
|
||||
:rows="dataStore.rows"
|
||||
:filter="filterKeyword.trim()"
|
||||
row-key="tb-list"
|
||||
flat
|
||||
bordered
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ export const useEvaluateDirectorDataStore = defineStore(
|
|||
|
||||
// ข้อมูลในตาราง
|
||||
const rows = ref<MainList[]>([]);
|
||||
const rowsData = ref<MainList[]>([]);
|
||||
function fetchData(data: DataResponseList[]) {
|
||||
const dataList: MainList[] = data.map((item: DataResponseList) => ({
|
||||
id: item.id,
|
||||
|
|
@ -92,12 +93,14 @@ export const useEvaluateDirectorDataStore = defineStore(
|
|||
lastUpdatedAt: item.lastUpdatedAt,
|
||||
}));
|
||||
rows.value = dataList;
|
||||
rowsData.value = dataList;
|
||||
}
|
||||
|
||||
return {
|
||||
visibleColumns,
|
||||
columns,
|
||||
rows,
|
||||
rowsData,
|
||||
fetchData,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ export const useEvaluateMeetingDataStore = defineStore(
|
|||
|
||||
// ข้อมูลในตาราง
|
||||
const rows = ref<any[]>([]);
|
||||
const rowsData = ref<any[]>([]);
|
||||
function fetchData(data: any[]) {
|
||||
const dataList: any[] = data.map((item: any) => ({
|
||||
id: item.id,
|
||||
|
|
@ -75,12 +76,14 @@ export const useEvaluateMeetingDataStore = defineStore(
|
|||
duration: item.duration,
|
||||
}));
|
||||
rows.value = dataList;
|
||||
rowsData.value = dataList;
|
||||
}
|
||||
|
||||
return {
|
||||
visibleColumns,
|
||||
columns,
|
||||
rows,
|
||||
rowsData,
|
||||
fetchData,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue