fix leave Skeleton Load

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-08-14 11:47:03 +07:00
parent 7cdff8d853
commit 474828c5ee
15 changed files with 282 additions and 260 deletions

View file

@ -28,6 +28,7 @@ export const useLeaveStore = defineStore("Leave", () => {
const fiscalYearyear = ref<Number | null>(new Date().getFullYear());
const rows = ref<ListLeaveTable[]>([]);
const leaveTypeData = ref<TypeLeave[]>([]);
const isLoadingProfile = ref<boolean>(false); // สถานะการโหลดข้อมูลโปรไฟล์
/**
* function Table
@ -307,7 +308,8 @@ export const useLeaveStore = defineStore("Leave", () => {
//ดึงข้อมูล profile จาก API
async function fetchProfile() {
showLoader();
// showLoader();
isLoadingProfile.value = true;
await http
.post(config.API.leaveProfile(), { type: typeId.value })
.then((res: any) => {
@ -345,7 +347,8 @@ export const useLeaveStore = defineStore("Leave", () => {
console.log(e);
})
.finally(() => {
hideLoader();
// hideLoader();
isLoadingProfile.value = false;
});
}
@ -474,5 +477,6 @@ export const useLeaveStore = defineStore("Leave", () => {
converstType,
fetchLeaveTypeData,
isLoadingProfile,
};
});