From 13c97d76348b5451381320aa54efa0706f38ecb6 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期四, 31 十月 2024 08:49:52 +0800
Subject: [PATCH] 测点列表.xlsx

---
 src/views/data/point/DaPointForm.vue |   73 ++++++++++++++++++++++++++++--------
 1 files changed, 57 insertions(+), 16 deletions(-)

diff --git a/src/views/data/point/DaPointForm.vue b/src/views/data/point/DaPointForm.vue
index 883361d..0279054 100644
--- a/src/views/data/point/DaPointForm.vue
+++ b/src/views/data/point/DaPointForm.vue
@@ -1,5 +1,5 @@
 <template>
-  <Dialog v-model="dialogVisible" :title="dialogTitle" width="50%">
+  <Dialog v-model="dialogVisible" :title="dialogTitle" width="60%">
     <el-form
       ref="formRef"
       v-loading="formLoading"
@@ -61,8 +61,7 @@
         </el-col>
         <el-col :span="12">
           <el-form-item label="单位转换" prop="unittransfactor">
-            <el-input-number v-model="formData.unittransfactor" style="width: 100%"
-                             :controls="false"/>
+            <el-input-number v-model="formData.unittransfactor" style="width: 100%" :controls="false"/>
           </el-form-item>
         </el-col>
       </el-row>
@@ -136,6 +135,31 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <el-row v-if="formData.pointType === 'MEASURE'">
+        <el-col :span="12">
+          <el-form-item label="测量值类型" prop="measurePoint.valueType">
+            <el-select
+              v-model="formData.measurePoint.valueType"
+              clearable
+              placeholder="请选择值类型"
+            >
+              <el-option
+                v-for="dict in getDictOptions(DICT_TYPE.MEASURE_VALUE_TYPE)"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="平滑尺度(min)" prop="measurePoint.dimension">
+            <el-input-number v-model="formData.measurePoint.dimension" style="width: 100%"
+                             :min="0" :max="100"
+                             :controls="false"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
       <!--计算点-->
       <el-row :gutter="20" v-if="formData.pointType === 'CALCULATE'">
         <el-col :span="24">
@@ -144,11 +168,11 @@
               :data="expressionList"
               border
               style="width: 100%">
-<!--              <el-table-column
+              <el-table-column
                 type="index"
                 align="center"
-                width="50"
-                label="序号"/>-->
+                width="60"
+                label="序号"/>
               <el-table-column
                 prop=""
                 label="左括号"
@@ -172,6 +196,7 @@
               <el-table-column
                 prop=""
                 label="测点"
+                min-width="160"
                 align="center">
                 <template #default="scope">
                   <el-select
@@ -189,6 +214,7 @@
               <el-table-column
                 prop=""
                 label="运算值"
+                min-width="120"
                 align="center">
                 <template #default="scope">
                   <el-input
@@ -221,7 +247,7 @@
               <el-table-column
                 prop=""
                 label="运算符"
-                width="120"
+                width="100"
                 align="center">
                 <template #default="scope">
                   <el-select v-model="scope.row.operator" clearable>
@@ -236,19 +262,19 @@
               <el-table-column
                 prop=""
                 label="操作"
-                width="140"
+                width="120"
                 align="center">
                 <template #default="scope">
                   <el-button
                     @click="addExpressionRow(scope.$index, expressionList)"
                     type="text"
-                    size="small">
+                    size="mini">
                     添加
                   </el-button>
                   <el-button
                     @click="deleteExpressionRow(scope.$index, expressionList)"
                     type="text"
-                    size="small">
+                    size="mini">
                     删除
                   </el-button>
                 </template>
@@ -268,7 +294,6 @@
 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 {getTagTree} from "@/api/data/channel/tag";
 
 defineOptions({name: 'DataDaPointForm'})
 
@@ -285,7 +310,7 @@
   pointNo: ''
 }])
 const queryParams = reactive({
-  pointType: "MEASURE"
+  pointTypes: "MEASURE,CONSTANT",
 })
 const operatorList = ref(['+', '-', '*', '/', '&', '|', '!', '>', '<'])
 const formData = ref({
@@ -317,12 +342,16 @@
     sourceId: '',
     tagNo: '',
     dimension: '',
+    valueType: '',
   }
 })
 const formRules = reactive({
   pointName: [{required: true, message: '测点名称不能为空', trigger: 'blur'}],
   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'}],
 })
 const formRef = ref() // 表单 Ref
 
@@ -416,15 +445,27 @@
     storeType: undefined,
     unit: undefined,
     unittransfactor: 1,
-    defaultValue: 10,
-    maxValue: 10000000,
+    defaultValue: 0,
+    maxValue: 100000000,
     minValue: 0,
     minfreqid: undefined,
     remark: undefined,
     isEnable: 1,
     sourceOption: [],
-    mathPoint: {},
-    measurePoint: {},
+    mathPoint: {
+      id: '',
+      pointId: '',
+      expression: ''
+    },
+    measurePoint: {
+      id: '',
+      pointId: '',
+      sourceType: '',
+      sourceId: '',
+      tagNo: '',
+      dimension: '1',
+      valueType: 'SIMULATE',
+    }
   }
   formRef.value?.resetFields()
 }

--
Gitblit v1.9.3