diff --git a/web/client/src/sections/bigScreen/components/basis.js b/web/client/src/sections/bigScreen/components/basis.js index 394e279..4d7dabf 100644 --- a/web/client/src/sections/bigScreen/components/basis.js +++ b/web/client/src/sections/bigScreen/components/basis.js @@ -17,8 +17,8 @@ const Basis = ({ actions, dispatch, setshowData }) => { const [siteList, setSiteList] = useState([]) //站点列表 const [strucId, setStrucId] = useState() //站点ID const [pageRefresh1, setPageRefresh1] = useState(false) - const [pageRefresh2, setPageRefresh2] = useState(false) - const [pageRefresh3, setPageRefresh3] = useState(false) + const [pageRefresh2, setPageRefresh2] = useState(0) + const [pageRefresh3, setPageRefresh3] = useState(0) const [left2List, setleft2List] = useState([]) const [depthWater, setDepthWater] = useState([]) const [information, setInformation] = useState({}) @@ -61,7 +61,7 @@ const Basis = ({ actions, dispatch, setshowData }) => { })).then(async d => { if (d.success) { 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 => { if (d.success) { left2Data.current?.push({ name: v.name, data: d.payload.data?.stations }) - setPageRefresh2(!pageRefresh2) + setPageRefresh2(moment().format('x')) } }) } diff --git a/web/client/src/sections/bigScreen/components/basis/right_1.js b/web/client/src/sections/bigScreen/components/basis/right_1.js index 17f7be2..db76ee7 100644 --- a/web/client/src/sections/bigScreen/components/basis/right_1.js +++ b/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) => { setStrucId(v); for (let key in POWER_STATIONS) { - if (POWER_STATIONS[key]?.name == option?.name) { + if (POWER_STATIONS[key]?.name == option?.label) { setInformation(POWER_STATIONS[key]) } } diff --git a/web/client/src/sections/bigScreen/components/capacity.js b/web/client/src/sections/bigScreen/components/capacity.js index c125dca..f566be3 100644 --- a/web/client/src/sections/bigScreen/components/capacity.js +++ b/web/client/src/sections/bigScreen/components/capacity.js @@ -30,6 +30,7 @@ const Capacity = ({ actions, dispatch, siteList, }) => { }, [siteList]) useEffect(async () => { + let pump = [] let cabinetSun = [] let sun = {} @@ -347,7 +348,8 @@ const Capacity = ({ actions, dispatch, siteList, }) => { sun.day30 = day30 + day1 sun.day365 = day365 + day1 sun.daySun = daySun - + setPageLeft(0) + setPageRight(0) setCentreData(sun) }, [strucId]) @@ -500,7 +502,7 @@ const Capacity = ({ actions, dispatch, siteList, }) => {
总用电量:
-
{v.data[0]?.eMotor_EQ} kwh
+
{v.data[0]?.eMotor_EQ?.toFixed(2)} kwh
单次运行时间:
diff --git a/web/client/src/sections/bigScreen/components/electrity/realTimeStatus.js b/web/client/src/sections/bigScreen/components/electrity/realTimeStatus.js index f921476..32d1e31 100644 --- a/web/client/src/sections/bigScreen/components/electrity/realTimeStatus.js +++ b/web/client/src/sections/bigScreen/components/electrity/realTimeStatus.js @@ -142,7 +142,7 @@ const RealTimeStatus = (props) => { display: 'flex', alignItems: "center", justifyContent: 'space-between', }}>
控制方式:
-
{pumpOne?.data[0]?.sMotor_LR ? '现场就地' : "平台远程"}
+
{pumpOne?.data[0]?.sMotor_LR ? "平台远程" : '现场就地'}
{ } -function mapStateToProps(state) { +function mapStateToProps (state) { const { auth, global } = state; return { user: auth.user, diff --git a/web/client/src/sections/bigScreen/components/realTime.js b/web/client/src/sections/bigScreen/components/realTime.js index 62cfedc..34cc359 100644 --- a/web/client/src/sections/bigScreen/components/realTime.js +++ b/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 { 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 [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 [softStartData, setSoftStartData] = useState([]) //软启动总用电数据 const [electro, setElectro] = useState({ week: 0, year: 0, day: 0 }) //用电概况 @@ -61,12 +44,6 @@ const RealTime = ({ dispatch, actions, user, siteList, }) => { if (p.success) { let dataId = p.payload.data[0]?.groups[0]?.stations?.map(k => k.id) || [] 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) { // 当前时间 await dispatch(bigScreen.axyData({ @@ -173,25 +150,7 @@ const RealTime = ({ dispatch, actions, user, siteList, }) => { }) }) station.cabine = dataId - // setCabinetList(dataId) - // setCabinetId(p.payload.data[0]?.groups[0]?.stations[0]?.id) 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({ 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
diff --git a/web/client/src/sections/bigScreen/components/realTime/below.js b/web/client/src/sections/bigScreen/components/realTime/below.js index be20f9a..f75dde2 100644 --- a/web/client/src/sections/bigScreen/components/realTime/below.js +++ b/web/client/src/sections/bigScreen/components/realTime/below.js @@ -6,7 +6,7 @@ import moment from 'moment' const { Option } = Select; -const Below = ({ dispatch, actions, stations,level }) => { +const Below = ({ dispatch, actions, stations, level }) => { const { bigScreen } = actions const [page, setPage] = useState(0) const [threePower, setThreePower] = useState([]) @@ -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); } @@ -99,7 +105,6 @@ const Below = ({ dispatch, actions, stations,level }) => { } })).then(d => { if (d.success) { - console.log(timeData); timeData.forEach((x, i) => { if (i == (timeData?.length - 1)) { 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 => { if (d.success) { - console.log(timeData); timeData.forEach((x, i) => { if (i == (timeData?.length - 1)) { d.payload.data[0]?.stations?.map(c => {