แก้ฟิลเตอร์ระบบ บรรจุ
This commit is contained in:
parent
a15efd7b45
commit
b8f336d2ba
7 changed files with 88 additions and 23 deletions
|
|
@ -15,7 +15,7 @@ import { useSelectOrgStore } from "@/modules/05_placement/stores/storeSelect";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** use*/
|
||||
const { date2Thai } = useCounterMixin();
|
||||
const { date2Thai, onSearchDataTable } = useCounterMixin();
|
||||
|
||||
const store = useSelectOrgStore();
|
||||
|
||||
|
|
@ -40,6 +40,7 @@ const optionPosLevel = defineModel<FormPosLevel[]>("optionPosLevel", {
|
|||
const bmaOfficer = defineModel<string>("bmaOfficer", { required: true });
|
||||
|
||||
const positionRows = ref<DataPositionNo[]>(positionData.value);
|
||||
const positionRowsData = ref<DataPositionNo[]>(positionData.value);
|
||||
|
||||
const props = defineProps({
|
||||
fetchDataTable: Function,
|
||||
|
|
@ -231,10 +232,19 @@ async function onClickSelectPos(id: string) {
|
|||
// }
|
||||
// }
|
||||
|
||||
function onSearch() {
|
||||
positionRows.value = onSearchDataTable(
|
||||
filters.value,
|
||||
positionRowsData.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
// เช็คว่าถ้ามีการปรับ filter ระบบจะนำข้อมูลไปเช็ค filter แสดงเฉพาะตำแหน่งที่ตรงกับการสอบใหม่อีกครั้ง
|
||||
watch(positionData, (newVal, oldVal) => {
|
||||
if (newVal != oldVal) {
|
||||
positionRows.value = positionData.value;
|
||||
positionRowsData.value = positionData.value;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -248,6 +258,7 @@ onMounted(async () => {
|
|||
}, 1000);
|
||||
} else {
|
||||
positionRows.value = positionData.value;
|
||||
positionRowsData.value = positionData.value;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
@ -349,9 +360,15 @@ onMounted(async () => {
|
|||
|
||||
<div class="row q-gutter-md">
|
||||
<div>
|
||||
<q-input outlined dense v-model="filters" label="ค้นหา">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
v-model="filters"
|
||||
label="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" color="grey-5" />
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
|
@ -377,7 +394,6 @@ onMounted(async () => {
|
|||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="positionRows"
|
||||
:filter="filters"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue