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 NoResource from './no-resource';
import LimitTextArea from './limit-textarea';
import ProcessForm from './process_form'
import FlowRecordTable from './flowRecordTable'
import Table from './table'
import Search from './search'
@ -16,7 +15,6 @@ export {
Upload,
NoResource,
LimitTextArea,
ProcessForm,
FlowRecordTable,
Table,
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%" }}>
<img src='/assets/images/leadership/beijinglan.png' style={{ width: "100%", height: "100%" }} />
<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 style={{ position: "absolute", top: "0", width: "50%", left: "50%", paddingRight: "10px" }}>
<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 Lunbo from "../right/lunbo"
import { connect } from 'react-redux'
import { YSIframePlayer } from '../../../../../../components'
// import "./left.less"
const Leftcenter = ({ videoCenterList }) => {
console.log(videoCenterList);
const style = { height: "30%", marginTop: "5%" }
// const hualun = "auto"
const [num, setNum] = useState(1);
@ -31,10 +31,10 @@ const Leftcenter = ({ videoCenterList }) => {
const timer = setInterval(() => {
if (num == list.length) {
setNum(1);
setTu(list[0].img);
// setTu(list[0].img);
} else {
setNum(num + 1);
setTu(list[num].img);
// setTu(list[num].img);
}
}, 2000 * 10);
return () => clearInterval(timer);
@ -77,10 +77,24 @@ const Leftcenter = ({ videoCenterList }) => {
<div style={{ width: "60%", height: "100%", float: "left", marginLeft: "1%" }}>
{
list.map((item, index) => {
console.log(item);
return index + 1 == num ?
<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={{
width: "100%", height: "3vh", position: "absolute", bottom: "3%",
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 './left.less';
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;
}
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 = {
shuzu: [
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
],
imgs: [],
showIndex: 0, //显示第几个图片
timer: null, // 定时器
show: false, // 前后按钮显示
// arr1: ""
}
// console.log(this.state.imgs);
this.state.imgs = this.chunk((this.state.shuzu), 4)
}
constructor() {
super();
this.state = {
shuzu: [
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
],
imgs: [],
showIndex: 0, //显示第几个图片
timer: null, // 定时器
show: false, // 前后按钮显示
// arr1: ""
}
// console.log(this.state.imgs);
this.state.imgs = this.chunk((this.state.shuzu), 4)
}
render () {
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}
>
<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: "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[0]?.name}
</div>
</div>
render () {
console.log(this.props);
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}
>
<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: "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[0]?.name}
</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%" }}>
<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[1]?.name}
</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%" }}>
<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[2]?.name}
</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%" }}>
<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[3]?.name}
</div>
</div>
</div> : ""}
{/* <div>{value[1].name}</div>
</div>
{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: "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[1]?.name}
</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%" }}>
<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[2]?.name}
</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%" }}>
<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[3]?.name}
</div>
</div>
</div> : ""}
{/* <div>{value[1].name}</div>
<div>{value[2].name}</div>
<div>{value[3].name}</div> */}
</li>
)
})
}
</ul>
{/* <ul className="dots" style={{ width: this.state.imgs.length * 20 + 'px' }}>
</li>
)
})
}
</ul>
{/* <ul className="dots" style={{ width: this.state.imgs.length * 20 + 'px' }}>
{
this.state.imgs.map((value, index) => {
return (
@ -115,68 +116,71 @@ class ReactCarousel extends Component {
}
</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 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>
</div>
)
}
componentDidMount () { //一开始自动播放
this.start();
}
)
}
componentDidMount () { //一开始自动播放
if(this.props.shuzu)
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
})
}
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
})
}
}
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 { Radio, Select, Spin } from 'antd';
import Lunbo from "./lunbo"
import Huadong from './hudong';
import Huadong from './hudongVideo';
import { connect } from 'react-redux'
import "./left.less"
const Righttop = () => {
const { Option } = Select;
const style = { height: "68%" }
const children = [];
const [size, setSize] = useState('454544545');
const [num, setNum] = useState();
const [tu, setTu] = useState("");
const [name, setName] = useState("");
const handleChange = (value) => {
// console.log(`Selected: ${value}`);
setSize(value)
};
const Righttop = ({ videoCenterList }) => {
const { Option } = Select;
const style = { height: "68%" }
const children = [];
const [size, setSize] = useState('454544545');
const [num, setNum] = useState();
const [tu, setTu] = useState("");
const [name, setName] = useState("");
const handleChange = (value) => {
// console.log(`Selected: ${value}`);
setSize(value)
};
const [list, setList] = useState([
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
])
for (let i = 0; i < list.length; i++) {
children.push(<Option key={i.toString(36) + i}>{list[i].name}</Option>);
}
const [list, setList] = useState([
// { name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
// { name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
// { name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
// { name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
// { name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
// { name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
// { name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
// { name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
// { name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
// { name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
])
// for (let i = 0; i < list.length; i++) {
// children.push(<Option key={i.toString(36) + i}>{list[i].name}</Option>);
// }
// useEffect(() => {
// const timer = setInterval(() => {
// if (num == 12) {
// setNum(1);
// setTu(list[0].img);
// } else {
// setNum(num + 1);
// setTu(list[num].img);
// }
// }, 6000);
// return () => clearInterval(timer);
// }, [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%" }} /> : ""}
// useEffect(() => {
// const timer = setInterval(() => {
// if (num == 12) {
// setNum(1);
// setTu(list[0].img);
// } else {
// setNum(num + 1);
// setTu(list[num].img);
// }
// }, 6000);
// return () => clearInterval(timer);
// }, [num]);
<p style={{ position: "absolute", left: "5%", color: num == index ? "#FFFFFF" : "rgba(216,240,255,0.8)" }} >{item.name}</p>
<p style={{ position: "absolute", right: "5%", color: num == index ? "#FFFFFF" : "rgba(216,240,255,0.8)" }}>{item.name}</p>
</li>
</div>
</div>
)
useEffect(() => {
if (videoCenterList.length) {
setList(videoCenterList.slice(-4))
}
}, [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%" }} /> : ""} */}
})
}
</div >
)
}
return (
<>
<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>
</li>
</div>
</div>
)
}) : ''
}
</div >
)
}
return (
<>
<Module style={style} title={"路面执法监控"}>
<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: "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>
<div style={{ width: "100%", height: "10%", position: "relative" }}>
<img src='/assets/images/leadership/head.png' style={{ width: "15%", marginLeft: "5%" }} />
<Module style={style} title={"路面执法监控"}>
<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" }}>{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" }}>
{
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%" }}>
<Select
size={size}
defaultValue="选择路段"
onChange={handleChange}
style={{
width: 100,
fontSize: "12px",
color: "#D8F0FF",
}}
>
{children}
</Select>
<div>{size}</div>
{/* <div className='wy-rightTop' style={{ position: "absolute", right: "5%", top: "130%" }}>
<Select
size={size}
defaultValue="选择路段"
onChange={handleChange}
style={{
width: 100,
fontSize: "12px",
color: "#D8F0FF",
}}
>
{children}
</Select>
<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>
<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>
</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": {
"test": "mocha",
"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:13401 --qndmn http://rfkimpwbb.hn-bkt.clouddn.com",
>>>>>>> Stashed changes
"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": "export NODE_ENV=production&&webpack --config webpack.config.prod.js",

Loading…
Cancel
Save