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();
});
};