From 0ce0ba8723679be52802f8a51bc0b1d10d211872 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Tue, 10 Dec 2024 10:32:56 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9F=E0=B8=B4?= =?UTF-8?q?=E0=B8=A5=E0=B9=80=E0=B8=95=E0=B8=AD=E0=B8=A3=E0=B9=8C=E0=B8=97?= =?UTF-8?q?=E0=B8=94=E0=B8=A5=E0=B8=AD=E0=B8=87=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/probation/ProbationDetail.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/modules/05_placement/components/probation/ProbationDetail.vue b/src/modules/05_placement/components/probation/ProbationDetail.vue index aebb1edfc..5ad4570d2 100644 --- a/src/modules/05_placement/components/probation/ProbationDetail.vue +++ b/src/modules/05_placement/components/probation/ProbationDetail.vue @@ -18,6 +18,7 @@ const personalId = ref(route.params.id as string); const checkRoutePermisson = ref(route.name == "probationDetailOnly"); const $q = useQuasar(); //ใช้ noti quasar const rows = ref([]); +const rowsData = ref([]); const name = ref(""); const attrs = ref(useAttrs()); const paging = ref(true); @@ -45,6 +46,7 @@ const { hideLoader, date2Thai, dialogConfirm, + onSearchDataTable, } = mixin; /** ข้อมูลที่เเสดงในตาราง */ @@ -157,7 +159,7 @@ async function getAssignList() { .get(config.API.probationGetAssignList(personalId.value)) .then(async (res) => { const data = await res.data.result; - rows.value = await data.map((item: FormProbationDetail) => ({ + const listData = await data.map((item: FormProbationDetail) => ({ id: item.id, round_no: item.round_no, date_start: date2Thai(new Date(item.date_start)), @@ -166,6 +168,8 @@ async function getAssignList() { commander: item.commander, chairman: item.chairman, })); + rows.value = listData; + rowsData.value = listData; }) .catch((err) => { messageError($q, err); @@ -280,6 +284,14 @@ async function fetchProfilePhoto() { }); } +function onSearch() { + rows.value = onSearchDataTable( + filterKeyword.value, + rowsData.value, + columns.value ? columns.value : [] + ); +} + /** get ค่า เมื่อโหลดหน้า */ onMounted(async () => { await Promise.all([getpersonalList(), getAssignList(), fetchProfilePhoto()]); @@ -399,6 +411,7 @@ onMounted(async () => { outlined debounce="300" placeholder="ค้นหา" + @keydown.enter="onSearch" >