new loader

This commit is contained in:
Thanit Konmek 2023-06-09 14:25:41 +07:00
parent fd7aae2f5d
commit fe6c712a18
95 changed files with 1189 additions and 950 deletions

View file

@ -319,7 +319,8 @@ const $q = useQuasar();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const profileStore = useProfileDataStore();
const { birthDate, retireText } = storeToRefs(profileStore);
const edit = ref<boolean>(false);
@ -540,7 +541,7 @@ watch(retireText, async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileGovId(route.params.id.toString()))
.then((res) => {
@ -564,7 +565,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -574,7 +575,7 @@ const refreshData = async () => {
};
const editData = async () => {
loaderPage(true);
showLoader();
const body: ResponseObject = {
oc: govermentData.value.ocId,
business: govermentData.value.businessId,
@ -623,7 +624,7 @@ const handleDate = async (modelData: Date) => {
};
const fetchCalAgeGov = async (date: Date) => {
loaderPage(true);
showLoader();
const body = {
dateAppoint: date,
};
@ -637,7 +638,7 @@ const fetchCalAgeGov = async (date: Date) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -646,7 +647,7 @@ const fetchCalAgeGov = async (date: Date) => {
*/
const clickHistory = async () => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileGovHisId(route.params.id.toString()))
.then((res) => {
@ -677,7 +678,7 @@ const clickHistory = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};