From 9c72cd249d2a739343fcc79b769f9ec4b96ba42a Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Thu, 6 Mar 2025 09:55:28 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9F=E0=B8=B4=E0=B8=A5=E0=B9=80=E0=B8=95?= =?UTF-8?q?=E0=B8=AD=E0=B8=A3=E0=B9=8C=20=E0=B8=AA=E0=B8=96=E0=B8=B2?= =?UTF-8?q?=E0=B8=99=E0=B8=A0=E0=B8=B2=E0=B8=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../09_leave/components/05_Leave/Tab1.vue | 1 + .../09_leave/components/05_Leave/Tab2.vue | 1 + .../components/05_Leave/ToolBarLeave.vue | 57 ++++++++++++++++++- .../09_leave/interface/request/leave.ts | 1 + src/modules/09_leave/stores/LeaveStore.ts | 1 + 5 files changed, 59 insertions(+), 2 deletions(-) diff --git a/src/modules/09_leave/components/05_Leave/Tab1.vue b/src/modules/09_leave/components/05_Leave/Tab1.vue index b3d426161..086f6c17d 100644 --- a/src/modules/09_leave/components/05_Leave/Tab1.vue +++ b/src/modules/09_leave/components/05_Leave/Tab1.vue @@ -30,6 +30,7 @@ const querySting = reactive({ page: 1, //*สถานะการของลา pageSize: 10, //*สถานะการของลา keyword: leaveStore.filter.keyword, //keyword ค้นหา + profileType: '', //profileType }); //** เรียกข้อมูลจาก API*/ diff --git a/src/modules/09_leave/components/05_Leave/Tab2.vue b/src/modules/09_leave/components/05_Leave/Tab2.vue index 4394ec295..c46822b76 100644 --- a/src/modules/09_leave/components/05_Leave/Tab2.vue +++ b/src/modules/09_leave/components/05_Leave/Tab2.vue @@ -33,6 +33,7 @@ const querySting = reactive({ page: 1, //*สถานะการของลา pageSize: 10, //*สถานะการของลา keyword: leaveStore.filter.keyword, //keyword ค้นหา + profileType: '', //profileType }); //** เรียกข้อมูลจาก API*/ async function fecthLeaveList() { diff --git a/src/modules/09_leave/components/05_Leave/ToolBarLeave.vue b/src/modules/09_leave/components/05_Leave/ToolBarLeave.vue index 16621aa43..72350d583 100644 --- a/src/modules/09_leave/components/05_Leave/ToolBarLeave.vue +++ b/src/modules/09_leave/components/05_Leave/ToolBarLeave.vue @@ -23,6 +23,12 @@ const props = defineProps({ }); /** Option*/ +const roleMainOp = ref([ + { id: "OFFICER", name: "ข้าราชการ กทม. สามัญ" }, + { id: "EMPLOYEE", name: "ลูกจ้างประจำ กทม." }, +]); +const roleOp = ref(); + const optionTypeMain = ref([]); const optionType = ref([]); const optionStatus = ref([ @@ -91,6 +97,18 @@ function filterOption(val: string, update: any, name: string) { }); } +/** + * function ค้นหาข้อมูลใน option + * @param val คำค้นหา + * @param update function + */ +function filterOptionFn(val: string, update: Function) { + update(() => { + const data = roleMainOp.value; + roleOp.value = data.filter((e: any) => e.name.search(val) !== -1); + }); +} + watch( async () => props.dataToobar, () => { @@ -116,6 +134,42 @@ watch(