From 291bf570b2106cb99b0e689af7d6ccaacc9e5c1c Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期三, 25 十二月 2024 18:10:42 +0800
Subject: [PATCH] Merge branch 'master' of http://dlindusit.com:53929/r/iailab-plat-ui-vue3

---
 src/api/model/sche/model/index.ts |   99 ++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 93 insertions(+), 6 deletions(-)

diff --git a/src/api/model/sche/model/index.ts b/src/api/model/sche/model/index.ts
index 4a557dd..d850247 100644
--- a/src/api/model/sche/model/index.ts
+++ b/src/api/model/sche/model/index.ts
@@ -1,4 +1,9 @@
 import request from '@/config/axios'
+import * as DataPointApi from '@/api/data/da/point'
+import * as PredictItemApi from '@/api/model/pre/item'
+import * as PlanItemApi from '@/api/data/plan/item'
+import {CommonEnabled} from "@/utils/constants";
+import {getItemList, ItemVO} from "@/api/data/plan/item";
 
 export interface ScheduleModelVO {
   id: string
@@ -25,6 +30,10 @@
   datalength: number
 }
 
+export interface WorkPrecessParamVO {
+  processType: string
+}
+
 export interface ScheduleModelPageReqVO extends PageParam {
   modelCode?: string
   modelName?: string
@@ -37,12 +46,12 @@
 
 // 查询ScheduleModel详情
 export const getScheduleModel = (id: number) => {
-  return request.get({ url: `/model/sche/model/info/${id}`})
+  return request.get({ url: '/model/sche/model/get?id=' + id})
 }
 
 // 新增ScheduleModel
 export const createScheduleModel = (data: ScheduleModelVO) => {
-  return request.post({ url: '/model/sche/model/add', data })
+  return request.post({ url: '/model/sche/model/create', data })
 }
 
 // 修改ScheduleModel
@@ -55,9 +64,87 @@
   return request.delete({ url: '/model/sche/model/delete?id=' + id })
 }
 
-// 查询模型参数列表
-export const getModelParamList = () => {
-  let modelparamListMap = []
+// 查询ScheduleModel列表
+export const getScheduleModelList = () => {
+  return request.get({ url: '/model/sche/model/list'})
+}
 
-  return modelparamListMap
+// 查询模型参数列表
+export const getModelParamList = async (id) => {
+
+  const dataPointList = ref([] as DataPointApi.DaPointVO)
+  dataPointList.value = await DataPointApi.getPointList({})
+  const pointList = []
+  if (dataPointList.value) {
+    dataPointList.value.forEach(item => {
+      pointList.push(
+        {
+          id: item.id,
+          name: item.pointName
+        }
+      )
+    })
+  }
+
+  const predictItemList = ref([] as PredictItemApi.MmPredictItemVO)
+  predictItemList.value = await PredictItemApi.getMmPredictItemList({
+    status: CommonEnabled.ENABLE
+  })
+  const normalItemList = []
+  const predictNormalItemList = predictItemList.value.filter(e => e.itemtypename === 'NormalItem' && e.outPuts && e.outPuts.length > 0);
+  if (predictNormalItemList && predictNormalItemList.length > 0) {
+    // 过滤掉本身
+    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,
+              label: e.resultName
+            }
+          })
+        }
+      )
+    })
+  }
+
+  const planItemList = ref([] as PlanItemApi.ItemVO)
+  planItemList.value = await PlanItemApi.getItemList({
+  })
+  const planList = []
+  if (planItemList.value) {
+    planItemList.value.forEach(item => {
+      planList.push(
+        {
+          id: item.id,
+          name:  item.itemName
+        }
+      )
+    })
+  }
+
+  const predictMergeItemList = predictItemList.value.filter(e => e.itemtypename === 'MergeItem' && e.outPuts && e.outPuts.length > 0);
+  const mergeItemList = []
+  if (predictMergeItemList && predictMergeItemList.length > 0) {
+    // 过滤掉本身
+    predictMergeItemList.filter(e => e.id !== id).forEach(item => {
+      mergeItemList.push(
+          {
+            id: item.outPuts[0].id,
+            name: item.itemname
+          }
+      )
+    })
+  }
+
+  return {
+    'DATAPOINT':pointList,
+    'NormalItem': normalItemList,
+    'MergeItem': mergeItemList,
+    'PLAN': planList,
+  }
 }

--
Gitblit v1.9.3