|
@ -13,24 +13,7 @@ import AccumulateTime from '../components/realTime/accumulateTime'; |
|
|
const RealTime = ({ dispatch, actions, user, siteList, }) => { |
|
|
const RealTime = ({ dispatch, actions, user, siteList, }) => { |
|
|
|
|
|
|
|
|
const { bigScreen } = actions |
|
|
const { bigScreen } = actions |
|
|
const [pageLeft, setPageLeft] = useState(0) //左边翻页
|
|
|
|
|
|
const [pageRight, setPageRight] = useState(0) //左边翻页
|
|
|
|
|
|
const [pumpList, setPumpList] = useState([]) //水泵列表
|
|
|
|
|
|
const [cabinetList, setCabinetList] = useState([]) //水泵列表
|
|
|
|
|
|
const [strucId, setStrucId] = useState() //站点ID
|
|
|
const [strucId, setStrucId] = useState() //站点ID
|
|
|
const [pumpId, setPumpId] = useState() //水泵id
|
|
|
|
|
|
const [cabinetId, setCabinetId] = useState() //进线柜id
|
|
|
|
|
|
const [usePumpId, setUsePumpId] = useState() //水泵id
|
|
|
|
|
|
const [voltagePumpId, setVoltagePumpId] = useState([]) //水泵电压id
|
|
|
|
|
|
const [pumpOne, setPumpOne] = useState({ data: [] }) //单个水泵数据
|
|
|
|
|
|
const [voltagepump, setVoltagePump] = useState([]) //单个水泵数据
|
|
|
|
|
|
|
|
|
|
|
|
const [cabinetOne, setCabinetOne] = useState({ data: [] }) //单个进线柜数据
|
|
|
|
|
|
const [cabinetData, setCabinetData] = useState([]) //进线柜数据
|
|
|
|
|
|
const [centreData, setCentreData] = useState({}) //中间数据
|
|
|
|
|
|
const [depthWater, setDepthWater] = useState([]) //液位趋势
|
|
|
|
|
|
const [electricityTrend, setElectricityTrend] = useState([]) //电流趋势
|
|
|
|
|
|
const [useTrend, setUseTrend] = useState([]) //用电趋势
|
|
|
|
|
|
const [stations, setStations] = useState({}) //测点id
|
|
|
const [stations, setStations] = useState({}) //测点id
|
|
|
const [softStartData, setSoftStartData] = useState([]) //软启动总用电数据
|
|
|
const [softStartData, setSoftStartData] = useState([]) //软启动总用电数据
|
|
|
const [electro, setElectro] = useState({ week: 0, year: 0, day: 0 }) //用电概况
|
|
|
const [electro, setElectro] = useState({ week: 0, year: 0, day: 0 }) //用电概况
|
|
@ -61,12 +44,6 @@ const RealTime = ({ dispatch, actions, user, siteList, }) => { |
|
|
if (p.success) { |
|
|
if (p.success) { |
|
|
let dataId = p.payload.data[0]?.groups[0]?.stations?.map(k => k.id) || [] |
|
|
let dataId = p.payload.data[0]?.groups[0]?.stations?.map(k => k.id) || [] |
|
|
station.pump = dataId |
|
|
station.pump = dataId |
|
|
// let voltageId =[]
|
|
|
|
|
|
|
|
|
|
|
|
// setPumpList(p.payload.data[0]?.groups[0]?.stations)
|
|
|
|
|
|
// setPumpId(p.payload.data[0]?.groups[0]?.stations[0]?.id)
|
|
|
|
|
|
// setVoltagePumpId(voltageId)
|
|
|
|
|
|
// setUsePumpId(p.payload.data[0]?.groups[0]?.stations[0]?.id)
|
|
|
|
|
|
if (dataId.length) { |
|
|
if (dataId.length) { |
|
|
// 当前时间
|
|
|
// 当前时间
|
|
|
await dispatch(bigScreen.axyData({ |
|
|
await dispatch(bigScreen.axyData({ |
|
@ -173,25 +150,7 @@ const RealTime = ({ dispatch, actions, user, siteList, }) => { |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
station.cabine = dataId |
|
|
station.cabine = dataId |
|
|
// setCabinetList(dataId)
|
|
|
|
|
|
// setCabinetId(p.payload.data[0]?.groups[0]?.stations[0]?.id)
|
|
|
|
|
|
if (dataId.length) { |
|
|
if (dataId.length) { |
|
|
// // 当前时间
|
|
|
|
|
|
await dispatch(bigScreen.axyData({ |
|
|
|
|
|
type: 'get', url: `stations/theme/data`, params: { |
|
|
|
|
|
query: { |
|
|
|
|
|
stations: dataId.join(), |
|
|
|
|
|
startTime: moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
|
|
|
|
|
endTime: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss'), |
|
|
|
|
|
limit: 1 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
})).then(d => { |
|
|
|
|
|
if (d.success) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// // 今天
|
|
|
// // 今天
|
|
|
await dispatch(bigScreen.axyData({ |
|
|
await dispatch(bigScreen.axyData({ |
|
|
type: 'get', url: `stations/data/theme`, params: { |
|
|
type: 'get', url: `stations/data/theme`, params: { |
|
@ -309,70 +268,6 @@ const RealTime = ({ dispatch, actions, user, siteList, }) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// useEffect(async () => {
|
|
|
|
|
|
// if (pumpId) {
|
|
|
|
|
|
// await dispatch(bigScreen.axyData({
|
|
|
|
|
|
// type: 'get', url: `stations/theme/data`, params: {
|
|
|
|
|
|
// query: {
|
|
|
|
|
|
// stations: pumpId,
|
|
|
|
|
|
// startTime: moment().startOf('day').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(async () => {
|
|
|
|
|
|
// if (cabinetId) {
|
|
|
|
|
|
// await dispatch(bigScreen.axyData({
|
|
|
|
|
|
// type: 'get', url: `stations/theme/data`, params: {
|
|
|
|
|
|
// query: {
|
|
|
|
|
|
// stations: cabinetId,
|
|
|
|
|
|
// startTime: moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
|
|
|
|
|
// endTime: moment().format('YYYY-MM-DD HH:mm:ss'),
|
|
|
|
|
|
// limit: 1
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// })).then(d => {
|
|
|
|
|
|
// if (d.success) {
|
|
|
|
|
|
// setCabinetOne(d.payload.data?.stations[0] || { data: [] })
|
|
|
|
|
|
// }
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }, [cabinetId])
|
|
|
|
|
|
|
|
|
|
|
|
// useEffect(async () => {
|
|
|
|
|
|
// if (voltagePumpId?.length > 0) {
|
|
|
|
|
|
// await dispatch(bigScreen.axyData({
|
|
|
|
|
|
// type: 'get', url: `stations/theme/data`, params: {
|
|
|
|
|
|
// query: {
|
|
|
|
|
|
// stations: voltagePumpId?.join(),
|
|
|
|
|
|
// startTime: moment().add(-24, 'hours').format('YYYY-MM-DD HH:mm:ss'),
|
|
|
|
|
|
// endTime: moment().format('YYYY-MM-DD HH:mm:ss'),
|
|
|
|
|
|
// limit: 1440
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// })).then(d => {
|
|
|
|
|
|
// if (d.success) {
|
|
|
|
|
|
// setVoltagePump(d.payload.data?.stations || [])
|
|
|
|
|
|
// }
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }, [voltagePumpId])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return <div style={{ width: '100%', height: 'calc(100% - 200px', color: '#FFF', position: 'absolute', top: 160, left: 0 }}> |
|
|
return <div style={{ width: '100%', height: 'calc(100% - 200px', color: '#FFF', position: 'absolute', top: 160, left: 0 }}> |
|
|
<div style={{ width: '100%', height: "100%", position: 'relative', }}> |
|
|
<div style={{ width: '100%', height: "100%", position: 'relative', }}> |
|
|
<General setInterval={setInterval} stations={stations} /> |
|
|
<General setInterval={setInterval} stations={stations} /> |
|
|