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 VideoOperation from './videoOperation'
import './videoPlay.less';
import EZUIKit from 'ezuikit-js'
import EZUIKit, { log } from 'ezuikit-js'
import { done } from "nprogress";
const timeFormat = 'YYYY-MM-DD HH:mm:ss'
@ -18,492 +18,493 @@ const yingshiOpenSoundKey = 'openSound'
const VideoPlay = ({
height, width, containerId = 'myPlayer',
// playUrl,
name,
global,
videoStyle,
changeData,
videoObj,
sizeWh,
slideDown, //
IsSize, //16:9
// videoObj = {
// type: 'yingshi',
// audio: false,
// serialNo: 'G75922040', //
// channelNo: 1, //
// yingshiToken: 'at.6nn6duwz8g8gbd919as9a6ea82bmn31x-709fnp7s3k-13q3v7e-mlov7lysf', //
// playUrlSd: 'ezopen://open.ys7.com/G75922040/1.live', //
// // playUrl: 'ws://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000003',
// playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live',
// replayUrl: 'ezopen://open.ys7.com/G75922040/1.hd.local.rec',
// },
// videoObj = {
// type: 'yingshi',
// audio: false,
// serialNo: 'G56385051', //
// channelNo: 1, //
// yingshiToken: 'at.6nn6duwz8g8gbd919as9a6ea82bmn31x-709fnp7s3k-13q3v7e-mlov7lysf', //
// playUrlSd: 'ezopen://open.ys7.com/G56384814/1.live', //
// // playUrl: 'ws://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000003',
// playUrlHd: 'ezopen://open.ys7.com/G56384814/1.hd.live',
// replayUrl: 'ezopen://open.ys7.com/G56384814/1.hd.local.rec',
// },
// videoObj = {
// type: 'cascade',
// audio: false,
// serialNo: '34020000001310000001', //
// topSerialNo: '34020000001110000077', //
// playUrlSd: 'http://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000001', //
// // playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live',
// // replayUrl: 'ezopen://open.ys7.com/G75922040/1.rec',
// },
//
iotVideoServer,
local, //
height, width, containerId = 'myPlayer',
// playUrl,
name,
global,
videoStyle,
changeData,
videoObj,
sizeWh,
slideDown, //
IsSize, //16:9
// videoObj = {
// type: 'yingshi',
// audio: false,
// serialNo: 'G75922040', //
// channelNo: 1, //
// yingshiToken: 'at.6nn6duwz8g8gbd919as9a6ea82bmn31x-709fnp7s3k-13q3v7e-mlov7lysf', //
// playUrlSd: 'ezopen://open.ys7.com/G75922040/1.live', //
// // playUrl: 'ws://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000003',
// playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live',
// replayUrl: 'ezopen://open.ys7.com/G75922040/1.hd.local.rec',
// },
// videoObj = {
// type: 'yingshi',
// audio: false,
// serialNo: 'G56385051', //
// channelNo: 1, //
// yingshiToken: 'at.6nn6duwz8g8gbd919as9a6ea82bmn31x-709fnp7s3k-13q3v7e-mlov7lysf', //
// playUrlSd: 'ezopen://open.ys7.com/G56384814/1.live', //
// // playUrl: 'ws://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000003',
// playUrlHd: 'ezopen://open.ys7.com/G56384814/1.hd.live',
// replayUrl: 'ezopen://open.ys7.com/G56384814/1.hd.local.rec',
// },
// videoObj = {
// type: 'cascade',
// audio: false,
// serialNo: '34020000001310000001', //
// topSerialNo: '34020000001110000077', //
// playUrlSd: 'http://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000001', //
// // playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live',
// // replayUrl: 'ezopen://open.ys7.com/G75922040/1.rec',
// },
//
iotVideoServer,
local, //
}) => {
console.log(videoObj);
if (videoObj.type == 'yingshi') {
videoObj = {
...videoObj,
playUrlSd: `ezopen://open.ys7.com/${videoObj.serialNo}/${videoObj.channelNo || '1'}.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`,
}
}
const [jessibuca, setjessibuca] = useState(null)
const [player, setPlayer] = useState(null)
const [isPlaying, setIsPlaying] = useState(false)
const [operationState, setoperationState] = useState()
const [voiceDisY, setVoiceDisY] = useState(0)
const [processDisX, setProcessDisX] = useState(0)
const [isAdjustProcess, setIsAdjustProcess] = useState(false)
const [histroyTime, setHistroyTime] = useState([])
const [histroyBegain, setHistroyBegain] = useState()
const [roll, setRoll] = useState()//
const [photo, setPhoto] = useState(1)//
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 [videoMask, setVideoMask] = useState(true) // sd hd
// ifream
const [yingshiPrepare, setYingshiPrepare] = useState('')
const operationRef = useRef(null)
const Begain = useRef()
const playBackTime = useRef([])
const quanp = useRef()
const processChangeTimeoutRef = useRef(null)
// ifream
const yingshiPrepareRef = useRef(null)
const playState = useRef(false) //
const player_ = useRef(null)
useEffect(() => {
setRoll(false)
}, [resolution]);
useEffect(() => {
setResolution(changeData?.hdChecked ? 'hd' : 'sd')
if (player) {
player.stop().then(() => {
player.play({ url: changeData?.hdChecked ? videoObj.playUrlHd : videoObj.playUrlSd })
})
}
}, [changeData?.hdChecked])
const changeSelectState = (key) => {
// if (videoObj.type == 'yingshi' && yingshiPrepareRef.current) {
// return
// }
const nextOperationState = JSON.parse(JSON.stringify(operationRef.current))
if (key == 'histroy' && nextOperationState.histroy.select) {
//
setProcessDisX(0)
setHistroyTime([])
playBackTime.current = []
}
for (let k in nextOperationState) {
if (k == key) {
nextOperationState[k].select = !nextOperationState[k].select
} else if (k !== 'fullScreen') {
nextOperationState[k].select = false
// console.log(sizeWh,videoObj);
if (videoObj.type == 'yingshi') {
videoObj = {
...videoObj,
playUrlSd: `ezopen://open.ys7.com/${videoObj.serialNo}/${videoObj.channelNo || '1'}.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`,
}
}
const [jessibuca, setjessibuca] = useState(null)
const [player, setPlayer] = useState(null)
const [isPlaying, setIsPlaying] = useState(false)
const [operationState, setoperationState] = useState()
const [voiceDisY, setVoiceDisY] = useState(0)
const [processDisX, setProcessDisX] = useState(0)
const [isAdjustProcess, setIsAdjustProcess] = useState(false)
const [histroyTime, setHistroyTime] = useState([])
const [histroyBegain, setHistroyBegain] = useState()
const [roll, setRoll] = useState()//
const [photo, setPhoto] = useState(1)//
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 [videoMask, setVideoMask] = useState(true) // sd hd
// ifream
const [yingshiPrepare, setYingshiPrepare] = useState('')
const operationRef = useRef(null)
const Begain = useRef()
const playBackTime = useRef([])
const quanp = useRef()
const processChangeTimeoutRef = useRef(null)
// ifream
const yingshiPrepareRef = useRef(null)
const playState = useRef(false) //
const player_ = useRef(null)
useEffect(() => {
setRoll(false)
}, [resolution]);
useEffect(() => {
setResolution(changeData?.hdChecked ? 'hd' : 'sd')
if (player) {
player.stop().then(() => {
player.play({ url: changeData?.hdChecked ? videoObj.playUrlHd : videoObj.playUrlSd })
})
}
}, [changeData?.hdChecked])
const changeSelectState = (key) => {
// if (videoObj.type == 'yingshi' && yingshiPrepareRef.current) {
// return
// }
const nextOperationState = JSON.parse(JSON.stringify(operationRef.current))
if (key == 'histroy' && nextOperationState.histroy.select) {
//
setProcessDisX(0)
setHistroyTime([])
playBackTime.current = []
}
for (let k in nextOperationState) {
if (k == key) {
nextOperationState[k].select = !nextOperationState[k].select
} else if (k !== 'fullScreen') {
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)
}
}
}, {
key: 'histroy',
hide: !Boolean(videoObj.replayUrl),
click: () => {
changeSelectState('histroy')
processChangeTimeoutRef.current = setTimeout(() => {
setHistroyBegain(
moment(histroyTime[0])
.add(
Math.abs(moment(histroyTime[0]).diff(moment(histroyTime[1]), 'seconds')) * (processDisX / document.getElementById('process_point').parentElement.offsetWidth),
'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(() => {
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
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 () => {
if (jessibuca) {
jessibuca.destroy()
}
if (player && videoObj.type == 'yingshi' && player) {
console.log(11111111111);
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(
moment(histroyTime[0])
.add(
Math.abs(moment(histroyTime[0]).diff(moment(histroyTime[1]), 'seconds')) * (processDisX / document.getElementById('process_point').parentElement.offsetWidth),
'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.play({ url: `${videoObj.replayUrl}?begin=${moment(Begain.current).format("YYYYMMDDHHmmss")}&end=${moment(playBackTime.current[1]).format("YYYYMMDDHHmmss")}` })
playState.current = false
})
} else {
//
document.getElementById('process_point').style.left = processDisX - 4.5 + 'px'
}
}
}, [processDisX])
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);
}
let $container = document.getElementById(containerId);
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)
}
}
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 {
//
document.getElementById('process_point').style.left = processDisX - 4.5 + 'px'
}
}
}, [processDisX])
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);
console.warn('传递宽高参数有误,请确认容器大小范围内')
if (containerWidth / 16 > containerHeight / 9) {
videoWidth = (containerHeight / 9) * 16
} else {
videoHeight = (containerWidth / 16) * 9
}
}
let $container = document.getElementById(containerId);
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)
}
if (videoObj.type == 'yingshi' && player) {
player.reSize(videoWidth, videoHeight)
}
setSize({ parentWidth: containerWidth, parentHeight: containerHeight, width: videoWidth, height: videoHeight })
return data == 'width' ? videoWidth : data == 'height' ? videoHeight : ''
}
}
useEffect(() => {
setupSize()
}, [sizeWh])
return (
<>
<div className="vcmp_videoplay" style={{ width: size?.parentWidth || '100%', height: size?.parentHeight || '100%', backgroundColor: 'black', overflow: 'hidden', display: 'flex', alignItems: 'center', justifyContent: 'center', }}>
<div id="vcmp_videoplay" style={{ position: 'relative', height: size?.height || '100%', width: size?.width || '100%', minWidth: 240, minHeight: 135, overflow: 'hidden' }}>
{/* 顶部信息 */}
<VideoHeader
operationState={operationState} changeSelectState={changeSelectState}
histroyTime={histroyTime}
setoperationState={setoperationState} name={name}
roll={roll}
videoObj={videoObj}
showTime={histroyBegain || moment()}
setProcessDisX={setProcessDisX}
content={videoObj.content}
videoStyle={videoStyle}
player={player}
resolution={resolution}
playState={playState.current}
/>
{/* 视频内容 */}
{
// <iframe
// frameBorder="0"
// allowFullScreen='true'
// id={containerId}
// src={
// `${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}`
// }
// // https://open.ys7.com/doc/zh/book/index/live_proto.html
// // {width: 400px;height: 300px;}
// width={'100%'}
// height={'100%'}
// wmode="transparent"
// style={{ pointerEvents: 'none' }}
// />
}
<div id={containerId} style={{ height: '100%', width: '100%', }}></div>
{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> : ''}
{/* 下方操作栏 */}
{/* 显示操作功能条件(宽高) */}
{size?.parentWidth > 320 ?
<VideoOperation
operationState={operationState} operation={operation}
voiceDisY={voiceDisY} setVoiceDisY={setVoiceDisY}
processDisX={processDisX} setProcessDisX={setProcessDisX}
isAdjustProcess={isAdjustProcess} setIsAdjustProcess={setIsAdjustProcess}
resolution={resolution} setResolution={setResolution}
histroyTime={histroyTime} setHistroyTime={setHistroyTime}
histroyBegain={histroyBegain}
play={play} pause={pause} closeSound={closeSound} openSound={openSound}
isPlaying={isPlaying}
videoObj={videoObj}
setYingshiPrepare={setYingshiPrepare}
yingshiPrepareRef={yingshiPrepareRef}
slideDown={slideDown}
setPlayer={setPlayer}
player={player}
playState={playState.current}
/> : ""
}
</div>
} else {
if (videoObj.type == 'yingshi' && player?.pluginStatus) {
player.reSize(width || sizeWh?.parentWidth, height || sizeWh?.parentHeight)
}
}
setSize({ parentWidth: containerWidth, parentHeight: containerHeight, width: videoWidth, height: videoHeight })
return data == 'width' ? videoWidth : data == 'height' ? videoHeight : ''
}
}
useEffect(() => {
setupSize()
}, [sizeWh])
return (
<>
<div className="vcmp_videoplay" style={{ width: size?.parentWidth || '100%', height: size?.parentHeight || '100%', backgroundColor: 'black', overflow: 'hidden', display: 'flex', alignItems: 'center', justifyContent: 'center', }}>
<div id="vcmp_videoplay" style={{ position: 'relative', height: size?.height || '100%', width: size?.width || '100%', minWidth: 240, minHeight: 135, overflow: 'hidden' }}>
{/* 顶部信息 */}
<VideoHeader
operationState={operationState} changeSelectState={changeSelectState}
histroyTime={histroyTime}
setoperationState={setoperationState} name={name}
roll={roll}
videoObj={videoObj}
showTime={histroyBegain || moment()}
setProcessDisX={setProcessDisX}
content={videoObj.content}
videoStyle={videoStyle}
player={player}
resolution={resolution}
playState={playState.current}
/>
{/* 视频内容 */}
{
// <iframe
// frameBorder="0"
// allowFullScreen='true'
// id={containerId}
// src={
// `${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}`
// }
// // https://open.ys7.com/doc/zh/book/index/live_proto.html
// // {width: 400px;height: 300px;}
// width={'100%'}
// height={'100%'}
// wmode="transparent"
// style={{ pointerEvents: 'none' }}
// />
}
<div id={containerId} style={{ height: '100%', width: '100%', }}></div>
{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> : ''}
{/* 下方操作栏 */}
{/* 显示操作功能条件(宽高) */}
{size?.parentWidth > 320 ?
<VideoOperation
operationState={operationState} operation={operation}
voiceDisY={voiceDisY} setVoiceDisY={setVoiceDisY}
processDisX={processDisX} setProcessDisX={setProcessDisX}
isAdjustProcess={isAdjustProcess} setIsAdjustProcess={setIsAdjustProcess}
resolution={resolution} setResolution={setResolution}
histroyTime={histroyTime} setHistroyTime={setHistroyTime}
histroyBegain={histroyBegain}
play={play} pause={pause} closeSound={closeSound} openSound={openSound}
isPlaying={isPlaying}
videoObj={videoObj}
setYingshiPrepare={setYingshiPrepare}
yingshiPrepareRef={yingshiPrepareRef}
slideDown={slideDown}
setPlayer={setPlayer}
player={player}
playState={playState.current}
/> : ""
}
</div>
</>
)
</div>
</>
)
}
function mapStateToProps (state) {
const { auth, global } = state;
return {
user: auth.user,
iotVideoServer: global.iotVideoServer,
};
const { auth, global } = state;
return {
user: auth.user,
iotVideoServer: global.iotVideoServer,
};
}
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 { connect } from 'react-redux';
import { Coming } from '$components'
import VideoScreen from '../components/videoScreen'
import '../style.less'
@ -9,10 +9,8 @@ import '../style.less'
const JournalingCenter = (props) => {
return (
// <Coming />
<>
<VideoScreen />
</>
<Coming />
)
}

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 [videoWidth, setVideoWidth] = useState()
const [videoHeight, setVideoHeight] = useState()
// console.log(videoObj);
useEffect(() => {
const resize_ = () => {
@ -25,19 +26,21 @@ const Container = ({ videoObj, pageSize }) => {
setVideoWidth(document.getElementById('videoo').clientWidth)
setVideoHeight(document.getElementById('videoo').clientHeight)
}, [pageSize])
console.log(videoWidth, videoHeight);
// console.log(videoWidth, videoHeight);
return (
<div style={{ width: videoWidth || '100%', height: videoHeight || '100%', padding: 5 }}>
<VideoPlay sizeWh={{
width: videoWidth - 10,
height: videoHeight - 10,
parentWidth: videoWidth - 10,
parentHeight: videoHeight - 10,
}}
videoObj={videoObj}
videoStyle='true'
containerId={videoObj.name}
local={true} />
<div style={{ width: videoWidth || '100%', height: videoHeight || '100%', padding: 5 }}>
{videoWidth && videoHeight ?
<VideoPlay sizeWh={{
width: videoWidth - 10,
height: videoHeight - 40,
parentWidth: videoWidth - 10,
parentHeight: videoHeight - 40,
}}
videoObj={videoObj.videoData}
videoStyle='true'
containerId={videoObj.label}
local={true} /> : ""}
<div style={{lineHeight:'30px',paddingLeft:6}}>{videoObj?.label}</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 }) => {
let span = 8
let rowsCount = 2
if (pageSize === 1) {
@ -29,7 +26,7 @@ const VideoCard = ({ data, pageSize }) => {
rowsCount = 3
}
let cheight = Math.floor(100 / rowsCount) + "%"
console.log(pageSize,span,cheight);
return (
<>
<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 { 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 VideoCard from './videoCard'
const VideoScreen = (props) => {
const treeData = [{
label: '公司',
value: '公司',
key: '0-1',
children: [
{
label: '大门',
value: '大门',
key: '0-1-1',
videoData: {
channelNo: 1,
content: ['5442542542', '452345', '234524525'],
serialNo: "F61504020",
type: "yingshi",
yingshiToken: "at.7pl4c5orb9fpndtlbjpsn5m11szujnf7-1laxxre0ob-010o8fw-kqeuwthva"
}
}, {
label: '机房',
value: '机房',
key: '0-1-2',
videoData: {
channelNo: 3,
content: ['5442542542', '452345', '234524525'],
serialNo: "F61504020",
type: "yingshi",
yingshiToken: "at.7pl4c5orb9fpndtlbjpsn5m11szujnf7-1laxxre0ob-010o8fw-kqeuwthva"
}
}, {
label: '后门',
value: '后门',
key: '0-1-3',
videoData: {
channelNo: 1,
content: ['5442542542', '452345', '234524525'],
serialNo: "F61504020",
type: "yingshi",
yingshiToken: "at.7pl4c5orb9fpndtlbjpsn5m11szujnf7-1laxxre0ob-010o8fw-kqeuwthva"
}
},
]
}, {
label: '外部',
value: '外部',
key: '0-2',
children: [
{
label: '水库',
value: '水库',
key: '0-2-1',
children: [
{
label: '房子',
value: '房子',
key: '0-2-1-1',
videoData: {
channelNo: 1,
content: ['5442542542', '452345', '234524525'],
serialNo: "F61504020",
type: "yingshi",
yingshiToken: "at.7pl4c5orb9fpndtlbjpsn5m11szujnf7-1laxxre0ob-010o8fw-kqeuwthva",
}
},
]
},
]
}, {
label: '外',
value: '外',
key: '0-3',
children: [
{
label: '库',
value: '库',
key: '0-3-1',
children: [
{
label: '子',
value: '子',
key: '0-3-1-1',
},
]
},
]
}]
const treeData = [
{
label: '公司',
value: '公司',
key: '0-1',
children: [
{
label: '大门',
value: '大门',
key: '0-1-1',
videoData: {
channelNo: 1,
content: ['5442542542', '452345', '234524525'],
serialNo: "F61504020",
type: "yingshi",
yingshiToken: "at.6vznnc23bv51vzjt7lnkj7e19bb2z61f-3gnj7m5lxp-10666cy-bgwcjkekk"
}
}, {
label: '机房',
value: '机房',
key: '0-1-2',
videoData: {
channelNo: 3,
content: ['5442542542', '452345', '234524525'],
serialNo: "F61504020",
type: "yingshi",
yingshiToken: "at.6vznnc23bv51vzjt7lnkj7e19bb2z61f-3gnj7m5lxp-10666cy-bgwcjkekk"
}
}, {
label: '后门',
value: '后门',
key: '0-1-3',
videoData: {
channelNo: 2,
content: ['5442542542', '452345', '234524525'],
serialNo: "F61504020",
type: "yingshi",
yingshiToken: "at.6vznnc23bv51vzjt7lnkj7e19bb2z61f-3gnj7m5lxp-10666cy-bgwcjkekk"
}
},
]
},
{
label: '外部',
value: '外部',
key: '0-2',
children: [
{
label: '水库',
value: '水库',
key: '0-2-1',
children: [
{
label: '房子',
value: '房子',
key: '0-2-1-1',
videoData: {
channelNo: null,
content: ['5442542542', '452345', '234524525'],
serialNo: "G56384764",
type: "yingshi",
yingshiToken: "at.c7dnknnvd4irh8zddul3dgkpb4f3oz83-4n6u7zv8st-1gxz7ny-lgffyh25z",
}
},
]
},
]
}, {
label: '外',
value: '外',
key: '0-3',
children: [
{
label: '库',
value: '库',
key: '0-3-1',
children: [
{
label: '子',
value: '子',
key: '0-3-1-1',
},
]
},
]
}]
const [pageSize, setPageSize] = useState(4) //
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 [queryValue, setQueryValue] = useState(['全部']) //
const [leftValue, setLeftValue] = useState() //
const [leftValue, setLeftValue] = useState(treeData.map(v => v.value)) //
const api = useRef();
@ -106,27 +108,52 @@ const VideoScreen = (props) => {
query.push({ label: v.label, value: v.value, key: v.key })
])
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(() => {
if (treeData && queryValue.includes('全部')) {
setLefTtree(treeData)
} else {
let leftData = []
queryValue.map(item => leftData.push(treeData?.find(({ value }) => item == value))) //
setLefTtree([{ label: '全部', value: '全部', key: '0', children: leftData }])
queryValue.map(item => {
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(() => {
setLeftValue()
}, [])
//
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%',
backgroundSize: '100% 100%',
color: '#FFFFFF',
position: 'absolute', minWidth: 1000,
// minWidth: 1000,
}}>
{/* 头部标题 */}
<div style={{
@ -185,9 +212,9 @@ const VideoScreen = (props) => {
</div>
<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>查询
<TreeSelect
style={{ width: 150, }}
@ -208,17 +235,18 @@ const VideoScreen = (props) => {
multiple
treeData={leftTree}
defaultExpandAll
defaultValue={['公司','外部']}
value={leftValue}
blockNode={false}
onChange={(e) => {
console.log(e);
setLeftValue(e)
}}
onSelect={(e)=>{
onSelect={(e) => {
console.log(e);
}}
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 style={{
flex: 1, marginLeft: '10px', border: '2px solid #003D9E',
@ -292,15 +320,35 @@ const VideoScreen = (props) => {
</Button> */}
</div>
</div>
<div style={{ display: 'flex', height: `calc( 100% - 160px )` }}>
<div style={{ display: 'flex', height: '100%' }}>
{/* 视频 */}
<div style={{ flex: 1, height: '100%' }}>
<Row style={{ height: '100%' }}>
{/* {data.map((v, index) => {
console.log(v);
<Row style={{ height: `calc( 100% - 160px )` }}>
{playData?.map((v, index) => {
return <VideoCard key={'VideoCard' + index} data={v} pageSize={pageSize} />
})} */}
})}
</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 style={{
@ -313,7 +361,6 @@ const VideoScreen = (props) => {
return <div key={index}>
<Popover
position='left'
trigger='click'
content={() => {
switch (v.value) {
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 {
.semi-tree-option,
.semi-icon,
.semi-checkbox-addon, //全选文字
.semi-form-field-label-text {
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 '../style.less'
import { Tree, Popconfirm, Typography, Input, Switch, Modal, Checkbox, CheckboxGroup } from "@douyinfe/semi-ui";
import VideoScreen from '../components/videoScreen'
const MirroringDetail = (props) => {
const { history, dispatch, actions, user, loading, StatusPushList } = props;
const { openness } = actions;
useEffect(() => {
const { history, dispatch, actions, user, loading, StatusPushList } = props;
const { openness } = actions;
useEffect(() => {
}, []);
// const = useRef(0)
}, []);
// const = useRef(0)
const [chooseNum, setChooseNum] = useState(0);//tab
const [chooseList, setChooseList] = useState(['节点', '样式', '功能']);
const [editKey, setEditKey] = useState('')
const [comingVisible, setComingVisible] = useState(false)
const [treeData, setTreeData] = useState([//
{
label: '主要节点1',
value: '0',
key: '0',
},
]);
const searchData = useRef({})//
const [search, setSearch] = useState({}); //
const [indeterminate, setIndeterminate] = useState(true);//
const [checkAll, setCheckall] = useState(false);//
const onCheckAllChange = (e) => {//
console.log(e);
setCheckedList(e.target.checked ? plainOptions : []);
setIndeterminate(false);
setCheckall(e.target.checked);
};
const equipmentGetCamera = () => {
searchData.current = { ...search }
dispatch(openness.getCamera(searchData.current)).then((res) => {
// limits.current = res.payload.data.data.length
console.log(res.payload.data.data);
});
}
useEffect(() => {
equipmentGetCamera();
}, []);
function nodeDelete (item) {//
let mainData = JSON.parse(JSON.stringify(treeData))
let nodeKeyArr = item.key.split('-')
if (nodeKeyArr.length == 1) {
mainData.splice(
mainData.indexOf(mainData.find(function (element) {
return element.key === item.key
})), 1)
} else if (nodeKeyArr.length == 2) {
for (let index = 0; index < mainData.length; index++) {
mainData[index].children.splice(
mainData[index].children.indexOf(mainData[index].children.find(function (element) {
return element.key === item.key
})), 1)
const [chooseNum, setChooseNum] = useState(0);//tab
const [chooseList, setChooseList] = useState(['节点', '样式', '功能']);
const [editKey, setEditKey] = useState('')
const [comingVisible, setComingVisible] = useState(false)
const [treeData, setTreeData] = useState([//
{
label: '主要节点1',
value: '0',
key: '0',
},
]);
const searchData = useRef({})//
const [search, setSearch] = useState({}); //
const [indeterminate, setIndeterminate] = useState(true);//
const [checkAll, setCheckall] = useState(false);//
const onCheckAllChange = (e) => {//
console.log(e);
setCheckedList(e.target.checked ? plainOptions : []);
setIndeterminate(false);
setCheckall(e.target.checked);
};
const equipmentGetCamera = () => {
searchData.current = { ...search }
dispatch(openness.getCamera(searchData.current)).then((res) => {
// limits.current = res.payload.data.data.length
console.log(res.payload.data.data);
});
}
useEffect(() => {
equipmentGetCamera();
}, []);
function nodeDelete (item) {//
let mainData = JSON.parse(JSON.stringify(treeData))
let nodeKeyArr = item.key.split('-')
if (nodeKeyArr.length == 1) {
mainData.splice(
mainData.indexOf(mainData.find(function (element) {
return element.key === item.key
})), 1)
} else if (nodeKeyArr.length == 2) {
for (let index = 0; index < mainData.length; index++) {
mainData[index].children.splice(
mainData[index].children.indexOf(mainData[index].children.find(function (element) {
return element.key === item.key
})), 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++) {
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 == 4) {
for (let k = 0; k < mainData.length; k++) {
for (let j = 0; j < mainData[k].children.length; j++) {
for (let i = 0; i < mainData[k].children[j].children.length; i++) {
mainData[k].children[j].children[i].children.splice(
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++) {
for (let i = 0; i < mainData[k].children[j].children.length; i++) {
mainData[k].children[j].children[i].children.splice(
mainData[k].children[j].children[i].children.indexOf(mainData[k].children[j].children[i].children.find(function (element) {
return element.key === item.key
})), 1)
}
}
}
}
setTreeData(mainData)
}
function nodeAdd (item) {//
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) {
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)
}
function nodeAdd (item) {//
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) {
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',
}]
}
}
}
} else if (nodeKeyArr.length == 2) {
for (let index = 0; index < mainData.length; index++) {
for (let j = 0; j < mainData[index].children.length; j++) {
if (mainData[index].children[j].key == item.key) {
if (mainData[index].children[j].children && mainData[index].children[j].children.length > 0) {
let mainKey = mainData[index].children[j].children[mainData[index].children[j].children.length - 1].key
let thekeyarr = mainKey.split('-')
mainData[index].children[j].children.push({
label: '三级节点' + (Number(thekeyarr[2]) + 2),
value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-' + (Number(thekeyarr[2]) + 1),
key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-' + (Number(thekeyarr[2]) + 1),
})
}
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',
}]
}
}
}
} else if (nodeKeyArr.length == 2) {
for (let index = 0; index < mainData.length; index++) {
for (let j = 0; j < mainData[index].children.length; j++) {
if (mainData[index].children[j].key == item.key) {
if (mainData[index].children[j].children && mainData[index].children[j].children.length > 0) {
let mainKey = mainData[index].children[j].children[mainData[index].children[j].children.length - 1].key
let thekeyarr = mainKey.split('-')
mainData[index].children[j].children.push({
label: '三级节点' + (Number(thekeyarr[2]) + 2),
value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-' + (Number(thekeyarr[2]) + 1),
key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-' + (Number(thekeyarr[2]) + 1),
})
}
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)
}
function changeLable (value, item) {//
console.log('valvalval', value);
console.log('itemitem', item);
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
}
}
setTreeData(mainData)
}
function changeLable (value, item) {//
console.log('valvalval', value);
console.log('itemitem', item);
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++) {
for (let j = 0; j < mainData[index].children.length; j++) {
if (mainData[index].children[j].key == item.key) {
mainData[index].children[j].label = value
}
}
} else if (nodeKeyArr.length == 2) {
for (let index = 0; index < mainData.length; index++) {
for (let j = 0; j < mainData[index].children.length; j++) {
if (mainData[index].children[j].key == item.key) {
mainData[index].children[j].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++) {
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++) {
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
}
}
}
}
}
setTreeData(mainData)
}
function lableBlur () {
setEditKey('')
}
function cameraAdd (item) {//
}
}
setTreeData(mainData)
}
function lableBlur () {
setEditKey('')
}
function cameraAdd (item) {//
}
const renderLabel = (label, item) => {//
let keyArr = item.key.split('-')
return (
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
{
keyArr.length == 1 ? (
<div style={{ display: 'flex' }}>
<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) }}>
}
const renderLabel = (label, item) => {//
let keyArr = item.key.split('-')
return (
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
{
keyArr.length == 1 ? (
<div style={{ display: 'flex' }}>
<div style={{ width: 13, height: 10 }}>
<img
src="/assets/images/imageImg/nodeEdit.png"
alt="编辑"
style={{ width: '100%' }}
src="/assets/images/imageImg/folder.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
src="/assets/images/imageImg/nodeadd.png"
alt="添加子节点"
style={{ width: '100%' }}
/>
</div>
)
}
</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}>
</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/toback.png"
alt="设置"
style={{ width: '100%' }}
src="/assets/images/imageImg/nodeCamera.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' }}>
</div>
) : ('')
}
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => { setEditKey(item.key) }}>
<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
src="/assets/images/imageImg/nameChange.png"
alt="设置"
style={{ width: '100%' }}
src="/assets/images/imageImg/nodeadd.png"
alt="添加子节点"
style={{ width: '100%' }}
/>
</div>
</div>
<div style={{ display: 'flex', }}>
<div style={{ width: 22, height: 22, marginRight: 30, cursor: 'pointer' }}>
</div>
)
}
</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
src="/assets/images/imageImg/save.png"
alt="设置"
style={{ width: '100%' }}
src="/assets/images/imageImg/addMainNodes.png"
alt="设置"
style={{ width: '100%' }}
/>
</div>
<div style={{ width: 22, height: 22, marginRight: 44, cursor: 'pointer' }}>
</div>
<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
src="/assets/images/imageImg/upload.png"
alt="设置"
style={{ width: '100%' }}
src="/assets/images/imageImg/close.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
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>
<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>
<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
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 style={{ width: 32, height: 32 }}>
<img
src="/assets/images/imageImg/find.png"
alt="设置"
style={{ width: '100%' }}
/>
</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={{ display: 'flex' }}>
<div>
<Checkbox
indeterminate={indeterminate}
onChange={onCheckAllChange}
checked={checkAll}
aria-label="Checkbox 示例"
>
全选
</Checkbox>
</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>
<Checkbox onChange={checked => console.log(checked)} aria-label="Checkbox 示例">隐藏添加过的</Checkbox>
</div>
</div>
</div>
<div style={{flex:1}}>
</div>
</div>
</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>
<Modal
title="提醒"
visible={comingVisible}
onOk={() => {
setComingVisible(false)
}}
width={610}
onCancel={() => {
setComingVisible(false)
}}
okText="确定"
cancelText="取消"
closeOnEsc={true}
>
开发中敬请期待~
</Modal>
</div>
)
</div>
<Modal
title="提醒"
visible={comingVisible}
onOk={() => {
setComingVisible(false)
}}
width={610}
onCancel={() => {
setComingVisible(false)
}}
okText="确定"
cancelText="取消"
closeOnEsc={true}
>
开发中敬请期待~
</Modal>
</div>
)
}
function mapStateToProps (state) {
const { auth, global } = state;
return {
user: auth.user,
actions: global.actions,
};
const { auth, global } = state;
return {
user: auth.user,
actions: global.actions,
};
}
export default connect(mapStateToProps)(MirroringDetail);

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

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

Loading…
Cancel
Save