From df90c0c5cfa4de114798015b92120ad8ba8b4826 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期五, 22 十一月 2024 10:45:40 +0800
Subject: [PATCH] MEASURE_VALUE_TYPE

---
 src/views/data/channel/opcua/OpcUaDeviceForm.vue |   54 +++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/src/views/data/channel/opcua/OpcUaDeviceForm.vue b/src/views/data/channel/opcua/OpcUaDeviceForm.vue
index 981a395..b65a413 100644
--- a/src/views/data/channel/opcua/OpcUaDeviceForm.vue
+++ b/src/views/data/channel/opcua/OpcUaDeviceForm.vue
@@ -22,34 +22,57 @@
       <el-row>
         <el-col :span="12">
           <el-form-item label="安全策略" prop="securityPolicy">
-            <el-input v-model="formData.securityPolicy" placeholder="请输入安全策略"/>
+            <el-select v-model="formData.securityPolicy" placeholder="请选择">
+              <el-option
+                v-for="dict in getStrDictOptions(DICT_TYPE.OPCUA_SECURITY_POLICY)"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="安全模式" prop="securityMode">
-            <el-input v-model="formData.securityMode" placeholder="请输入安全模式"/>
+            <el-select v-model="formData.securityMode" placeholder="请选择">
+              <el-option
+                v-for="dict in getStrDictOptions(DICT_TYPE.OPCUA_SECURITY_MODE)"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row>
         <el-col :span="12">
           <el-form-item label="连接方式" prop="connectionType">
-            <el-input v-model="formData.connectionType" placeholder="请输入连接方式"/>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="用户名" prop="userName">
-            <el-input v-model="formData.userName" placeholder="请输入用户名"/>
+            <el-select v-model="formData.connectionType" placeholder="请选择">
+              <el-option
+                v-for="dict in getStrDictOptions(DICT_TYPE.OPCUA_CONNECTION_TYPE)"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row>
         <el-col :span="12">
+          <el-form-item label="用户名" prop="userName">
+            <el-input v-model="formData.userName" placeholder="请输入用户名"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
           <el-form-item label="密码" prop="password">
             <el-input type="password" v-model="formData.password" placeholder="请输入密码"/>
           </el-form-item>
         </el-col>
-        <el-col :span="12">
+      </el-row>
+      <el-row>
+        <el-col :span="24">
           <el-form-item label="安全证书路径" prop="certificatePath">
             <el-input v-model="formData.certificatePath" placeholder="请输入安全证书路径"/>
           </el-form-item>
@@ -57,8 +80,8 @@
       </el-row>
       <el-row>
         <el-col :span="12">
-          <el-form-item label="连接方式" prop="connectInactivityTimeout">
-            <el-input v-model="formData.connectInactivityTimeout" placeholder="请输入连接方式"/>
+          <el-form-item label="不活动超时" prop="connectInactivityTimeout">
+            <el-input v-model="formData.connectInactivityTimeout" placeholder="请输入不活动超时"/>
           </el-form-item>
         </el-col>
         <el-col :span="12">
@@ -76,6 +99,7 @@
 </template>
 <script lang="ts" setup>
 import * as OpcUaApi from '@/api/data/channel/opcua'
+import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
 
 defineOptions({name: 'DataOpcUaDeviceForm'})
 
@@ -96,10 +120,14 @@
   password: undefined,
   certificatePath: undefined,
   connectInactivityTimeout: undefined,
-  reconnectInterval: undefined,
+  reconnectInterval: 5000,
 })
 const formRules = reactive({
   serverName: [{required: true, message: '服务名不能为空', trigger: 'blur'}],
+  endpointUrl: [{required: true, message: '端点URL不能为空', trigger: 'blur'}],
+  securityPolicy: [{required: true, message: '安全策略不能为空', trigger: 'blur'}],
+  securityMode: [{required: true, message: '安全模式不能为空', trigger: 'blur'}],
+  connectionType: [{required: true, message: '连接方式不能为空', trigger: 'blur'}],
 })
 const formRef = ref() // 表单 Ref
 
@@ -160,7 +188,7 @@
     password: undefined,
     certificatePath: undefined,
     connectInactivityTimeout: undefined,
-    reconnectInterval: undefined,
+    reconnectInterval: 5000,
   }
   formRef.value?.resetFields()
 }

--
Gitblit v1.9.3