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

@ -202,7 +202,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
@ -366,7 +366,7 @@ const $q = useQuasar();
const fetchData = async () => {
await props.fetchDataComponent();
rows.value.splice(0);
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeeGroupHistory)
.then((res) => {
@ -392,7 +392,7 @@ const fetchData = async () => {
})
.finally(() => {
updateData.value = false;
loaderPage(false);
hideLoader();
});
};
@ -400,7 +400,7 @@ const fetchData = async () => {
* งชนดอมลประวแกไขขอมลทงหมด
*/
const fetchHistory = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeeGroupPublishedHistory)
.then((res) => {
@ -428,7 +428,7 @@ const fetchHistory = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -437,7 +437,7 @@ const fetchHistory = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const clearPublishedData = async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.listPositionEmployeeGroupHistory)
.then((res) => {
@ -457,7 +457,7 @@ const clearPublishedData = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const publishedData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeeGroupPublished)
.then((res) => {
@ -517,7 +517,7 @@ const save = async (publish: boolean) => {
lastUpdateFullName: e.lastUpdateFullName,
lastUpdateUserId: e.lastUpdateUserId,
}));
loaderPage(true);
showLoader();
await http
.post(config.API.listPositionEmployeeGroupHistoryId(idVersion.value), {
id: idVersion.value,
@ -537,7 +537,7 @@ const save = async (publish: boolean) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -202,7 +202,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
@ -365,7 +365,7 @@ const $q = useQuasar();
const fetchData = async () => {
await props.fetchDataComponent();
rows.value.splice(0);
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeeLevelHistory)
.then((res) => {
@ -391,7 +391,7 @@ const fetchData = async () => {
})
.finally(() => {
updateData.value = false;
loaderPage(false);
hideLoader();
});
};
@ -399,7 +399,7 @@ const fetchData = async () => {
* งชนดอมลประวแกไขขอมลทงหมด
*/
const fetchHistory = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeeLevelPublishedHistory)
.then((res) => {
@ -427,7 +427,7 @@ const fetchHistory = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -436,7 +436,7 @@ const fetchHistory = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const clearPublishedData = async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.listPositionEmployeeLevelHistory)
.then((res) => {
@ -456,7 +456,7 @@ const clearPublishedData = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const publishedData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeeLevelPublished)
.then((res) => {
@ -516,7 +516,7 @@ const save = async (publish: boolean) => {
lastUpdateFullName: e.lastUpdateFullName,
lastUpdateUserId: e.lastUpdateUserId,
}));
loaderPage(true);
showLoader();
await http
.post(config.API.listPositionEmployeeLevelHistoryId(idVersion.value), {
id: idVersion.value,
@ -536,7 +536,7 @@ const save = async (publish: boolean) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -202,7 +202,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
@ -366,7 +366,7 @@ const $q = useQuasar();
const fetchData = async () => {
await props.fetchDataComponent();
rows.value.splice(0);
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeeLineHistory)
.then((res) => {
@ -392,7 +392,7 @@ const fetchData = async () => {
})
.finally(() => {
updateData.value = false;
loaderPage(false);
hideLoader();
});
};
@ -400,7 +400,7 @@ const fetchData = async () => {
* งชนดอมลประวแกไขขอมลทงหมด
*/
const fetchHistory = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeeLinePublishedHistory)
.then((res) => {
@ -428,7 +428,7 @@ const fetchHistory = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -437,7 +437,7 @@ const fetchHistory = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const clearPublishedData = async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.listPositionEmployeeLineHistory)
.then((res) => {
@ -457,7 +457,7 @@ const clearPublishedData = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const publishedData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeeLinePublished)
.then((res) => {
@ -517,7 +517,7 @@ const save = async (publish: boolean) => {
lastUpdateFullName: e.lastUpdateFullName,
lastUpdateUserId: e.lastUpdateUserId,
}));
loaderPage(true);
showLoader();
await http
.post(config.API.listPositionEmployeeLineHistoryId(idVersion.value), {
id: idVersion.value,
@ -537,7 +537,7 @@ const save = async (publish: boolean) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -214,7 +214,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
@ -402,7 +402,7 @@ const $q = useQuasar();
const fetchData = async () => {
await props.fetchDataComponent();
rows.value.splice(0);
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeePositionHistory)
.then((res) => {
@ -429,7 +429,7 @@ const fetchData = async () => {
})
.finally(() => {
updateData.value = false;
loaderPage(false);
hideLoader();
});
};
@ -437,7 +437,7 @@ const fetchData = async () => {
* งชนดอมลประวแกไขขอมลทงหมด
*/
const fetchHistory = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeePositionPublishedHistory)
.then((res) => {
@ -466,7 +466,7 @@ const fetchHistory = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -475,7 +475,7 @@ const fetchHistory = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const clearPublishedData = async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.listPositionEmployeePositionHistory)
.then((res) => {
@ -495,7 +495,7 @@ const clearPublishedData = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const publishedData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeePositionPublished)
.then((res) => {
@ -556,7 +556,7 @@ const save = async (publish: boolean) => {
lastUpdateFullName: e.lastUpdateFullName,
lastUpdateUserId: e.lastUpdateUserId,
}));
loaderPage(true);
showLoader();
await http
.post(config.API.listPositionEmployeePositionHistoryId(idVersion.value), {
id: idVersion.value,
@ -576,7 +576,7 @@ const save = async (publish: boolean) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -214,7 +214,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
@ -402,7 +402,7 @@ const $q = useQuasar();
const fetchData = async () => {
await props.fetchDataComponent();
rows.value.splice(0);
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeePositionSideHistory)
.then((res) => {
@ -429,7 +429,7 @@ const fetchData = async () => {
})
.finally(() => {
updateData.value = false;
loaderPage(false);
hideLoader();
});
};
@ -437,7 +437,7 @@ const fetchData = async () => {
* งชนดอมลประวแกไขขอมลทงหมด
*/
const fetchHistory = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeePositionSidePublishedHistory)
.then((res) => {
@ -466,7 +466,7 @@ const fetchHistory = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -475,7 +475,7 @@ const fetchHistory = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const clearPublishedData = async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.listPositionEmployeePositionSideHistory)
.then((res) => {
@ -495,7 +495,7 @@ const clearPublishedData = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const publishedData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeePositionSidePublished)
.then((res) => {
@ -556,7 +556,7 @@ const save = async (publish: boolean) => {
lastUpdateFullName: e.lastUpdateFullName,
lastUpdateUserId: e.lastUpdateUserId,
}));
loaderPage(true);
showLoader();
await http
.post(
config.API.listPositionEmployeePositionSideHistoryId(idVersion.value),
@ -579,7 +579,7 @@ const save = async (publish: boolean) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -202,7 +202,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
@ -366,7 +366,7 @@ const $q = useQuasar();
const fetchData = async () => {
await props.fetchDataComponent();
rows.value.splice(0);
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeeStatusHistory)
.then((res) => {
@ -392,7 +392,7 @@ const fetchData = async () => {
})
.finally(() => {
updateData.value = false;
loaderPage(false);
hideLoader();
});
};
@ -400,7 +400,7 @@ const fetchData = async () => {
* งชนดอมลประวแกไขขอมลทงหมด
*/
const fetchHistory = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeeStatusPublishedHistory)
.then((res) => {
@ -428,7 +428,7 @@ const fetchHistory = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -437,7 +437,7 @@ const fetchHistory = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const clearPublishedData = async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.listPositionEmployeeStatusHistory)
.then((res) => {
@ -457,7 +457,7 @@ const clearPublishedData = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const publishedData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listPositionEmployeeStatusPublished)
.then((res) => {
@ -517,7 +517,7 @@ const save = async (publish: boolean) => {
lastUpdateFullName: e.lastUpdateFullName,
lastUpdateUserId: e.lastUpdateUserId,
}));
loaderPage(true);
showLoader();
await http
.post(config.API.listPositionEmployeeStatusHistoryId(idVersion.value), {
id: idVersion.value,
@ -537,7 +537,7 @@ const save = async (publish: boolean) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};