From 4fbc4bab560963b8a39b2ccab322677ce1d73345 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Tue, 26 Mar 2024 13:16:06 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=20filter=20=E0=B8=95=E0=B8=B3=E0=B9=81=E0=B8=AB=E0=B8=99?= =?UTF-8?q?=E0=B9=88=E0=B8=87=E0=B8=AA=E0=B8=B2=E0=B8=A1=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=E0=B8=96=E0=B8=9E=E0=B8=B4=E0=B8=A1=E0=B8=9E=E0=B9=8C=E0=B9=80?= =?UTF-8?q?=E0=B8=9E=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B8=84=E0=B9=89?= =?UTF-8?q?=E0=B8=99=E0=B8=AB=E0=B8=B2=E0=B9=84=E0=B8=94=E0=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DialogFormCriteria.vue | 29 ++++++++++-- .../salaryEmployeeChart/TabCriteria.vue | 44 ++++++++++++++++--- 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/src/modules/13_salary/components/salaryEmployeeChart/DialogFormCriteria.vue b/src/modules/13_salary/components/salaryEmployeeChart/DialogFormCriteria.vue index 853eae634..20810d344 100644 --- a/src/modules/13_salary/components/salaryEmployeeChart/DialogFormCriteria.vue +++ b/src/modules/13_salary/components/salaryEmployeeChart/DialogFormCriteria.vue @@ -45,6 +45,7 @@ const props = defineProps({ const posTypeOp = ref([]); const posNameOp = ref([]); +const posNameOpMain = ref([]); const groupOldOp = ref([]); const posLevelOp = ref([]); const posNameListOp = ref([]); @@ -205,7 +206,7 @@ function getPosName() { .then((res) => { const dataOp = res.data.result; posNameListOp.value = res.data.result; - posNameOp.value = [ + posNameOpMain.value = [ ...new Map( dataOp.map((i: DataListOptions) => [i.posDictName, i]) ).values(), @@ -230,7 +231,7 @@ function getPosNameEdit() { .then((res) => { const dataOp = res.data.result; posNameListOp.value = res.data.result; - posNameOp.value = [ + posNameOpMain.value = [ ...new Map( dataOp.map((i: DataListOptions) => [i.posDictName, i]) ).values(), @@ -325,6 +326,20 @@ watch( } } ); + +/** + * function ต้นหาข้อมูลของ Option + * @param val ค่าที่ต้องการฟิลเตอร์ + * @param update อัพเดทค่า + * @param refData ดาต้าที่ต้องการฟิลเตอร์ + */ + function filterOption(val: any, update: Function) { + update(() => { + posNameOp.value = posNameOpMain.value.filter( + (v: any) => v.name.indexOf(val) > -1 + ); + }); +}