Commit 2565e509 authored by 皮倩雯's avatar 皮倩雯

修复宿主管理物联配置无法保存问题

parent 42548322
Pipeline #40138 passed with stages
in 26 minutes 55 seconds
/* eslint-disable react/jsx-no-undef */
import React, { useEffect, useState } from 'react';
import {
Card,
......@@ -11,6 +12,7 @@ import {
Col,
Spin,
} from 'antd';
import { CloseCircleFilled } from '@ant-design/icons';
import styles from './IotConfig.less';
import Internet from '../../../../assets/images/icons/物联.svg';
import EMQ from '../../../../assets/images/icons/EMQ.svg';
......@@ -21,7 +23,6 @@ import {
PingIOTPlatform,
SaveTcpAddress,
} from '@/services/platform/hostmanager';
import { CloseCircleFilled } from '@ant-design/icons';
const layout = {
labelCol: { span: 4 },
wrapperCol: { span: 20 },
......@@ -44,20 +45,20 @@ const IotConfig = () => {
const [form] = Form.useForm();
const onFinish = values => {
if (values.IotAddress != null && values.IotAddress.length > 0) {
if (values.SSLSafe == '是') {
values.SSLSafe = 0;
}
if (values.SSLSafe == '否') {
if (values.SSLSafe === '是') {
values.SSLSafe = 1;
}
PingIot({ ip: values.IotAddress, values: values });
} else {
if (values.SSLSafe == '是') {
if (values.SSLSafe === '否') {
values.SSLSafe = 0;
}
if (values.SSLSafe == '否') {
PingIot({ ip: values.IotAddress, values });
} else {
if (values.SSLSafe === '是') {
values.SSLSafe = 1;
}
if (values.SSLSafe === '否') {
values.SSLSafe = 0;
}
SaveIotConfig({
tcpAddress: values.TcpAddress,
iotAddress: values.IotAddress,
......@@ -262,8 +263,8 @@ const IotConfig = () => {
rules={[{ required: true, message: '请选择是否!' }]}
>
<Select placeholder="请选择是否!" style={{ width: '95%' }}>
<Option value="0"></Option>
<Option value="1"></Option>
<Option value="1"></Option>
<Option value="0"></Option>
</Select>
</Form.Item>
</Col>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment