From 76680b5a434415a718b23bc42283ee8d62c3eb88 Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期一, 20 一月 2025 15:48:28 +0800
Subject: [PATCH] 预测项 指标数据下拉数据

---
 src/api/model/sche/model/index.ts |   37 +++++++++++++++++++++++++------------
 1 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/src/api/model/sche/model/index.ts b/src/api/model/sche/model/index.ts
index 59807b1..b2b130f 100644
--- a/src/api/model/sche/model/index.ts
+++ b/src/api/model/sche/model/index.ts
@@ -4,6 +4,7 @@
 import * as PlanItemApi from '@/api/data/plan/item'
 import {CommonEnabled} from "@/utils/constants";
 import {getItemList, ItemVO} from "@/api/data/plan/item";
+import * as ItemApi from '@/api/data/ind/item/item'
 
 export interface ScheduleModelVO {
   id: string
@@ -90,18 +91,19 @@
 
   const predictItemList = ref([] as PredictItemApi.MmPredictItemVO)
   predictItemList.value = await PredictItemApi.getMmPredictItemList({
-    status: CommonEnabled.ENABLE,
-    itemtypename: 'NormalItem'
+    status: CommonEnabled.ENABLE
   })
   const normalItemList = []
-  if (predictItemList.value) {
+  const predictNormalItemList = predictItemList.value.filter(e => e.itemtypename === 'NormalItem' && e.outPuts && e.outPuts.length > 0);
+  if (predictNormalItemList && predictNormalItemList.length > 0) {
     // 过滤掉本身
-    predictItemList.value.filter(e => e.id !== id).forEach(item => {
+    predictNormalItemList.filter(e => e.id !== id).forEach(item => {
       normalItemList.push(
         {
           value: item.id,
           label:  item.itemname,
           predictlength: item.predictlength,
+          moduleid: item.moduleid,
           children: item.outPuts?.map(e => {
             return {
               value: e.id,
@@ -128,20 +130,30 @@
     })
   }
 
-
-  predictItemList.value = await PredictItemApi.getMmPredictItemList({
-    status: CommonEnabled.ENABLE,
-    itemtypename: 'MergeItem'
-  })
+  const predictMergeItemList = predictItemList.value.filter(e => e.itemtypename === 'MergeItem' && e.outPuts && e.outPuts.length > 0);
   const mergeItemList = []
-  if (predictItemList.value) {
+  if (predictMergeItemList && predictMergeItemList.length > 0) {
     // 过滤掉本身
-    predictItemList.value.filter(e => e.id !== id).forEach(item => {
+    predictMergeItemList.filter(e => e.id !== id).forEach(item => {
       mergeItemList.push(
           {
-            id: item.id,
+            id: item.outPuts[0].id,
             name: item.itemname
           }
+      )
+    })
+  }
+
+  // 指标数据
+  const indItemList = await ItemApi.getItemList({})
+  const indList = []
+  if (indItemList) {
+    indItemList.forEach(item => {
+      indList.push(
+        {
+          id: item.id,
+          name: item.itemName
+        }
       )
     })
   }
@@ -151,5 +163,6 @@
     'NormalItem': normalItemList,
     'MergeItem': mergeItemList,
     'PLAN': planList,
+    'IND': indList,
   }
 }

--
Gitblit v1.9.3