refactor code ส่วนของเครื่องราชฯ
This commit is contained in:
parent
33c2b338a2
commit
1ed9faebf2
11 changed files with 326 additions and 149 deletions
|
|
@ -7,7 +7,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { showLoader, hideLoader, date2Thai } = mixin;
|
||||
const { showLoader, hideLoader, date2Thai, messageError } = mixin;
|
||||
const $q = useQuasar();
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -78,13 +78,13 @@ const columns = ref<QTableProps["columns"]>([
|
|||
const myForm = ref<any>([]);
|
||||
const personalForm = ref<any>([]);
|
||||
const selection = ref<any>([]);
|
||||
|
||||
// เมื่อ props.Modal จะเรียกข้อมูลการศึกษา
|
||||
watch(props, () => {
|
||||
if (props.Modal === true) {
|
||||
fetchData();
|
||||
}
|
||||
});
|
||||
|
||||
// ข้อมูลการศึกษา
|
||||
const fetchData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -101,7 +101,7 @@ const fetchData = async () => {
|
|||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log("e", e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -120,7 +120,7 @@ const formBmaofficer = (val: string) => {
|
|||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
// ปิด POPUP ข้อมูล
|
||||
const close = async () => {
|
||||
props.close();
|
||||
selection.value = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue