เพิ่ม 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(

View file

@ -4,6 +4,11 @@ import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import type {
OptionQuestions,
OptionQuestions2,
} from "@/modules/06_retirement/interface/request/Main";
import http from "@/plugins/http";
import config from "@/app.config";
import keycloak from "@/plugins/keycloak";
@ -188,13 +193,13 @@ const questionDesc = reactive<any>([
question10Desc: "",
},
]);
const question1Answer = ref<any>([]);
const question2Answer = ref<any>([]);
const question3Answer = ref<any>([]);
const question4Answer = ref<any>([]);
const question7Answer = ref<any>([]);
const question8Answer = ref<any>([]);
const question9Answer = ref<any>([]);
const question1Answer = ref<OptionQuestions[]>([]);
const question2Answer = ref<OptionQuestions[]>([]);
const question3Answer = ref<OptionQuestions[]>([]);
const question4Answer = ref<OptionQuestions[]>([]);
const question7Answer = ref<OptionQuestions2[]>([]);
const question8Answer = ref<OptionQuestions2[]>([]);
const question9Answer = ref<OptionQuestions2[]>([]);
async function fecthquestion() {
await http
.get(config.API.questionnaireList())

View file

@ -1 +1,14 @@
export type {};
interface OptionQuestions {
label: string;
value: number;
}
interface OptionQuestions2 {
label: string;
value: boolean;
}
export type {
OptionQuestions,
OptionQuestions2
};