แก้ไข loader

This commit is contained in:
Thanit Konmek 2023-08-04 10:04:59 +07:00
parent f072224851
commit b663eedb09
147 changed files with 3095 additions and 3256 deletions

View file

@ -237,19 +237,19 @@
import type { QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import { useDataStore } from "@/stores/data";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
const $q = useQuasar();
const dataStore = useDataStore();
const router = useRouter();
const route = useRoute();
const mixin = useCounterMixin();
const { messageError } = mixin;
const { loaderPage } = dataStore;
const { messageError, showLoader, hideLoader } = mixin;
const date = ref<any>();
const profile_id = ref<string>("");
const birthdate = ref<string>("");
@ -289,7 +289,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.getDisableExamDetail(importId.value, examId.value))
.then((res) => {
@ -328,12 +328,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadScore = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.downloadDisableScoreReport(importId.value, examId.value), {
responseType: "blob",
@ -349,12 +349,12 @@ const downloadScore = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadCertificate = async () => {
loaderPage(true);
showLoader();
await http
.get(
config.API.downloadDisableExamReport(importId.value, examId.value, 2),
@ -373,7 +373,7 @@ const downloadCertificate = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
</script>