From 75fa420862250ceb64bea520699913f70502356f Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 27 Mar 2025 14:39:04 +0700 Subject: [PATCH] =?UTF-8?q?fix=20load=20=E0=B8=97=E0=B8=B0=E0=B9=80?= =?UTF-8?q?=E0=B8=9A=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0?= =?UTF-8?q?=E0=B8=A7=E0=B8=B1=E0=B8=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/04_registryPerson/views/listView.vue | 15 ++++++++++----- src/stores/structureTree.ts | 3 --- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/modules/04_registryPerson/views/listView.vue b/src/modules/04_registryPerson/views/listView.vue index 20e26a18e..6779b012d 100644 --- a/src/modules/04_registryPerson/views/listView.vue +++ b/src/modules/04_registryPerson/views/listView.vue @@ -27,6 +27,7 @@ const TableView = defineAsyncComponent( () => import("@/modules/04_registryPerson/components/TableView.vue") ); import DialogHeader from "@/components/DialogHeader.vue"; +import LoadView from "@/components/LoadView.vue"; const $q = useQuasar(); const store = useRegistryNewDataStore(); @@ -47,7 +48,7 @@ const expanded = ref([]); //แสดงข้อมูลในโค const selectNode = ref(false); //แสดงโครงสร้าง -const isLoad = ref(false); //โหลดข้อมูลโครงสร้าง +const isLoad = ref(true); //โหลดข้อมูลโครงสร้าง const nodeData = reactive({ name: "เลือกหน่วยงาน/ส่วนราชการ", nodeId: null, @@ -342,7 +343,7 @@ async function fetchTree() { store.routerName = route.name ? route.name : ""; } if (data) { - isLoad.value = true; + isLoad.value = false; node.value = data; // hideLoader(); } @@ -379,7 +380,9 @@ function updateSelectedTreeMain(data: DataStructureTree) { /** callback function เมื่อมีการเปิด popup*/ watch(selectNode, () => { - isLoad.value && hideLoader(); + if (selectNode.value) { + isLoad.value = node.value.length !== 0 ? false : true; + } }); function getSearch() { @@ -468,7 +471,7 @@ onMounted(async () => { label-color="white" dropdown-icon="mdi-chevron-down" class="q-pl-sm" - @click="() => ((selectNode = true), showLoader())" + @click="() => (selectNode = true)" >