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

@ -65,7 +65,7 @@ const dataStore = useDataStore();
const { loaderPage } = dataStore;
const router = useRouter();
const mixin = useCounterMixin();
const { date2Thai, messageError } = mixin;
const { date2Thai, messageError, showLoader, hideLoader } = mixin;
const rows = ref<ResponsePeriodExam[]>([]);
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
@ -163,12 +163,12 @@ const columns = ref<QTableProps["columns"]>([
]);
onMounted(async () => {
loaderPage(false);
hideLoader();
await fetchData();
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.periodExamType("exam"))
.then((res) => {
@ -219,7 +219,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};