From e9d8f9afe74248637f6a2a3986f23615d89850fa Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期日, 13 十月 2024 23:54:34 +0800
Subject: [PATCH] 测点配置修改

---
 src/views/data/point/index.vue       |   36 +++++++++++++++++++++++++++++-------
 src/utils/dict.ts                    |    4 ++--
 src/views/data/point/DaPointForm.vue |   12 ++++++------
 3 files changed, 37 insertions(+), 15 deletions(-)

diff --git a/src/utils/dict.ts b/src/utils/dict.ts
index 8df18e7..eef6249 100644
--- a/src/utils/dict.ts
+++ b/src/utils/dict.ts
@@ -243,6 +243,7 @@
   // ========== DATA - 数据平台模块  ==========
   DATA_FIELD_TYPE = 'data_field_type',
   TAG_DATA_TYPE = 'tag_data_type',
+  POINT_DATA_TYPE = 'point_data_type',
   IS_ENABLED = 'is_enabled',
   OPCUA_SECURITY_POLICY = 'opcua_security_policy',
   OPCUA_SECURITY_MODE = 'opcua_security_mode',
@@ -253,7 +254,6 @@
   IND_TIME_LIMIT = 'ind_time_limit',
   IND_ITEM_TYPE = 'ind_item_type',
   COM_IS_INT = 'com_is_int',
-  POINT_TYPE = 'point_type',
-  DATA_TYPE = 'data_type',
+  DATA_POINT_TYPE = 'data_point_type',
   MINFREQID = 'minfreqid',
 }
diff --git a/src/views/data/point/DaPointForm.vue b/src/views/data/point/DaPointForm.vue
index e467d76..883361d 100644
--- a/src/views/data/point/DaPointForm.vue
+++ b/src/views/data/point/DaPointForm.vue
@@ -10,7 +10,7 @@
       <el-row>
         <el-col :span="12">
           <el-form-item label="测点编码" prop="pointNo">
-            <el-input v-model="formData.pointNo" placeholder="请输入测点编码" disabled/>
+            <el-input v-model="formData.pointNo" disabled/>
           </el-form-item>
         </el-col>
         <el-col :span="12">
@@ -28,7 +28,7 @@
               placeholder="请选择测点类型"
             >
               <el-option
-                v-for="dict in getDictOptions(DICT_TYPE.POINT_TYPE)"
+                v-for="dict in getDictOptions(DICT_TYPE.DATA_POINT_TYPE)"
                 :key="dict.value"
                 :label="dict.label"
                 :value="dict.value"
@@ -44,7 +44,7 @@
               placeholder="请选择数据类型"
             >
               <el-option
-                v-for="dict in getDictOptions(DICT_TYPE.DATA_TYPE)"
+                v-for="dict in getDictOptions(DICT_TYPE.POINT_DATA_TYPE)"
                 :key="dict.value"
                 :label="dict.label"
                 :value="dict.value"
@@ -110,7 +110,7 @@
               placeholder="请选择是否启用"
             >
               <el-option
-                v-for="dict in getIntDictOptions(DICT_TYPE.IS_ENABLED)"
+                v-for="dict in getIntDictOptions(DICT_TYPE.COM_IS_INT)"
                 :key="dict.value"
                 :label="dict.label"
                 :value="dict.value"
@@ -126,7 +126,7 @@
       </el-row>
       <!--计量点-->
       <el-row v-if="formData.pointType === 'MEASURE'">
-        <el-col :span="12">
+        <el-col :span="24">
           <el-form-item prop="sourceOption" label="数据源">
             <el-cascader
               style="width: 100%;"
@@ -417,7 +417,7 @@
     unit: undefined,
     unittransfactor: 1,
     defaultValue: 10,
-    maxValue: 1000000,
+    maxValue: 10000000,
     minValue: 0,
     minfreqid: undefined,
     remark: undefined,
diff --git a/src/views/data/point/index.vue b/src/views/data/point/index.vue
index f8aefba..5934665 100644
--- a/src/views/data/point/index.vue
+++ b/src/views/data/point/index.vue
@@ -26,6 +26,15 @@
           class="!w-240px"
         />
       </el-form-item>
+      <el-form-item label="测点Tag" prop="tagNo">
+        <el-input
+          v-model="queryParams.tagNo"
+          placeholder="请输入测点Tag"
+          clearable
+          @keyup.enter="handleQuery"
+          class="!w-240px"
+        />
+      </el-form-item>
       <el-form-item>
         <el-button @click="handleQuery">
           <Icon icon="ep:search" class="mr-5px" />
@@ -52,21 +61,32 @@
   <ContentWrap>
     <el-table border stripe v-loading="loading" :data="list">
       <el-table-column fixed label="测点编码" header-align="center" align="left" min-width="100" prop="pointNo" />
-      <el-table-column label="测点名称" header-align="center" align="left" min-width="100" prop="pointName" />
-      <el-table-column label="测点类型" align="center" prop="pointType" />
-      <el-table-column label="数据类型" align="center" prop="dataType" />
-      <el-table-column label="测量单位" align="center" prop="unit" />
+      <el-table-column label="测点名称" header-align="center" align="left" min-width="200" prop="pointName" />
+      <el-table-column label="测点类型" align="center" prop="pointType" width="100">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.DATA_POINT_TYPE" :value="scope.row.pointType" />
+        </template>
+      </el-table-column>
+      <el-table-column label="数据类型" align="center" prop="dataType" width="100">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.POINT_DATA_TYPE" :value="scope.row.dataType" />
+        </template>
+      </el-table-column>
+      <el-table-column label="测量单位" align="center" prop="unit" width="100"/>
       <el-table-column label="单位转换" align="center" prop="unittransfactor" />
       <el-table-column label="默认值" align="center" prop="defaultValue" />
-      <el-table-column label="采集频率" align="center" prop="minfreqid" />
-      <el-table-column label="是否启用" align="center" prop="isEnable">
+      <el-table-column label="采集频率" align="center" prop="minfreqid" width="100"/>
+      <el-table-column label="数据源类型" align="center" prop="sourceType" width="100"/>
+      <el-table-column label="数据源名称" align="center" prop="sourceName" width="100"/>
+      <el-table-column label="测点Tag" header-align="center" align="left" prop="tagNo" min-width="150"/>
+      <el-table-column label="是否启用" align="center" prop="isEnable" width="100">
         <template #default="scope">
           <el-tag v-if="scope.row.isEnable === 1" size="small">是</el-tag>
           <el-tag v-else size="small" type="danger">否</el-tag>
         </template>
       </el-table-column>
 
-      <el-table-column label="操作" align="center" min-width="110" fixed="right">
+      <el-table-column label="操作" align="center" min-width="110" fixed="right" width="120">
         <template #default="scope">
           <el-button
             link
@@ -103,6 +123,7 @@
 <script lang="ts" setup>
 import DaPointForm from './DaPointForm.vue'
 import * as DaPoint from '@/api/data/da/point'
+import {DICT_TYPE, getDictOptions} from "@/utils/dict";
 
 defineOptions({name: 'DataPoint'})
 
@@ -117,6 +138,7 @@
     pageSize: 10,
     pointNo: undefined,
     pointName: undefined,
+    tagNo: undefined,
   })
   const queryFormRef = ref() // 搜索的表单
   const exportLoading = ref(false) // 导出的加载中

--
Gitblit v1.9.3