From 5e26f4e419440a810d66d2f3a5c978da5581f56f Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期一, 06 一月 2025 13:30:00 +0800
Subject: [PATCH] pyFile可编辑

---
 src/views/data/point/DaPointForm.vue |   70 +++++++++++++++++++++++++++++++++--
 1 files changed, 66 insertions(+), 4 deletions(-)

diff --git a/src/views/data/point/DaPointForm.vue b/src/views/data/point/DaPointForm.vue
index ac36580..5a1682b 100644
--- a/src/views/data/point/DaPointForm.vue
+++ b/src/views/data/point/DaPointForm.vue
@@ -283,6 +283,38 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <!--累计点-->
+      <el-row :gutter="20" v-if="formData.pointType === 'CUMULATE'">
+        <el-col :span="24">
+          <el-form-item label="瞬时测点" prop="cumulatePoint.momentPoint">
+            <el-select
+              v-model="formData.cumulatePoint.momentPoint"
+              filterable
+              placeholder="请选择">
+              <el-option
+                v-for="(item, index) in pointList2"
+                :key="index"
+                :label="item.pointName"
+                :value="item.pointNo"/>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="累计长度" prop="cumulatePoint.length">
+            <el-input-number v-model="formData.cumulatePoint.length" style="width: 100%"
+                             :min="1" :max="3000"
+                             :controls="false"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="除数" prop="cumulatePoint.divisor">
+            <el-input-number v-model="formData.cumulatePoint.divisor" style="width: 100%"
+                             :min="1" :max="3000"
+                             :controls="false"/>
+          </el-form-item>
+        </el-col>
+
+      </el-row>
     </el-form>
     <template #footer>
       <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
@@ -294,6 +326,7 @@
 import * as DaPoint from '@/api/data/da/point'
 import * as TagApi from '@/api/data/channel/tag'
 import {DICT_TYPE, getDictOptions, getIntDictOptions} from "@/utils/dict";
+import {getPointSimpleList} from "@/api/data/da/point";
 
 defineOptions({name: 'DataDaPointForm'})
 
@@ -310,7 +343,14 @@
   pointNo: ''
 }])
 const queryParams = reactive({
-  pointType: "MEASURE"
+  pointTypes: "MEASURE,CONSTANT",
+})
+const pointList2 = ref([{
+  pointName: '',
+  pointNo: ''
+}])
+const queryParams2 = reactive({
+  pointTypes: "MEASURE,CONSTANT,CALCULATE",
 })
 const operatorList = ref(['+', '-', '*', '/', '&', '|', '!', '>', '<'])
 const formData = ref({
@@ -343,6 +383,13 @@
     tagNo: '',
     dimension: '',
     valueType: '',
+  },
+  cumulatePoint: {
+    id: '',
+    pointId: '',
+    momentPoint: '',
+    length: '',
+    divisor: ''
   }
 })
 const formRules = reactive({
@@ -350,8 +397,11 @@
   pointType: [{required: true, message: '测点类型不能为空', trigger: 'blur'}],
   dataType: [{required: true, message: '数据类型不能为空', trigger: 'blur'}],
   minfreqid: [{required: true, message: '采集频率不能为空', trigger: 'blur'}],
-  "measurePoint.valueType": [{required: true, message: '采集频率不能为空', trigger: 'blur'}],
-  "measurePoint.dimension": [{required: true, message: '采集频率不能为空', trigger: 'blur'}],
+  "measurePoint.valueType": [{required: true, message: '值类型不能为空', trigger: 'blur'}],
+  "measurePoint.dimension": [{required: true, message: '平滑尺度不能为空', trigger: 'blur'}],
+  "cumulatePoint.momentPoint": [{required: true, message: '累计测点不能为空', trigger: 'blur'}],
+  "cumulatePoint.length": [{required: true, message: '累计长度不能为空', trigger: 'blur'}],
+  "cumulatePoint.divisor": [{required: true, message: '除数不能为空', trigger: 'blur'}],
 })
 const formRef = ref() // 表单 Ref
 
@@ -363,6 +413,7 @@
   resetForm()
   getSourceOption()
   getPointList()
+  getPointList2()
   // 修改时,设置数据
   if (id) {
     formLoading.value = true
@@ -465,6 +516,13 @@
       tagNo: '',
       dimension: '1',
       valueType: 'SIMULATE',
+    },
+    cumulatePoint: {
+      id: '',
+      pointId: '',
+      momentPoint: '',
+      length: 60,
+      divisor: 60
     }
   }
   formRef.value?.resetFields()
@@ -525,7 +583,11 @@
 }
 
 const getPointList = async () => {
-  pointList.value = await DaPoint.getPointList(queryParams)
+  pointList.value = await DaPoint.getPointSimpleList(queryParams)
+}
+
+const getPointList2 = async () => {
+  pointList2.value = await DaPoint.getPointSimpleList(queryParams2)
 }
 
 const getInfo = async (id) => {

--
Gitblit v1.9.3