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)" >