filter ==> ตั้งค่าระบบ
This commit is contained in:
parent
55ea7f7c5b
commit
ad250ce83f
4 changed files with 98 additions and 64 deletions
|
|
@ -33,6 +33,7 @@ const {
|
|||
dialogRemove,
|
||||
dialogConfirm,
|
||||
dialogMessageNotify,
|
||||
onSearchDataTable,
|
||||
} = useCounterMixin();
|
||||
const {
|
||||
getSchedule,
|
||||
|
|
@ -112,8 +113,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
align: "left",
|
||||
label: "วันที่เริ่มการสำรองข้อมูล",
|
||||
sortable: true,
|
||||
field: (v) => date2Thai(v, false, true),
|
||||
|
||||
field: "startAt",
|
||||
format(val, row) {
|
||||
return date2Thai(val, false, true);
|
||||
},
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -268,6 +271,14 @@ function clearForm() {
|
|||
formDataschedule.value.time = "";
|
||||
formDataschedule.value.schedule = "";
|
||||
}
|
||||
const dataMain = ref<Schedule[]>([]);
|
||||
function serchDataTable() {
|
||||
dataSchedule.value = onSearchDataTable(
|
||||
filter.value,
|
||||
dataMain.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
watch(tab, () => {
|
||||
if (tab.value === formDataschedule.value.type) {
|
||||
|
|
@ -282,7 +293,8 @@ watch(tab, () => {
|
|||
});
|
||||
|
||||
onMounted(async () => {
|
||||
getSchedule();
|
||||
await getSchedule();
|
||||
dataMain.value = dataSchedule.value;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -309,10 +321,10 @@ onMounted(async () => {
|
|||
<q-input
|
||||
borderless
|
||||
dense
|
||||
debounce="300"
|
||||
outlined
|
||||
v-model="filter"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter.pervent="serchDataTable"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -338,7 +350,6 @@ onMounted(async () => {
|
|||
:columns="columns"
|
||||
row-key="name"
|
||||
:visible-columns="visibleColumns"
|
||||
:filter="filter"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue