| | |
| | | // ========== DATA - 数据平台模块 ========== |
| | | DATA_FIELD_TYPE = 'data_field_type', |
| | | TAG_DATA_TYPE = 'tag_data_type', |
| | | IS_ENABLED = 'is_enabled' |
| | | IS_ENABLED = 'is_enabled', |
| | | OPCUA_SECURITY_POLICY = 'opcua_security_policy', |
| | | OPCUA_SECURITY_MODE = 'opcua_security_mode', |
| | | OPCUA_CONNECTION_TYPE = 'opcua_connection_type', |
| | | |
| | | } |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="实例名称" prop="instanceName"> |
| | | <el-input v-model="formData.instanceName" placeholder="请输入实例名称" /> |
| | | <el-input v-model="formData.instanceName" placeholder="请输入实例名称"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="IP地址" prop="address"> |
| | | <el-input v-model="formData.address" placeholder="请输入IP地址" /> |
| | | <el-input v-model="formData.address" placeholder="请输入IP地址"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="端口" prop="port"> |
| | | <el-input v-model="formData.port" placeholder="请输入端口" /> |
| | | <el-input v-model="formData.port" placeholder="请输入端口"/> |
| | | </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-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-input type="password" v-model="formData.password" placeholder="请输入密码"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as KioApi from '@/api/data/channel/kio' |
| | | import * as KioApi from '@/api/data/channel/kio' |
| | | import {isIP, isPositiveInteger} from '@/utils/validate' |
| | | |
| | | defineOptions({ name: 'DataKioDeviceForm' }) |
| | | defineOptions({name: 'DataKioDeviceForm'}) |
| | | |
| | | const { t } = useI18n() // 国际化 |
| | | const {t} = useI18n() // 国际化 |
| | | const message = useMessage() // 消息弹窗 |
| | | const dialogVisible = ref(false) // 弹窗的是否展示 |
| | | const dialogTitle = ref('') // 弹窗的标题 |
| | |
| | | username: undefined, |
| | | password: undefined, |
| | | }) |
| | | const validateIP = (rule, value, callback) => { |
| | | if (!isIP(value)) { |
| | | callback(new Error('IP地址不正确')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | const validateNum = (rule, value, callback) => { |
| | | if (!isPositiveInteger(value)) { |
| | | callback(new Error('格式不正确')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | const formRules = reactive({ |
| | | instanceName: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }], |
| | | address: [{ required: true, message: 'IP地址不能为空', trigger: 'blur' }], |
| | | port: [{ required: true, message: '端口不能为空', trigger: 'blur' }], |
| | | username: [{ required: true, message: '用户名不能为空', trigger: 'blur' }], |
| | | password: [{ required: true, message: '密码不能为空', trigger: 'blur' }] |
| | | instanceName: [{required: true, message: '设备名称不能为空', trigger: 'blur'}], |
| | | address: [ |
| | | {required: true, message: 'IP地址不能为空', trigger: 'blur'}, |
| | | {validator: validateIP, trigger: 'blur'} |
| | | ], |
| | | port: [ |
| | | {required: true, message: '端口不能为空', trigger: 'blur'}, |
| | | {validator: validateNum, trigger: 'blur'} |
| | | ], |
| | | username: [{required: true, message: '用户名不能为空', trigger: 'blur'}], |
| | | password: [{required: true, message: '密码不能为空', trigger: 'blur'}] |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
| | | defineExpose({open}) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | /** 提交表单 */ |
| | | const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
| | |
| | | <el-button |
| | | link |
| | | type="primary" |
| | | @click="openTagList(scope.row.name)" |
| | | @click="openTagList(scope.row.instanceName)" |
| | | v-hasPermi="['data:channel-kio:update']" |
| | | > |
| | | TAG |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as KioTagApi from '@/api/data/channel/kio/tag' |
| | | import { CommonEnabled } from '@/utils/constants' |
| | | import { CommonEnabledBool } from '@/utils/constants' |
| | | import {isPositiveInteger} from '@/utils/validate' |
| | | import { DICT_TYPE, getStrDictOptions, getBoolDictOptions } from '@/utils/dict' |
| | | |
| | |
| | | dataType: undefined, |
| | | tagId: undefined, |
| | | tagDesc: '', |
| | | enabled: CommonEnabled.ENABLE, |
| | | enabled: CommonEnabledBool.ENABLE, |
| | | device: undefined, |
| | | samplingRate: undefined |
| | | |
| | |
| | | dataType: undefined, |
| | | tagId: undefined, |
| | | tagDesc: '', |
| | | enabled: CommonEnabled.ENABLE, |
| | | enabled: CommonEnabledBool.ENABLE, |
| | | device: undefined, |
| | | samplingRate: undefined |
| | | } |
| | |
| | | class="!w-240px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="地址" prop="address"> |
| | | <el-input |
| | | v-model="queryParams.address" |
| | | placeholder="请输入Modbus地址" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | class="!w-240px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="handleQuery"> |
| | | <Icon icon="ep:search" class="mr-5px" /> |
| | |
| | | <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> |
| | |
| | | </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"> |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as OpcUaApi from '@/api/data/channel/opcua' |
| | | import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
| | | |
| | | defineOptions({name: 'DataOpcUaDeviceForm'}) |
| | | |
| | |
| | | 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 |
| | | |
| | |
| | | password: undefined, |
| | | certificatePath: undefined, |
| | | connectInactivityTimeout: undefined, |
| | | reconnectInterval: undefined, |
| | | reconnectInterval: 5000, |
| | | } |
| | | formRef.value?.resetFields() |
| | | } |
| | |
| | | <!-- 列表 --> |
| | | <ContentWrap> |
| | | <el-table v-loading="loading" :data="list"> |
| | | <el-table-column label="服务名" align="center" prop="serverName"/> |
| | | <el-table-column label="端点URL" align="center" prop="endpointUrl"/> |
| | | <el-table-column label="服务名" header-align="center" align="left" prop="serverName" min-width="180"/> |
| | | <el-table-column label="端点URL" header-align="center" align="left" prop="endpointUrl" min-width="260"/> |
| | | <el-table-column label="安全策略" align="center" prop="securityPolicy"/> |
| | | <el-table-column label="安全模式" align="center" prop="securityMode"/> |
| | | <el-table-column label="连接方式" align="center" prop="connectionType"/> |
| | | <el-table-column label="连接方式" align="center" prop="connectionType"> |
| | | <template #default="scope"> |
| | | <dict-tag :type="DICT_TYPE.OPCUA_CONNECTION_TYPE" :value="scope.row.connectionType" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="用户名" align="center" prop="userName"/> |
| | | <el-table-column label="密码" align="center" prop="password"/> |
| | | <el-table-column label="安全证书路径" align="center" prop="certificatePath"/> |
| | | <el-table-column label="安全证书路径" header-align="center" align="left" prop="certificatePath" min-width="200"/> |
| | | <el-table-column label="设备不活动超时时间" align="center" prop="connectInactivityTimeout"/> |
| | | <el-table-column label="重连超时" align="center" prop="reconnectInterval"/> |
| | | <el-table-column label="操作" align="center" min-width="110" fixed="right"> |
| | |
| | | import * as OpcUaApi from '@/api/data/channel/opcua' |
| | | import OpcUaDeviceForm from './OpcUaDeviceForm.vue' |
| | | import TagList from './tag/index.vue' |
| | | import { DICT_TYPE } from '@/utils/dict' |
| | | |
| | | defineOptions({name: 'DataOpcUa'}) |
| | | |