From 61c379331f94ece797022388a65dde1458953ce4 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期五, 15 十一月 2024 16:44:54 +0800
Subject: [PATCH] 计划数据

---
 src/views/model/pre/item/MmPredictItemForm.vue |   24 ++++++++++++++++--------
 src/api/data/plan/item/index.ts                |    2 +-
 src/api/model/sche/model/index.ts              |   21 ++++++++++++++++++++-
 3 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/src/api/data/plan/item/index.ts b/src/api/data/plan/item/index.ts
index e42e999..eec13e9 100644
--- a/src/api/data/plan/item/index.ts
+++ b/src/api/data/plan/item/index.ts
@@ -50,7 +50,7 @@
 
 //获取下拉集合
 export const getItemList = (params: PageParam) => {
-  return request.get({ url: '/data/plan-item/getList', params})
+  return request.get({ url: '/data/plan-item/list', params})
 }
 
 // 查询Plan图表
diff --git a/src/api/model/sche/model/index.ts b/src/api/model/sche/model/index.ts
index 3c5b8bc..8863d31 100644
--- a/src/api/model/sche/model/index.ts
+++ b/src/api/model/sche/model/index.ts
@@ -1,7 +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
@@ -100,8 +102,25 @@
       )
     })
   }
+
+  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
+        }
+      )
+    })
+  }
+
   return {
     'DATAPOINT':pointList,
-    'PREDICTITEM': itemList
+    'PREDICTITEM': itemList,
+    'PLAN': planList,
   }
 }
diff --git a/src/views/model/pre/item/MmPredictItemForm.vue b/src/views/model/pre/item/MmPredictItemForm.vue
index e10af7d..cb01f79 100644
--- a/src/views/model/pre/item/MmPredictItemForm.vue
+++ b/src/views/model/pre/item/MmPredictItemForm.vue
@@ -17,7 +17,8 @@
         </el-col>
         <el-col :span="12">
           <el-form-item label="编号" prop="mmPredictItem.itemno">
-            <el-input v-model="dataForm.mmPredictItem.itemno" placeholder="编号" maxlength="50" readonly/>
+            <el-input v-model="dataForm.mmPredictItem.itemno" placeholder="编号" maxlength="50"
+                      readonly/>
           </el-form-item>
         </el-col>
       </el-row>
@@ -210,13 +211,13 @@
         :data="dataForm.mmItemOutputList"
         border
         style="width: 100%; margin-top: 5px;">
-        <el-table-column prop="outputorder" label="排序" align="center" width="80px" />
+        <el-table-column prop="outputorder" label="排序" align="center" width="80px"/>
         <el-table-column label="结果" align="center" width="150px">
           <template #default="scope">
             <el-input v-model="scope.row.resultstr" placeholder="请输入"/>
           </template>
         </el-table-column>
-        <el-table-column label="结果数据类型" align="center"  width="150px">
+        <el-table-column label="结果数据类型" align="center" width="150px">
           <template #default="scope">
             <el-select
               v-model="scope.row.resultType"
@@ -233,7 +234,9 @@
         </el-table-column>
         <el-table-column label="索引" align="center" width="120px">
           <template #default="scope">
-            <el-input-number style="width:100%;hight:100%" :disabled="scope.row.resultType !== 2" v-model="scope.row.resultIndex" :min="0" step-strictly controls-position="right"/>
+            <el-input-number style="width:100%;hight:100%" :disabled="scope.row.resultType !== 2"
+                             v-model="scope.row.resultIndex" :min="0" step-strictly
+                             controls-position="right"/>
           </template>
         </el-table-column>
         <el-table-column label="数据点" align="center">
@@ -290,7 +293,9 @@
         <el-table-column prop="modelparamorder" label="序号" width="60" align="center"/>
         <el-table-column prop="" label="类型" width="200" align="center">
           <template #default="scope">
-            <el-select v-model="scope.row.modelparamtype" placeholder="请选择">
+            <el-select v-model="scope.row.modelparamtype"
+                       @change="changeModelparamtype(scope.row)"
+                       placeholder="请选择">
               <el-option
                 v-for="dict in getStrDictOptions(DICT_TYPE.MODEL_PARAM_TYPE)"
                 :key="dict.value"
@@ -761,11 +766,11 @@
   dataForm.value.itemtypename = itemTypeMap[value]
 }
 
-function changeModelparamtype(value, row) {
+function changeModelparamtype(row) {
   row.modelparamid = ''
 }
 
-function changeOutputPoint(value,row) {
+function changeOutputPoint(value, row) {
   row.tagname = pointMap[value]
 }
 
@@ -792,10 +797,12 @@
   rows.splice(index, 0, row)
   orderRow(rows)
 }
+
 function addItemOutput(list) {
   list.push({})
   orderItemOutput(list)
 }
+
 function deleteItemOutput(index: string, rows) {
   if (!rows || rows.length === 1) {
     message.error('不能全部删除!')
@@ -804,6 +811,7 @@
   rows.splice(index, 1)
   orderItemOutput(rows)
 }
+
 function orderItemOutput(list) {
   list.sort((a, b) => a.outputorder - b.outputorder);
   let outputorder = 1
@@ -816,7 +824,7 @@
 function resultTypeChange(value, row) {
   if (value === 1) {
     row.resultIndex = undefined
-  }else if (value === 2) {
+  } else if (value === 2) {
     row.resultIndex = 0
   }
 }

--
Gitblit v1.9.3