ปรับ fe sprint2

This commit is contained in:
Kittapath 2023-06-19 15:50:50 +07:00
parent 8576f3c387
commit 0d6ff7be0a
83 changed files with 6932 additions and 2571 deletions

View file

@ -420,8 +420,7 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const { date2Thai, success, dateToISO, messageError } = mixin;
const route = useRoute();
const id = ref<string>("");
const insigniaId = ref<string>("");
@ -791,7 +790,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
};
const fetchInsignia = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.insignia)
.then((res) => {
@ -812,12 +811,12 @@ const fetchInsignia = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.profileInsignId(profileId.value))
.then((res) => {
@ -847,7 +846,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -941,7 +940,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
showLoader();
loaderPage(true);
await http
.post(config.API.profileInsignId(profileId.value), {
id: id.value,
@ -973,7 +972,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
showLoader();
loaderPage(true);
await http
.put(config.API.profileInsignId(id.value), {
id: id.value,
@ -1013,7 +1012,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
showLoader();
loaderPage(true);
await http
.delete(config.API.profileInsignId(id.value))
.then((res) => {
@ -1135,7 +1134,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
showLoader();
loaderPage(true);
await http
.get(config.API.profileInsignHisId(row.id))
.then((res) => {
@ -1165,7 +1164,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};