fix loading
This commit is contained in:
parent
4646a3fdbb
commit
23dbf79067
6 changed files with 112 additions and 41 deletions
|
|
@ -24,9 +24,15 @@ import type {
|
|||
import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Profile";
|
||||
|
||||
/** importComponents*/
|
||||
import CardNotPermission from "@/components/CardNotPermission.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import TabMain from "@/modules/04_registryPerson/components/detail/TabMain.vue";
|
||||
const CardNotPermission = defineAsyncComponent(
|
||||
() => import("@/components/CardNotPermission.vue")
|
||||
);
|
||||
const DialogHeader = defineAsyncComponent(
|
||||
() => import("@/components/DialogHeader.vue")
|
||||
);
|
||||
const TabMain = defineAsyncComponent(
|
||||
() => import("@/modules/04_registryPerson/components/detail/TabMain.vue")
|
||||
);
|
||||
|
||||
const DialogRetired = defineAsyncComponent(
|
||||
() => import("@/modules/04_registryPerson/components/DialogRetired.vue")
|
||||
|
|
@ -392,11 +398,7 @@ async function fetchDataPersonal() {
|
|||
} else {
|
||||
messageError($q, err);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
hideLoader();
|
||||
}, 2800);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -604,6 +606,8 @@ function clickSaveDeceased() {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
|
|
@ -627,14 +631,17 @@ async function getImage() {
|
|||
.get(config.API.orgProfileAvatar + `/${profileId.value}`)
|
||||
.then(async (res) => {
|
||||
let data = res.data.result;
|
||||
imagesAlldata.value = data;
|
||||
if (!data || !Array.isArray(data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
await getImg(data[i]);
|
||||
imagesAlldata.value = data;
|
||||
for (const img of data) {
|
||||
await getImg(img);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
// messageError($q, e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -655,10 +662,11 @@ async function getImg(dataList: any) {
|
|||
isActive: dataList.isActive,
|
||||
...data,
|
||||
};
|
||||
images.value = [...images.value, newData];
|
||||
|
||||
images.value.push(newData);
|
||||
})
|
||||
.catch((e) => {
|
||||
// messageError($q, e);
|
||||
messageError($q, e);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue