ปรับ 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

@ -194,7 +194,7 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
const { date2Thai, success, messageError } = mixin;
const route = useRoute();
const id = ref<string>("");
const date = ref<Date>(new Date());
@ -302,7 +302,7 @@ onMounted(async () => {
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.profileOtherId(profileId.value))
.then((res) => {
@ -322,7 +322,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -407,7 +407,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
showLoader();
loaderPage(true);
await http
.post(config.API.profileOtherId(profileId.value), {
id: id.value,
@ -430,7 +430,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
showLoader();
loaderPage(true);
await http
.put(config.API.profileOtherId(id.value), {
id: id.value,
@ -461,7 +461,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
showLoader();
loaderPage(true);
await http
.delete(config.API.profileOtherId(id.value))
.then((res) => {
@ -565,7 +565,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
showLoader();
loaderPage(true);
await http
.get(config.API.profileOtherHisId(row.id))
.then((res) => {
@ -585,7 +585,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};