Browse Source

BENGZHAN_DB

master
wenlele 2 years ago
parent
commit
549214b226
  1. 6
      api/config.js
  2. BIN
      web/client/assets/images/realTime/left.png
  3. BIN
      web/client/assets/images/realTime/notebook.png
  4. BIN
      web/client/assets/images/realTime/right.png
  5. BIN
      web/client/assets/images/realTime/specific.png
  6. 6
      web/client/src/sections/bigScreen/components/capacity.js
  7. 5
      web/client/src/sections/bigScreen/components/electrical.js
  8. 2
      web/client/src/sections/bigScreen/components/electrity/lineBoxStatus.js
  9. 308
      web/client/src/sections/bigScreen/components/realTime.js
  10. 83
      web/client/src/sections/bigScreen/components/realTime/general.js
  11. 45
      web/client/src/sections/bigScreen/components/realTime/softStart.js
  12. 2
      web/client/src/sections/bigScreen/containers/systemManagement.js

6
api/config.js

@ -16,13 +16,13 @@ args.option('axyProject', '安心云泵站项目信息');
const flags = args.parse(process.argv);
const XUNJIAN_DB = process.env.XUNJIAN_DB || flags.pg;
const BENGZHAN_DB = process.env.XUNJIAN_DB || flags.pg;
const API_ANXINYUN_URL = process.env.API_ANXINYUN_URL || flags.apiAnxinyunUrl
const AXY_BZ_PROJECT = process.env.AXY_BZ_PROJECT || flags.axyProject
if (!XUNJIAN_DB || !API_ANXINYUN_URL || !AXY_BZ_PROJECT) {
if (!BENGZHAN_DB || !API_ANXINYUN_URL || !AXY_BZ_PROJECT) {
console.log('缺少启动参数,异常退出');
args.showHelp();
process.exit(-1);
@ -54,7 +54,7 @@ const product = {
}
],
dc: {
url: XUNJIAN_DB,
url: BENGZHAN_DB,
opts: {
pool: {
max: 80,

BIN
web/client/assets/images/realTime/left.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
web/client/assets/images/realTime/notebook.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
web/client/assets/images/realTime/right.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
web/client/assets/images/realTime/specific.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

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

@ -283,7 +283,7 @@ const Capacity = ({ actions, dispatch, user, }) => {
type: 'get', url: `stations/theme/data`, params: {
query: {
stations: p.payload.data[0]?.groups[0]?.stations[0]?.id,
startTime: moment().add(-24, 'hours').format('YYYY-MM-DD HH:mm:ss'),
startTime: moment().add(-12, 'hours').format('YYYY-MM-DD HH:mm:ss'),
endTime: moment().format('YYYY-MM-DD HH:mm:ss'),
limit: 1440
}
@ -337,7 +337,7 @@ const Capacity = ({ actions, dispatch, user, }) => {
type: 'get', url: `stations/theme/data`, params: {
query: {
stations: pumpId,
startTime: moment().add(-24, 'hours').format('YYYY-MM-DD HH:mm:ss'),
startTime: moment().add(-12, 'hours').format('YYYY-MM-DD HH:mm:ss'),
endTime: moment().format('YYYY-MM-DD HH:mm:ss'),
limit: 1440
}
@ -363,7 +363,7 @@ const Capacity = ({ actions, dispatch, user, }) => {
type: 'get', url: `stations/theme/data`, params: {
query: {
stations: usePumpId,
startTime: moment().add(-24, 'hours').format('YYYY-MM-DD HH:mm:ss'),
startTime: moment().add(-12, 'hours').format('YYYY-MM-DD HH:mm:ss'),
endTime: moment().format('YYYY-MM-DD HH:mm:ss'),
limit: 1440
}

5
web/client/src/sections/bigScreen/components/electrical.js

@ -219,7 +219,6 @@ const Electrical = ({ dispatch, actions, user, module, setModule }) => {
setVoltagePump(d.payload.data?.stations || [])
}
})
}
}, [voltagePumpId])
@ -241,7 +240,7 @@ const Electrical = ({ dispatch, actions, user, module, setModule }) => {
fontSize: 20, width: 160, height: 160, textAlign: 'center',
}}>
<div style={{ fontSize: 20, color: '#E2F8FF', fontWeight: 600 }}>
环境湿度</div>{depthWater[0]?.sHumidity} %
环境湿度</div>{depthWater[0]?.sHumidity || "--"} %
</div>
<div style={{
backgroundImage: 'url(/assets/images/monitor/pedestal.png)',
@ -257,7 +256,7 @@ const Electrical = ({ dispatch, actions, user, module, setModule }) => {
fontSize: 20, width: 160, height: 160, textAlign: 'center',
}}>
<div style={{ fontSize: 20, color: '#E2F8FF', fontWeight: 600 }}>
信号</div>{depthWater[0]?.CSQ4G}
信号</div>{depthWater[0]?.CSQ4G || "--"}
</div>
</div>
<img style={{ width: "44%", height: "46%", position: "absolute", left: "28%", top: "34%" }} src={`/assets/images/electrical/centre.png`} />

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

@ -95,7 +95,7 @@ const LineBoxStatus = ({ user, cabinetId, cabinetList, setCabinetId, cabinetOne
<div style={{ flex: 1, textAlign: "end", fontSize: 16, fontFamily: "YouSheBiaoTiHei" }}>{cabinetOne?.data[0]?.eQF_C_A} A</div>
</div>
<div style={{ display: 'flex', width: "48%" }}>
<div style={{ width: 70, fontFamily: "SourceHanSansCN-Medium", color: "#63B0FF", }}>B相电压</div>
<div style={{ width: 80,textIndent:10, fontFamily: "SourceHanSansCN-Medium", color: "#63B0FF", }}>B相电压</div>
<div style={{ flex: 1, textAlign: "end", fontSize: 16, fontFamily: "YouSheBiaoTiHei" }}>{cabinetOne?.data[0]?.eQF_C_V} V</div>
</div>
</div>

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

@ -1,17 +1,310 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import { Spin, Card, Modal, TreeSelect, message } from 'antd';
import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form';
import Title from 'antd/lib/skeleton/Title';
import { Select } from 'antd';
import moment from 'moment'
import ReactECharts from 'echarts-for-react';
import General from '../components/realTime/general';
import LineBoxStatus from '../components/electrity/lineBoxStatus';
import SoftStart from '../components/realTime/softStart';
import LevelTrend from '../components/electrity/levelTrend';
const RealTime = ({ user, module, setModule }) => {
const RealTime = ({ dispatch, actions, user, module, setModule }) => {
const { bigScreen } = actions
const [pageLeft, setPageLeft] = useState(0) //左边翻页
const [pageRight, setPageRight] = useState(0) //左边翻页
const [siteList, setSiteList] = useState([]) //站点列表
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 [interval, setInterval] = useState('本日') //用电概况区间
useEffect(() => {
dispatch(bigScreen.axyData({ type: 'get', url: `organizations/{orgId}/structures` })).then(res => {
if (res.success) {
setSiteList(res.payload.data?.map(v => ({ value: v.id, label: v.name })) || [])
setStrucId(res.payload.data[0]?.id)
}
})
}, [])
useEffect(async () => {
if (strucId) {
await dispatch(bigScreen.axyData({ type: 'get', url: `structures/${strucId}/factors` })).then(async r => {
if (r.success) {
//水泵信息
let waterId = r.payload.data?.find(v => v.name == '泵站水泵')?.id
if (waterId) {
await dispatch(bigScreen.axyData({
type: 'get', url: `structures/${strucId}/stations`,
params: { query: { factorId: waterId } }
})).then(async p => {
if (p.success) {
let dataId = []
let voltageId = []
p.payload.data?.map(v => {
v.groups?.map(s => {
s.stations?.map(f => {
dataId.push(f.id)
if (voltageId?.length < 3) {
voltageId.push(f.id)
}
})
})
})
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({
// type: 'get', url: `stations/theme/data`, params: {
// query: {
// stations: dataId.join(),
// startTime: moment().day(moment().day() - 1).startOf('day').format('YYYY-MM-DD HH:mm:ss'),
// endTime: moment().day(moment().day() - 1).endOf('day').format('YYYY-MM-DD HH:mm:ss'),
// limit: 1440
// }
// }
// })).then(d => {
// if (d.success) {
// }
// })
// }
if (dataId.length) {
// 当前时间
await dispatch(bigScreen.axyData({
type: 'get', url: `stations/data/theme`, params: {
query: {
stations: dataId.join(),
begin: moment().add(-100, 'hours').format('x'),
end: moment().endOf('day').format('x'),
// limit: 1
aggtype:'d',
orderDirection:'ASC',
}
}
})).then(d => {
if (d.success) {
}
})
}
}
})
}
// 进线柜
// let wireCabinetId = r.payload.data?.find(v => v.name == '泵站进线柜')?.id
// if (wireCabinetId) {
// await dispatch(bigScreen.axyData({
// type: 'get', url: `structures/${strucId}/stations`,
// params: { query: { factorId: wireCabinetId } }
// })).then(async p => {
// if (p.success) {
// let dataId = []
// p.payload.data?.map(v => {
// v.groups?.map(s => {
// s.stations?.map(f => {
// dataId.push({ value: f.id, label: f.name })
// })
// })
// })
// 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) {
// }
// })
// }
// }
// })
// }
// //泵站信息
// let informationId = r.payload.data?.find(v => v.name == '泵站信息')?.id
// if (informationId) {
// await dispatch(bigScreen.axyData({
// type: 'get', url: `structures/${strucId}/stations`,
// params: { query: { factorId: informationId } }
// })).then(async p => {
// if (p.success) {
// // 液位趋势
// await dispatch(bigScreen.axyData({
// type: 'get', url: `stations/theme/data`, params: {
// query: {
// stations: p.payload.data[0]?.groups[0]?.stations[0]?.id,
// 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) {
// setDepthWater(d.payload.data?.stations[0]?.data)
// }
// })
// }
// })
// }
}
})
}
}, [strucId])
// 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: '100%' }}>
实时监测
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', }}>
<General setInterval={setInterval} interval={interval} />
{/* <LineBoxStatus cabinetId={cabinetId} cabinetList={cabinetList} setCabinetId={setCabinetId} cabinetOne={cabinetOne} /> */}
<SoftStart />
{/* <LevelTrend depthWater={depthWater} /> */}
<div style={{
width: "30%", height: 160, position: "absolute", left: '35%', top: "8%",
display: 'flex', justifyContent: 'space-between',
}}>
<div style={{
backgroundImage: 'url(/assets/images/monitor/pedestal.png)',
backgroundSize: '100% 100%', backgroundPosition: 'center', backgroundRepeat: 'no-repeat',
fontSize: 20, width: 160, height: 160, textAlign: 'center',
}}>
<div style={{ fontSize: 20, color: '#E2F8FF', fontWeight: 600 }}>
环境湿度</div>{depthWater[0]?.sHumidity} %
</div>
<div style={{
backgroundImage: 'url(/assets/images/monitor/pedestal.png)',
backgroundSize: '100% 100%', backgroundPosition: 'center', backgroundRepeat: 'no-repeat',
fontSize: 20, width: 160, height: 160, textAlign: 'center',
}}>
<div style={{ fontSize: 20, color: '#E2F8FF', fontWeight: 600 }}>
环境湿度</div>{depthWater[0]?.sTEMP || "--"}
</div>
<div style={{
backgroundImage: 'url(/assets/images/monitor/pedestal.png)',
backgroundSize: '100% 100%', backgroundPosition: 'center', backgroundRepeat: 'no-repeat',
fontSize: 20, width: 160, height: 160, textAlign: 'center',
}}>
<div style={{ fontSize: 20, color: '#E2F8FF', fontWeight: 600 }}>
信号</div>{depthWater[0]?.CSQ4G}
</div>
</div>
<img style={{ width: "44%", height: "46%", position: "absolute", left: "28%", top: "34%" }} src={`/assets/images/electrical/centre.png`} />
<div className='site' style={{
display: 'flex', justifyContent: 'center', alignItems: 'center',
width: '40%', bottom: 10, position: 'absolute', left: "28%"
}}>
<img style={{ width: 67, height: 68, marginLeft: 94 }} src='/assets/images/monitor/site.png' />
<div style={{
width: 180, height: 41, backgroundImage: 'url(/assets/images/monitor/title.png)',
backgroundSize: '100% 100%', backgroundPosition: 'center', backgroundRepeat: 'no-repeat',
textAlign: 'center', lineHeight: '41px', fontSize: 20, color: '#FFF', fontStyle: "italic"
}}>{siteList?.filter(v => v.value == strucId)[0]?.label}</div>
<Select
showSearch
placeholder="请选择站点"
value={strucId}
style={{ width: 155 }}
optionFilterProp="children"
onSelect={v => {
setStrucId(v)
}}
options={siteList}
/>
</div>
</div>
</div >
}
@ -20,6 +313,7 @@ function mapStateToProps (state) {
return {
user: auth.user,
clientHeight: global.clientHeight,
actions: global.actions,
};
}

83
web/client/src/sections/bigScreen/components/realTime/general.js

@ -0,0 +1,83 @@
import React from 'react';
import { connect } from 'react-redux';
import { Select } from 'antd';
import ReactECharts from 'echarts-for-react';
import moment from 'moment'
const { Option } = Select;
const General = ({ user, setInterval, interval, }) => {
return <div style={{
backgroundImage: 'url(/assets/images/monitor/headerTitle.png)',
backgroundSize: '100% 36px',
backgroundPosition: '0 0',
backgroundRepeat: 'no-repeat', zIndex: 2,
width: '26%', height: '30%', minWidth: 360, position: "absolute", left: 10, top: 0
}}>
<div className='site' style={{ display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between' }}>
<div style={{ lineHeight: "36px", color: '#E2F8FF', fontSize: 20., textIndent: 20, fontFamily: 'YouSheBiaoTiHei', fontSizeL: '1rem' }}>用电概况</div>
<div style={{ display: "flex", justifyContent: 'space-between', width: 200 }}>
{['本日', "本月", '本年'].map(v => <div style={{
width: 60, height: 20, color: interval == v ? "#24DCF7" : '#00A9FF', border: '1px solid',
background: interval == v ? "#5bc1ff33" : "#236cfe4d", textAlign: "center", cursor: 'pointer'
}} onClick={() => {
setInterval(v)
}}>{v}</div>)}
</div>
</div>
<div style={{
width: '100%', height: 'calc(100% - 36px)', backgroundImage: "linear-gradient(180deg, #000e28e6 1%, #021f48cc 100%)",
display: "flex", justifyContent: 'center', alignItems: "center"
}}>
<div>
<div style={{ width: 150, height: 56, display: "flex" }}>
<img style={{ width: 40, height: 45 }} src="/assets/images/realTime/notebook.png" />
<div style={{ marginLeft: 10 }}>
<div>{interval == '本日' ?
"当日用电" : interval == '本月' ?
"当月用电" : interval == '本年' ?
"当年用电" : ""}</div>
<div>{ } kwh</div>
</div>
</div>
<div style={{ width: 150, height: 56, display: "flex" }}>
<img style={{ width: 40, height: 45 }} src="/assets/images/realTime/notebook.png" />
<div style={{ marginLeft: 10 }}>
<div>{interval == '本日' ?
"昨日用电" : interval == '本月' ?
"上月用电" : interval == '本年' ?
"上年用电" : ""}</div>
<div>{ } kwh</div>
</div>
</div>
</div>
<div style={{ display: 'flex' }}>
<img style={{ width: 10, height: 100 }} src="/assets/images/realTime/left.png" />
<div style={{
backgroundImage: 'url(/assets/images/realTime/specific.png)',
backgroundSize: '100% 100%', backgroundPosition: '0 0', backgroundRepeat: 'no-repeat',
width: 170, height: 50, height: 100
}}>
<div></div>
</div>
<img style={{ width: 10, height: 100 }} src="/assets/images/realTime/right.png" />
</div>
</div>
</div>
}
function mapStateToProps (state) {
const { auth, global } = state;
return {
user: auth.user,
clientHeight: global.clientHeight,
};
}
export default connect(mapStateToProps)(General);

45
web/client/src/sections/bigScreen/components/realTime/softStart.js

@ -0,0 +1,45 @@
import React from 'react';
import { connect } from 'react-redux';
import { Select } from 'antd';
import ReactECharts from 'echarts-for-react';
import moment from 'moment'
const { Option } = Select;
const SoftStart = ({ user, setInterval, interval }) => {
return <div style={{
backgroundImage: 'url(/assets/images/monitor/headerTitle.png)',
backgroundSize: '100% 36px',
backgroundPosition: '0 0',
backgroundRepeat: 'no-repeat', zIndex: 2,
width: '26%', height: '30%', minWidth: 360, position: "absolute", left: 10, top: "30%"
}}>
<div className='site' style={{ display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between' }}>
<div style={{ lineHeight: "36px", color: '#E2F8FF', fontSize: 20., textIndent: 20, fontFamily: 'YouSheBiaoTiHei', fontSizeL: '1rem' }}>软启动总用电量</div>
</div>
<div style={{ width: '100%', height: 'calc(100% - 36px)', backgroundImage: "linear-gradient(180deg, #000e28e6 1%, #021f48cc 100%)" }}>
<div style={{ margin: "20px 20px" }}>单位kwh</div>
<div style={{}}>
<img style={{ width: 40, height: 45 }} src="/assets/images/realTime/notebook.png" />
<img style={{ width: 40, height: 45 }} src="/assets/images/realTime/notebook.png" />
</div>
</div>
</div>
}
function mapStateToProps (state) {
const { auth, global } = state;
return {
user: auth.user,
clientHeight: global.clientHeight,
};
}
export default connect(mapStateToProps)(SoftStart);

2
web/client/src/sections/bigScreen/containers/systemManagement.js

@ -15,7 +15,7 @@ const TreeNode = Tree.TreeNode;
const SystemManagement = ({ clientHeight, user, history }) => {
const [module, setModule] = useState('basis')
const [module, setModule] = useState('realTime')
const [showData, setshowData] = useState([])
useEffect(() => {

Loading…
Cancel
Save