Browse Source

三相电流修改

master
wenlele 2 years ago
parent
commit
b4601edb9e
  1. 8
      web/client/src/sections/bigScreen/components/basis.js
  2. 2
      web/client/src/sections/bigScreen/components/basis/right_1.js
  3. 6
      web/client/src/sections/bigScreen/components/capacity.js
  4. 2
      web/client/src/sections/bigScreen/components/electrity/realTimeStatus.js
  5. 105
      web/client/src/sections/bigScreen/components/realTime.js
  6. 14
      web/client/src/sections/bigScreen/components/realTime/below.js

8
web/client/src/sections/bigScreen/components/basis.js

@ -17,8 +17,8 @@ const Basis = ({ actions, dispatch, setshowData }) => {
const [siteList, setSiteList] = useState([]) //站点列表 const [siteList, setSiteList] = useState([]) //站点列表
const [strucId, setStrucId] = useState() //站点ID const [strucId, setStrucId] = useState() //站点ID
const [pageRefresh1, setPageRefresh1] = useState(false) const [pageRefresh1, setPageRefresh1] = useState(false)
const [pageRefresh2, setPageRefresh2] = useState(false) const [pageRefresh2, setPageRefresh2] = useState(0)
const [pageRefresh3, setPageRefresh3] = useState(false) const [pageRefresh3, setPageRefresh3] = useState(0)
const [left2List, setleft2List] = useState([]) const [left2List, setleft2List] = useState([])
const [depthWater, setDepthWater] = useState([]) const [depthWater, setDepthWater] = useState([])
const [information, setInformation] = useState({}) const [information, setInformation] = useState({})
@ -61,7 +61,7 @@ const Basis = ({ actions, dispatch, setshowData }) => {
})).then(async d => { })).then(async d => {
if (d.success) { if (d.success) {
left1Data.current?.push({ name: v.name, level: d.payload.data?.stations[0]?.data[0]?.sLiquid_level || 0 }) left1Data.current?.push({ name: v.name, level: d.payload.data?.stations[0]?.data[0]?.sLiquid_level || 0 })
setPageRefresh1(!pageRefresh1) setPageRefresh1(moment().format('x'))
} }
}) })
} }
@ -101,7 +101,7 @@ const Basis = ({ actions, dispatch, setshowData }) => {
})).then(d => { })).then(d => {
if (d.success) { if (d.success) {
left2Data.current?.push({ name: v.name, data: d.payload.data?.stations }) left2Data.current?.push({ name: v.name, data: d.payload.data?.stations })
setPageRefresh2(!pageRefresh2) setPageRefresh2(moment().format('x'))
} }
}) })
} }

2
web/client/src/sections/bigScreen/components/basis/right_1.js

@ -16,7 +16,7 @@ export default function Right_1 ({ data, siteList, strucId, setStrucId, POWER_ST
onSelect={(v, option) => { onSelect={(v, option) => {
setStrucId(v); setStrucId(v);
for (let key in POWER_STATIONS) { for (let key in POWER_STATIONS) {
if (POWER_STATIONS[key]?.name == option?.name) { if (POWER_STATIONS[key]?.name == option?.label) {
setInformation(POWER_STATIONS[key]) setInformation(POWER_STATIONS[key])
} }
} }

6
web/client/src/sections/bigScreen/components/capacity.js

@ -30,6 +30,7 @@ const Capacity = ({ actions, dispatch, siteList, }) => {
}, [siteList]) }, [siteList])
useEffect(async () => { useEffect(async () => {
let pump = [] let pump = []
let cabinetSun = [] let cabinetSun = []
let sun = {} let sun = {}
@ -347,7 +348,8 @@ const Capacity = ({ actions, dispatch, siteList, }) => {
sun.day30 = day30 + day1 sun.day30 = day30 + day1
sun.day365 = day365 + day1 sun.day365 = day365 + day1
sun.daySun = daySun sun.daySun = daySun
setPageLeft(0)
setPageRight(0)
setCentreData(sun) setCentreData(sun)
}, [strucId]) }, [strucId])
@ -500,7 +502,7 @@ const Capacity = ({ actions, dispatch, siteList, }) => {
<div style={{ width: "100%", height: 90, padding: '10px 25px', display: 'flex', flexDirection: 'column', justifyContent: 'space-around', color: 'white' }}> <div style={{ width: "100%", height: 90, padding: '10px 25px', display: 'flex', flexDirection: 'column', justifyContent: 'space-around', color: 'white' }}>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<div style={{ width: 90, textAlign: 'end' }}>总用电量:</div> <div style={{ width: 90, textAlign: 'end' }}>总用电量:</div>
<div style={{ width: 90, textAlign: 'end', color: '#FFCB00' }}>{v.data[0]?.eMotor_EQ} kwh</div> <div style={{ width: 90, textAlign: 'end', color: '#FFCB00' }}>{v.data[0]?.eMotor_EQ?.toFixed(2)} kwh</div>
</div> </div>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<div style={{ width: 90, textAlign: 'end' }}>单次运行时间:</div> <div style={{ width: 90, textAlign: 'end' }}>单次运行时间:</div>

2
web/client/src/sections/bigScreen/components/electrity/realTimeStatus.js

@ -142,7 +142,7 @@ const RealTimeStatus = (props) => {
display: 'flex', alignItems: "center", justifyContent: 'space-between', display: 'flex', alignItems: "center", justifyContent: 'space-between',
}}> }}>
<div style={{ marginLeft: 6 }}>控制方式</div> <div style={{ marginLeft: 6 }}>控制方式</div>
<div style={{ marginRight: 6 }}>{pumpOne?.data[0]?.sMotor_LR ? '现场就地' : "平台远程"}</div> <div style={{ marginRight: 6 }}>{pumpOne?.data[0]?.sMotor_LR ? "平台远程" : '现场就地'}</div>
</div> </div>
<div style={{ <div style={{
height: 30, borderBottom: '1px solid #96b8bcba', height: 30, borderBottom: '1px solid #96b8bcba',

105
web/client/src/sections/bigScreen/components/realTime.js

@ -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} />

14
web/client/src/sections/bigScreen/components/realTime/below.js

@ -46,7 +46,13 @@ const Below = ({ dispatch, actions, stations,level }) => {
}) })
}) })
} }
})
threedata.forEach((f, i) => {
if (d.payload.data?.stations?.length) {
f.A = f.A / d.payload.data?.stations?.length
f.B = f.B / d.payload.data?.stations?.length
f.C = f.C / d.payload.data?.stations?.length
}
}) })
setThreePower(threedata); setThreePower(threedata);
} }
@ -99,7 +105,6 @@ const Below = ({ dispatch, actions, stations,level }) => {
} }
})).then(d => { })).then(d => {
if (d.success) { if (d.success) {
console.log(timeData);
timeData.forEach((x, i) => { timeData.forEach((x, i) => {
if (i == (timeData?.length - 1)) { if (i == (timeData?.length - 1)) {
d.payload.data[0]?.stations?.map(c => { d.payload.data[0]?.stations?.map(c => {
@ -111,12 +116,8 @@ const Below = ({ dispatch, actions, stations,level }) => {
}) })
} }
}) })
} }
}) })
} }
@ -166,7 +167,6 @@ const Below = ({ dispatch, actions, stations,level }) => {
} }
})).then(d => { })).then(d => {
if (d.success) { if (d.success) {
console.log(timeData);
timeData.forEach((x, i) => { timeData.forEach((x, i) => {
if (i == (timeData?.length - 1)) { if (i == (timeData?.length - 1)) {
d.payload.data[0]?.stations?.map(c => { d.payload.data[0]?.stations?.map(c => {

Loading…
Cancel
Save