From fbbcf6a6eaf97f0fb0deb84bcc6782302bdb4925 Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Thu, 25 Apr 2024 18:14:49 +0700 Subject: [PATCH] no message --- .../Tab/Dialog/04_FormCompetency.vue | 74 +++++++++++-------- src/modules/08_KPI/interface/request/index.ts | 8 +- 2 files changed, 50 insertions(+), 32 deletions(-) diff --git a/src/modules/08_KPI/components/Tab/Dialog/04_FormCompetency.vue b/src/modules/08_KPI/components/Tab/Dialog/04_FormCompetency.vue index a3b8b0a..625cd64 100644 --- a/src/modules/08_KPI/components/Tab/Dialog/04_FormCompetency.vue +++ b/src/modules/08_KPI/components/Tab/Dialog/04_FormCompetency.vue @@ -2,6 +2,7 @@ import { ref, reactive, onMounted, watch } from "vue"; import DialogHeader from "@/components/DialogHeader.vue"; import type { DataOptions } from "@/modules/08_KPI/interface/index/Main"; +import type { ListCapacity } from "@/modules/08_KPI/interface/request/index"; import { useKpiDataStore } from "@/modules/08_KPI/store"; import { useCounterMixin } from "@/stores/mixin"; @@ -11,6 +12,7 @@ import config from "@/app.config"; import { useQuasar } from "quasar"; import { useRoute } from "vue-router"; +const dataListCapacityDetails = ref([]); const route = useRoute(); const idParam = ref(route.params.id as string); @@ -78,10 +80,13 @@ const fieldLabels = { const competencyTypeOp = ref(store.competencyType); function clickList(index: string, data: any) { - showLoader() - setTimeout(()=>{ - hideLoader() - },100) + const dataCapacityDetails = data.capacityDetails.sort( + (a: any, b: any) => a.level - b.level + ); + showLoader(); + setTimeout(() => { + hideLoader(); + }, 100); formScore.score1 = ""; formScore.score2 = ""; formScore.score3 = ""; @@ -93,11 +98,12 @@ function clickList(index: string, data: any) { formDetail.type = data.type; formDetail.name = data.name; formDetail.definition = data.description; - formScore.score1 = data.capacityDetails[0].description; - formScore.score2 = data.capacityDetails[1].description; - formScore.score3 = data.capacityDetails[2].description; - formScore.score4 = data.capacityDetails[3].description; - formScore.score5 = data.capacityDetails[4].description; + dataListCapacityDetails.value = dataCapacityDetails; + // formScore.score1 = dataCapacityDetails[0].description; + // formScore.score2 = dataCapacityDetails[1].description; + // formScore.score3 = dataCapacityDetails[2].description; + // formScore.score4 = dataCapacityDetails[3].description; + // formScore.score5 = dataCapacityDetails[4].description; } /** ปิด dialog */ @@ -119,6 +125,8 @@ function closeDialog() { idProps.value = null; weight.value = null; expectedLevel.value = null; + + dataListCapacityDetails.value = []; } /** เรียกใช้ class */ @@ -192,6 +200,11 @@ function getDataById() { const list = listTargetMain.value; const data = res.data.result; const target = list.find((item: any) => item.name == data.name); + + const dataListCriteria = target.capacityDetails.sort( + (a: any, b: any) => a.level - b.level + ); + listCheck.value = data.name as string; formDetail.name = data.name; @@ -202,11 +215,8 @@ function getDataById() { formDetail.type = target.type; formDetail.name = target.name; formDetail.definition = target.description; - formScore.score1 = target.capacityDetails[0].description; - formScore.score2 = target.capacityDetails[1].description; - formScore.score3 = target.capacityDetails[2].description; - formScore.score4 = target.capacityDetails[3].description; - formScore.score5 = target.capacityDetails[4].description; + + dataListCapacityDetails.value = dataListCriteria; }) .catch((e) => {}) .finally(() => {}); @@ -406,33 +416,35 @@ watch( -
+
-
ระดับสมรรถนะ
+
+ ระดับสมรรถนะ +
- พฤติกรรมที่คาดหวัง/พฤติกรรมย่อย + พฤติกรรมที่คาดหวัง/พฤติกรรมย่อย
-
-
- {{ fieldLabels[field as keyof typeof fieldLabels] }} + ไม่พบข้อมูลสมรรถนะ +
+
+
+
+ {{ item.level }}
-
- +
+
-
- -
+
diff --git a/src/modules/08_KPI/interface/request/index.ts b/src/modules/08_KPI/interface/request/index.ts index 10de77f..7cd6849 100644 --- a/src/modules/08_KPI/interface/request/index.ts +++ b/src/modules/08_KPI/interface/request/index.ts @@ -41,5 +41,11 @@ interface ListCriteria { level: number; description: string; } +interface ListCapacity { + id: string; + level: number; + description: string; + capacityId:string +} -export type { FormProfile, FormDataAssigned, FormCapacityList,ListCriteria }; +export type { FormProfile, FormDataAssigned, FormCapacityList,ListCriteria,ListCapacity };