From c7aa139d7479786bf279406a8b837687156c1858 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 1 Feb 2024 14:14:50 +0700 Subject: [PATCH 1/2] table position --- .../components/listView.vue | 2 +- .../components/tableTree.vue | 176 ++++++++++-------- 2 files changed, 99 insertions(+), 79 deletions(-) diff --git a/src/modules/02_organizationalNew/components/listView.vue b/src/modules/02_organizationalNew/components/listView.vue index 4fb08251b..be42f4ada 100644 --- a/src/modules/02_organizationalNew/components/listView.vue +++ b/src/modules/02_organizationalNew/components/listView.vue @@ -116,7 +116,7 @@ async function fetchDataTable(id: string, level: number, action: boolean) { .finally(() => { setTimeout(() => { isLoad.value = false; - }, 1500); + }, 500); }); } diff --git a/src/modules/02_organizationalNew/components/tableTree.vue b/src/modules/02_organizationalNew/components/tableTree.vue index a750554ad..cbc6151e1 100644 --- a/src/modules/02_organizationalNew/components/tableTree.vue +++ b/src/modules/02_organizationalNew/components/tableTree.vue @@ -297,7 +297,6 @@ function updatePagination(newPagination: NewPagination) { bordered :paging="true" dense - class="custom-header-table" :rows-per-page-options="[10, 25, 50, 100]" :filter="filter" @update:pagination="updatePagination" @@ -376,84 +375,78 @@ function updatePagination(newPagination: NewPagination) {
-
- - - - + From 039d4081d6d65f5b1e737f9b6c26c99bb3f74c9a Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 1 Feb 2024 14:31:22 +0700 Subject: [PATCH 2/2] filter keyword --- .../components/listView.vue | 7 +++++ .../components/tableTree.vue | 31 ++++++++----------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/modules/02_organizationalNew/components/listView.vue b/src/modules/02_organizationalNew/components/listView.vue index be42f4ada..0b6cedcde 100644 --- a/src/modules/02_organizationalNew/components/listView.vue +++ b/src/modules/02_organizationalNew/components/listView.vue @@ -120,6 +120,12 @@ async function fetchDataTable(id: string, level: number, action: boolean) { }); } +async function filterKeyword() { + reqMaster.page = 1; + action1.value === false && + fetchDataTable(reqMaster.id, reqMaster.type, false); +} + /**lifecycle Hook*/ onMounted(async () => { const id = @@ -197,6 +203,7 @@ watch( v-model:reqMaster="reqMaster" v-model:totalPage="totalPage" v-model:posMaster="posMaster" + :filterKeyword="filterKeyword" /> diff --git a/src/modules/02_organizationalNew/components/tableTree.vue b/src/modules/02_organizationalNew/components/tableTree.vue index cbc6151e1..640a68b49 100644 --- a/src/modules/02_organizationalNew/components/tableTree.vue +++ b/src/modules/02_organizationalNew/components/tableTree.vue @@ -17,6 +17,10 @@ import DialogSort from "@/modules/02_organizationalNew/components/DialogSortPosi /** importStore*/ import { useOrganizational } from "@/modules/02_organizationalNew/store/organizational"; +const props = defineProps({ + filterKeyword: { type: Function, require: true, default: () => {} }, +}); + const dataSort = ref>([]); const modalSort = ref(false); const showAllData = ref(false); @@ -188,22 +192,6 @@ const columnsExpand = ref([ style: "font-size: 14px", }, ]); -const rows = ref([ - { - noPosition: "สกง.1", - namePosition: "นักทรัพยากรบุคคล", - typePosition: "ทั่วไป", - levelPositoion: "ชำนาญการ / ?", - isStatus: "ไม่มี", - }, - { - noPosition: "สกง.2", - namePosition: "นักทรัพยากรบุคคล", - typePosition: "ทั่วไป", - levelPositoion: "ชำนาญการ / ?", - isStatus: "ไม่มี", - }, -]); const dialogPosition = ref(false); function onClickPosition(type: string) { @@ -281,7 +269,15 @@ function updatePagination(newPagination: NewPagination) { >
-
+
+ +
@@ -298,7 +294,6 @@ function updatePagination(newPagination: NewPagination) { :paging="true" dense :rows-per-page-options="[10, 25, 50, 100]" - :filter="filter" @update:pagination="updatePagination" >