diff --git a/web/client/src/sections/bigScreen/components/electrity/realTimeStatus.js b/web/client/src/sections/bigScreen/components/electrity/realTimeStatus.js index 8ff38d2..a1b9656 100644 --- a/web/client/src/sections/bigScreen/components/electrity/realTimeStatus.js +++ b/web/client/src/sections/bigScreen/components/electrity/realTimeStatus.js @@ -1,11 +1,14 @@ import React, { useState, useEffect } from 'react'; import { connect } from 'react-redux'; -import { Select, Modal, Switch } from 'antd'; +import { Select, Modal, Switch, Input, Button, Form, message } from 'antd'; const RealTimeStatus = (props) => { const { dispatch, actions, user, pumpId, pumpList, setPumpId, pumpOne, strucId, siteList, setPumpOne } = props; const { bigScreen } = actions; + const [pwOpen, setPwOpen] = useState(false); + const [form] = Form.useForm(); + const [isModalOpen, setIsModalOpen] = useState(false); const [pumpName, setPumpName] = useState(''); const [checked, setChecked] = useState({ @@ -19,7 +22,6 @@ const RealTimeStatus = (props) => { }, [pumpList]) useEffect(() => { - console.log(pumpOne, 'pumpOne') if (pumpOne?.data.length) { setChecked({ '模式切换': pumpOne.data[0].cMotor_AUTO, @@ -30,13 +32,26 @@ const RealTimeStatus = (props) => { }, [pumpOne]) const showModal = () => { - setIsModalOpen(true); + setPwOpen(true); }; const handleCancel = () => { setIsModalOpen(false); }; + const handlePwCancel = () => { + setPwOpen(false); + form.resetFields(); + }; + const handlePwFinish = (values) => { + if (values.password !== 'pc123456a') { + message.warning('密码错误'); + return; + } + handlePwCancel(); + setIsModalOpen(true); + } + const onChange = (label, isChecked) => { const nextChecked = { ...checked, [label]: isChecked }; setChecked(nextChecked); @@ -225,11 +240,39 @@ const RealTimeStatus = (props) => { ) } + } + width={287} + > +
+ 请输入密码 +
+
+ + + + +
+
- } -function mapStateToProps (state) { +function mapStateToProps(state) { const { auth, global } = state; return { user: auth.user,