Browse Source

大屏视频播放

dev
巴林闲侠 2 years ago
parent
commit
77d7ec0061
  1. 2
      web/client/src/components/index.js
  2. 11
      web/client/src/sections/quanju/containers/footer/conserve/right/right-top.js
  3. 22
      web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js
  4. 320
      web/client/src/sections/quanju/containers/footer/leadership/right/hudong.js
  5. 202
      web/client/src/sections/quanju/containers/footer/leadership/right/hudongVideo.js
  6. 252
      web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js
  7. 4
      web/package.json

2
web/client/src/components/index.js

@ -4,7 +4,6 @@
import Upload from './Upload'; import Upload from './Upload';
import NoResource from './no-resource'; import NoResource from './no-resource';
import LimitTextArea from './limit-textarea'; import LimitTextArea from './limit-textarea';
import ProcessForm from './process_form'
import FlowRecordTable from './flowRecordTable' import FlowRecordTable from './flowRecordTable'
import Table from './table' import Table from './table'
import Search from './search' import Search from './search'
@ -16,7 +15,6 @@ export {
Upload, Upload,
NoResource, NoResource,
LimitTextArea, LimitTextArea,
ProcessForm,
FlowRecordTable, FlowRecordTable,
Table, Table,
Search, Search,

11
web/client/src/sections/quanju/containers/footer/conserve/right/right-top.js

@ -84,7 +84,16 @@ const RightTop = (props) => {
<div style={{ position: "fixed", width: "400px", height: "200px", zIndex: 100, right: "24%", marginTop: "0", top: "25%" }}> <div style={{ position: "fixed", width: "400px", height: "200px", zIndex: 100, right: "24%", marginTop: "0", top: "25%" }}>
<img src='/assets/images/leadership/beijinglan.png' style={{ width: "100%", height: "100%" }} /> <img src='/assets/images/leadership/beijinglan.png' style={{ width: "100%", height: "100%" }} />
<div style={{ width: "50%", height: "100%", position: "absolute", top: "0", }}> <div style={{ width: "50%", height: "100%", position: "absolute", top: "0", }}>
<Hua shuzu={[{ "imgs": item.conserveAfterPic ? item.conserveAfterPic[0] : "" }, { "imgs": item.conserveBeforePic ? item.conserveBeforePic[0] : "" }, { "imgs": item.conserveUnderwayPic ? item.conserveUnderwayPic[0] : "" }]} /> <Hua shuzu={[{
"imgs": item.conserveAfterPic ?
item.conserveAfterPic[0] : ""
}, {
"imgs": item.conserveBeforePic ?
item.conserveBeforePic[0] : ""
}, {
"imgs": item.conserveUnderwayPic ?
item.conserveUnderwayPic[0] : ""
}]} />
</div> </div>
<div style={{ position: "absolute", top: "0", width: "50%", left: "50%", paddingRight: "10px" }}> <div style={{ position: "absolute", top: "0", width: "50%", left: "50%", paddingRight: "10px" }}>
<p style={{ marginTop: "20px", color: "#FFFFFF", fontSize: "16px", fontFamily: "YouSheBiaoTiHei" }}> <p style={{ marginTop: "20px", color: "#FFFFFF", fontSize: "16px", fontFamily: "YouSheBiaoTiHei" }}>

22
web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js

@ -2,10 +2,10 @@ import React, { useEffect, useState } from 'react'
import Module from '../../../public/module' import Module from '../../../public/module'
import Lunbo from "../right/lunbo" import Lunbo from "../right/lunbo"
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { YSIframePlayer } from '../../../../../../components'
// import "./left.less" // import "./left.less"
const Leftcenter = ({ videoCenterList }) => { const Leftcenter = ({ videoCenterList }) => {
console.log(videoCenterList);
const style = { height: "30%", marginTop: "5%" } const style = { height: "30%", marginTop: "5%" }
// const hualun = "auto" // const hualun = "auto"
const [num, setNum] = useState(1); const [num, setNum] = useState(1);
@ -31,10 +31,10 @@ const Leftcenter = ({ videoCenterList }) => {
const timer = setInterval(() => { const timer = setInterval(() => {
if (num == list.length) { if (num == list.length) {
setNum(1); setNum(1);
setTu(list[0].img); // setTu(list[0].img);
} else { } else {
setNum(num + 1); setNum(num + 1);
setTu(list[num].img); // setTu(list[num].img);
} }
}, 2000 * 10); }, 2000 * 10);
return () => clearInterval(timer); return () => clearInterval(timer);
@ -77,10 +77,24 @@ const Leftcenter = ({ videoCenterList }) => {
<div style={{ width: "60%", height: "100%", float: "left", marginLeft: "1%" }}> <div style={{ width: "60%", height: "100%", float: "left", marginLeft: "1%" }}>
{ {
list.map((item, index) => { list.map((item, index) => {
console.log(item);
return index + 1 == num ? return index + 1 == num ?
<div style={{ width: "100%", height: "100%", position: "relative" }}> <div style={{ width: "100%", height: "100%", position: "relative" }}>
<img style={{ width: "100%", height: '100%', position: "absolute", bottom: "5%" }} src={item.img} /> {/* <img style={{ width: "100%", height: '100%', position: "absolute", bottom: "5%" }} src={item.img} /> */}
<YSIframePlayer
containerId={`yingshiPlay_${index}`}
height='100%'
width="100%"
url={`ezopen://open.ys7.com/${item.deviceSerial}/${item.channelNo || '1'}.live`}
audio="0"
ysToken={item.token}
videoState={{
status: item.status
}}
/>
<p style={{ <p style={{
width: "100%", height: "3vh", position: "absolute", bottom: "3%", width: "100%", height: "3vh", position: "absolute", bottom: "3%",
backgroundColor: "rgba(0,0,0,0.26)", lineHeight: "3vh", textAlign: "" backgroundColor: "rgba(0,0,0,0.26)", lineHeight: "3vh", textAlign: ""

320
web/client/src/sections/quanju/containers/footer/leadership/right/hudong.js

@ -1,108 +1,109 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import './left.less'; import './left.less';
class ReactCarousel extends Component { class ReactCarousel extends Component {
chunk (arr, size) { chunk (arr, size) {
var arr1 = new Array(); var arr1 = new Array();
for (var i = 0; i < Math.ceil(arr.length / size); i++) { for (var i = 0; i < Math.ceil(arr.length / size); i++) {
arr1[i] = new Array(); arr1[i] = new Array();
} }
var j = 0; var j = 0;
var x = 0; var x = 0;
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (!((i % size == 0) && (i != 0))) { if (!((i % size == 0) && (i != 0))) {
arr1[j][x] = arr[i]; arr1[j][x] = arr[i];
x++; x++;
} else { } else {
j++; j++;
x = 0; x = 0;
arr1[j][x] = arr[i]; arr1[j][x] = arr[i];
x++; x++;
} }
} }
return arr1; return arr1;
} }
constructor() { constructor() {
super(); super();
this.state = { this.state = {
shuzu: [ shuzu: [
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" }, { name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" }, { name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" }, { name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" }, { name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" }, { name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" }, { name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" }, { name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" }, { name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" }, { name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" }, { name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
], ],
imgs: [], imgs: [],
showIndex: 0, //显示第几个图片 showIndex: 0, //显示第几个图片
timer: null, // 定时器 timer: null, // 定时器
show: false, // 前后按钮显示 show: false, // 前后按钮显示
// arr1: "" // arr1: ""
} }
// console.log(this.state.imgs); // console.log(this.state.imgs);
this.state.imgs = this.chunk((this.state.shuzu), 4) this.state.imgs = this.chunk((this.state.shuzu), 4)
} }
render () { render () {
return ( console.log(this.props);
<div className="ReactCarousel" style={{ width: "100%", height: "100%" }}> return (
<div className="contain" <div className="ReactCarousel" style={{ width: "100%", height: "100%" }}>
onMouseEnter={() => { this.stop() }} //鼠标进入停止自动播放 <div className="contain"
onMouseLeave={() => { this.start() }} //鼠标退出自动播放 onMouseEnter={() => { this.stop() }} //鼠标进入停止自动播放
> onMouseLeave={() => { this.start() }} //鼠标退出自动播放
<ul className="ul"> >
{ <ul className="ul">
this.state.imgs.map((value, index) => { {
return ( this.state.imgs.map((value, index) => {
<li style={{ position: "relative", left: "8%", width: "100%", height: "100%", top: "-5%", fontSize: "12px" }} className={index === this.state.showIndex ? 'show' : ''} return (
key={index} <li style={{ position: "relative", left: "8%", width: "100%", height: "100%", top: "-5%", fontSize: "12px" }} className={index === this.state.showIndex ? 'show' : ''}
> key={index}
<div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[0].img})`, backgroundSize: 'cover', position: "absolute", left: "-3%", top: "5%" }}> >
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[0].img})`, backgroundSize: 'cover', position: "absolute", left: "-3%", top: "5%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> <div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> <div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
{value[0]?.name} <img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
</div> {value[0]?.name}
</div> </div>
</div>
</div> </div>
{value[1]?.name ? <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[1].img})`, backgroundSize: 'cover', position: "absolute", left: "45%", top: "5%" }}> {value[1]?.name ? <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[1].img})`, backgroundSize: 'cover', position: "absolute", left: "45%", top: "5%" }}>
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> <div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> <div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> <img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value[1]?.name} {value[1]?.name}
</div> </div>
</div> </div>
</div> : ""} </div> : ""}
{value[2]?.name ? <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[0].img})`, backgroundSize: 'cover', position: "absolute", left: "-3%", top: "49%" }}> {value[2]?.name ? <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[0].img})`, backgroundSize: 'cover', position: "absolute", left: "-3%", top: "49%" }}>
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> <div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> <div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> <img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value[2]?.name} {value[2]?.name}
</div> </div>
</div> </div>
</div> : ""} </div> : ""}
{value[3]?.name ? <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[3].img})`, backgroundSize: 'cover', position: "absolute", left: "45%", top: "49%" }}> {value[3]?.name ? <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[3].img})`, backgroundSize: 'cover', position: "absolute", left: "45%", top: "49%" }}>
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> <div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> <div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> <img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value[3]?.name} {value[3]?.name}
</div> </div>
</div> </div>
</div> : ""} </div> : ""}
{/* <div>{value[1].name}</div> {/* <div>{value[1].name}</div>
<div>{value[2].name}</div> <div>{value[2].name}</div>
<div>{value[3].name}</div> */} <div>{value[3].name}</div> */}
</li> </li>
) )
}) })
} }
</ul> </ul>
{/* <ul className="dots" style={{ width: this.state.imgs.length * 20 + 'px' }}> {/* <ul className="dots" style={{ width: this.state.imgs.length * 20 + 'px' }}>
{ {
this.state.imgs.map((value, index) => { this.state.imgs.map((value, index) => {
return ( return (
@ -115,68 +116,71 @@ class ReactCarousel extends Component {
} }
</ul> */} </ul> */}
<div className="control" style={{ width: "100%", height: "10%" }}> <div className="control" style={{ width: "100%", height: "10%" }}>
<span style={{ position: "absolute", top: "86%", width: "3%", height: "8%" }} className="left" onClick={(e) => { this.previous(e) }}> <span style={{ position: "absolute", top: "86%", width: "3%", height: "8%" }} className="left" onClick={(e) => { this.previous(e) }}>
<img src='/assets/images/leadership/zuofanye.png' style={{ width: "100%", height: "100%" }} /> <img src='/assets/images/leadership/zuofanye.png' style={{ width: "100%", height: "100%" }} />
</span> </span>
<span style={{ position: "absolute", top: "86%", width: "3%", height: "8%", right: "6%" }} className="right" onClick={(e) => { this.next(e) }}> <span style={{ position: "absolute", top: "86%", width: "3%", height: "8%", right: "6%" }} className="right" onClick={(e) => { this.next(e) }}>
<img src='/assets/images/leadership/youofanye.png' style={{ width: "100%", height: "100%" }} /> <img src='/assets/images/leadership/youofanye.png' style={{ width: "100%", height: "100%" }} />
</span> </span>
</div> </div>
</div>
</div> </div>
</div> )
) }
} componentDidMount () { //一开始自动播放
componentDidMount () { //一开始自动播放 if(this.props.shuzu)
this.start(); setTimeout(() => {
} this.start();
}, 0)
}
componentWillUnmount () { //销毁前清除定时器 componentWillUnmount () { //销毁前清除定时器
this.stop(); this.stop();
} }
stop = () => { //暂停 stop = () => { //暂停
let { timer } = this.state; let { timer } = this.state;
clearInterval(timer); clearInterval(timer);
} }
start = () => { //开始 start = () => { //开始
let { timer } = this.state; let { timer } = this.state;
timer = setInterval(() => { timer = setInterval(() => {
this.next(); this.next();
}, 300000); }, 300000);
this.setState({ this.setState({
timer timer
}) })
} }
change = (index) => { //点击下面的按钮切换当前显示的图片 change = (index) => { //点击下面的按钮切换当前显示的图片
let { showIndex } = this.state; let { showIndex } = this.state;
showIndex = index; showIndex = index;
this.setState({ this.setState({
showIndex showIndex
}) })
} }
previous = (e) => { //上一张 previous = (e) => { //上一张
let ev = e || window.event; let ev = e || window.event;
let { showIndex, imgs } = this.state; let { showIndex, imgs } = this.state;
if (showIndex <= 0) { if (showIndex <= 0) {
showIndex = imgs.length - 1; showIndex = imgs.length - 1;
} else { } else {
showIndex--; showIndex--;
} }
this.setState({ this.setState({
showIndex showIndex
}) })
} }
next = (e) => { //下一张 next = (e) => { //下一张
let ev = e || window.event; let ev = e || window.event;
let { showIndex, imgs } = this.state; let { showIndex, imgs } = this.state;
if (showIndex >= imgs.length - 1) { if (showIndex >= imgs.length - 1) {
showIndex = 0; showIndex = 0;
} else { } else {
showIndex++; showIndex++;
} }
this.setState({ this.setState({
showIndex showIndex
}) })
} }
} }
export default ReactCarousel; export default ReactCarousel;

202
web/client/src/sections/quanju/containers/footer/leadership/right/hudongVideo.js

@ -0,0 +1,202 @@
import React, { Component } from 'react';
import './left.less';
import { connect } from 'react-redux'
import { YSIframePlayer } from '../../../../../../components'
class ReactCarousel extends Component {
chunk (arr, size) {
var arr1 = new Array();
for (var i = 0; i < Math.ceil(arr.length / size); i++) {
arr1[i] = new Array();
}
var j = 0;
var x = 0;
for (var i = 0; i < arr.length; i++) {
if (!((i % size == 0) && (i != 0))) {
arr1[j][x] = arr[i];
x++;
} else {
j++;
x = 0;
arr1[j][x] = arr[i];
x++;
}
}
return arr1;
}
constructor() {
super();
this.state = {
imgs: [],
showIndex: 0, //显示第几个图片
timer: null, // 定时器
show: false, // 前后按钮显示
}
}
renderVideo = (item, index) => {
return <YSIframePlayer
containerId={`yingshiPlay_lu_${index}`}
height='100%'
width="100%"
url={`ezopen://open.ys7.com/${item.deviceSerial}/${item.channelNo || '1'}.live`}
audio="0"
ysToken={item.token}
videoState={{
status: item.status
}}
/>
}
render () {
console.log(this.props);
const { imgs } = this.state
return (
<div className="ReactCarousel" style={{ width: "100%", height: "100%" }}>
<div className="contain"
onMouseEnter={() => { this.stop() }} //鼠标进入停止自动播放
onMouseLeave={() => { this.start() }} //鼠标退出自动播放
>
<ul className="ul">
{
this.state.imgs.map((value, index) => {
return (
<li style={{ position: "relative", left: "8%", width: "100%", height: "100%", top: "-5%", fontSize: "12px" }} className={index === this.state.showIndex ? 'show' : ''}
key={index}
>
{
imgs.map((value, index) => {
if (index == 0) {
return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "-3%", top: "5%" }}>
{this.renderVideo(value, index)}
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value?.deviceName}
</div>
</div>
</div> : ''
} else if (index == 1) {
return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "45%", top: "5%" }}>
{this.renderVideo(value, index)}
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value?.deviceName}
</div>
</div>
</div> : ""
} else if (index == 2) {
return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "-3%", top: "49%" }}>
{this.renderVideo(value, index)}
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value?.deviceName}
</div>
</div>
</div> : ""
} else if (index == 3) {
return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "45%", top: "49%" }}>
{this.renderVideo(value, index)}
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value?.deviceName}
</div>
</div>
</div> : ""
} else {
return undefined
}
})
}
</li>
)
})
}
</ul>
{/* <div className="control" style={{ width: "100%", height: "10%" }}>
<span style={{ position: "absolute", top: "86%", width: "3%", height: "8%" }} className="left" onClick={(e) => { this.previous(e) }}>
<img src='/assets/images/leadership/zuofanye.png' style={{ width: "100%", height: "100%" }} />
</span>
<span style={{ position: "absolute", top: "86%", width: "3%", height: "8%", right: "6%" }} className="right" onClick={(e) => { this.next(e) }}>
<img src='/assets/images/leadership/youofanye.png' style={{ width: "100%", height: "100%" }} />
</span>
</div> */}
</div>
</div>
)
}
componentWillReceiveProps (nextProps, oldProps) {
if (nextProps.videoCenterList && nextProps.videoCenterList.length && (!oldProps.videoCenterList || !oldProps.videoCenterList.length)) {
this.setState({
imgs: nextProps.videoCenterList.slice(-4)
})
}
}
componentDidMount () { //一开始自动播放
setTimeout(() => {
this.start();
}, 0)
}
componentWillUnmount () { //销毁前清除定时器
this.stop();
}
stop = () => { //暂停
let { timer } = this.state;
clearInterval(timer);
}
start = () => { //开始
let { timer } = this.state;
timer = setInterval(() => {
this.next();
}, 300000);
this.setState({
timer
})
}
change = (index) => { //点击下面的按钮切换当前显示的图片
let { showIndex } = this.state;
showIndex = index;
this.setState({
showIndex
})
}
previous = (e) => { //上一张
let ev = e || window.event;
let { showIndex, imgs } = this.state;
if (showIndex <= 0) {
showIndex = imgs.length - 1;
} else {
showIndex--;
}
this.setState({
showIndex
})
}
next = (e) => { //下一张
let ev = e || window.event;
let { showIndex, imgs } = this.state;
if (showIndex >= imgs.length - 1) {
showIndex = 0;
} else {
showIndex++;
}
this.setState({
showIndex
})
}
}
function mapStateToProps (state) {
const { videoCenterList } = state
return {
videoCenterList: videoCenterList.data || []
}
}
export default connect(mapStateToProps)(ReactCarousel)

252
web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js

@ -2,133 +2,151 @@ import React, { useState, useEffect } from 'react';
import Module from '../../../public/module' import Module from '../../../public/module'
import { Radio, Select, Spin } from 'antd'; import { Radio, Select, Spin } from 'antd';
import Lunbo from "./lunbo" import Lunbo from "./lunbo"
import Huadong from './hudong'; import Huadong from './hudongVideo';
import { connect } from 'react-redux'
import "./left.less" import "./left.less"
const Righttop = () => { const Righttop = ({ videoCenterList }) => {
const { Option } = Select; const { Option } = Select;
const style = { height: "68%" } const style = { height: "68%" }
const children = []; const children = [];
const [size, setSize] = useState('454544545'); const [size, setSize] = useState('454544545');
const [num, setNum] = useState(); const [num, setNum] = useState();
const [tu, setTu] = useState(""); const [tu, setTu] = useState("");
const [name, setName] = useState(""); const [name, setName] = useState("");
const handleChange = (value) => { const handleChange = (value) => {
// console.log(`Selected: ${value}`); // console.log(`Selected: ${value}`);
setSize(value) setSize(value)
}; };
const [list, setList] = useState([ const [list, setList] = useState([
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" }, // { name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" }, // { name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" }, // { name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" }, // { name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" }, // { name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" }, // { name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" }, // { name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" }, // { name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" }, // { name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" }, // { name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
]) ])
for (let i = 0; i < list.length; i++) { // for (let i = 0; i < list.length; i++) {
children.push(<Option key={i.toString(36) + i}>{list[i].name}</Option>); // children.push(<Option key={i.toString(36) + i}>{list[i].name}</Option>);
} // }
// useEffect(() => { // useEffect(() => {
// const timer = setInterval(() => { // const timer = setInterval(() => {
// if (num == 12) { // if (num == 12) {
// setNum(1); // setNum(1);
// setTu(list[0].img); // setTu(list[0].img);
// } else { // } else {
// setNum(num + 1); // setNum(num + 1);
// setTu(list[num].img); // setTu(list[num].img);
// } // }
// }, 6000); // }, 6000);
// return () => clearInterval(timer); // return () => clearInterval(timer);
// }, [num]); // }, [num]);
const renderBody = () => {
return (
<div id='op' style={{ width: "100%", height: "55%" }}>{
list.map((item, index) => {
return (
<div style={{ width: "100%", height: "100%" }} >
<div style={{ width: "100%", height: "100%", }}>
<li className={index} style={{
height: "20px", position: "relative", width: "100%", color: "#FFFFFF", marginTop: index == 0 ? "4px" : "5px", listStyle: "none", fontSize: "14px"
}} onMouseEnter={() => {
// setTu(item.img);
setNum(index);
}} onMouseLeave={() => {
setNum()
}}>
{num == index ? <img src={item.img} style={{ width: "100%", height: "120%", position: "absolute", }} /> : ""}
{num == index ? <img src={item.img} style={{ width: "5%", height: "100%", position: "absolute", left: "-0.5%", top: "20%" }} /> : ""}
<p style={{ position: "absolute", left: "5%", color: num == index ? "#FFFFFF" : "rgba(216,240,255,0.8)" }} >{item.name}</p> useEffect(() => {
<p style={{ position: "absolute", right: "5%", color: num == index ? "#FFFFFF" : "rgba(216,240,255,0.8)" }}>{item.name}</p> if (videoCenterList.length) {
</li> setList(videoCenterList.slice(-4))
</div> }
</div> }, [videoCenterList])
) const renderBody = () => {
const offlineDevice = videoCenterList.filter(v => v.status == 0)
return (
<div id='op' style={{ width: "100%", height: "55%" }}>{
offlineDevice.length ? offlineDevice.map((item, index) => {
return (
<div style={{ width: "100%", height: "100%" }} >
<div style={{ width: "100%", height: "100%", }}>
<li className={index} style={{
height: "20px", position: "relative", width: "100%", color: "#FFFFFF", marginTop: index == 0 ? "4px" : "5px", listStyle: "none", fontSize: "14px"
}} onMouseEnter={() => {
// setTu(item.img);
setNum(index);
}} onMouseLeave={() => {
setNum()
}}>
{/* {num == index ? <img src={item.img} style={{ width: "100%", height: "120%", position: "absolute", }} /> : ""}
{num == index ? <img src={item.img} style={{ width: "5%", height: "100%", position: "absolute", left: "-0.5%", top: "20%" }} /> : ""} */}
}) <p style={{ position: "absolute", left: "5%", color: num == index ? "#FFFFFF" : "rgba(216,240,255,0.8)" }} >{item.deviceName}</p>
} <p style={{ position: "absolute", right: "5%", color: num == index ? "#FFFFFF" : "rgba(216,240,255,0.8)" }}>{item.deviceSerial}</p>
</div > </li>
) </div>
} </div>
return ( )
<> }) : ''
}
</div >
)
}
return (
<>
<Module style={style} title={"路面执法监控"}> <Module style={style} title={"路面执法监控"}>
<div style={{ width: "100%", height: "65%", position: "relative" }}> <div style={{ width: "100%", height: "65%", position: "relative" }}>
<p style={{ position: "absolute", left: "25%", top: "2%", fontSize: "14px", color: "#FFFFFF" }}>监控总数</p><p style={{ position: "absolute", left: "37%", fontSize: "24px", marginLeft: "1%", top: "-0.5%", color: "#FFFFFF", fontFamily: "YouSheBiaoTiHei" }}>129</p> <p style={{ position: "absolute", left: "25%", top: "2%", fontSize: "14px", color: "#FFFFFF" }}>监控总数</p><p style={{ position: "absolute", left: "37%", fontSize: "24px", marginLeft: "1%", top: "-0.5%", color: "#FFFFFF", fontFamily: "YouSheBiaoTiHei" }}>{videoCenterList.length}</p>
<p style={{ position: "absolute", left: "55%", top: "2%", fontSize: "14px", color: "#FFFFFF" }}>在线率</p><p style={{ position: "absolute", right: "15%", fontSize: "24px", marginLeft: "2%", top: "-0.5%", color: "#FFFFFF", fontFamily: "YouSheBiaoTiHei" }}>88.87%</p> <p style={{ position: "absolute", left: "55%", top: "2%", fontSize: "14px", color: "#FFFFFF" }}>在线率</p><p style={{ position: "absolute", right: "15%", fontSize: "24px", marginLeft: "2%", top: "-0.5%", color: "#FFFFFF", fontFamily: "YouSheBiaoTiHei" }}>
<div style={{ width: "100%", height: "10%", position: "relative" }}> {
<img src='/assets/images/leadership/head.png' style={{ width: "15%", marginLeft: "5%" }} /> videoCenterList.length ?
((videoCenterList.filter(v => v.status == 1).length / videoCenterList.length) * 100).toFixed(0) : '100'
}%</p>
<div style={{ width: "100%", height: "10%", position: "relative" }}>
<img src='/assets/images/leadership/head.png' style={{ width: "15%", marginLeft: "5%" }} />
<div className='wy-rightTop' style={{ position: "absolute", right: "5%", top: "130%" }}> {/* <div className='wy-rightTop' style={{ position: "absolute", right: "5%", top: "130%" }}>
<Select <Select
size={size} size={size}
defaultValue="选择路段" defaultValue="选择路段"
onChange={handleChange} onChange={handleChange}
style={{ style={{
width: 100, width: 100,
fontSize: "12px", fontSize: "12px",
color: "#D8F0FF", color: "#D8F0FF",
}} }}
> >
{children} {children}
</Select> </Select>
<div>{size}</div> <div>{size}</div>
</div> */}
</div> </div>
<div style={{ width: "100%", height: "90%", position: "relative", top: "10%" }}>
<Huadong />
</div>
</div>
<div style={{ width: "100%", height: "35%" }}>
<div style={{ width: "100%", height: "40px"/* , backgroundColor: "#fff" */, position: "relative" }}>
{/* <p>{title || ''}</p> */}
<img src='/assets/images/quanju/icon.png' style={{ width: "24px", position: "absolute", left: "20px", top: "18%" }} />
<span style={{ position: "absolute", color: "#FFFFFF", fontSize: "24px", fontFamily: "YouSheBiaoTiHei", left: "50px" }}>离线详情</span>
<img src='/assets/images/leadership/zibiaoti.png' style={{ width: "94%", height: "34px", position: "absolute", top: "8px", left: "35px" }} />
</div>
<Spin tip="Loading..." spinning={num ? true : false} style={{ width: "100%", height: "100%" }}>
<Lunbo
// canScroll={true}
content={renderBody()}
containerStyle={{ position: "relative", height: "100%", width: "90%", left: "5%", top: "5%" }}
divHeight={"100%"}
divId={"screen-slope"}
/>
</Spin>
</div>
</div> </Module>
<div style={{ width: "100%", height: "80%", position: "relative", top: "10%" }}>
<Huadong />
</div>
</div>
<div style={{ width: "100%", height: "35%" }}>
<div style={{ width: "100%", height: "40px"/* , backgroundColor: "#fff" */, position: "relative" }}>
{/* <p>{title || ''}</p> */}
<img src='/assets/images/quanju/icon.png' style={{ width: "24px", position: "absolute", left: "20px", top: "18%" }} />
<span style={{ position: "absolute", color: "#FFFFFF", fontSize: "24px", fontFamily: "YouSheBiaoTiHei", left: "50px" }}>离线详情</span>
<img src='/assets/images/leadership/zibiaoti.png' style={{ width: "94%", height: "34px", position: "absolute", top: "8px", left: "35px" }} />
</div>
<Spin tip="Loading..." spinning={num ? true : false} style={{ width: "100%", height: "100%" }}>
<Lunbo
// canScroll={true}
content={renderBody()}
containerStyle={{ position: "relative", height: "100%", width: "90%", left: "5%", top: "5%" }}
divHeight={"100%"}
divId={"screen-slope"}
/>
</Spin>
</div>
</Module> </>
)
}
function mapStateToProps (state) {
const { videoCenterList } = state
</> return {
) videoCenterList: videoCenterList.data || []
}
} }
export default Righttop export default connect(mapStateToProps)(Righttop)

4
web/package.json

@ -6,11 +6,7 @@
"scripts": { "scripts": {
"test": "mocha", "test": "mocha",
"start": "cross-env NODE_ENV=development npm run start-params", "start": "cross-env NODE_ENV=development npm run start-params",
<<<<<<< Updated upstream
"start-params": "node server -p 5000 -u http://localhost:13400 --qndmn http://rfkimpwbb.hn-bkt.clouddn.com --vcmpWebUrl https://mediaconsole.ngaiot.com --vcmpMirrorId 24461524032354", "start-params": "node server -p 5000 -u http://localhost:13400 --qndmn http://rfkimpwbb.hn-bkt.clouddn.com --vcmpWebUrl https://mediaconsole.ngaiot.com --vcmpMirrorId 24461524032354",
=======
"start-params": "node server -p 5000 -u http://localhost:13401 --qndmn http://rfkimpwbb.hn-bkt.clouddn.com",
>>>>>>> Stashed changes
"deploy": "export NODE_ENV=production&&npm run color && npm run build && node server", "deploy": "export NODE_ENV=production&&npm run color && npm run build && node server",
"build-dev": "export NODE_ENV=development&&webpack --config webpack.config.js", "build-dev": "export NODE_ENV=development&&webpack --config webpack.config.js",
"build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js", "build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js",

Loading…
Cancel
Save