Refactoring code module 15_development
This commit is contained in:
parent
895bfe98f2
commit
32ff7bdc96
25 changed files with 271 additions and 1440 deletions
|
|
@ -2,8 +2,10 @@
|
|||
import { ref, reactive, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/**
|
||||
* importType
|
||||
|
|
@ -16,7 +18,6 @@ import type { ResPrefix } from "@/modules/15_development/interface/response/Main
|
|||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
|
|
@ -33,27 +34,27 @@ const {
|
|||
/**
|
||||
* props
|
||||
*/
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const tab = defineModel<string>("tab", { required: true });
|
||||
const modal = defineModel<boolean>("modal", { required: true }); //รับ ตัวแปร popup
|
||||
const tab = defineModel<string>("tab", { required: true }); //รับข้อมูล tab
|
||||
|
||||
const props = defineProps({
|
||||
fetchData: { type: Function, required: true },
|
||||
});
|
||||
|
||||
const projectId = ref<string>(route.params.id.toString());
|
||||
const projectId = ref<string>(route.params.id.toString()); // id route
|
||||
const formData = reactive({
|
||||
type: "",
|
||||
citizenId: "",
|
||||
prefix: "",
|
||||
firstName: "",
|
||||
lastName: "",
|
||||
position: "",
|
||||
org: "",
|
||||
dateStart: null,
|
||||
dateEnd: null,
|
||||
trainingDays: "",
|
||||
commandNumber: "",
|
||||
commandDate: null,
|
||||
type: "", //ประเภท
|
||||
citizenId: "", // เลข ปชช
|
||||
prefix: "", //คำนำหน้า
|
||||
firstName: "", //ชื่อ
|
||||
lastName: "", //นามสกุล
|
||||
position: "", //ตำแหน่ง
|
||||
org: "", //หน่วยงาน
|
||||
dateStart: null, //วันที่เริ่ม
|
||||
dateEnd: null, //วันที่สิ้นสุด
|
||||
trainingDays: "", //จำนวนวันที่ อบรม
|
||||
commandNumber: "", //เลขที่คำสั่ง
|
||||
commandDate: null, //ลงวันที่
|
||||
});
|
||||
|
||||
/** Option*/
|
||||
|
|
@ -67,9 +68,9 @@ const typeOpsMain = ref<DataOption[]>([
|
|||
name: "ลูกจ้างประจำ",
|
||||
},
|
||||
]);
|
||||
const typeOps = ref<DataOption[]>(typeOpsMain.value);
|
||||
const prefixOpsMain = ref<DataOption[]>([]);
|
||||
const prefixOps = ref<DataOption[]>([]);
|
||||
const typeOps = ref<DataOption[]>(typeOpsMain.value); // ตัวเลือกประเภท
|
||||
const prefixOpsMain = ref<DataOption[]>([]); //ตัวเลือกคำนำหน้า หลัก
|
||||
const prefixOps = ref<DataOption[]>([]); //ตัวเลือกคำนำหน้า
|
||||
|
||||
/**
|
||||
* function บันทึกข้อมูลการเพิ่มราชชื่อ
|
||||
|
|
@ -100,7 +101,7 @@ function onSubmit() {
|
|||
* @param update function
|
||||
* @param refData ประเภท
|
||||
*/
|
||||
const filterSelector = (val: string, update: Function, refData: string) => {
|
||||
function filterSelector(val: string, update: Function, refData: string) {
|
||||
switch (refData) {
|
||||
case "type":
|
||||
update(() => {
|
||||
|
|
@ -121,7 +122,7 @@ const filterSelector = (val: string, update: Function, refData: string) => {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* function ปิด Dialig และเคลียร์ข้อมูลใน formData
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue