เพิ่ม load props

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-10-09 14:26:56 +07:00
parent 2ad74a38fc
commit 64c49a5d01
4 changed files with 48 additions and 24 deletions

View file

@ -113,6 +113,7 @@ const guidCheck = (id: string) => {
};
const fetchData = async () => {
storePersonal.loading = false;
showLoader();
await http
.get(config.API.placementPersonalId(examId.value))

View file

@ -168,7 +168,7 @@ const emit = defineEmits(["update:statusEdit"]);
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const route = useRoute();
const { success, messageError, showLoader, hideLoader } = mixin;
const { success, messageError, showLoader, dialogConfirm } = mixin;
const profileId = ref<string>(
route.params.personalId ? route.params.personalId.toString() : ""
);
@ -206,20 +206,25 @@ const getData = async () => {
};
const deleteData = async (id: string) => {
console.log(id);
showLoader();
await http
.delete(config.API.documentDelid(profileId.value, id))
.then(() => {
success($q, "ลบไฟล์เอกสารสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await props.fetch();
});
dialogConfirm(
$q,
async () => {
showLoader();
await http
.delete(config.API.documentDelid(profileId.value, id))
.then(() => {
success($q, "ลบไฟล์เอกสารสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await props.fetch();
});
},
"ยืนยันการลบเอกสารหลักฐาน",
"ต้องการยืนยันการลบเอกสารหลักฐานนี้หรือไม่ ?"
);
};
const uploadData = async () => {
@ -242,11 +247,11 @@ const uploadData = async () => {
messageError($q, e);
})
.finally(async () => {
await props.fetch();
uploader.value.reset();
name.value = "";
edit.value = false;
emit("update:statusEdit", false);
await props.fetch();
});
// } else {
// // modalError(