Browse Source

视频

release_1.3.0
wenlele 2 years ago
parent
commit
a38accd952
  1. 945
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx
  2. 8
      code/VideoAccess-VCMP/web/client/src/sections/journaling/containers/journalingCenter.jsx
  3. 27
      code/VideoAccess-VCMP/web/client/src/sections/openness/components/container.jsx
  4. 5
      code/VideoAccess-VCMP/web/client/src/sections/openness/components/videoCard.jsx
  5. 253
      code/VideoAccess-VCMP/web/client/src/sections/openness/components/videoScreen.jsx
  6. 1
      code/VideoAccess-VCMP/web/client/src/sections/openness/components/videoScreen.less
  7. 848
      code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx
  8. 1
      code/VideoAccess-VCMP/web/client/src/utils/webapi.js

945
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx

@ -8,7 +8,7 @@ import { Button, ToastFactory, } from '@douyinfe/semi-ui';
import VideoHeader from './voiceHeader' import VideoHeader from './voiceHeader'
import VideoOperation from './videoOperation' import VideoOperation from './videoOperation'
import './videoPlay.less'; import './videoPlay.less';
import EZUIKit from 'ezuikit-js' import EZUIKit, { log } from 'ezuikit-js'
import { done } from "nprogress"; import { done } from "nprogress";
const timeFormat = 'YYYY-MM-DD HH:mm:ss' const timeFormat = 'YYYY-MM-DD HH:mm:ss'
@ -18,492 +18,493 @@ const yingshiOpenSoundKey = 'openSound'
const VideoPlay = ({ const VideoPlay = ({
height, width, containerId = 'myPlayer', height, width, containerId = 'myPlayer',
// playUrl, // playUrl,
name, name,
global, global,
videoStyle, videoStyle,
changeData, changeData,
videoObj, videoObj,
sizeWh, sizeWh,
slideDown, // slideDown, //
IsSize, //16:9 IsSize, //16:9
// videoObj = { // videoObj = {
// type: 'yingshi', // type: 'yingshi',
// audio: false, // audio: false,
// serialNo: 'G75922040', // // serialNo: 'G75922040', //
// channelNo: 1, // // channelNo: 1, //
// yingshiToken: 'at.6nn6duwz8g8gbd919as9a6ea82bmn31x-709fnp7s3k-13q3v7e-mlov7lysf', // // yingshiToken: 'at.6nn6duwz8g8gbd919as9a6ea82bmn31x-709fnp7s3k-13q3v7e-mlov7lysf', //
// playUrlSd: 'ezopen://open.ys7.com/G75922040/1.live', // // playUrlSd: 'ezopen://open.ys7.com/G75922040/1.live', //
// // playUrl: 'ws://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000003', // // playUrl: 'ws://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000003',
// playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live', // playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live',
// replayUrl: 'ezopen://open.ys7.com/G75922040/1.hd.local.rec', // replayUrl: 'ezopen://open.ys7.com/G75922040/1.hd.local.rec',
// }, // },
// videoObj = { // videoObj = {
// type: 'yingshi', // type: 'yingshi',
// audio: false, // audio: false,
// serialNo: 'G56385051', // // serialNo: 'G56385051', //
// channelNo: 1, // // channelNo: 1, //
// yingshiToken: 'at.6nn6duwz8g8gbd919as9a6ea82bmn31x-709fnp7s3k-13q3v7e-mlov7lysf', // // yingshiToken: 'at.6nn6duwz8g8gbd919as9a6ea82bmn31x-709fnp7s3k-13q3v7e-mlov7lysf', //
// playUrlSd: 'ezopen://open.ys7.com/G56384814/1.live', // // playUrlSd: 'ezopen://open.ys7.com/G56384814/1.live', //
// // playUrl: 'ws://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000003', // // playUrl: 'ws://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000003',
// playUrlHd: 'ezopen://open.ys7.com/G56384814/1.hd.live', // playUrlHd: 'ezopen://open.ys7.com/G56384814/1.hd.live',
// replayUrl: 'ezopen://open.ys7.com/G56384814/1.hd.local.rec', // replayUrl: 'ezopen://open.ys7.com/G56384814/1.hd.local.rec',
// }, // },
// videoObj = { // videoObj = {
// type: 'cascade', // type: 'cascade',
// audio: false, // audio: false,
// serialNo: '34020000001310000001', // // serialNo: '34020000001310000001', //
// topSerialNo: '34020000001110000077', // // topSerialNo: '34020000001110000077', //
// playUrlSd: 'http://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000001', // // playUrlSd: 'http://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000001', //
// // playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live', // // playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live',
// // replayUrl: 'ezopen://open.ys7.com/G75922040/1.rec', // // replayUrl: 'ezopen://open.ys7.com/G75922040/1.rec',
// }, // },
// //
iotVideoServer, iotVideoServer,
local, // local, //
}) => { }) => {
console.log(videoObj); // console.log(sizeWh,videoObj);
if (videoObj.type == 'yingshi') { if (videoObj.type == 'yingshi') {
videoObj = { videoObj = {
...videoObj, ...videoObj,
playUrlSd: `ezopen://open.ys7.com/${videoObj.serialNo}/${videoObj.channelNo || '1'}.live`, playUrlSd: `ezopen://open.ys7.com/${videoObj.serialNo}/${videoObj.channelNo || '1'}.live`,
playUrlHd: `ezopen://open.ys7.com/${videoObj.serialNo}/${videoObj.channelNo || '1'}.hd.live`, playUrlHd: `ezopen://open.ys7.com/${videoObj.serialNo}/${videoObj.channelNo || '1'}.hd.live`,
replayUrl: `ezopen://open.ys7.com/${videoObj.serialNo}/${videoObj.channelNo || '1'}.hd.local.rec`, replayUrl: `ezopen://open.ys7.com/${videoObj.serialNo}/${videoObj.channelNo || '1'}.hd.local.rec`,
} }
} }
const [jessibuca, setjessibuca] = useState(null) const [jessibuca, setjessibuca] = useState(null)
const [player, setPlayer] = useState(null) const [player, setPlayer] = useState(null)
const [isPlaying, setIsPlaying] = useState(false) const [isPlaying, setIsPlaying] = useState(false)
const [operationState, setoperationState] = useState() const [operationState, setoperationState] = useState()
const [voiceDisY, setVoiceDisY] = useState(0) const [voiceDisY, setVoiceDisY] = useState(0)
const [processDisX, setProcessDisX] = useState(0) const [processDisX, setProcessDisX] = useState(0)
const [isAdjustProcess, setIsAdjustProcess] = useState(false) const [isAdjustProcess, setIsAdjustProcess] = useState(false)
const [histroyTime, setHistroyTime] = useState([]) const [histroyTime, setHistroyTime] = useState([])
const [histroyBegain, setHistroyBegain] = useState() const [histroyBegain, setHistroyBegain] = useState()
const [roll, setRoll] = useState()// const [roll, setRoll] = useState()//
const [photo, setPhoto] = useState(1)// const [photo, setPhoto] = useState(1)//
const [size, setSize] = useState({ parentWidth: sizeWh?.parentWidth, parentHeight: sizeWh?.parentHeight, width: width || sizeWh?.parentWidth, height: height || sizeWh?.parentHeight }) // const [size, setSize] = useState({ parentWidth: sizeWh?.parentWidth, parentHeight: sizeWh?.parentHeight, width: width || sizeWh?.parentWidth, height: height || sizeWh?.parentHeight }) //
const [resolution, setResolution] = useState('sd') // sd hd const [resolution, setResolution] = useState('sd') // sd hd
const [videoMask, setVideoMask] = useState(true) // sd hd const [videoMask, setVideoMask] = useState(true) // sd hd
// ifream // ifream
const [yingshiPrepare, setYingshiPrepare] = useState('') const [yingshiPrepare, setYingshiPrepare] = useState('')
const operationRef = useRef(null) const operationRef = useRef(null)
const Begain = useRef() const Begain = useRef()
const playBackTime = useRef([]) const playBackTime = useRef([])
const quanp = useRef() const quanp = useRef()
const processChangeTimeoutRef = useRef(null) const processChangeTimeoutRef = useRef(null)
// ifream // ifream
const yingshiPrepareRef = useRef(null) const yingshiPrepareRef = useRef(null)
const playState = useRef(false) // const playState = useRef(false) //
const player_ = useRef(null) const player_ = useRef(null)
useEffect(() => { useEffect(() => {
setRoll(false) setRoll(false)
}, [resolution]); }, [resolution]);
useEffect(() => { useEffect(() => {
setResolution(changeData?.hdChecked ? 'hd' : 'sd') setResolution(changeData?.hdChecked ? 'hd' : 'sd')
if (player) { if (player) {
player.stop().then(() => { player.stop().then(() => {
player.play({ url: changeData?.hdChecked ? videoObj.playUrlHd : videoObj.playUrlSd }) player.play({ url: changeData?.hdChecked ? videoObj.playUrlHd : videoObj.playUrlSd })
}) })
} }
}, [changeData?.hdChecked]) }, [changeData?.hdChecked])
const changeSelectState = (key) => { const changeSelectState = (key) => {
// if (videoObj.type == 'yingshi' && yingshiPrepareRef.current) { // if (videoObj.type == 'yingshi' && yingshiPrepareRef.current) {
// return // return
// } // }
const nextOperationState = JSON.parse(JSON.stringify(operationRef.current)) const nextOperationState = JSON.parse(JSON.stringify(operationRef.current))
if (key == 'histroy' && nextOperationState.histroy.select) { if (key == 'histroy' && nextOperationState.histroy.select) {
// //
setProcessDisX(0) setProcessDisX(0)
setHistroyTime([]) setHistroyTime([])
playBackTime.current = [] playBackTime.current = []
} }
for (let k in nextOperationState) { for (let k in nextOperationState) {
if (k == key) { if (k == key) {
nextOperationState[k].select = !nextOperationState[k].select nextOperationState[k].select = !nextOperationState[k].select
} else if (k !== 'fullScreen') { } else if (k !== 'fullScreen') {
nextOperationState[k].select = false nextOperationState[k].select = false
}
}
operationRef.current = nextOperationState
if (operationRef.current.histroy.select && histroyTime.length == 0) {
setHistroyTime([moment().subtract(72, 'hours').format(timeFormat), moment().format(timeFormat)])
playBackTime.current = [moment().subtract(72, 'hours').format(timeFormat), moment().format(timeFormat)]
}
setoperationState(nextOperationState)
}
//
const operation = [{
key: 'control',
click: () => {
changeSelectState('control')
}
}, {
key: 'talk',
hide: !(videoObj.type == 'yingshi'),
click: (e) => {
console.log(e);
changeSelectState('talk')
}
}, {
key: 'fullScreen',
click: () => {
changeSelectState('fullScreen')
let videoplay = document.getElementById('vcmp_videoplay')
if (screenfull.isEnabled) {
screenfull.toggle(videoplay);
if (videoObj?.type == 'yingshi' && player) {
if (operationRef.current?.fullScreen.select) {
console.log(5515);
player.reSize(screen.width, screen.height);
} else {
console.log(5515);
player.reSize(size?.width, size?.height);
}
} }
}
operationRef.current = nextOperationState
if (operationRef.current.histroy.select && histroyTime.length == 0) {
setHistroyTime([moment().subtract(72, 'hours').format(timeFormat), moment().format(timeFormat)])
playBackTime.current = [moment().subtract(72, 'hours').format(timeFormat), moment().format(timeFormat)]
}
setoperationState(nextOperationState)
}
//
const operation = [{
key: 'control',
click: () => {
changeSelectState('control')
}
}, {
key: 'talk',
hide: !(videoObj.type == 'yingshi'),
click: (e) => {
console.log(e);
changeSelectState('talk')
}
}, {
key: 'fullScreen',
click: () => {
changeSelectState('fullScreen')
let videoplay = document.getElementById('vcmp_videoplay')
if (screenfull.isEnabled) {
screenfull.toggle(videoplay);
if (videoObj?.type == 'yingshi') {
console.log(operationRef.current);
if (operationRef.current?.fullScreen.select) {
player.reSize(screen.width, screen.height);
} else {
player.reSize(size?.width, size?.height);
}
}
}
}
}, {
key: 'histroy',
hide: !Boolean(videoObj.replayUrl),
click: () => {
changeSelectState('histroy')
player.stop().then(() => {
if (operationRef.current?.histroy?.select && Begain.current) {
player.play({ url: `${videoObj.replayUrl}?begin=${moment(Begain.current).format("YYYYMMDDHHmmss")}&end=${moment(playBackTime.current[1]).format("YYYYMMDDHHmmss")}` })
}
playState.current = false
})
}
},]
// useEffect(() => {
// createPlay()
// }, [quanp.current])
useEffect(() => {
createPlay()
let nextOperationState = {}
for (let p of operation) {
nextOperationState[p.key] = {
select: false
}
}
setoperationState(nextOperationState)
operationRef.current = nextOperationState
//
screenfull.on('change', () => {
if (screenfull.isFullscreen && operationRef.current && !operationRef.current['fullScreen'].select) {
changeSelectState('fullScreen')
}
if (!screenfull.isFullscreen && operationRef.current && operationRef.current['fullScreen'].select) {
changeSelectState('fullScreen')
}
});
// const resize_ = () => {
// const VideoLocal = document.getElementById('vcmp_videoplay')
// setSize({ parentWidth: VideoLocal?.clientWidth, parentHeight: VideoLocal?.clientHeight, width: VideoLocal?.clientWidth, height: VideoLocal?.clientHeight })
// }
// if (local) {
// window.addEventListener('resize', resize_); //
// }
return () => {
console.log(854453453);
if (jessibuca) {
jessibuca.destroy()
}
if (player && videoObj.type == 'yingshi') {
console.log(854453453);
player.stop()
}
// if (local) {
// window.removeEventListener('resize', resize_);
// }
}
}, [])
useEffect(() => {
if (histroyTime.length) {
setHistroyBegain(histroyTime[0])
Begain.current = histroyTime[0]
document.getElementById('process_point').style.left = 0 + 'px'; //
if (videoObj.type == 'yingshi') {
// yingshiPrepareRef.current = 'play'
// setYingshiPrepare('play')
}
} else {
setHistroyBegain(null)
Begain.current == null
}
}, [histroyTime])
useEffect(() => {
if (operationState && operationState.histroy.select) {
if (isAdjustProcess) {
//
if (processChangeTimeoutRef.current) {
clearTimeout(processChangeTimeoutRef.current)
} }
} processChangeTimeoutRef.current = setTimeout(() => {
}, { setHistroyBegain(
key: 'histroy', moment(histroyTime[0])
hide: !Boolean(videoObj.replayUrl), .add(
click: () => { Math.abs(moment(histroyTime[0]).diff(moment(histroyTime[1]), 'seconds')) * (processDisX / document.getElementById('process_point').parentElement.offsetWidth),
changeSelectState('histroy') 'second'
)
.format(timeFormat)
)
Begain.current = moment(histroyTime[0])
.add(
Math.abs(moment(histroyTime[0]).diff(moment(histroyTime[1]), 'seconds')) * (processDisX / document.getElementById('process_point').parentElement.offsetWidth),
'second'
)
.format(timeFormat)
if (videoObj.type == 'yingshi') {
// yingshiPrepareRef.current = 'play'
// setYingshiPrepare('play')
}
}, 300)
player.stop().then(() => { player.stop().then(() => {
if (operationRef.current?.histroy?.select && Begain.current) { player.play({ url: `${videoObj.replayUrl}?begin=${moment(Begain.current).format("YYYYMMDDHHmmss")}&end=${moment(playBackTime.current[1]).format("YYYYMMDDHHmmss")}` })
player.play({ url: `${videoObj.replayUrl}?begin=${moment(Begain.current).format("YYYYMMDDHHmmss")}&end=${moment(playBackTime.current[1]).format("YYYYMMDDHHmmss")}` }) playState.current = false
}
playState.current = false
}) })
} } else {
},] //
document.getElementById('process_point').style.left = processDisX - 4.5 + 'px'
// useEffect(() => { }
// createPlay() }
// }, [quanp.current]) }, [processDisX])
useEffect(() => { const createPlay = async () => {
createPlay() if (videoObj.type != 'yingshi') {
let nextOperationState = {} try {
for (let p of operation) { // const inviteRes = await IotVideoServerRequest.get(VideoServeApi.invite, {
nextOperationState[p.key] = { // id: '36011200002002021114',
select: false // channel: '36011200581314002900'
} // }).then(res => {
} // console.log(res);
setoperationState(nextOperationState) // }, err => {.
operationRef.current = nextOperationState // console.log(err);
// })
// console.log(videoObj);
screenfull.on('change', () => { const inviteRes_ = await request.get(`${iotVideoServer}/api/gb28181/invite?id=${videoObj.topSerialNo}&channel=${videoObj.serialNo}`)
if (screenfull.isFullscreen && operationRef.current && !operationRef.current['fullScreen'].select) { } catch (error) {
changeSelectState('fullScreen') console.log(error.response);
} }
if (!screenfull.isFullscreen && operationRef.current && operationRef.current['fullScreen'].select) {
changeSelectState('fullScreen')
} let $container = document.getElementById(containerId);
}); const jessibuca = new window.Jessibuca({
// const resize_ = () => { container: $container,
// const VideoLocal = document.getElementById('vcmp_videoplay') videoBuffer: 0.2, //
// setSize({ parentWidth: VideoLocal?.clientWidth, parentHeight: VideoLocal?.clientHeight, width: VideoLocal?.clientWidth, height: VideoLocal?.clientHeight }) isResize: false,
text: "",
// } loadingText: "加载中",
// if (local) { debug: true,
// window.addEventListener('resize', resize_); // showBandwidth: false, //
// } operateBtns: {
return () => { fullscreen: true,
if (jessibuca) { screenshot: false,
jessibuca.destroy() play: false,
} audio: false,
if (player && videoObj.type == 'yingshi' && player) { },
console.log(11111111111); forceNoOffscreen: false,
player.stop() isNotMute: false,
} });
// if (local) { setjessibuca(jessibuca)
// window.removeEventListener('resize', resize_); play({ jessibuca })
// } } else {
} const player = new EZUIKit.EZUIKitPlayer({
}, []) id: containerId, // ID
accessToken: videoObj?.yingshiToken,
useEffect(() => { url: videoObj.playUrlSd,
if (histroyTime.length) { width: setupSize('width'),
setHistroyBegain(histroyTime[0]) height: setupSize('height'),
Begain.current = histroyTime[0] handleSuccess: () => { //
document.getElementById('process_point').style.left = 0 + 'px'; // setRoll(true)
if (videoObj.type == 'yingshi') { setVideoMask(false)
// yingshiPrepareRef.current = 'play' playState.current = true
// setYingshiPrepare('play') },
} handleError: (e) => { //
} else { console.log(e, '播放失败');
setHistroyBegain(null) },
Begain.current == null })
} setPlayer(player)
}, [histroyTime]) }
useEffect(() => { }
if (operationState && operationState.histroy.select) {
if (isAdjustProcess) { const play = (params) => {
// if (videoObj.type == 'yingshi') {
if (processChangeTimeoutRef.current) {
clearTimeout(processChangeTimeoutRef.current) } else if ((params.jessibuca || jessibuca) && videoObj.playUrlSd) {
} const jes = params.jessibuca || jessibuca
processChangeTimeoutRef.current = setTimeout(() => { jes.play(videoObj.playUrlSd);
setHistroyBegain( setIsPlaying(true)
moment(histroyTime[0]) }
.add( }
Math.abs(moment(histroyTime[0]).diff(moment(histroyTime[1]), 'seconds')) * (processDisX / document.getElementById('process_point').parentElement.offsetWidth),
'second' const pause = () => {
) if (videoObj.type == 'yingshi' && player) {
.format(timeFormat) 5
) } else if (jessibuca) {
Begain.current = moment(histroyTime[0]) jessibuca.pause();
.add( setIsPlaying(false)
Math.abs(moment(histroyTime[0]).diff(moment(histroyTime[1]), 'seconds')) * (processDisX / document.getElementById('process_point').parentElement.offsetWidth), }
'second' }
)
.format(timeFormat) const closeSound = () => {
if (videoObj.type == 'yingshi') { if (videoObj.type == 'yingshi') {
// yingshiPrepareRef.current = 'play' yingshiPrepareRef.current = yingshiCloseSoundKey
// setYingshiPrepare('play') setYingshiPrepare(yingshiCloseSoundKey)
} // yingshiOperation(yingshiCloseSoundKey)
}, 300) }
player.stop().then(() => { }
player.play({ url: `${videoObj.replayUrl}?begin=${moment(Begain.current).format("YYYYMMDDHHmmss")}&end=${moment(playBackTime.current[1]).format("YYYYMMDDHHmmss")}` })
playState.current = false const openSound = () => {
}) if (videoObj.type == 'yingshi') {
yingshiPrepareRef.current = yingshiOpenSoundKey
setYingshiPrepare(yingshiOpenSoundKey)
// yingshiOperation(yingshiOpenSoundKey)
}
}
const setupSize = (data) => {
if (!operationRef.current?.fullScreen.select) {
let containerWidth = sizeWh?.parentWidth //
let containerHeight = sizeWh?.parentHeight
let videoWidth = width || sizeWh?.width
let videoHeight = height || sizeWh?.height
if (IsSize == 'true') {
if (containerWidth >= videoWidth && containerHeight >= videoHeight) {
if (videoHeight / videoWidth >= 0.55 && videoHeight / videoWidth <= 0.57) {
} else {
console.warn('宽高不符合尺寸要求,故返回合适的尺寸')
if (videoWidth / 16 > videoHeight / 9) {
videoWidth = (videoHeight / 9) * 16
} else {
videoHeight = (videoWidth / 16) * 9
}
}
} else { } else {
// console.warn('传递宽高参数有误,请确认容器大小范围内')
document.getElementById('process_point').style.left = processDisX - 4.5 + 'px' if (containerWidth / 16 > containerHeight / 9) {
} videoWidth = (containerHeight / 9) * 16
} } else {
}, [processDisX]) videoHeight = (containerWidth / 16) * 9
}
const createPlay = async () => {
if (videoObj.type != 'yingshi') {
try {
// const inviteRes = await IotVideoServerRequest.get(VideoServeApi.invite, {
// id: '36011200002002021114',
// channel: '36011200581314002900'
// }).then(res => {
// console.log(res);
// }, err => {.
// console.log(err);
// })
console.log(videoObj);
const inviteRes_ = await request.get(`${iotVideoServer}/api/gb28181/invite?id=${videoObj.topSerialNo}&channel=${videoObj.serialNo}`)
} catch (error) {
console.log(error.response);
} }
if (videoObj.type == 'yingshi' && player) {
let $container = document.getElementById(containerId); player.reSize(videoWidth, videoHeight)
const jessibuca = new window.Jessibuca({
container: $container,
videoBuffer: 0.2, //
isResize: false,
text: "",
loadingText: "加载中",
debug: true,
showBandwidth: false, //
operateBtns: {
fullscreen: true,
screenshot: false,
play: false,
audio: false,
},
forceNoOffscreen: false,
isNotMute: false,
});
setjessibuca(jessibuca)
play({ jessibuca })
} else {
const player = new EZUIKit.EZUIKitPlayer({
id: containerId, // ID
accessToken: videoObj?.yingshiToken,
url: videoObj.playUrlSd,
width: setupSize('width'),
height: setupSize('height'),
handleSuccess: () => { //
setRoll(true)
setVideoMask(false)
playState.current = true
},
handleError: (e) => { //
console.log(e, '播放失败');
},
})
setPlayer(player)
player_.current = player
}
}
const play = (params) => {
if (videoObj.type == 'yingshi') {
} else if ((params.jessibuca || jessibuca) && videoObj.playUrlSd) {
const jes = params.jessibuca || jessibuca
jes.play(videoObj.playUrlSd);
setIsPlaying(true)
}
}
const pause = () => {
if (videoObj.type == 'yingshi' && player) {
5
} else if (jessibuca) {
jessibuca.pause();
setIsPlaying(false)
}
}
const closeSound = () => {
if (videoObj.type == 'yingshi') {
yingshiPrepareRef.current = yingshiCloseSoundKey
setYingshiPrepare(yingshiCloseSoundKey)
// yingshiOperation(yingshiCloseSoundKey)
}
}
const openSound = () => {
if (videoObj.type == 'yingshi') {
yingshiPrepareRef.current = yingshiOpenSoundKey
setYingshiPrepare(yingshiOpenSoundKey)
// yingshiOperation(yingshiOpenSoundKey)
}
}
const setupSize = (data) => {
if (!operationRef.current?.fullScreen.select) {
let containerWidth = sizeWh?.parentWidth //
let containerHeight = sizeWh?.parentHeight
let videoWidth = width || sizeWh?.width
let videoHeight = height || sizeWh?.height
if (IsSize == 'true') {
if (containerWidth >= videoWidth && containerHeight >= videoHeight) {
if (videoHeight / videoWidth >= 0.55 && videoHeight / videoWidth <= 0.57) {
} else {
console.warn('宽高不符合尺寸要求,故返回合适的尺寸')
if (videoWidth / 16 > videoHeight / 9) {
videoWidth = (videoHeight / 9) * 16
} else {
videoHeight = (videoWidth / 16) * 9
}
}
} else {
console.warn('传递宽高参数有误,请确认容器大小范围内')
if (containerWidth / 16 > containerHeight / 9) {
videoWidth = (containerHeight / 9) * 16
} else {
videoHeight = (containerWidth / 16) * 9
}
}
if (videoObj.type == 'yingshi' && player) {
player.reSize(videoWidth, videoHeight)
}
} else {
if (videoObj.type == 'yingshi' && player) {
player.reSize(width || sizeWh?.parentWidth, height || sizeWh?.parentHeight)
}
} }
setSize({ parentWidth: containerWidth, parentHeight: containerHeight, width: videoWidth, height: videoHeight }) } else {
return data == 'width' ? videoWidth : data == 'height' ? videoHeight : '' if (videoObj.type == 'yingshi' && player?.pluginStatus) {
} player.reSize(width || sizeWh?.parentWidth, height || sizeWh?.parentHeight)
} }
}
useEffect(() => { setSize({ parentWidth: containerWidth, parentHeight: containerHeight, width: videoWidth, height: videoHeight })
setupSize() return data == 'width' ? videoWidth : data == 'height' ? videoHeight : ''
}, [sizeWh]) }
}
return ( useEffect(() => {
<> setupSize()
<div className="vcmp_videoplay" style={{ width: size?.parentWidth || '100%', height: size?.parentHeight || '100%', backgroundColor: 'black', overflow: 'hidden', display: 'flex', alignItems: 'center', justifyContent: 'center', }}> }, [sizeWh])
<div id="vcmp_videoplay" style={{ position: 'relative', height: size?.height || '100%', width: size?.width || '100%', minWidth: 240, minHeight: 135, overflow: 'hidden' }}>
{/* 顶部信息 */} return (
<VideoHeader <>
operationState={operationState} changeSelectState={changeSelectState} <div className="vcmp_videoplay" style={{ width: size?.parentWidth || '100%', height: size?.parentHeight || '100%', backgroundColor: 'black', overflow: 'hidden', display: 'flex', alignItems: 'center', justifyContent: 'center', }}>
histroyTime={histroyTime} <div id="vcmp_videoplay" style={{ position: 'relative', height: size?.height || '100%', width: size?.width || '100%', minWidth: 240, minHeight: 135, overflow: 'hidden' }}>
setoperationState={setoperationState} name={name} {/* 顶部信息 */}
roll={roll} <VideoHeader
videoObj={videoObj} operationState={operationState} changeSelectState={changeSelectState}
showTime={histroyBegain || moment()} histroyTime={histroyTime}
setProcessDisX={setProcessDisX} setoperationState={setoperationState} name={name}
content={videoObj.content} roll={roll}
videoStyle={videoStyle} videoObj={videoObj}
player={player} showTime={histroyBegain || moment()}
resolution={resolution} setProcessDisX={setProcessDisX}
playState={playState.current} content={videoObj.content}
/> videoStyle={videoStyle}
{/* 视频内容 */} player={player}
{ resolution={resolution}
// <iframe playState={playState.current}
// frameBorder="0" />
// allowFullScreen='true' {/* 视频内容 */}
// id={containerId} {
// src={ // <iframe
// `${yingshiUrl}?audio=${videoObj.audio && operationState && !operationState.histroy.select ? '1' : '0'}&url=${operationState && operationState.histroy.select && histroyBegain ? `${videoObj.replayUrl}?begin=${moment(histroyBegain).format("YYYYMMDDHHmmss")}&end=${moment(histroyTime[1]).format("YYYYMMDDHHmmss")}` : resolution == 'sd' ? videoObj.playUrlSd : videoObj.playUrlHd}&autoplay=${'1'}&accessToken=${videoObj.yingshiToken}` // frameBorder="0"
// } // allowFullScreen='true'
// // https://open.ys7.com/doc/zh/book/index/live_proto.html // id={containerId}
// // {width: 400px;height: 300px;} // src={
// width={'100%'} // `${yingshiUrl}?audio=${videoObj.audio && operationState && !operationState.histroy.select ? '1' : '0'}&url=${operationState && operationState.histroy.select && histroyBegain ? `${videoObj.replayUrl}?begin=${moment(histroyBegain).format("YYYYMMDDHHmmss")}&end=${moment(histroyTime[1]).format("YYYYMMDDHHmmss")}` : resolution == 'sd' ? videoObj.playUrlSd : videoObj.playUrlHd}&autoplay=${'1'}&accessToken=${videoObj.yingshiToken}`
// height={'100%'} // }
// wmode="transparent" // // https://open.ys7.com/doc/zh/book/index/live_proto.html
// style={{ pointerEvents: 'none' }} // // {width: 400px;height: 300px;}
// /> // width={'100%'}
} // height={'100%'}
<div id={containerId} style={{ height: '100%', width: '100%', }}></div> // wmode="transparent"
{videoMask ? <div style={{ height: size?.height || '100%', width: size?.width || '100%', minWidth: 400, minHeight: 225, overflow: 'hidden', position: 'absolute', top: '0', left: '0', zIndex: 99, backgroundColor: 'rgba(255,255,255,0.65)' }}></div> : ''} // style={{ pointerEvents: 'none' }}
// />
{/* 下方操作栏 */} }
{/* 显示操作功能条件(宽高) */} <div id={containerId} style={{ height: '100%', width: '100%', }}></div>
{size?.parentWidth > 320 ? {videoMask ? <div style={{ height: size?.height || '100%', width: size?.width || '100%', minWidth: 400, minHeight: 225, overflow: 'hidden', position: 'absolute', top: '0', left: '0', zIndex: 99, backgroundColor: 'rgba(255,255,255,0.65)' }}></div> : ''}
<VideoOperation
operationState={operationState} operation={operation} {/* 下方操作栏 */}
voiceDisY={voiceDisY} setVoiceDisY={setVoiceDisY} {/* 显示操作功能条件(宽高) */}
processDisX={processDisX} setProcessDisX={setProcessDisX} {size?.parentWidth > 320 ?
isAdjustProcess={isAdjustProcess} setIsAdjustProcess={setIsAdjustProcess} <VideoOperation
resolution={resolution} setResolution={setResolution} operationState={operationState} operation={operation}
histroyTime={histroyTime} setHistroyTime={setHistroyTime} voiceDisY={voiceDisY} setVoiceDisY={setVoiceDisY}
histroyBegain={histroyBegain} processDisX={processDisX} setProcessDisX={setProcessDisX}
play={play} pause={pause} closeSound={closeSound} openSound={openSound} isAdjustProcess={isAdjustProcess} setIsAdjustProcess={setIsAdjustProcess}
isPlaying={isPlaying} resolution={resolution} setResolution={setResolution}
videoObj={videoObj} histroyTime={histroyTime} setHistroyTime={setHistroyTime}
setYingshiPrepare={setYingshiPrepare} histroyBegain={histroyBegain}
yingshiPrepareRef={yingshiPrepareRef} play={play} pause={pause} closeSound={closeSound} openSound={openSound}
slideDown={slideDown} isPlaying={isPlaying}
setPlayer={setPlayer} videoObj={videoObj}
player={player} setYingshiPrepare={setYingshiPrepare}
playState={playState.current} yingshiPrepareRef={yingshiPrepareRef}
/> : "" slideDown={slideDown}
} setPlayer={setPlayer}
</div> player={player}
playState={playState.current}
/> : ""
}
</div> </div>
</>
) </div>
</>
)
} }
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth, global } = state; const { auth, global } = state;
return { return {
user: auth.user, user: auth.user,
iotVideoServer: global.iotVideoServer, iotVideoServer: global.iotVideoServer,
}; };
} }
export default connect(mapStateToProps)(VideoPlay); export default connect(mapStateToProps)(VideoPlay);

8
code/VideoAccess-VCMP/web/client/src/sections/journaling/containers/journalingCenter.jsx

@ -1,7 +1,7 @@
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Coming } from '$components' import { Coming } from '$components'
import VideoScreen from '../components/videoScreen'
import '../style.less' import '../style.less'
@ -9,10 +9,8 @@ import '../style.less'
const JournalingCenter = (props) => { const JournalingCenter = (props) => {
return ( return (
// <Coming /> <Coming />
<>
<VideoScreen />
</>
) )
} }

27
code/VideoAccess-VCMP/web/client/src/sections/journaling/components/container.jsx → code/VideoAccess-VCMP/web/client/src/sections/openness/components/container.jsx

@ -8,6 +8,7 @@ import { useState } from 'react';
const Container = ({ videoObj, pageSize }) => { const Container = ({ videoObj, pageSize }) => {
const [videoWidth, setVideoWidth] = useState() const [videoWidth, setVideoWidth] = useState()
const [videoHeight, setVideoHeight] = useState() const [videoHeight, setVideoHeight] = useState()
// console.log(videoObj);
useEffect(() => { useEffect(() => {
const resize_ = () => { const resize_ = () => {
@ -25,19 +26,21 @@ const Container = ({ videoObj, pageSize }) => {
setVideoWidth(document.getElementById('videoo').clientWidth) setVideoWidth(document.getElementById('videoo').clientWidth)
setVideoHeight(document.getElementById('videoo').clientHeight) setVideoHeight(document.getElementById('videoo').clientHeight)
}, [pageSize]) }, [pageSize])
console.log(videoWidth, videoHeight); // console.log(videoWidth, videoHeight);
return ( return (
<div style={{ width: videoWidth || '100%', height: videoHeight || '100%', padding: 5 }}> <div style={{ width: videoWidth || '100%', height: videoHeight || '100%', padding: 5 }}>
<VideoPlay sizeWh={{ {videoWidth && videoHeight ?
width: videoWidth - 10, <VideoPlay sizeWh={{
height: videoHeight - 10, width: videoWidth - 10,
parentWidth: videoWidth - 10, height: videoHeight - 40,
parentHeight: videoHeight - 10, parentWidth: videoWidth - 10,
}} parentHeight: videoHeight - 40,
videoObj={videoObj} }}
videoStyle='true' videoObj={videoObj.videoData}
containerId={videoObj.name} videoStyle='true'
local={true} /> containerId={videoObj.label}
local={true} /> : ""}
<div style={{lineHeight:'30px',paddingLeft:6}}>{videoObj?.label}</div>
</div> </div>
) )
} }

5
code/VideoAccess-VCMP/web/client/src/sections/journaling/components/videoCard.jsx → code/VideoAccess-VCMP/web/client/src/sections/openness/components/videoCard.jsx

@ -7,9 +7,6 @@ import Container from "./container";
const VideoCard = ({ data, pageSize }) => { const VideoCard = ({ data, pageSize }) => {
let span = 8 let span = 8
let rowsCount = 2 let rowsCount = 2
if (pageSize === 1) { if (pageSize === 1) {
@ -29,7 +26,7 @@ const VideoCard = ({ data, pageSize }) => {
rowsCount = 3 rowsCount = 3
} }
let cheight = Math.floor(100 / rowsCount) + "%" let cheight = Math.floor(100 / rowsCount) + "%"
console.log(pageSize,span,cheight);
return ( return (
<> <>
<Col id="videoo" span={span} style={{ height: cheight, }}> <Col id="videoo" span={span} style={{ height: cheight, }}>

253
code/VideoAccess-VCMP/web/client/src/sections/journaling/components/videoScreen.jsx → code/VideoAccess-VCMP/web/client/src/sections/openness/components/videoScreen.jsx

@ -1,102 +1,104 @@
import React, { useEffect, useRef, useState } from 'react'; import React, { useEffect, useRef, useState } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { TreeSelect, Tree, Form, Button, Popover, Tag, Switch, Input, Row } from '@douyinfe/semi-ui'; import { TreeSelect, Tree, Form, Button, Popover, Tag, Switch, Input, Row, Pagination, Checkbox } from '@douyinfe/semi-ui';
import './videoScreen.less' import './videoScreen.less'
import VideoCard from './videoCard' import VideoCard from './videoCard'
const VideoScreen = (props) => { const VideoScreen = (props) => {
const treeData = [{ const treeData = [
label: '公司', {
value: '公司', label: '公司',
key: '0-1', value: '公司',
children: [ key: '0-1',
{ children: [
label: '大门', {
value: '大门', label: '大门',
key: '0-1-1', value: '大门',
videoData: { key: '0-1-1',
channelNo: 1, videoData: {
content: ['5442542542', '452345', '234524525'], channelNo: 1,
serialNo: "F61504020", content: ['5442542542', '452345', '234524525'],
type: "yingshi", serialNo: "F61504020",
yingshiToken: "at.7pl4c5orb9fpndtlbjpsn5m11szujnf7-1laxxre0ob-010o8fw-kqeuwthva" type: "yingshi",
} yingshiToken: "at.6vznnc23bv51vzjt7lnkj7e19bb2z61f-3gnj7m5lxp-10666cy-bgwcjkekk"
}, { }
label: '机房', }, {
value: '机房', label: '机房',
key: '0-1-2', value: '机房',
videoData: { key: '0-1-2',
channelNo: 3, videoData: {
content: ['5442542542', '452345', '234524525'], channelNo: 3,
serialNo: "F61504020", content: ['5442542542', '452345', '234524525'],
type: "yingshi", serialNo: "F61504020",
yingshiToken: "at.7pl4c5orb9fpndtlbjpsn5m11szujnf7-1laxxre0ob-010o8fw-kqeuwthva" type: "yingshi",
} yingshiToken: "at.6vznnc23bv51vzjt7lnkj7e19bb2z61f-3gnj7m5lxp-10666cy-bgwcjkekk"
}, { }
label: '后门', }, {
value: '后门', label: '后门',
key: '0-1-3', value: '后门',
videoData: { key: '0-1-3',
channelNo: 1, videoData: {
content: ['5442542542', '452345', '234524525'], channelNo: 2,
serialNo: "F61504020", content: ['5442542542', '452345', '234524525'],
type: "yingshi", serialNo: "F61504020",
yingshiToken: "at.7pl4c5orb9fpndtlbjpsn5m11szujnf7-1laxxre0ob-010o8fw-kqeuwthva" type: "yingshi",
} yingshiToken: "at.6vznnc23bv51vzjt7lnkj7e19bb2z61f-3gnj7m5lxp-10666cy-bgwcjkekk"
}, }
] },
}, { ]
label: '外部', },
value: '外部', {
key: '0-2', label: '外部',
children: [ value: '外部',
{ key: '0-2',
label: '水库', children: [
value: '水库', {
key: '0-2-1', label: '水库',
children: [ value: '水库',
{ key: '0-2-1',
label: '房子', children: [
value: '房子', {
key: '0-2-1-1', label: '房子',
videoData: { value: '房子',
channelNo: 1, key: '0-2-1-1',
content: ['5442542542', '452345', '234524525'], videoData: {
serialNo: "F61504020", channelNo: null,
type: "yingshi", content: ['5442542542', '452345', '234524525'],
yingshiToken: "at.7pl4c5orb9fpndtlbjpsn5m11szujnf7-1laxxre0ob-010o8fw-kqeuwthva", serialNo: "G56384764",
} type: "yingshi",
}, yingshiToken: "at.c7dnknnvd4irh8zddul3dgkpb4f3oz83-4n6u7zv8st-1gxz7ny-lgffyh25z",
] }
}, },
] ]
}, { },
label: '外', ]
value: '外', }, {
key: '0-3', label: '外',
children: [ value: '外',
{ key: '0-3',
label: '库', children: [
value: '库', {
key: '0-3-1', label: '库',
children: [ value: '库',
{ key: '0-3-1',
label: '子', children: [
value: '子', {
key: '0-3-1-1', label: '子',
}, value: '子',
] key: '0-3-1-1',
}, },
] ]
}] },
]
}]
const [pageSize, setPageSize] = useState(4) // const [pageSize, setPageSize] = useState(4) //
const [queryData, setQueryData] = useState([{ label: '全部', value: '全部', key: '0' }]) // const [queryData, setQueryData] = useState([{ label: '全部', value: '全部', key: '0' }]) //
const [leftTree, setLefTtree] = useState([{ label: '全部', value: '全部', key: '0', children: treeData}]) // const [leftTree, setLefTtree] = useState(treeData) //
const [playData, setPlayData] = useState([]) // const [playData, setPlayData] = useState([]) //
const [queryValue, setQueryValue] = useState(['全部']) // const [queryValue, setQueryValue] = useState(['全部']) //
const [leftValue, setLeftValue] = useState() // const [leftValue, setLeftValue] = useState(treeData.map(v => v.value)) //
const api = useRef(); const api = useRef();
@ -106,27 +108,52 @@ const VideoScreen = (props) => {
query.push({ label: v.label, value: v.value, key: v.key }) query.push({ label: v.label, value: v.value, key: v.key })
]) ])
setQueryData([{ label: '全部', value: '全部', key: '0', children: query }]) setQueryData([{ label: '全部', value: '全部', key: '0', children: query }])
let playVideo = []
const playVideoData = (data) => {
// console.log(data);
data.map(v => {
if (v.videoData) playVideo.push(v)
if (v.children) playVideoData(v.children)
})
}
playVideoData(treeData)
setPlayData(playVideo)
// console.log(playVideo);
}, []) }, [])
useEffect(() => { useEffect(() => {
if (treeData && queryValue.includes('全部')) { if (treeData && queryValue.includes('全部')) {
setLefTtree(treeData) setLefTtree(treeData)
} else { } else {
let leftData = [] let leftData = []
queryValue.map(item => leftData.push(treeData?.find(({ value }) => item == value))) // queryValue.map(item => {
setLefTtree([{ label: '全部', value: '全部', key: '0', children: leftData }]) leftData.push(treeData?.find(({ value }) => item == value))
}) //
console.log(leftData);
setLefTtree(leftData)
let playVideo = []
const playVideoData = (data) => {
// console.log(data);
data.map(v => {
if (v.videoData) playVideo.push(v)
if (v.children) playVideoData(v.children)
})
}
playVideoData(leftData)
setPlayData(playVideo)
} }
}, [queryData, queryValue]) }, [queryData, queryValue, leftValue])
useEffect(() => { useEffect(() => {
setLeftValue()
}, []) }, [])
// //
const screen = { width: 193, marginRight: 20, marginBottom: 16, color: "#fff", }; const screen = { width: 193, marginRight: 20, marginBottom: 16, color: "#fff", };
@ -162,7 +189,7 @@ const VideoScreen = (props) => {
background: 'url(/assets/images/application/background.png) 100% 100%', background: 'url(/assets/images/application/background.png) 100% 100%',
backgroundSize: '100% 100%', backgroundSize: '100% 100%',
color: '#FFFFFF', color: '#FFFFFF',
position: 'absolute', minWidth: 1000, // minWidth: 1000,
}}> }}>
{/* 头部标题 */} {/* 头部标题 */}
<div style={{ <div style={{
@ -185,9 +212,9 @@ const VideoScreen = (props) => {
</div> </div>
<div style={{ <div style={{
height: "calc(100% - 112px)", margin: '16px', display: 'flex', height: "calc(100% - 116px)", margin: '16px', display: 'flex',
}}> }}>
<div style={{ width: 300, height: "100%", border: '2px solid #003D9E', }}> <div style={{ width: 300, height: "100%", border: '2px solid #003D9E', position: 'relative' }}>
<div>查询 <div>查询
<TreeSelect <TreeSelect
style={{ width: 150, }} style={{ width: 150, }}
@ -208,17 +235,18 @@ const VideoScreen = (props) => {
multiple multiple
treeData={leftTree} treeData={leftTree}
defaultExpandAll defaultExpandAll
defaultValue={['公司','外部']} value={leftValue}
blockNode={false} blockNode={false}
onChange={(e) => { onChange={(e) => {
console.log(e); console.log(e);
setLeftValue(e) setLeftValue(e)
}} }}
onSelect={(e)=>{ onSelect={(e) => {
console.log(e); console.log(e);
}} }}
style={{ width: 150, color: '#FFFFFF' }} style={{ width: 150, color: '#FFFFFF' }}
/> />
<Checkbox defaultChecked onChange={checked => console.log(checked)} aria-label="Checkbox 示例" style={{ position: 'absolute', right: 0, bottom: 60 }}>全选</Checkbox>
</div> </div>
<div style={{ <div style={{
flex: 1, marginLeft: '10px', border: '2px solid #003D9E', flex: 1, marginLeft: '10px', border: '2px solid #003D9E',
@ -292,15 +320,35 @@ const VideoScreen = (props) => {
</Button> */} </Button> */}
</div> </div>
</div> </div>
<div style={{ display: 'flex', height: `calc( 100% - 160px )` }}> <div style={{ display: 'flex', height: '100%' }}>
{/* 视频 */} {/* 视频 */}
<div style={{ flex: 1, height: '100%' }}> <div style={{ flex: 1, height: '100%' }}>
<Row style={{ height: '100%' }}> <Row style={{ height: `calc( 100% - 160px )` }}>
{/* {data.map((v, index) => { {playData?.map((v, index) => {
console.log(v);
return <VideoCard key={'VideoCard' + index} data={v} pageSize={pageSize} /> return <VideoCard key={'VideoCard' + index} data={v} pageSize={pageSize} />
})} */} })}
</Row> </Row>
<div
style={{
display: "flex",
justifyContent: 'space-between',
padding: "10px",
}}
>
<span style={{ lineHeight: "30px" }}>
{10}个设备
</span>
<Pagination
total={100}
// currentPage={1}
style={{ color: 'white' }}
onChange={(currentPage, pageSize) => {
// setQuery({ limit: pageSize, page: currentPage - 1 });
// page.current = currentPage - 1
}}
/>
</div>
</div> </div>
{/* 视频设置 */} {/* 视频设置 */}
<div style={{ <div style={{
@ -313,7 +361,6 @@ const VideoScreen = (props) => {
return <div key={index}> return <div key={index}>
<Popover <Popover
position='left' position='left'
trigger='click'
content={() => { content={() => {
switch (v.value) { switch (v.value) {
case '宫格设置': case '宫格设置':

1
code/VideoAccess-VCMP/web/client/src/sections/journaling/components/videoScreen.less → code/VideoAccess-VCMP/web/client/src/sections/openness/components/videoScreen.less

@ -1,6 +1,7 @@
.KJBlue { .KJBlue {
.semi-tree-option, .semi-tree-option,
.semi-icon, .semi-icon,
.semi-checkbox-addon, //全选文字
.semi-form-field-label-text { .semi-form-field-label-text {
color: #fff; color: #fff;
} }

848
code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx

@ -2,458 +2,462 @@ import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import '../style.less' import '../style.less'
import { Tree, Popconfirm, Typography, Input, Switch, Modal, Checkbox, CheckboxGroup } from "@douyinfe/semi-ui"; import { Tree, Popconfirm, Typography, Input, Switch, Modal, Checkbox, CheckboxGroup } from "@douyinfe/semi-ui";
import VideoScreen from '../components/videoScreen'
const MirroringDetail = (props) => { const MirroringDetail = (props) => {
const { history, dispatch, actions, user, loading, StatusPushList } = props; const { history, dispatch, actions, user, loading, StatusPushList } = props;
const { openness } = actions; const { openness } = actions;
useEffect(() => { useEffect(() => {
}, []); }, []);
// const = useRef(0) // const = useRef(0)
const [chooseNum, setChooseNum] = useState(0);//tab const [chooseNum, setChooseNum] = useState(0);//tab
const [chooseList, setChooseList] = useState(['节点', '样式', '功能']); const [chooseList, setChooseList] = useState(['节点', '样式', '功能']);
const [editKey, setEditKey] = useState('') const [editKey, setEditKey] = useState('')
const [comingVisible, setComingVisible] = useState(false) const [comingVisible, setComingVisible] = useState(false)
const [treeData, setTreeData] = useState([// const [treeData, setTreeData] = useState([//
{ {
label: '主要节点1', label: '主要节点1',
value: '0', value: '0',
key: '0', key: '0',
}, },
]); ]);
const searchData = useRef({})// const searchData = useRef({})//
const [search, setSearch] = useState({}); // const [search, setSearch] = useState({}); //
const [indeterminate, setIndeterminate] = useState(true);// const [indeterminate, setIndeterminate] = useState(true);//
const [checkAll, setCheckall] = useState(false);// const [checkAll, setCheckall] = useState(false);//
const onCheckAllChange = (e) => {// const onCheckAllChange = (e) => {//
console.log(e); console.log(e);
setCheckedList(e.target.checked ? plainOptions : []); setCheckedList(e.target.checked ? plainOptions : []);
setIndeterminate(false); setIndeterminate(false);
setCheckall(e.target.checked); setCheckall(e.target.checked);
}; };
const equipmentGetCamera = () => { const equipmentGetCamera = () => {
searchData.current = { ...search } searchData.current = { ...search }
dispatch(openness.getCamera(searchData.current)).then((res) => { dispatch(openness.getCamera(searchData.current)).then((res) => {
// limits.current = res.payload.data.data.length // limits.current = res.payload.data.data.length
console.log(res.payload.data.data); console.log(res.payload.data.data);
}); });
} }
useEffect(() => { useEffect(() => {
equipmentGetCamera(); equipmentGetCamera();
}, []); }, []);
function nodeDelete (item) {// function nodeDelete (item) {//
let mainData = JSON.parse(JSON.stringify(treeData)) let mainData = JSON.parse(JSON.stringify(treeData))
let nodeKeyArr = item.key.split('-') let nodeKeyArr = item.key.split('-')
if (nodeKeyArr.length == 1) { if (nodeKeyArr.length == 1) {
mainData.splice( mainData.splice(
mainData.indexOf(mainData.find(function (element) { mainData.indexOf(mainData.find(function (element) {
return element.key === item.key return element.key === item.key
})), 1) })), 1)
} else if (nodeKeyArr.length == 2) { } else if (nodeKeyArr.length == 2) {
for (let index = 0; index < mainData.length; index++) { for (let index = 0; index < mainData.length; index++) {
mainData[index].children.splice( mainData[index].children.splice(
mainData[index].children.indexOf(mainData[index].children.find(function (element) { mainData[index].children.indexOf(mainData[index].children.find(function (element) {
return element.key === item.key return element.key === item.key
})), 1) })), 1)
}
} else if (nodeKeyArr.length == 3) {
for (let j = 0; j < mainData.length; j++) {
for (let i = 0; i < mainData[j].children.length; i++) {
mainData[j].children[i].children.splice(
mainData[j].children[i].children.indexOf(mainData[j].children[i].children.find(function (element) {
return element.key === item.key
})), 1)
} }
} else if (nodeKeyArr.length == 3) { }
for (let j = 0; j < mainData.length; j++) { } else if (nodeKeyArr.length == 4) {
for (let i = 0; i < mainData[j].children.length; i++) { for (let k = 0; k < mainData.length; k++) {
mainData[j].children[i].children.splice( for (let j = 0; j < mainData[k].children.length; j++) {
mainData[j].children[i].children.indexOf(mainData[j].children[i].children.find(function (element) { for (let i = 0; i < mainData[k].children[j].children.length; i++) {
return element.key === item.key mainData[k].children[j].children[i].children.splice(
})), 1) mainData[k].children[j].children[i].children.indexOf(mainData[k].children[j].children[i].children.find(function (element) {
} return element.key === item.key
})), 1)
}
} }
} else if (nodeKeyArr.length == 4) { }
for (let k = 0; k < mainData.length; k++) { }
for (let j = 0; j < mainData[k].children.length; j++) { setTreeData(mainData)
for (let i = 0; i < mainData[k].children[j].children.length; i++) { }
mainData[k].children[j].children[i].children.splice( function nodeAdd (item) {//
mainData[k].children[j].children[i].children.indexOf(mainData[k].children[j].children[i].children.find(function (element) { let mainData = JSON.parse(JSON.stringify(treeData))
return element.key === item.key let nodeKeyArr = item.key.split('-')
})), 1) if (nodeKeyArr.length == 1) {
} for (let index = 0; index < mainData.length; index++) {
} if (mainData[index].key == item.key) {
if (mainData[index].children && mainData[index].children > 0) {
let mainKey = mainData[index].children[mainData[index].children.length - 1].key
let thekeyarr = mainKey.split('-')
mainData[index].children.push({
label: '二级节点' + (Number(thekeyarr[1]) + 2),
value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1]) + 1),
key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1]) + 1),
})
}
else {
let mainKey = mainData[index].key
let thekeyarr = mainKey.split('-')
mainData[index].children = [{
label: '二级节点1',
value: (Number(thekeyarr[0])) + '-0',
key: (Number(thekeyarr[0])) + '-0',
}]
}
} }
} }
setTreeData(mainData) } else if (nodeKeyArr.length == 2) {
} for (let index = 0; index < mainData.length; index++) {
function nodeAdd (item) {// for (let j = 0; j < mainData[index].children.length; j++) {
let mainData = JSON.parse(JSON.stringify(treeData)) if (mainData[index].children[j].key == item.key) {
let nodeKeyArr = item.key.split('-') if (mainData[index].children[j].children && mainData[index].children[j].children.length > 0) {
if (nodeKeyArr.length == 1) { let mainKey = mainData[index].children[j].children[mainData[index].children[j].children.length - 1].key
for (let index = 0; index < mainData.length; index++) { let thekeyarr = mainKey.split('-')
if (mainData[index].key == item.key) { mainData[index].children[j].children.push({
if (mainData[index].children && mainData[index].children > 0) { label: '三级节点' + (Number(thekeyarr[2]) + 2),
let mainKey = mainData[index].children[mainData[index].children.length - 1].key value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-' + (Number(thekeyarr[2]) + 1),
let thekeyarr = mainKey.split('-') key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-' + (Number(thekeyarr[2]) + 1),
mainData[index].children.push({ })
label: '二级节点' + (Number(thekeyarr[1]) + 2), }
value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1]) + 1), else {
key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1]) + 1), let mainKey = mainData[index].children[j].key
}) let thekeyarr = mainKey.split('-')
} mainData[index].children[j].children = [{
else { label: '三级节点1',
let mainKey = mainData[index].key value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-0',
let thekeyarr = mainKey.split('-') key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-0',
mainData[index].children = [{ }]
label: '二级节点1', }
value: (Number(thekeyarr[0])) + '-0', }
key: (Number(thekeyarr[0])) + '-0',
}]
}
}
} }
} else if (nodeKeyArr.length == 2) { }
for (let index = 0; index < mainData.length; index++) { }
for (let j = 0; j < mainData[index].children.length; j++) { setTreeData(mainData)
if (mainData[index].children[j].key == item.key) { }
if (mainData[index].children[j].children && mainData[index].children[j].children.length > 0) { function changeLable (value, item) {//
let mainKey = mainData[index].children[j].children[mainData[index].children[j].children.length - 1].key console.log('valvalval', value);
let thekeyarr = mainKey.split('-') console.log('itemitem', item);
mainData[index].children[j].children.push({ let mainData = JSON.parse(JSON.stringify(treeData))
label: '三级节点' + (Number(thekeyarr[2]) + 2), let nodeKeyArr = item.key.split('-')
value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-' + (Number(thekeyarr[2]) + 1), if (nodeKeyArr.length == 1) {
key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-' + (Number(thekeyarr[2]) + 1), for (let index = 0; index < mainData.length; index++) {
}) if (mainData[index].key == item.key) {
} mainData[index].label = value
else {
let mainKey = mainData[index].children[j].key
let thekeyarr = mainKey.split('-')
mainData[index].children[j].children = [{
label: '三级节点1',
value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-0',
key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-0',
}]
}
}
}
} }
} }
setTreeData(mainData) } else if (nodeKeyArr.length == 2) {
} for (let index = 0; index < mainData.length; index++) {
function changeLable (value, item) {// for (let j = 0; j < mainData[index].children.length; j++) {
console.log('valvalval', value); if (mainData[index].children[j].key == item.key) {
console.log('itemitem', item); mainData[index].children[j].label = value
let mainData = JSON.parse(JSON.stringify(treeData)) }
let nodeKeyArr = item.key.split('-')
if (nodeKeyArr.length == 1) {
for (let index = 0; index < mainData.length; index++) {
if (mainData[index].key == item.key) {
mainData[index].label = value
}
} }
} else if (nodeKeyArr.length == 2) { }
for (let index = 0; index < mainData.length; index++) { } else if (nodeKeyArr.length == 3) {
for (let j = 0; j < mainData[index].children.length; j++) { for (let index = 0; index < mainData.length; index++) {
if (mainData[index].children[j].key == item.key) { for (let j = 0; j < mainData[index].children.length; j++) {
mainData[index].children[j].label = value for (let k = 0; k < mainData[index].children[j].children.length; k++) {
} if (mainData[index].children[j].children[k].key == item.key) {
} mainData[index].children[j].children[k].label = value
}
}
} }
} else if (nodeKeyArr.length == 3) { }
for (let index = 0; index < mainData.length; index++) { }
for (let j = 0; j < mainData[index].children.length; j++) { setTreeData(mainData)
for (let k = 0; k < mainData[index].children[j].children.length; k++) { }
if (mainData[index].children[j].children[k].key == item.key) { function lableBlur () {
mainData[index].children[j].children[k].label = value setEditKey('')
} }
} function cameraAdd (item) {//
}
}
}
setTreeData(mainData)
}
function lableBlur () {
setEditKey('')
}
function cameraAdd (item) {//
} }
const renderLabel = (label, item) => {// const renderLabel = (label, item) => {//
let keyArr = item.key.split('-') let keyArr = item.key.split('-')
return ( return (
<div style={{ display: 'flex', justifyContent: 'space-between' }}> <div style={{ display: 'flex', justifyContent: 'space-between' }}>
{ {
keyArr.length == 1 ? ( keyArr.length == 1 ? (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<div style={{ width: 13, height: 10 }}> <div style={{ width: 13, height: 10 }}>
<img
src="/assets/images/imageImg/folder.png"
alt="设置"
style={{ width: '100%' }}
/>
</div>
<div style={{ marginLeft: 8, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
{
editKey == item.key ? (
<Input value={label} onBlur={lableBlur} onChange={(value) => changeLable(value, item)} style={{ width: 65 }} className='inputpadding' size='small'></Input>
) :
(
<Typography.Text
ellipsis={{ showTooltip: true }}
>
{label}
</Typography.Text>)
}
</div>
</div>
) : (
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
{
editKey == item.key ? (
<Input value={label} onBlur={lableBlur} onChange={(value) => changeLable(value, item)} style={{ width: 65 }} className='inputpadding' size='small'></Input>
) :
(
<Typography.Text
ellipsis={{ showTooltip: true }}
>
{label}
</Typography.Text>)
}
</div>
)
}
<div style={{ display: 'flex', paddingRight: 13 }}>
{
!item.children || item.children < 1 ? (
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => cameraAdd(item)}>
<img
src="/assets/images/imageImg/nodeCamera.png"
alt="添加摄像头"
style={{ width: '100%' }}
/>
</div>
) : ('')
}
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => { setEditKey(item.key) }}>
<img <img
src="/assets/images/imageImg/nodeEdit.png" src="/assets/images/imageImg/folder.png"
alt="编辑" alt="设置"
style={{ width: '100%' }} style={{ width: '100%' }}
/> />
</div> </div>
<Popconfirm <div style={{ marginLeft: 8, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
title="删除节点也会删除节点下的从属节点和视频,是否继续?" {
arrowPointAtCenter={false} editKey == item.key ? (
showArrow={true} <Input value={label} onBlur={lableBlur} onChange={(value) => changeLable(value, item)} style={{ width: 65 }} className='inputpadding' size='small'></Input>
position="topRight" ) :
onConfirm={() => nodeDelete(item)}> (
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }}> <Typography.Text
<img ellipsis={{ showTooltip: true }}
src="/assets/images/imageImg/nodeDel.png" >
alt="删除" {label}
style={{ width: '100%' }} </Typography.Text>)
/> }
</div> </div>
</Popconfirm> </div>
{ ) : (
keyArr.length > 2 ? ('') : ( <div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => nodeAdd(item)}> {
<img editKey == item.key ? (
src="/assets/images/imageImg/nodeadd.png" <Input value={label} onBlur={lableBlur} onChange={(value) => changeLable(value, item)} style={{ width: 65 }} className='inputpadding' size='small'></Input>
alt="添加子节点" ) :
style={{ width: '100%' }} (
/> <Typography.Text
</div> ellipsis={{ showTooltip: true }}
) >
} {label}
</div> </Typography.Text>)
</div> }
) </div>
}; )
function toback () {// }
history.goBack() <div style={{ display: 'flex', paddingRight: 13 }}>
} {
function tochange (index) {// !item.children || item.children < 1 ? (
setChooseNum(index) <div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => cameraAdd(item)}>
}
function addMainNode () {//
let mainData = JSON.parse(JSON.stringify(treeData))
if (mainData.length > 0) {
let mainKey = mainData[mainData.length - 1].key
mainKey = Number(mainKey) + 2
mainData.push({
label: '主要节点' + mainKey,
value: String(mainKey - 1),
key: String(mainKey - 1),
})
}
else {
mainData.push({
label: '主要节点1',
value: '0',
key: '0',
})
}
setTreeData(mainData)
}
return (
<div style={{ background: 'rgb(246, 250, 255)', height: '100%', width: '100%' }}>
<div style={{
height: 64, background: "url(/assets/images/imageImg/banner.png)", backgroundSize: "100% 100%", display: 'flex', alignItems: 'center', justifyContent: 'space-between'
}}>
<div style={{ display: 'flex', }}>
<div style={{ width: 20, height: 20, marginLeft: 19, cursor: 'pointer' }} onClick={toback}>
<img <img
src="/assets/images/imageImg/toback.png" src="/assets/images/imageImg/nodeCamera.png"
alt="设置" alt="添加摄像头"
style={{ width: '100%' }} style={{ width: '100%' }}
/> />
</div> </div>
<div style={{ fontSize: 16, color: '#FFFFFF', marginLeft: 20 }}> ) : ('')
智慧小蓝智慧排涝视频融合系统 }
</div> <div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => { setEditKey(item.key) }}>
<div style={{ width: 12, height: 12, marginLeft: 8, marginTop: 1, cursor: 'pointer' }}> <img
src="/assets/images/imageImg/nodeEdit.png"
alt="编辑"
style={{ width: '100%' }}
/>
</div>
<Popconfirm
title="删除节点也会删除节点下的从属节点和视频,是否继续?"
arrowPointAtCenter={false}
showArrow={true}
position="topRight"
onConfirm={() => nodeDelete(item)}>
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }}>
<img
src="/assets/images/imageImg/nodeDel.png"
alt="删除"
style={{ width: '100%' }}
/>
</div>
</Popconfirm>
{
keyArr.length > 2 ? ('') : (
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => nodeAdd(item)}>
<img <img
src="/assets/images/imageImg/nameChange.png" src="/assets/images/imageImg/nodeadd.png"
alt="设置" alt="添加子节点"
style={{ width: '100%' }} style={{ width: '100%' }}
/> />
</div> </div>
</div> )
<div style={{ display: 'flex', }}> }
<div style={{ width: 22, height: 22, marginRight: 30, cursor: 'pointer' }}> </div>
</div>
)
};
function toback () {//
history.goBack()
}
function tochange (index) {//
setChooseNum(index)
}
function addMainNode () {//
let mainData = JSON.parse(JSON.stringify(treeData))
if (mainData.length > 0) {
let mainKey = mainData[mainData.length - 1].key
mainKey = Number(mainKey) + 2
mainData.push({
label: '主要节点' + mainKey,
value: String(mainKey - 1),
key: String(mainKey - 1),
})
}
else {
mainData.push({
label: '主要节点1',
value: '0',
key: '0',
})
}
setTreeData(mainData)
}
return (
<div style={{ background: 'rgb(246, 250, 255)', height: '100%', width: '100%' }}>
<div style={{
height: 64, background: "url(/assets/images/imageImg/banner.png)", backgroundSize: "100% 100%", display: 'flex', alignItems: 'center', justifyContent: 'space-between'
}}>
<div style={{ display: 'flex', }}>
<div style={{ width: 20, height: 20, marginLeft: 19, cursor: 'pointer' }} onClick={toback}>
<img
src="/assets/images/imageImg/toback.png"
alt="设置"
style={{ width: '100%' }}
/>
</div>
<div style={{ fontSize: 16, color: '#FFFFFF', marginLeft: 20 }}>
智慧小蓝智慧排涝视频融合系统
</div>
<div style={{ width: 12, height: 12, marginLeft: 8, marginTop: 1, cursor: 'pointer' }}>
<img
src="/assets/images/imageImg/nameChange.png"
alt="设置"
style={{ width: '100%' }}
/>
</div>
</div>
<div style={{ display: 'flex', }}>
<div style={{ width: 22, height: 22, marginRight: 30, cursor: 'pointer' }}>
<img
src="/assets/images/imageImg/save.png"
alt="设置"
style={{ width: '100%' }}
/>
</div>
<div style={{ width: 22, height: 22, marginRight: 44, cursor: 'pointer' }}>
<img
src="/assets/images/imageImg/upload.png"
alt="设置"
style={{ width: '100%' }}
/>
</div>
</div>
</div>
<div style={{ display: 'flex', height: '100%' }}>
<div style={{ height: "100%", width: 200, background: '#FFFFFF' }}>
<div style={{ display: 'flex', height: 49, background: '#1859C1', border: '1px solid #1859C1', color: 'rgba(255,255,255,0.65)', fontSize: 14, width: '100%' }}>
{chooseList.map((item, index) => {
return (
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', width: '33.3333%', cursor: 'pointer' }}
key={index}
className={index == chooseNum ? 'onchoose' : ''}
onClick={() => tochange(index)} >
{item}
</div>
)
})}
</div>
{/* 节点 */}
<div style={{ display: chooseNum == "0" ? "block" : "none", }}>
<div style={{ height: 40, display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'rgb(246, 250, 255)', cursor: 'pointer' }} onClick={addMainNode}>
<div style={{ width: 20, height: 20 }}>
<img <img
src="/assets/images/imageImg/save.png" src="/assets/images/imageImg/addMainNodes.png"
alt="设置" alt="设置"
style={{ width: '100%' }} style={{ width: '100%' }}
/> />
</div> </div>
<div style={{ width: 22, height: 22, marginRight: 44, cursor: 'pointer' }}> <div style={{ marginLeft: 9, fontSize: 15, color: 'rgba(0,0,0,0.65)' }}>
增加主要节点
</div>
</div>
<Tree
treeData={treeData}
renderLabel={renderLabel}
/>
</div>
{/* 添加视频 */}
<div style={{ width: 264, height: '100%', position: 'absolute', top: 64, left: 200 }}>
<div style={{ background: 'linear-gradient(180deg, #1859C1 0%, #2C66E7 100%)', display: 'flex', height: 49, padding: '0px 12px 0px 10px', alignItems: 'center', justifyContent: 'space-between', }}>
<div style={{ fontSize: 14, color: '#F9F9F9' }}>添加视频</div>
<div style={{ width: 16, height: 16, cursor: 'pointer' }}>
<img <img
src="/assets/images/imageImg/upload.png" src="/assets/images/imageImg/close.png"
alt="设置" alt="设置"
style={{ width: '100%' }} style={{ width: '100%' }}
/> />
</div> </div>
</div> </div>
</div> <div style={{ borderBottom: '1px solid rgba(226,226,226,0.5)', background: '#FFFFFF' }}>
<div style={{display:'flex',height:'100%'}}> <div style={{ display: 'flex', padding: "8px 10px 10px 10px", alignItems: 'center' }}>
<div style={{ height: "100%", width: 200, background: '#FFFFFF' }}> <div style={{ fontSize: 12 }}>摄像头名称</div>
<div style={{ display: 'flex', height: 49, background: '#1859C1', border: '1px solid #1859C1', color: 'rgba(255,255,255,0.65)', fontSize: 14, width: '100%' }}> <div>
{chooseList.map((item, index) => { <Input placeholder='请输入摄像头名称' style={{ width: 140, marginLeft: 10 }}></Input>
return (
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', width: '33.3333%', cursor: 'pointer' }}
key={index}
className={index == chooseNum ? 'onchoose' : ''}
onClick={() => tochange(index)} >
{item}
</div>
)
})}
</div>
{/* 节点 */}
<div style={{ display: chooseNum == "0" ? "block" : "none", }}>
<div style={{ height: 40, display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'rgb(246, 250, 255)', cursor: 'pointer' }} onClick={addMainNode}>
<div style={{ width: 20, height: 20 }}>
<img
src="/assets/images/imageImg/addMainNodes.png"
alt="设置"
style={{ width: '100%' }}
/>
</div>
<div style={{ marginLeft: 9, fontSize: 15, color: 'rgba(0,0,0,0.65)' }}>
增加主要节点
</div>
</div> </div>
<Tree <div style={{ width: 32, height: 32 }}>
treeData={treeData} <img
renderLabel={renderLabel} src="/assets/images/imageImg/find.png"
/> alt="设置"
</div> style={{ width: '100%' }}
{/* 添加视频 */} />
<div style={{ width: 264, height: '100%', position: 'absolute', top: 64, left: 200 }}>
<div style={{ background: 'linear-gradient(180deg, #1859C1 0%, #2C66E7 100%)', display: 'flex', height: 49, padding: '0px 12px 0px 10px', alignItems: 'center', justifyContent: 'space-between', }}>
<div style={{ fontSize: 14, color: '#F9F9F9' }}>添加视频</div>
<div style={{ width: 16, height: 16, cursor: 'pointer' }}>
<img
src="/assets/images/imageImg/close.png"
alt="设置"
style={{ width: '100%' }}
/>
</div>
</div>
<div style={{ borderBottom: '1px solid rgba(226,226,226,0.5)', background: '#FFFFFF' }}>
<div style={{ display: 'flex', padding: "8px 10px 10px 10px", alignItems: 'center' }}>
<div style={{ fontSize: 12 }}>摄像头名称</div>
<div>
<Input placeholder='请输入摄像头名称' style={{ width: 140, marginLeft: 10 }}></Input>
</div>
<div style={{ width: 32, height: 32 }}>
<img
src="/assets/images/imageImg/find.png"
alt="设置"
style={{ width: '100%' }}
/>
</div>
</div>
<div style={{ display: 'flex' }}>
<div>
<Checkbox
indeterminate={indeterminate}
onChange={onCheckAllChange}
checked={checkAll}
aria-label="Checkbox 示例"
>
全选
</Checkbox>
</div>
<div>
<Checkbox onChange={checked => console.log(checked)} aria-label="Checkbox 示例">隐藏添加过的</Checkbox>
</div>
</div>
</div> </div>
</div> </div>
{/* 样式 */} <div style={{ display: 'flex' }}>
<div style={{ display: chooseNum == "1" ? "block" : "none", fontSize: 12 }} className="hasHeader"> <div>
<div style={{ height: 41, display: 'flex', alignItems: 'center', justifyContent: 'space-between', borderBottom: '1px solid rgba(226,226,226,0.2)' }}> <Checkbox
<div style={{ marginLeft: 20 }}>header</div> indeterminate={indeterminate}
<div style={{ marginRight: 13 }}><Switch onChange={(v, e) => console.log(v)} size="small" aria-label="是否有头部"></Switch></div> onChange={onCheckAllChange}
checked={checkAll}
aria-label="Checkbox 示例"
>
全选
</Checkbox>
</div> </div>
<div style={{ height: 41, display: 'flex', alignItems: 'center', justifyContent: 'space-between', borderBottom: '1px solid rgba(226,226,226,0.2)', cursor: 'pointer' }} onClick={() => { setComingVisible(true) }}> <div>
<div style={{ marginLeft: 20 }}>自定义样式</div> <Checkbox onChange={checked => console.log(checked)} aria-label="Checkbox 示例">隐藏添加过的</Checkbox>
<div style={{ marginRight: 13, width: 9, height: 5, display: 'flex', alignItems: 'center', }}>
<img
src="/assets/images/imageImg/down.png"
alt="设置"
style={{ width: '100%' }}
/>
</div>
</div> </div>
</div> </div>
</div> </div>
<div style={{flex:1}}> </div>
</div> {/* 样式 */}
<div style={{ display: chooseNum == "1" ? "block" : "none", fontSize: 12 }} className="hasHeader">
<div style={{ height: 41, display: 'flex', alignItems: 'center', justifyContent: 'space-between', borderBottom: '1px solid rgba(226,226,226,0.2)' }}>
<div style={{ marginLeft: 20 }}>header</div>
<div style={{ marginRight: 13 }}><Switch onChange={(v, e) => console.log(v)} size="small" aria-label="是否有头部"></Switch></div>
</div>
<div style={{ height: 41, display: 'flex', alignItems: 'center', justifyContent: 'space-between', borderBottom: '1px solid rgba(226,226,226,0.2)', cursor: 'pointer' }} onClick={() => { setComingVisible(true) }}>
<div style={{ marginLeft: 20 }}>自定义样式</div>
<div style={{ marginRight: 13, width: 9, height: 5, display: 'flex', alignItems: 'center', }}>
<img
src="/assets/images/imageImg/down.png"
alt="设置"
style={{ width: '100%' }}
/>
</div>
</div>
</div>
</div>
<div style={{ flex: 1,height:'100%'}}>
<VideoScreen />
</div> </div>
<Modal </div>
title="提醒" <Modal
visible={comingVisible} title="提醒"
onOk={() => { visible={comingVisible}
setComingVisible(false) onOk={() => {
}} setComingVisible(false)
width={610} }}
onCancel={() => { width={610}
setComingVisible(false) onCancel={() => {
}} setComingVisible(false)
okText="确定" }}
cancelText="取消" okText="确定"
closeOnEsc={true} cancelText="取消"
> closeOnEsc={true}
开发中敬请期待~ >
</Modal> 开发中敬请期待~
</div> </Modal>
) </div>
)
} }
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth, global } = state; const { auth, global } = state;
return { return {
user: auth.user, user: auth.user,
actions: global.actions, actions: global.actions,
}; };
} }
export default connect(mapStateToProps)(MirroringDetail); export default connect(mapStateToProps)(MirroringDetail);

1
code/VideoAccess-VCMP/web/client/src/utils/webapi.js

@ -13,7 +13,6 @@ const { basicAction, RouteRequest } = webUtils
export { export {
basicAction, RouteRequest basicAction, RouteRequest
} }
console.log(basicAction, RouteRequest);
export const ApiTable = { export const ApiTable = {
login: "login", login: "login",

Loading…
Cancel
Save