ข้อมูลบุคคล: ต่อAPI

This commit is contained in:
oat 2024-02-05 14:04:00 +07:00
parent 47e96ddec5
commit 338c2a3b7d
12 changed files with 415 additions and 198 deletions

View file

@ -2,13 +2,14 @@
import { ref } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import dialogHeader from "@/components/DialogHeader.vue";
import { useQuasar } from "quasar";
import { QInput, useQuasar } from "quasar";
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogConfirm } = mixin;
const dataRef = ref<any>(null);
const dataRef = ref<QInput | null>(null);
const educationRankRef = ref<QInput | null>(null);
const data = defineModel<string>("data", {
required: true,
});
@ -16,7 +17,7 @@ const personalName = defineModel<string>("personalName");
const dialogStatus = defineModel<string>("dialogStatus");
const editId = defineModel<string>("editId");
const dialog = defineModel<boolean>("dialog");
const educationRank = defineModel<any>("rank");
const educationRank = defineModel<number>("rank");
const props = defineProps({
fetchData: {
type: Function,
@ -36,8 +37,8 @@ function closeDialog() {
}
function validateForm() {
dataRef.value.validate();
educationRank.value.validate();
dataRef.value?.validate();
educationRankRef.value?.validate();
onSubmit();
}
@ -98,6 +99,7 @@ async function onSubmit() {
type="number"
lazy-rules
borderless
min="1"
class="col-12 bg-white q-ma-md"
:rules="[(val) => val != undefined || 'กรุณากรอกลำดับ']"
hide-bottom-space