From e2d755caca32033da445aa627b4882b3c93f63bb Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 29 Sep 2023 10:27:24 +0700 Subject: [PATCH 1/2] =?UTF-8?q?filter=20=E0=B8=AA=E0=B9=88=E0=B8=87?= =?UTF-8?q?=E0=B9=84=E0=B8=9B=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=84=E0=B8=B3?= =?UTF-8?q?=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87=E0=B8=AD=E0=B8=B7=E0=B9=88?= =?UTF-8?q?=E0=B8=99=E0=B9=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/05_placement/components/Main.vue | 2 +- .../components/Other/Dialogbody.vue | 44 ++++++++++++++----- .../components/probation/MainProbation.vue | 2 +- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/modules/05_placement/components/Main.vue b/src/modules/05_placement/components/Main.vue index af79afc85..9ba46025c 100644 --- a/src/modules/05_placement/components/Main.vue +++ b/src/modules/05_placement/components/Main.vue @@ -425,7 +425,7 @@ function filterFnYear(val: string, update: any) { -import { ref, computed,watchEffect } from "vue"; +import { ref, computed, watchEffect } from "vue"; import { useQuasar } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import type { QTableProps } from "quasar"; @@ -25,8 +25,8 @@ const props = defineProps({ fecthlistOthet: Function, optionsType: Array, rows2: Array, - filterKeyword2:String, - type:String, + filterKeyword2: String, + type: String, }); const visibleColumns2 = ref([ "no", @@ -96,7 +96,6 @@ const emit = defineEmits([ "update:filterKeyword2", "update:type", "update:selected", - ]); const updateInput = (value: any) => { emit("update:filterKeyword2", value); @@ -107,7 +106,7 @@ const updateInputType = (value: any) => { }; //รีเซ็ตค่าในช่องค้นหา const Reset = () => { - emit("update:filterKeyword2", ""); + emit("update:filterKeyword2", ""); }; //เปิด modal ยืนยัน const clickAddlist = () => { @@ -117,7 +116,7 @@ const clickAddlist = () => { //อัพเดต ส่งไปออกคำสั่ง const addOther = async () => { let pId: string[] = []; - let Type = props.type as string + let Type = props.type as string; selected.value.forEach((e: any) => { pId.push(e.personalId); }); @@ -136,7 +135,7 @@ const addOther = async () => { .finally(() => { props.fecthlistOthet?.(); selected.value = []; - props.clickClose?.() + props.clickClose?.(); }); }; watchEffect(() => { @@ -144,6 +143,23 @@ watchEffect(() => { selected.value = []; } }); +// filter OptionsType +const OptionsTypeFn = ref([]); +function filterFnOptionsType(val: string, update: any) { + if (val == "") { + update(() => { + OptionsTypeFn.value = props.optionsType; + }); + } else { + update(() => { + if (props.optionsType) { + OptionsTypeFn.value = props.optionsType.filter( + (e: any) => e.name.search(val) !== -1 + ); + } + }); + } +}