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 React, { useEffect, useState } from 'react';
import { import {
Card, Card,
...@@ -11,6 +12,7 @@ import { ...@@ -11,6 +12,7 @@ import {
Col, Col,
Spin, Spin,
} from 'antd'; } from 'antd';
import { CloseCircleFilled } from '@ant-design/icons';
import styles from './IotConfig.less'; import styles from './IotConfig.less';
import Internet from '../../../../assets/images/icons/物联.svg'; import Internet from '../../../../assets/images/icons/物联.svg';
import EMQ from '../../../../assets/images/icons/EMQ.svg'; import EMQ from '../../../../assets/images/icons/EMQ.svg';
...@@ -21,7 +23,6 @@ import { ...@@ -21,7 +23,6 @@ import {
PingIOTPlatform, PingIOTPlatform,
SaveTcpAddress, SaveTcpAddress,
} from '@/services/platform/hostmanager'; } from '@/services/platform/hostmanager';
import { CloseCircleFilled } from '@ant-design/icons';
const layout = { const layout = {
labelCol: { span: 4 }, labelCol: { span: 4 },
wrapperCol: { span: 20 }, wrapperCol: { span: 20 },
...@@ -44,20 +45,20 @@ const IotConfig = () => { ...@@ -44,20 +45,20 @@ const IotConfig = () => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const onFinish = values => { const onFinish = values => {
if (values.IotAddress != null && values.IotAddress.length > 0) { if (values.IotAddress != null && values.IotAddress.length > 0) {
if (values.SSLSafe == '是') { if (values.SSLSafe === '是') {
values.SSLSafe = 0;
}
if (values.SSLSafe == '否') {
values.SSLSafe = 1; values.SSLSafe = 1;
} }
PingIot({ ip: values.IotAddress, values: values }); if (values.SSLSafe === '否') {
} else {
if (values.SSLSafe == '是') {
values.SSLSafe = 0; values.SSLSafe = 0;
} }
if (values.SSLSafe == '否') { PingIot({ ip: values.IotAddress, values });
} else {
if (values.SSLSafe === '是') {
values.SSLSafe = 1; values.SSLSafe = 1;
} }
if (values.SSLSafe === '否') {
values.SSLSafe = 0;
}
SaveIotConfig({ SaveIotConfig({
tcpAddress: values.TcpAddress, tcpAddress: values.TcpAddress,
iotAddress: values.IotAddress, iotAddress: values.IotAddress,
...@@ -262,8 +263,8 @@ const IotConfig = () => { ...@@ -262,8 +263,8 @@ const IotConfig = () => {
rules={[{ required: true, message: '请选择是否!' }]} rules={[{ required: true, message: '请选择是否!' }]}
> >
<Select placeholder="请选择是否!" style={{ width: '95%' }}> <Select placeholder="请选择是否!" style={{ width: '95%' }}>
<Option value="0"></Option> <Option value="1"></Option>
<Option value="1"></Option> <Option value="0"></Option>
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </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