Refactoring code module 15_development

This commit is contained in:
STW_TTTY\stwtt 2024-09-20 14:47:35 +07:00
parent 895bfe98f2
commit 32ff7bdc96
25 changed files with 271 additions and 1440 deletions

View file

@ -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