diff --git a/src/modules/05_placement/components/PersonalDetail/Information/Certicate.vue b/src/modules/05_placement/components/PersonalDetail/Information/Certicate.vue index dac33a121..e672d9044 100644 --- a/src/modules/05_placement/components/PersonalDetail/Information/Certicate.vue +++ b/src/modules/05_placement/components/PersonalDetail/Information/Certicate.vue @@ -52,7 +52,7 @@ const mixin = useCounterMixin(); const { date2Thai, success, - + onSearchDataTable, messageError, showLoader, hideLoader, @@ -82,6 +82,7 @@ const modalHistory = ref(false); //modal ประวัติการ const profileId = ref(""); const rows = ref([]); +const rowsData = ref([]); const filter = ref(""); //search data table const visibleColumns = ref([]); profileData.certicate.columns.length == 0 @@ -333,6 +334,7 @@ const saveData = async () => { await props.fetch("Certificate"); await success($q, "บันทึกข้อมูลสำเร็จ"); rows.value = props.data; + rowsData.value = props.data; modal.value = false; }) .catch((e) => { @@ -359,6 +361,7 @@ const editData = async () => { await props.fetch("Certificate"); await success($q, "บันทึกข้อมูลสำเร็จ"); rows.value = props.data; + rowsData.value = props.data; modal.value = false; }) .catch((e) => { @@ -384,6 +387,7 @@ const clickDelete = async () => { await props.fetch("Certificate"); await success($q, "ลบข้อมูลสำเร็จ"); rows.value = props.data; + rowsData.value = props.data; modal.value = false; }) .catch((e) => { @@ -488,6 +492,14 @@ const getClass = (val: boolean) => { }; }; +function onSearch() { + rows.value = onSearchDataTable( + filter.value, + rowsData.value, + columns.value ? columns.value : [] + ); +} + watch(visibleColumns, async (count: String[], prevCount: String[]) => { changeProfileColumns("certicate", count); }); @@ -497,6 +509,7 @@ onMounted(() => { profileId.value = route.params.personalId.toString(); } rows.value = props.data; + rowsData.value = props.data; });