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

@ -407,7 +407,7 @@ import { useQuasar } from "quasar";
const $q = useQuasar();
const mixin = useCounterMixin(); //
const { genColor15, messageError } = mixin;
const { genColor15, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();
const dataStore = useDataStore();
const { loaderPage } = dataStore; // load api
@ -598,7 +598,7 @@ const changeList = async (val: number) => {
*/
const fetchDataSummary = async () => {
lists.value = [];
loaderPage(true);
showLoader();
await http
.get(config.API.countDashbordHistory)
.then((res) => {
@ -615,7 +615,7 @@ const fetchDataSummary = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -630,7 +630,7 @@ const fetchDataSummarySubComponent = async () => {
*/
const fetchDataSummarySub = async (val: number) => {
dataNum.value = [];
// loaderPage(true);
// showLoader();
await http
.get(config.API.countDashbordSubHistory(val))
.then((res) => {
@ -648,7 +648,7 @@ const fetchDataSummarySub = async (val: number) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -656,7 +656,7 @@ const fetchDataSummarySub = async (val: number) => {
* สรปวนหย
*/
const fetchDataSummaryCalendar = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.summaryHolidayHistoryYear(yearSum.value))
.then((res) => {
@ -676,7 +676,7 @@ const fetchDataSummaryCalendar = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -365,6 +365,8 @@ const {
date2Thai,
messageError,
dialogMessage,
showLoader,
hideLoader,
} = mixin;
const { loaderPage } = dataStore; //
const store = useManageDataStore();
@ -491,7 +493,7 @@ const onSubmit = async () => {
)
);
} while (new Date(dateStart.value) <= new Date(dateAdd.value[1]));
loaderPage(true);
showLoader();
await http
.post(config.API.listHolidayHistoryAdd(category.value), dataAdd.value)
.then((res) => {
@ -503,7 +505,7 @@ const onSubmit = async () => {
})
.finally(() => {
refreshData.value = !refreshData.value;
loaderPage(false);
hideLoader();
});
}
});
@ -528,7 +530,7 @@ const onSubmitCopy = async () => {
);
return;
}
loaderPage(true);
showLoader();
await http
.post(config.API.listHolidayCopy, {
fromYear: dateYearStart.value,