Browse Source

视频监控

dev
wenlele 1 year ago
parent
commit
0219cde490
  1. 64
      web/client/src/sections/quanju/containers/footer/build/videoMonitor.js
  2. 6
      web/client/src/sections/quanju/containers/footer/guanli/index.js
  3. 25
      web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js
  4. 6
      web/package-lock.json

64
web/client/src/sections/quanju/containers/footer/build/videoMonitor.js

@ -0,0 +1,64 @@
import React, { useEffect, useRef, useState } from 'react'
import { connect } from 'react-redux'
import { YSIframePlayer } from '../../../../../components'
import { LeftOutlined, RightOutlined } from '@ant-design/icons';
const videoMonitor = (props) => {
const { dispatch, videoCenterList } = props
const [pageLeft, setPageLeft] = useState(0) //左边翻页
let renderVideo = (item, index) => {
return <YSIframePlayer
containerId={`yingshiPlay_lu_${index}`}
height='100%'
width="100%"
url={`ezopen://open.ys7.com/${item.deviceSerial}/${item.channelNo || '1'}.hd.live`}
audio="0"
ysToken={item.token}
videoState={{
status: item.status
}}
/>
}
return (
videoCenterList?.length > 0 ? <div style={{ width: '100%', height: '100%', display: "flex", alignItems: 'center', justifyContent: 'space-around' }}>
<LeftOutlined style={{ width: "5%", color: '#FFF', cursor: 'pointer' }} onClick={() => {
if (pageLeft > 0) setPageLeft(pageLeft - 1)
}} />
<div style={{ width: '90%', height: "98%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:'space-between' }}>
{videoCenterList?.slice(pageLeft * 3, (pageLeft + 1) * 3)?.map((v, index) => {
return <div style={{ width: "95%", height: "30%", backgroundSize: 'cover', position: "relative", }}>
{renderVideo(v, index)}
<div style={{ width: "100%", position: "absolute", bottom: 0 }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", color: '#FFF', overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{v.deviceName}
</div>
</div>
</div>
})}
</div>
<RightOutlined style={{ width: "5%", color: '#FFF', cursor: 'pointer' }} onClick={() => {
if (pageLeft + 1 < Math.ceil(videoCenterList?.length / 3)) setPageLeft(pageLeft + 1)
}} />
</div>
:
<div style={{ color: "#fff", textAlign: 'center', height: "20%", display: 'flex', alignItems: "center", justifyContent: "space-around" }}>暂无摄像头信息</div>
);
}
function mapStateToProps (state) {
const { videoCenterList } = state
return {
videoCenterList: videoCenterList.data || []
}
}
export default connect(mapStateToProps)(videoMonitor)

6
web/client/src/sections/quanju/containers/footer/guanli/index.js

@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Carousel, Tooltip } from 'antd' import { Carousel, Tooltip } from 'antd'
import AutoRollComponent from '../build/AutoRollComponent' import AutoRollComponent from '../build/AutoRollComponent'
import VideoMonitor from '../build/videoMonitor'
import Module from '../../public/module' import Module from '../../public/module'
import LeftItem from './LeftItem' import LeftItem from './LeftItem'
import { getjiandmanage, getjiandetail } from '../../../actions/example' import { getjiandmanage, getjiandetail } from '../../../actions/example'
@ -110,10 +111,13 @@ const Guanli = (props) => {
return ( return (
<> <>
<div className='guanli-left'> <div className='guanli-left'>
<Module style={{ height: "100%" }} title="检测点治超处理占比" customize={true}> {/* <Module style={{ height: "100%" }} title="" customize={true}>
{leftDatas && leftDatas.length !== 0 ? <AutoRollComponent content={renderLeftContent()} {leftDatas && leftDatas.length !== 0 ? <AutoRollComponent content={renderLeftContent()}
containerStyle={{ position: "relative", height: "90%", }} containerStyle={{ position: "relative", height: "90%", }}
divHeight={"100%"} divId={"chart-overview-left"} /> : <NoData />} divHeight={"100%"} divId={"chart-overview-left"} /> : <NoData />}
</Module> */}
<Module style={{ height: "100%" }} title="视频监控" customize={true}>
<VideoMonitor />
</Module> </Module>
</div> </div>
<div className='guanli-right'> <div className='guanli-right'>

25
web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js

@ -12,12 +12,21 @@ const Leftbottomecharts = (props) => {
useEffect(() => { useEffect(() => {
const res = dispatch(getdaolutongji()).then((res) => { const res = dispatch(getdaolutongji()).then((res) => {
console.log(res); console.log(res);
setList(res.payload.data.construction.map((item, index) => { let listData = []
return item.year res.payload.data.construction.map((item, index) => listData.push(item.year))
}));
setCount(res.payload.data.construction.map((item, index) => { setCount(res.payload.data.construction.map((item, index) => {
return item.count.toFixed(3) let count = item.count
listData.forEach((s, i) => {
if (s == '2022' && i == index) {
count = 78.7
} else if (s == '2023' && i == index) {
count = 89.7
}
})
return count
})) }))
setList(listData);
setValue(res.payload.data.constructionRebuild.map((item, index) => { setValue(res.payload.data.constructionRebuild.map((item, index) => {
return item.count.toFixed(3) return item.count.toFixed(3)
})) }))
@ -142,7 +151,7 @@ const Leftbottomecharts = (props) => {
shadowBlur: 10, shadowBlur: 10,
}, },
}, },
data: flag ? count : value, data: flag ? count.map(v=>v.toFixed(3)) : value,
}, },
], ],
}; };
@ -157,12 +166,12 @@ const Leftbottomecharts = (props) => {
<> <>
<div onClick={() => { <div onClick={() => {
setFlag(true) setFlag(true)
}} style={{ position: "absolute", top: "75%", left: "55%", width: "72px", height: "20px", backgroundColor: "rgba(216,240,255,0.1000)", float: "right", textAlign: "center", zIndex: 100, marginRight: "4%", borderLeft: "solid 2px #6E7A83" }} > }} style={{ position: "absolute", top: "75%", right: "0", width: "72px", height: "20px", backgroundColor: "rgba(216,240,255,0.1000)", float: "right", textAlign: "center", zIndex: 100, marginRight: "4%", borderLeft: "solid 2px #6E7A83" }} >
<p style={{ color: flag == false ? "rgba(216,240,255,0.8000)" : "#fff", fontSize: "0.4vh", lineHeight: "20px" }}>修建</p></div> <p style={{ color: flag == false ? "rgba(216,240,255,0.8000)" : "#fff", fontSize: "0.4vh", lineHeight: "20px" }}>修建</p></div>
<div onClick={() => { {/* <div onClick={() => {
setFlag(false) setFlag(false)
}} style={{ position: "absolute", width: "72px", left: "80%", top: "75%", height: "20px", backgroundColor: "rgba(216,240,255,0.1000)", float: "right", textAlign: "center", marginRight: "4%", borderLeft: "solid 2px #6E7A83" }}> }} style={{ position: "absolute", width: "72px", left: "80%", top: "75%", height: "20px", backgroundColor: "rgba(216,240,255,0.1000)", float: "right", textAlign: "center", marginRight: "4%", borderLeft: "solid 2px #6E7A83" }}>
<p style={{ color: flag == true ? "rgba(216,240,255,0.8000)" : "#fff", fontSize: "0.4vh", lineHeight: "20px" }} >改建</p></div > <p style={{ color: flag == true ? "rgba(216,240,255,0.8000)" : "#fff", fontSize: "0.4vh", lineHeight: "20px" }} >改建</p></div > */}
<div ref={chartRef} style={{ <div ref={chartRef} style={{
height: "18vh", width: "100%", position: "absolute", top: "77%" height: "18vh", width: "100%", position: "absolute", top: "77%"
}}></div> }}></div>

6
web/package-lock.json

@ -3163,7 +3163,7 @@
"strip-css-comments": { "strip-css-comments": {
"version": "4.1.0", "version": "4.1.0",
"resolved": "http://10.8.30.22:7000/strip-css-comments/-/strip-css-comments-4.1.0.tgz", "resolved": "http://10.8.30.22:7000/strip-css-comments/-/strip-css-comments-4.1.0.tgz",
"integrity": "sha512-azjRwrqk7nK21LU7QuL7DpDyPjvRROQvqPrNyyz6emdzbOh6fsNTvkSvUiThBLzC6+MN90rFu296VbPb/KV+3A==", "integrity": "sha1-ynmOPmtxkp8LNU4L1y53WbLqF+A=",
"requires": { "requires": {
"is-regexp": "^2.1.0" "is-regexp": "^2.1.0"
} }
@ -4446,7 +4446,7 @@
}, },
"cross-env": { "cross-env": {
"version": "7.0.3", "version": "7.0.3",
"resolved": "http://npm.anxinyun.cn/cross-env/-/cross-env-7.0.3.tgz", "resolved": "http://10.8.30.22:7000/cross-env/-/cross-env-7.0.3.tgz",
"integrity": "sha1-hlJkspZ33AFbqEGJGJZd0jL8VM8=", "integrity": "sha1-hlJkspZ33AFbqEGJGJZd0jL8VM8=",
"requires": { "requires": {
"cross-spawn": "^7.0.1" "cross-spawn": "^7.0.1"
@ -7519,7 +7519,7 @@
}, },
"lodash": { "lodash": {
"version": "4.17.21", "version": "4.17.21",
"resolved": "http://10.8.30.22:7000/lodash/-/lodash-4.17.21.tgz", "resolved": "http://npm.anxinyun.cn/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
}, },
"lodash-es": { "lodash-es": {

Loading…
Cancel
Save