refactor code
This commit is contained in:
parent
134af49f25
commit
8c60bf0a3e
9 changed files with 17 additions and 27 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, ref, reactive, watch } from "vue";
|
||||
import { ref, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
|
|||
|
|
@ -12,11 +12,10 @@ import type {
|
|||
import type { DataStrategic } from "@/modules/15_development/interface/response/Main";
|
||||
|
||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const other1 = ref<boolean>(false);
|
||||
const other2 = ref<boolean>(false);
|
||||
const reasonPlanned70 = ref<string>("");
|
||||
const reasonPlanned20 = ref<string>("");
|
||||
const reasonPlanned10 = ref<string>("");
|
||||
|
|
@ -58,6 +57,7 @@ const projectTypeOp = ref<String[]>([
|
|||
"โครงการต่อเนื่อง",
|
||||
]);
|
||||
|
||||
/** option */
|
||||
const projectTechniquesOp1 = ref<DataOptionTechnique[]>([
|
||||
{
|
||||
value: "on_the_job_training",
|
||||
|
|
@ -108,6 +108,7 @@ const projectTechniquesOp1 = ref<DataOptionTechnique[]>([
|
|||
label: "อื่น ๆ (ระบุ)",
|
||||
},
|
||||
]);
|
||||
|
||||
const projectTechniquesOp2 = ref<DataOptionTechnique[]>([
|
||||
{ value: "coaching", label: "การสอนงาน (Coaching)" },
|
||||
{ value: "mentoring", label: "การเป็นพี่เลี้ยง (Mentoring)" },
|
||||
|
|
@ -186,17 +187,16 @@ function fetchData() {
|
|||
formData.projectDayBackPlanned = data.projectDayBackPlanned;
|
||||
formData.projectDayHoldPlanned = data.projectDayHoldPlanned;
|
||||
formData.projectNigthHoldPlanned = data.projectNigthHoldPlanned;
|
||||
formData.developmentProjectTechniquePlanneds =
|
||||
data.developmentProjectTechniquePlanneds;
|
||||
formData.developmentProjectTechniquePlanneds = data.developmentProjectTechniquePlanneds;
|
||||
formData.isBackActual = data.isBackActual;
|
||||
formData.isHoldActual = data.isHoldActual;
|
||||
formData.projectDayBackActual = data.projectDayBackActual;
|
||||
formData.projectDayHoldActual = data.projectDayHoldActual;
|
||||
formData.projectNigthHoldActual = data.projectNigthHoldActual;
|
||||
formData.developmentProjectTechniqueActuals =
|
||||
data.developmentProjectTechniqueActuals;
|
||||
formData.developmentProjectTechniqueActuals = data.developmentProjectTechniqueActuals;
|
||||
formData.projectModalPlanned = data.projectModalPlanned;
|
||||
formData.projectModalActual = data.projectModalActual;
|
||||
|
||||
const arrayExpanded = [
|
||||
data.strategyChild1Planned,
|
||||
data.strategyChild2Planned,
|
||||
|
|
@ -204,6 +204,7 @@ function fetchData() {
|
|||
data.strategyChild4Planned,
|
||||
data.strategyChild5Planned,
|
||||
];
|
||||
|
||||
const arrayExpanded2 = [
|
||||
data.strategyChild1Actual,
|
||||
data.strategyChild2Actual,
|
||||
|
|
@ -211,10 +212,12 @@ function fetchData() {
|
|||
data.strategyChild4Actual,
|
||||
data.strategyChild5Actual,
|
||||
];
|
||||
|
||||
const filteredArray = arrayExpanded.filter((item) => item !== null);
|
||||
const filteredArray2 = arrayExpanded2.filter((item) => item !== null);
|
||||
const lastItem = filteredArray[filteredArray.length - 1];
|
||||
const lastItem2 = filteredArray2[filteredArray2.length - 1];
|
||||
|
||||
formData.strategyChildPlannedId =
|
||||
lastItem !== undefined ? lastItem : null;
|
||||
formData.strategyChildPlannedNode =
|
||||
|
|
@ -552,8 +555,9 @@ onMounted(() => {
|
|||
<div class="col-12 q-py-md">
|
||||
<div class="row q-col-gutter-md">
|
||||
<div class="col-12">
|
||||
|
||||
<q-label class="text-bold">เทคนิควิธีการที่ใช้ในการพัฒนา</q-label>
|
||||
<q-label class="text-bold"
|
||||
>เทคนิควิธีการที่ใช้ในการพัฒนา</q-label
|
||||
>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 col-md-4 align-top">
|
||||
<q-label class="q-mb-sm text-weight-medium text-body2"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import axios from "axios";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useQuasar } from "quasar";
|
||||
import type { ResRecord } from "@/modules/15_development/interface/response/Main";
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import { useDevelopmentDataStore } from "@/modules/15_development/store/developm
|
|||
import type { QTableProps } from "quasar";
|
||||
import type { DataOption } from "@/modules/15_development/interface/index/Main";
|
||||
import type {
|
||||
FormGroupTarget,
|
||||
FormGroupRelate,
|
||||
FormGroupTargetPlannedGoal,
|
||||
} from "@/modules/15_development/interface/request/Main";
|
||||
|
|
@ -21,7 +20,6 @@ import type {
|
|||
} from "@/modules/15_development/interface/response/Main";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const store = useDevelopmentDataStore();
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@ import type {
|
|||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const dateOrder = ref<Date | null>(null);
|
||||
const order = ref<string>("");
|
||||
|
||||
|
|
@ -81,7 +81,6 @@ function fetchData() {
|
|||
formMain.level = data.posLevelName ? data.posLevelName : null;
|
||||
formMain.positionSide = data.posExecutive ? data.posExecutive : null;
|
||||
formMain.oc = data.org ? data.org : null;
|
||||
|
||||
formMainProject.id = data.developmentId ? data.developmentId : null;
|
||||
formMainProject.project = data.projectName ? data.projectName : null;
|
||||
formMainProject.year = data.year ? data.year : null;
|
||||
|
|
@ -92,10 +91,7 @@ function fetchData() {
|
|||
? data.addressAcademic
|
||||
: null;
|
||||
formMainProject.topic = data.topicAcademic ? data.topicAcademic : null;
|
||||
// formMainProject.studyStart = data.dateStudyStart;
|
||||
// formMainProject.studyEnd = data.dateStudyEnd;
|
||||
formMainProject.organizingTraining = data.org ? data.org : null;
|
||||
|
||||
dateOrder.value = data.dateOrder;
|
||||
order.value = data.order;
|
||||
})
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import type {
|
|||
FormFilter,
|
||||
NewPagination,
|
||||
} from "@/modules/15_development/interface/index/Main";
|
||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
|
||||
|
|
@ -44,11 +43,9 @@ const mixin = useCounterMixin();
|
|||
const { messageError, dialogMessageNotify, showLoader, hideLoader } = mixin;
|
||||
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
|
||||
const selected = ref<any[]>([]);
|
||||
const search = ref<string>("citizenId");
|
||||
const inputSearch = ref<any>("");
|
||||
|
||||
const govOp = ref<DataOption[]>([
|
||||
{
|
||||
id: "citizenId",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import type {
|
|||
FormFilter,
|
||||
NewPagination,
|
||||
} from "@/modules/15_development/interface/index/Main";
|
||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
|
||||
|
|
@ -28,7 +27,6 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
} = mixin;
|
||||
const store = useDevelopmentDataStore();
|
||||
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ const props = defineProps({
|
|||
});
|
||||
|
||||
const maxPage = ref<number>(1);
|
||||
|
||||
const formFilter = reactive<FormFilter>({
|
||||
page: 1,
|
||||
pageSize: 20,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import type { FormsSholarship } from "@/modules/15_development/interface/request
|
|||
import type { DataSholarship } from "@/modules/15_development/interface/response/Scholarship";
|
||||
|
||||
import DialogGov from "@/modules/15_development/components/history/DialogGov.vue";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const fileBackReceived = ref<string>("");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue