แก้ไข loader
This commit is contained in:
parent
f072224851
commit
b663eedb09
147 changed files with 3095 additions and 3256 deletions
|
|
@ -258,7 +258,7 @@ import { onMounted, ref, watch } from "vue";
|
|||
import { useRoute } from "vue-router";
|
||||
import { useComponentProfileDataStore } from "@/components/information/store/store";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
import ProfileTable from "@/components/information/Table.vue";
|
||||
import DialogHeader from "@/components/information/DialogHeader.vue";
|
||||
import DialogFooter from "@/components/information/DialogFooter.vue";
|
||||
|
|
@ -283,10 +283,9 @@ const props = defineProps({
|
|||
const $q = useQuasar();
|
||||
const store = useComponentProfileDataStore();
|
||||
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 date = ref<Date>(new Date());
|
||||
|
|
@ -481,7 +480,7 @@ onMounted(async () => {
|
|||
|
||||
const fetchData = async () => {
|
||||
if (profileId.value != "") {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileNopaidId(profileId.value))
|
||||
.then((res) => {
|
||||
|
|
@ -505,7 +504,7 @@ const fetchData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -595,7 +594,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const saveData = async () => {
|
||||
if (profileId.value) {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.profileNopaidId(profileId.value), {
|
||||
id: id.value,
|
||||
|
|
@ -623,7 +622,7 @@ const saveData = async () => {
|
|||
* บันทึกแก้ไขข้อมูล
|
||||
*/
|
||||
const editData = async () => {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.profileNopaidId(id.value), {
|
||||
id: id.value,
|
||||
|
|
@ -658,7 +657,7 @@ const clickDelete = async () => {
|
|||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.profileNopaidId(id.value))
|
||||
.then((res) => {
|
||||
|
|
@ -768,7 +767,7 @@ const clickEditRow = () => {
|
|||
*/
|
||||
const clickHistory = async (row: RequestItemsObject) => {
|
||||
modalHistory.value = true;
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileNopaidHisId(row.id))
|
||||
.then((res) => {
|
||||
|
|
@ -792,7 +791,7 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue