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

@ -247,7 +247,8 @@ const props = defineProps({
const store = useDataStore();
const { loaderPage } = store;
const mixin = useCounterMixin(); //
const { success, dateToISO, date2Thai, messageError } = mixin;
const { success, dateToISO, date2Thai, messageError, showLoader, hideLoader } =
mixin;
const $q = useQuasar(); // noti quasar
const modalAdd = ref<boolean>(false); //modal
const modalDelete = ref<boolean>(false); //modal
@ -284,7 +285,7 @@ const dataSixDaysRaw = ref<RequestItemsObject[]>([]);
* เรยกฟงกนทงหมดตอนเรยกใชไฟล
*/
onMounted(async () => {
loaderPage(false);
hideLoader();
const calen = fullCalendar.value.getApi();
const date = new Date(props.dateYear, props.dateMonth);
calen.gotoDate(date);
@ -424,7 +425,7 @@ const onSubmit = async () => {
*/
const fetchData = async () => {
calendarOptions.value.events = [];
loaderPage(true);
showLoader();
await http
.get(
config.API.listHolidayHistoryYearMonth(
@ -577,7 +578,7 @@ const editData = async () => {
});
});
loaderPage(true);
showLoader();
await http
.post(config.API.listHolidayHistoryEdit(type.value), {
history: _dataHistory.value,
@ -620,7 +621,7 @@ const addDate = async () => {
)
);
} while (new Date(dateStart.value) <= new Date(dateRange.value[1]));
loaderPage(true);
showLoader();
await http
.post(config.API.listHolidayHistoryAdd(category.value), dataAdd.value)
.then((res) => {
@ -657,7 +658,7 @@ const deleteData = async () => {
new Date(dateStart.value).setDate(new Date(dateStart.value).getDate() + 1)
);
} while (new Date(dateStart.value) <= new Date(dateRange.value[1]));
loaderPage(true);
showLoader();
await http
.post(config.API.listHolidayHistoryDelete(type.value), dataDelete.value)
.then((res) => {