แก้ไข 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

@ -121,19 +121,19 @@ import { ref, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period";
import Table from "@/modules/03_recruiting/components/Table.vue";
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 { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError, success } = mixin;
const { messageError, success, showLoader, hideLoader } = mixin;
const year = ref<string>("");
const round = ref<string>("");
const name = ref<string>("");
@ -365,7 +365,7 @@ const columns = ref<QTableProps["columns"]>([
]);
onMounted(async () => {
loaderPage(false);
hideLoader();
await fetchData();
});
@ -374,7 +374,7 @@ const clickDetail = (examID: string) => {
};
const downloadExam = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.exportExam(importId.value), {
responseType: "blob",
@ -390,12 +390,12 @@ const downloadExam = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadPassExam = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.exportPassExam(importId.value), {
responseType: "blob",
@ -411,12 +411,12 @@ const downloadPassExam = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadPassResultExam = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.exportPassResultExam(importId.value), {
responseType: "blob",
@ -432,12 +432,12 @@ const downloadPassResultExam = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.getExamResultById(importId.value), {
examAttribute: "",
@ -474,7 +474,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -489,7 +489,7 @@ const candidateToPlacement = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.periodRecruitToPlacement(importId.value))
.then((res) => {
@ -499,7 +499,7 @@ const candidateToPlacement = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
router.go(-1);
});
})