new loader
This commit is contained in:
parent
fd7aae2f5d
commit
fe6c712a18
95 changed files with 1189 additions and 950 deletions
|
|
@ -261,7 +261,8 @@ const { profileData, changeProfileColumns } = store;
|
|||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, dateToISO, messageError } = mixin;
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
|
||||
mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
const dateStart = ref<Date>(new Date());
|
||||
|
|
@ -426,7 +427,7 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileDutyId(profileId.value))
|
||||
.then((res) => {
|
||||
|
|
@ -448,7 +449,7 @@ const fetchData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -535,7 +536,7 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.profileDutyId(profileId.value), {
|
||||
id: id.value,
|
||||
|
|
@ -560,7 +561,7 @@ const saveData = async () => {
|
|||
* บันทึกแก้ไขข้อมูล
|
||||
*/
|
||||
const editData = async () => {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.profileDutyId(id.value), {
|
||||
id: id.value,
|
||||
|
|
@ -593,7 +594,7 @@ const clickDelete = async () => {
|
|||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.profileDutyId(id.value))
|
||||
.then((res) => {
|
||||
|
|
@ -701,7 +702,7 @@ const clickEditRow = () => {
|
|||
*/
|
||||
const clickHistory = async (row: RequestItemsObject) => {
|
||||
modalHistory.value = true;
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileDutyHisId(row.id))
|
||||
.then((res) => {
|
||||
|
|
@ -723,7 +724,7 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue