From 48c25e01c079c45b26fd28958bf5412b29962e28 Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期二, 06 五月 2025 15:23:03 +0800
Subject: [PATCH] onMounted方法执行顺序修改

---
 src/views/data/point/DaPointForm.vue |   50 ++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/src/views/data/point/DaPointForm.vue b/src/views/data/point/DaPointForm.vue
index 195d0e9..94c85e5 100644
--- a/src/views/data/point/DaPointForm.vue
+++ b/src/views/data/point/DaPointForm.vue
@@ -25,6 +25,7 @@
             <el-select
               v-model="formData.pointType"
               clearable
+              :disabled = "formType !== 'create'"
               placeholder="请选择测点类型"
             >
               <el-option
@@ -286,27 +287,42 @@
       <!--累计点-->
       <el-row :gutter="20" v-if="formData.pointType === 'CUMULATE'">
         <el-col :span="24">
-          <el-form-item label="瞬时测点" prop="cumulatePoint.pointNo">
+          <el-form-item label="瞬时测点" prop="cumulatePoint.momentPoint">
             <el-select
-              v-model="formData.cumulatePoint.pointNo"
+              v-model="formData.cumulatePoint.momentPoint"
               filterable
               placeholder="请选择">
               <el-option
-                v-for="(item, index) in pointList"
+                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-col :span="8">
           <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-col :span="8">
+          <el-form-item label="累计单位" prop="cumulatePoint.cumulateUnit">
+            <el-select
+              v-model="formData.cumulatePoint.cumulateUnit"
+              placeholder="请选择累计单位"
+            >
+              <el-option
+                v-for="dict in getDictOptions(DICT_TYPE.CUMULATEUNIT)"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
           <el-form-item label="除数" prop="cumulatePoint.divisor">
             <el-input-number v-model="formData.cumulatePoint.divisor" style="width: 100%"
                              :min="1" :max="3000"
@@ -326,6 +342,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'})
 
@@ -343,6 +360,13 @@
 }])
 const queryParams = reactive({
   pointTypes: "MEASURE,CONSTANT",
+})
+const pointList2 = ref([{
+  pointName: '',
+  pointNo: ''
+}])
+const queryParams2 = reactive({
+  pointTypes: "MEASURE,CONSTANT,CALCULATE",
 })
 const operatorList = ref(['+', '-', '*', '/', '&', '|', '!', '>', '<'])
 const formData = ref({
@@ -379,7 +403,7 @@
   cumulatePoint: {
     id: '',
     pointId: '',
-    pointNo: '',
+    momentPoint: '',
     length: '',
     divisor: ''
   }
@@ -391,7 +415,7 @@
   minfreqid: [{required: true, message: '采集频率不能为空', trigger: 'blur'}],
   "measurePoint.valueType": [{required: true, message: '值类型不能为空', trigger: 'blur'}],
   "measurePoint.dimension": [{required: true, message: '平滑尺度不能为空', trigger: 'blur'}],
-  "cumulatePoint.pointNo": [{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'}],
 })
@@ -405,6 +429,7 @@
   resetForm()
   getSourceOption()
   getPointList()
+  getPointList2()
   // 修改时,设置数据
   if (id) {
     formLoading.value = true
@@ -489,7 +514,7 @@
     unittransfactor: 1,
     defaultValue: 0,
     maxValue: 100000000,
-    minValue: 0,
+    minValue: -100000000,
     minfreqid: undefined,
     remark: undefined,
     isEnable: 1,
@@ -511,8 +536,9 @@
     cumulatePoint: {
       id: '',
       pointId: '',
-      pointNo: '',
+      momentPoint: '',
       length: 60,
+      cumulateUnit: 'min',
       divisor: 60
     }
   }
@@ -574,7 +600,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