From 413d6598687f262ec27b6c5521fab0922f8930c4 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期三, 12 二月 2025 13:35:31 +0800
Subject: [PATCH] 累计点配置

---
 src/api/model/sche/model/index.ts |   45 +++++++++++++++++++++++++++++++--------------
 1 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/src/api/model/sche/model/index.ts b/src/api/model/sche/model/index.ts
index 16242f4..51a9ce7 100644
--- a/src/api/model/sche/model/index.ts
+++ b/src/api/model/sche/model/index.ts
@@ -4,6 +4,8 @@
 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'
+import {getPointSimpleList} from "@/api/data/da/point";
 
 export interface ScheduleModelVO {
   id: string
@@ -20,6 +22,7 @@
   status: number,
   paramList: null,
   settingList: null
+  modelOut:null
 }
 
 export interface ModelParamVO {
@@ -73,14 +76,15 @@
 export const getModelParamList = async (id) => {
 
   const dataPointList = ref([] as DataPointApi.DaPointVO)
-  dataPointList.value = await DataPointApi.getPointList({})
+  dataPointList.value = await DataPointApi.getPointSimpleList({})
   const pointList = []
   if (dataPointList.value) {
     dataPointList.value.forEach(item => {
       pointList.push(
         {
           id: item.id,
-          name: item.pointName
+          name: item.pointName,
+          itemNo : item.pointNo
         }
       )
     })
@@ -88,17 +92,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,
@@ -125,20 +131,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
+        }
       )
     })
   }
@@ -148,5 +164,6 @@
     'NormalItem': normalItemList,
     'MergeItem': mergeItemList,
     'PLAN': planList,
+    'IND': indList,
   }
 }

--
Gitblit v1.9.3