refactor code ส่วนของเครื่องราชฯ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-21 14:21:26 +07:00
parent 33c2b338a2
commit 1ed9faebf2
11 changed files with 326 additions and 149 deletions

View file

@ -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 = [];