Refactoring code module 15_development
This commit is contained in:
parent
895bfe98f2
commit
32ff7bdc96
25 changed files with 271 additions and 1440 deletions
|
|
@ -1,19 +1,17 @@
|
|||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useStructureTree } from "@/stores/structureTree";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** importType*/
|
||||
import type { FormBasicinfo } from "@/modules/15_development/interface/request/Main";
|
||||
import type { DataTree } from "@/modules/15_development/interface/response/Main";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
|
|
@ -30,23 +28,24 @@ const props = defineProps({
|
|||
onCheckChangeData: { type: Function, required: true },
|
||||
});
|
||||
|
||||
const projectId = ref<string>(route.params.id.toLocaleString());
|
||||
const projectId = ref<string>(route.params.id.toLocaleString()); // เก็บ id
|
||||
const checkRoutePermission = ref<boolean>(
|
||||
route.name == "developmentDetailPage"
|
||||
);
|
||||
); // check ชื่อ route
|
||||
|
||||
const formData = reactive<FormBasicinfo>({
|
||||
year: new Date().getFullYear(),
|
||||
projectName: "",
|
||||
reason: "",
|
||||
objective: "",
|
||||
node: null,
|
||||
nodeId: null,
|
||||
year: new Date().getFullYear(), //ปี
|
||||
projectName: "", //ชืื่อ
|
||||
reason: "", //หลักการเเละเหตุผล
|
||||
objective: "", //วัตถุประสงค์
|
||||
node: null, //หน่วยงาน/ส่วนราชการ
|
||||
nodeId: null, //id หน่วยงาน/ส่วนราชการ
|
||||
orgRevisionId: null,
|
||||
});
|
||||
|
||||
const orgName = ref<string>("");
|
||||
const node = ref<any[]>([]);
|
||||
const filter = ref<string>("");
|
||||
const orgName = ref<string>(""); //ชื่อ หน่วยงาน/ส่วนราชการ
|
||||
const node = ref<any[]>([]); //โครงสร้าง หน่วยงาน/ส่วนราชการ
|
||||
const filter = ref<string>(""); //input ค้นหา
|
||||
const expanded = ref<string[]>([]);
|
||||
|
||||
/**
|
||||
|
|
@ -107,7 +106,7 @@ function onSubmit() {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* ดึงข้อมูลโครง้ราง
|
||||
*/
|
||||
async function fetchActive() {
|
||||
const dataTree = await fetchStructureTree(route.meta.Key as string, true);
|
||||
|
|
@ -135,19 +134,19 @@ function onNextTab() {
|
|||
props.nextStep();
|
||||
}
|
||||
|
||||
/**
|
||||
* ดึงข้อมูลเมื่อโหลดหน้าเสร็จสิ้น
|
||||
*/
|
||||
onMounted(async () => {
|
||||
fetchActive();
|
||||
});
|
||||
|
||||
/**
|
||||
* เรียก function ไปใช่หน้าหลัก
|
||||
*/
|
||||
defineExpose({
|
||||
onSubmit,
|
||||
});
|
||||
|
||||
/**
|
||||
* ดึงข้อมูลเมื่อโหลดหน้าเสร็จสิ้น
|
||||
*/
|
||||
onMounted(async () => {
|
||||
fetchActive();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue