From c7a83747848f1689236c3fc74b366c049685af0f Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 11 Dec 2024 13:46:33 +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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/02_transfer/views/Main.vue | 26 +- .../08_KPI/components/Tab/02_Evaluator.vue | 14 +- .../01_Information/01_Information.vue | 3 + .../01_Information/02_ChangeName.vue | 31 ++- .../10_registry/01_Information/03_Address.vue | 3 + .../10_registry/01_Information/04_Family.vue | 7 +- .../01_Information/05_Educations.vue | 30 ++- .../10_registry/01_Information/06_Ability.vue | 30 ++- .../02_Government/01_Government.vue | 3 + .../02_Government/02_Discipline.vue | 179 +++++++------ .../10_registry/02_Government/03_Leave.vue | 241 +++++++++--------- .../10_registry/02_Government/04_Duty.vue | 180 ++++++------- .../10_registry/03_Salary/01_Salary.vue | 31 ++- .../10_registry/03_Salary/02_Nopaid.vue | 30 ++- .../04_Achievement/01_Certificate.vue | 30 ++- .../04_Achievement/02_Training.vue | 30 ++- .../04_Achievement/03_Insignia.vue | 30 ++- .../10_registry/04_Achievement/04_Honor.vue | 31 ++- .../04_Achievement/05_Assessments.vue | 29 ++- .../04_Achievement/06_DevelopmentPlan.vue | 29 ++- src/modules/10_registry/05_Other/01_Other.vue | 30 ++- .../10_registry/Dialog/DialogHistory.vue | 27 +- src/modules/11_probation/views/main.vue | 26 +- src/modules/11_probation/views/mainDetail.vue | 35 +-- src/modules/13_portfolio/views/Main.vue | 29 ++- src/stores/mixin.ts | 24 ++ 26 files changed, 626 insertions(+), 532 deletions(-) diff --git a/src/modules/02_transfer/views/Main.vue b/src/modules/02_transfer/views/Main.vue index 42624d7..80ad70d 100644 --- a/src/modules/02_transfer/views/Main.vue +++ b/src/modules/02_transfer/views/Main.vue @@ -20,7 +20,8 @@ const mixin = useCounterMixin(); const transferData = useTransferDataStore(); const { statusText } = transferData; -const { date2Thai, messageError, showLoader, hideLoader } = mixin; +const { date2Thai, messageError, showLoader, hideLoader, onSearchDataTable } = + mixin; const pagination = ref({ sortBy: "desc", @@ -30,6 +31,7 @@ const pagination = ref({ }); const rows = ref([]); +const rowsData = ref([]); const filter = ref(""); const visibleColumns = ref([ "no", @@ -123,7 +125,7 @@ async function fecthListTransfer() { .get(config.API.listUserTransfer()) .then((res) => { let data = res.data.result; - rows.value = data.map((e: TransferList) => ({ + const listData = data.map((e: TransferList) => ({ id: e.id, date: date2Thai(e.createdAt), status: e.status, @@ -135,6 +137,8 @@ async function fecthListTransfer() { salary: e.salary, transfer: e.organization, })); + rows.value = listData; + rowsData.value = listData; }) .catch((e: any) => { messageError($q, e); @@ -158,6 +162,14 @@ function clickBack() { router.push(`/`); } +function onSearch() { + rows.value = onSearchDataTable( + filter.value, + rowsData.value, + columns.value ? columns.value : [] + ); +} + /** * เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้ */ @@ -207,15 +219,10 @@ onMounted(async () => { debounce="300" placeholder="ค้นหา" style="max-width: 200px" + @keydown.enter="onSearch" > @@ -251,7 +258,6 @@ onMounted(async () => { :visible-columns="visibleColumns" :rows-per-page-options="[10, 25, 50, 100]" v-model:pagination="pagination" - :filter="filter" >