Commit 3c694e2a authored by 皮倩雯's avatar 皮倩雯

fix: '物联配置跳转网关'

parent ed7bc3c8
Pipeline #67022 passed with stages
......@@ -14,8 +14,10 @@ import {
Switch,
Progress,
Tooltip,
Modal,
Space,
} from 'antd';
import { CloseCircleFilled } from '@ant-design/icons';
import { CloseCircleFilled, InfoCircleFilled } from '@ant-design/icons';
import styles from './IotConfig.less';
import Internet from '../../../../assets/images/icons/物联.svg';
import EMQ from '../../../../assets/images/icons/EMQ.svg';
......@@ -34,6 +36,7 @@ import {
AddDB, // 添加数据库
DepositServiceDisable, // 停止数据库服务
DepositServiceEnable, // 启动数据库服务
GetGateWay,
} from '@/services/hostmanager/hostmanager';
import {
GetDbProduct, // 获取产品方案配置
......@@ -46,7 +49,8 @@ const tailLayout = {
wrapperCol: { offset: 9, span: 15 },
};
let time = null;
const IotConfig = () => {
const IotConfig = props => {
const {setActiveKey} = props;
const [loading, setLoading] = useState(false); // 加载
const [show1, setShow1] = useState('none');
const [show2, setShow2] = useState('none');
......@@ -75,8 +79,18 @@ const IotConfig = () => {
const [dbStatus, setDbStatus] = useState(''); // 数据库状态
const [buStatus, setBuStatus] = useState(''); // 按钮状态
const [keep, setKeep] = useState('');
const [getWay, setGetWay] = useState('');
const [getWayVisible, setGetWayVisible] = useState(false);
useEffect(() => {
GetGateWay().then(res => {
if (res.code === 0) {
setGetWay(res.data);
if (res.data === false) {
setGetWayVisible(true);
}
}
});
HealthCheck().then(res => {
if (res.success) {
setFlag(1);
......@@ -380,6 +394,9 @@ const IotConfig = () => {
}
};
const submit = () => {
window.location.href = `/civmanage/platform/host`;
};
return (
<div className={styles.iot_container}>
<Card
......@@ -403,6 +420,22 @@ const IotConfig = () => {
>
<img src={Internet} style={{ height: '16px' }} alt="" />
<span style={{ marginLeft: '10px', fontWeight: 'bold' }}>物联网统一接入平台</span>
{/* <div>
{getWay === false ? (
<>
<InfoCircleFilled
style={{
color: '#faad14',
fontSize: '18px',
marginLeft: '10px',
}}
/>
<span style={{ marginLeft: '5px' }}>请开启网关!</span>
</>
) : (
<></>
)}
</div> */}
</div>
<Divider />
<Form.Item style={{ marginLeft: '20px', marginBottom: '0px' }}>
......@@ -449,7 +482,6 @@ const IotConfig = () => {
}}
/>
</span>
</div>
</Form.Item>
......@@ -543,6 +575,35 @@ const IotConfig = () => {
</Form>
</Spin>
</Card>
<Modal
visible={getWayVisible}
title="提示"
width="350px"
closable={false}
footer={
<Space>
<Button
onClick={() => {
setGetWayVisible(false);
setActiveKey('5');
}}
type="primary"
>
好的,去开启
</Button>
</Space>
}
>
<InfoCircleFilled
style={{
color: '#faad14',
fontSize: '18px',
marginRight: '10px',
}}
/>
<span>当前网关暂未打开,请前往开启!</span>
</Modal>
</div>
);
};
......
......@@ -11,16 +11,20 @@ import GateConfig from './gateWay/gateWay';
const { TabPane } = Tabs;
const HostManager = () => {
const callback = () => {};
const [activeKey, setActiveKey] = useState('1')
// 修改选中的tab
const handleChange = key => {
setActiveKey(key);
};
return (
<PageContainer>
<Tabs onChange={callback} type="card" destroyInactiveTabPane>
<Tabs onChange={handleChange} type="card" destroyInactiveTabPane activeKey={activeKey} >
<TabPane tab="基础配置" key="1">
<BaseConfig />
</TabPane>
<TabPane tab="物联配置" key="2">
<IotConfig />
<IotConfig setActiveKey={setActiveKey}/>
</TabPane>
<TabPane tab="消息配置" key="3">
<MessageConfig />
......
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