ฟิลเตอร์ระบบ บรรจุ

This commit is contained in:
setthawutttty 2024-12-04 13:47:44 +07:00
parent 7ab17d378f
commit 992541eded
20 changed files with 674 additions and 488 deletions

View file

@ -21,7 +21,7 @@ const mixin = useCounterMixin();
const route = useRoute();
const DataStore = usePlacementDataStore();
const storeCommand = useCommandMainStore();
const { dialogConfirm, dateText } = mixin;
const { dialogConfirm, dateText,onSearchDataTable } = mixin;
const modal = defineModel<boolean>("modal", { required: true });
/** props */
@ -32,6 +32,7 @@ const props = defineProps({
const examId = route.params.examId;
const rows = ref<any[]>([]);
const rowsData = ref<any[]>([]);
const commandType = ref<string>("");
const commandOp = ref<ListCommand[]>([]);
const listCommand = ref<ListCommand[]>([]); //
@ -175,6 +176,7 @@ function filterSelectOrder() {
const data = props.rows ? props.rows : [];
selected.value = [];
rows.value = data;
rowsData.value = data;
}
/** ปิด Modal และล้างค่าที่เลือก */
@ -182,6 +184,16 @@ function closeModal() {
modal.value = false;
commandType.value = "";
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/**
* เม props.modal เป true
* กำหนดให selected เปนคาวางและกำหนด filter ประเภทตำแหนงตามประเภทการสอบ
@ -191,6 +203,7 @@ watch(
async () => {
if (modal.value === true) {
rows.value = props.rows ? props.rows : [];
rowsData.value = props.rows ? props.rows : [];
selected.value = [];
commandType.value = "";
filter.value = "";
@ -259,6 +272,7 @@ watch(
v-model="filter"
placeholder="ค้นหา"
style="width: 200px; max-width: auto"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -289,7 +303,6 @@ watch(
<d-table
:columns="columns"
:rows="rows"
:filter="filter"
row-key="personalId"
:visible-columns="visibleColumns"
selection="multiple"