|
@ -1,8 +1,10 @@ |
|
|
import React, { useState, useEffect } from 'react'; |
|
|
import React, { useState, useEffect } from 'react'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { connect } from 'react-redux'; |
|
|
|
|
|
import moment from 'moment' |
|
|
|
|
|
|
|
|
import { Select, Modal, Switch, Input, Button, Form, message } from 'antd'; |
|
|
import { Select, Modal, Switch, Input, Button, Form, message } from 'antd'; |
|
|
|
|
|
|
|
|
const RealTimeStatus = ({dispatch, actions, user, pumpId, pumpList, setPumpId, pumpOne, strucId, siteList, setPumpOne, currentSix }) => { |
|
|
const RealTimeStatus = ({ dispatch, actions, user, pumpId, pumpList, setPumpId, strucId, siteList,pumpOne, setPumpOne, currentSix }) => { |
|
|
|
|
|
|
|
|
const { bigScreen } = actions; |
|
|
const { bigScreen } = actions; |
|
|
|
|
|
|
|
@ -11,6 +13,7 @@ const RealTimeStatus = ({dispatch, actions, user, pumpId, pumpList, setPumpId, p |
|
|
|
|
|
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false); |
|
|
const [isModalOpen, setIsModalOpen] = useState(false); |
|
|
const [pumpName, setPumpName] = useState(''); |
|
|
const [pumpName, setPumpName] = useState(''); |
|
|
|
|
|
// const [pumpOne, setPumpOne] = useState({ data: [] });
|
|
|
const [checked, setChecked] = useState({ |
|
|
const [checked, setChecked] = useState({ |
|
|
'模式切换': false, // 平台手动/平台液控
|
|
|
'模式切换': false, // 平台手动/平台液控
|
|
|
'启动控制': false, |
|
|
'启动控制': false, |
|
@ -21,6 +24,24 @@ const RealTimeStatus = ({dispatch, actions, user, pumpId, pumpList, setPumpId, p |
|
|
setPumpName(pumpList?.length ? pumpList[0].name : '') |
|
|
setPumpName(pumpList?.length ? pumpList[0].name : '') |
|
|
}, [pumpList]) |
|
|
}, [pumpList]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
dispatch(bigScreen.axyData({ |
|
|
|
|
|
type: 'get', url: `stations/theme/data`, params: { |
|
|
|
|
|
query: { |
|
|
|
|
|
stations: pumpId, |
|
|
|
|
|
startTime: moment().startOf('week').format('YYYY-MM-DD HH:mm:ss'), |
|
|
|
|
|
endTime: moment().format('YYYY-MM-DD HH:mm:ss'), |
|
|
|
|
|
limit: 1 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
})).then(d => { |
|
|
|
|
|
if (d.success) { |
|
|
|
|
|
setPumpOne(d.payload.data?.stations[0] || { data: [] }) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, [pumpId]) |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (pumpOne?.data.length) { |
|
|
if (pumpOne?.data.length) { |
|
|
setChecked({ |
|
|
setChecked({ |
|
|