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

@ -206,7 +206,7 @@ const props = defineProps({
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError } = mixin;
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();
const { manageData, changeManageColumns } = store;
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
@ -370,7 +370,7 @@ const $q = useQuasar();
const fetchData = async () => {
await props.fetchDataComponent();
rows.value.splice(0);
loaderPage(true);
showLoader();
await http
.get(config.API.listBloodGroupHistory)
.then((res) => {
@ -396,7 +396,7 @@ const fetchData = async () => {
})
.finally(() => {
updateData.value = false;
loaderPage(false);
hideLoader();
});
};
@ -404,7 +404,7 @@ const fetchData = async () => {
* งชนดอมลประวแกไขขอมลทงหมด
*/
const fetchHistory = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listBloodGroupPublishedHistory)
.then((res) => {
@ -432,7 +432,7 @@ const fetchHistory = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -441,7 +441,7 @@ const fetchHistory = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const clearPublishedData = async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.listBloodGroupHistory)
.then((res) => {
@ -461,7 +461,7 @@ const clearPublishedData = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const publishedData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listBloodGroupPublished)
.then((res) => {
@ -521,7 +521,7 @@ const save = async (publish: boolean) => {
lastUpdateFullName: e.lastUpdateFullName,
lastUpdateUserId: e.lastUpdateUserId,
}));
loaderPage(true);
showLoader();
await http
.post(config.API.listBloodGroupHistoryId(idVersion.value), {
id: idVersion.value,
@ -541,7 +541,7 @@ const save = async (publish: boolean) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};