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

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