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

@ -134,7 +134,7 @@ const router = useRouter();
const route = useRoute();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError } = mixin;
const { messageError, showLoader, hideLoader } = mixin;
const year = ref<string>("");
const round = ref<string>("");
const name = ref<string>("");
@ -337,7 +337,7 @@ const pagesNumber = computed(() => {
});
onMounted(async () => {
loaderPage(false);
hideLoader();
await fetchData();
});
@ -346,7 +346,7 @@ const clickDetail = (examID: string) => {
};
const downloadExam = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.exportExam(importId.value), {
responseType: "blob",
@ -362,12 +362,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",
@ -383,12 +383,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",
@ -404,12 +404,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: "",
@ -437,7 +437,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
</script>