fix load ทะเบียนประวัต

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-03-27 14:39:04 +07:00
parent 90e406e21c
commit 75fa420862
2 changed files with 10 additions and 8 deletions

View file

@ -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<string[]>([]); //แสดงข้อมูลในโค
const selectNode = ref<boolean>(false); //
const isLoad = ref<boolean>(false); //
const isLoad = ref<boolean>(true); //
const nodeData = reactive<DataNodeData>({
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)"
>
<template v-slot:label>
{{
@ -853,7 +856,8 @@ onMounted(async () => {
<q-separator />
<q-card-section class="q-pa-sm">
<div class="row q-col-gutter-sm">
<LoadView v-if="isLoad" />
<div class="row q-col-gutter-sm" v-else>
<div class="col-12">
<q-input dense outlined v-model="filterMain" label="ค้นหา">
<template v-slot:append>
@ -869,6 +873,7 @@ onMounted(async () => {
</div>
<div class="col-12">
<q-tree
loading
class="tree-container"
dense
:nodes="node"

View file

@ -28,9 +28,6 @@ export const useStructureTree = defineStore("structureTree", () => {
* @returns
*/
async function fetchStructureTree(sysKey: string, isLoad: boolean = false) {
console.log(sysKey);
console.log(dataStore.value);
if (dataStore.value[sysKey]) {
return dataStore.value[sysKey] || [];
} else {