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

@ -245,7 +245,6 @@ import HeaderTop from "@/modules/03_recruiting/components/top.vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useDataStore } from "@/stores/data";
const props = defineProps({
provinceOptions: {
@ -266,15 +265,14 @@ const route = useRoute();
const candidateId = ref<string>(route.params.candidateId.toString());
const edit = ref<boolean>(true);
const myform = ref<any>({});
const loader = ref<boolean>(false);
const districtOptions = ref<DataOption[]>([]);
const districtCOptions = ref<DataOption[]>([]);
const subdistrictOptions = ref<DataOption[]>([]);
const subdistrictCOptions = ref<DataOption[]>([]);
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError } = mixin;
const { messageError, showLoader, hideLoader } = mixin;
const emit = defineEmits(["update:form"]);
watch(myform, async (count: any, prevCount: any) => {
@ -319,7 +317,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -362,7 +360,7 @@ const selectSubDistrict = (e: string, name: string) => {
};
const fetchDistrict = async (id: string, position: string) => {
loader.value = true;
showLoader();
await http
.get(config.API.listDistrict(id))
.then((res) => {
@ -381,12 +379,12 @@ const fetchDistrict = async (id: string, position: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchSubDistrict = async (id: string, position: string) => {
loader.value = true;
showLoader();
await http
.get(config.API.listSubDistrict(id))
.then((res) => {
@ -409,7 +407,7 @@ const fetchSubDistrict = async (id: string, position: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};