Browse Source

视频播放修改

dev_trial
wenlele 2 years ago
parent
commit
e6fe7868ff
  1. 4
      code/VideoAccess-VCMP/api/.vscode/launch.json
  2. 1
      code/VideoAccess-VCMP/api/app/lib/middlewares/authenticator.js
  3. 21
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperation.jsx
  4. 2
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperationCloudControl.jsx
  5. 16
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperationHistroyTime.jsx
  6. 2
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperationTalk.jsx
  7. 14
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx
  8. 15
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx
  9. 3
      code/VideoAccess-VCMP/web/client/src/layout/containers/layout/index.jsx
  10. 30
      code/VideoAccess-VCMP/web/client/src/layout/index.jsx
  11. 6
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx
  12. 2
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx
  13. 2
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  14. 2
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx
  15. 129
      code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/videoPlayCross.jsx
  16. 3
      code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/videoPlayCross.less
  17. 2
      code/VideoAccess-VCMP/web/client/src/sections/offline/containers/carrierpigeon.jsx
  18. 2
      code/VideoAccess-VCMP/web/client/src/sections/offline/containers/statuscode.jsx
  19. 1
      code/VideoAccess-VCMP/web/client/src/sections/openness/containers/callService.jsx
  20. 2
      code/VideoAccess-VCMP/web/package.json

4
code/VideoAccess-VCMP/api/.vscode/launch.json

@ -15,8 +15,8 @@
"args": [ "args": [
"-p 4000", "-p 4000",
"-f http://localhost:4000", "-f http://localhost:4000",
"-g postgres://postgres:123@10.8.30.166:5432/video-access", // "-g postgres://postgres:123@10.8.30.166:5432/video-access",
// "-g postgres://postgres:123@10.8.30.166:5432/video_access-dev", "-g postgres://postgres:123@10.8.30.166:5432/video_access-dev",
"--redisHost 10.8.30.112", "--redisHost 10.8.30.112",
"--redisPort 6379", "--redisPort 6379",
"--axyApiUrl http://127.0.0.1:4100", "--axyApiUrl http://127.0.0.1:4100",

1
code/VideoAccess-VCMP/api/app/lib/middlewares/authenticator.js

@ -83,6 +83,7 @@ let authorizeToken = async function (ctx, token) {
ctx.fs.api.token = token; ctx.fs.api.token = token;
} }
} catch (err) { } catch (err) {
console.log(11111111111,err);
const { error } = err.response || {}; const { error } = err.response || {};
ctx.fs.logger.log('[anxinyun]', '[AUTH] failed', (error || {}).message || `cannot GET /users/${token}`); ctx.fs.logger.log('[anxinyun]', '[AUTH] failed', (error || {}).message || `cannot GET /users/${token}`);
} }

21
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperation.jsx

@ -26,14 +26,17 @@ const VideoOperation = ({
isPlaying, isPlaying,
videoObj, videoObj,
setYingshiPrepare, yingshiPrepareRef, setYingshiPrepare, yingshiPrepareRef,
slideDown, slideDown, playBackTime,
player, player,
// setPlayer, // setPlayer,
playState, playState,
videoFront, videoFront,
videoAfter showTime_,
videoAfter,
showTimeSelect,
setShowTimeSelect
}) => { }) => {
const [showTimeSelect, setShowTimeSelect] = useState(false)
const butStyle = { const butStyle = {
border: '1px solid #fff', color: '#fff', padding: '0 10px', border: '1px solid #fff', color: '#fff', padding: '0 10px',
@ -64,6 +67,8 @@ const VideoOperation = ({
} }
const histroySelected = operationState && operationState.histroy.select const histroySelected = operationState && operationState.histroy.select
const vcmp_videoplayHeight = document.getElementById("vcmp_videoplay" + videoObj.id)?.clientHeight
const vcmp_videoplaWidth = document.getElementById('vcmp_videoplay' + videoObj.id)?.clientWidth
return ( return (
<> <>
@ -80,7 +85,7 @@ const VideoOperation = ({
{ {
showTimeSelect ? showTimeSelect ?
<VideoOperationHistroyTime <VideoOperationHistroyTime
close={() => { setShowTimeSelect(false) }} histroyTime={histroyTime} setHistroyTime={setHistroyTime} setProcessDisX={setProcessDisX} close={() => { setShowTimeSelect(false) }} videoObj={videoObj} setIsAdjustProcess={setIsAdjustProcess} playBackTime={playBackTime} histroyTime={histroyTime} setHistroyTime={setHistroyTime} setProcessDisX={setProcessDisX}
/> />
: '' : ''
} }
@ -113,7 +118,7 @@ const VideoOperation = ({
: '' : ''
} }
<span style={{ marginLeft: 12 }}> <span style={{ marginLeft: 12 }}>
{histroyTime.length ? `${moment(histroyTime[0]).format(timeFormat)} / ${moment(histroyTime[1]).format(timeFormat)}` : ''} {histroyTime.length ? `${showTime_} / ${moment(histroyTime[1]).format(timeFormat)}` : ''}
</span> </span>
</div> </div>
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
@ -123,9 +128,9 @@ const VideoOperation = ({
<VideoOperationSpeed butStyle={butStyle} /> <VideoOperationSpeed butStyle={butStyle} />
: '' : ''
} }
<div style={butStyle} onClick={() => { {vcmp_videoplayHeight > 359 && vcmp_videoplaWidth > 599 ? <div style={butStyle} onClick={() => {
setShowTimeSelect(!showTimeSelect) setShowTimeSelect(!showTimeSelect)
}}>时间设置</div> }}>时间设置</div> : ""}
</div> </div>
</> </>
: :
@ -136,7 +141,7 @@ const VideoOperation = ({
operation.map(p => { operation.map(p => {
if (p.hide) return null; if (p.hide) return null;
return <img return <img
src={`/assets/images/background/video-icon-${p.key}-${operationState[p.key].select ? 'select' : 'unselect'}.png`} src={`${__webpack_public_path__}assets/images/background/video-icon-${p.key}-${operationState[p.key].select ? 'select' : 'unselect'}.png`}
height={18} height={18}
style={{ marginRight: 24, cursor: 'pointer' }} style={{ marginRight: 24, cursor: 'pointer' }}
onClick={(e) => { p.click() }} onClick={(e) => { p.click() }}

2
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperationCloudControl.jsx

@ -40,7 +40,7 @@ const VideoOperationCloudControl = ({
}].map((s, i) => { }].map((s, i) => {
return ( return (
<img <img
src="/assets/images/background/up.png" src={`${__webpack_public_path__}assets/images/background/up.png`}
style={Object.assign({ style={Object.assign({
height: 24, width: 24, display: 'inline-block', transform: `rotate(${i * 90}deg)`, height: 24, width: 24, display: 'inline-block', transform: `rotate(${i * 90}deg)`,
position: 'absolute' position: 'absolute'

16
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperationHistroyTime.jsx

@ -6,7 +6,7 @@ import moment from "moment";
const timeFormat = 'YYYY-MM-DD HH:mm:ss' const timeFormat = 'YYYY-MM-DD HH:mm:ss'
const VideoOperationHistroyTime = ({ close, histroyTime, setHistroyTime, setProcessDisX,videoObj }) => { const VideoOperationHistroyTime = ({ close, histroyTime, setHistroyTime, setProcessDisX,playBackTime,setIsAdjustProcess }) => {
const [selectedTimeRange, setSelectedTimeRange] = useState(histroyTime) const [selectedTimeRange, setSelectedTimeRange] = useState(histroyTime)
useEffect(() => { useEffect(() => {
@ -21,9 +21,9 @@ const VideoOperationHistroyTime = ({ close, histroyTime, setHistroyTime, setProc
return ( return (
<div style={{ <div style={{
position: 'absolute', top: 'calc(50% - 90px)', left: 'calc(50% - 260px)', position: 'absolute', top: 'calc(50% - 130px)', left: 'calc(50% - 220px)',
width: 520, height: 180, backgroundColor: '#000000A5', padding: '40px 30px', width:440, height: 150, backgroundColor: '#000000A5', padding: 20,
display: 'flex', flexDirection: 'column', justifyContent: 'space-between' display: 'flex', flexDirection: 'column', justifyContent: 'space-around'
}}> }}>
<div style={{ display: 'flex', justifyContent: 'center' }}> <div style={{ display: 'flex', justifyContent: 'center' }}>
<DatePicker <DatePicker
@ -32,8 +32,9 @@ const VideoOperationHistroyTime = ({ close, histroyTime, setHistroyTime, setProc
value={selectedTimeRange} value={selectedTimeRange}
onChange={(t, timeRange) => { onChange={(t, timeRange) => {
setSelectedTimeRange(timeRange) setSelectedTimeRange(timeRange)
console.log(timeRange);
}} }}
style={{ width: '100%' }} style={{ width: 354 }}
// disabledDate={(date, options) => { // disabledDate={(date, options) => {
// const { rangeStart, rangeEnd } = options; // const { rangeStart, rangeEnd } = options;
// // console.log(date, options); // // console.log(date, options);
@ -54,7 +55,7 @@ const VideoOperationHistroyTime = ({ close, histroyTime, setHistroyTime, setProc
</div> </div>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', }}> <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', }}>
<span style={{ color: '#FF7100' }}> <span style={{ color: '#FF7100' }}>
<img src={`/assets/images/background/warning.png`} height={14} style={{ position: 'relative', top: 2, marginRight: 2 }} /> <img src={`${__webpack_public_path__}assets/images/background/warning.png`} height={14} style={{ position: 'relative', top: 2, marginRight: 2 }} />
最长时间跨度不超过72小时 最长时间跨度不超过72小时
</span> </span>
<span> <span>
@ -76,7 +77,8 @@ const VideoOperationHistroyTime = ({ close, histroyTime, setHistroyTime, setProc
return ToastInCustomContainer.error('所选时间超过 72 小时') return ToastInCustomContainer.error('所选时间超过 72 小时')
} }
setHistroyTime(selectedTimeRange) setHistroyTime(selectedTimeRange)
playBackTime.current = selectedTimeRange playBackTime = selectedTimeRange
setIsAdjustProcess(true)
setProcessDisX(0) setProcessDisX(0)
close() close()
} }

2
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperationTalk.jsx

@ -64,7 +64,7 @@ const VideoOperationTalk = ({
position: 'absolute', top: 'calc(50% - 88px)', left: 'calc(50% - 156px)', position: 'absolute', top: 'calc(50% - 88px)', left: 'calc(50% - 156px)',
width: 312, height: 186, backgroundColor: '#000000A5', transform: `scale(${vcmpVideo / 400 > 1.5 ? 1.5 : vcmpVideo / 400})`, width: 312, height: 186, backgroundColor: '#000000A5', transform: `scale(${vcmpVideo / 400 > 1.5 ? 1.5 : vcmpVideo / 400})`,
}}> }}>
<img src={`/assets/images/background/${recordState == RecordState.START ? 'talking' : 'talk'}.png`} style={{ display: 'block', margin: '12px auto' }} /> <img src={`${__webpack_public_path__}assets/images/background/${recordState == RecordState.START ? 'talking' : 'talk'}.png`} style={{ display: 'block', margin: '12px auto' }} />
<div <div
style={{ style={{
height: 32, width: 88, textAlign: 'center', margin: 'auto', color: '#fff', backgroundColor: '#1859C1', height: 32, width: 88, textAlign: 'center', margin: 'auto', color: '#fff', backgroundColor: '#1859C1',

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

@ -101,6 +101,9 @@ const VideoPlay = ({ dispatch, actions,
const [disappear, setDisappear] = useState(false) // const [disappear, setDisappear] = useState(false) //
const [numbers, setNumbers] = useState(false) const [numbers, setNumbers] = useState(false)
const [written, setWritten] = useState('') const [written, setWritten] = useState('')
const [showTime_, setShowTime] = useState('')
const [showTimeSelect, setShowTimeSelect] = useState(false)
const [hideFullScreenBut, setHideFullScreenBut] = useState(false) const [hideFullScreenBut, setHideFullScreenBut] = useState(false)
@ -337,6 +340,7 @@ const VideoPlay = ({ dispatch, actions,
} }
}, [histroyTime]) }, [histroyTime])
useEffect(() => { useEffect(() => {
// console.log(processDisX);
if (operationState && operationState.histroy.select) { if (operationState && operationState.histroy.select) {
if (isAdjustProcess) { if (isAdjustProcess) {
// //
@ -367,6 +371,7 @@ const VideoPlay = ({ dispatch, actions,
player.stop().then(() => { player.stop().then(() => {
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
setIsAdjustProcess(false)
}) })
} else { } else {
// //
@ -567,6 +572,9 @@ const VideoPlay = ({ dispatch, actions,
playState={playState.current} playState={playState.current}
videoFront={videoFront} videoFront={videoFront}
videoAfter={videoFront} videoAfter={videoFront}
showTime_={showTime_}
setShowTime={setShowTime}
setShowTimeSelect={setShowTimeSelect}
/> />
{/* 视频内容 */} {/* 视频内容 */}
{ {
@ -599,7 +607,7 @@ const VideoPlay = ({ dispatch, actions,
{/* 下方操作栏 */} {/* 下方操作栏 */}
{/* 显示操作功能条件(宽高) */} {/* 显示操作功能条件(宽高) */}
{size?.parentWidth > 480 ? {size?.parentWidth > 479 ?
<VideoOperation <VideoOperation
operationState={operationState} operation={operation} operationState={operationState} operation={operation}
voiceDisY={voiceDisY} setVoiceDisY={setVoiceDisY} voiceDisY={voiceDisY} setVoiceDisY={setVoiceDisY}
@ -619,6 +627,10 @@ const VideoPlay = ({ dispatch, actions,
videoFront={videoFront} videoFront={videoFront}
videoAfter={videoFront} videoAfter={videoFront}
playState={playState.current} playState={playState.current}
showTime_={showTime_}
playBackTime={playBackTime.current}
showTimeSelect={showTimeSelect}
setShowTimeSelect={setShowTimeSelect}
/> : "" /> : ""
} }
</div> </div>

15
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx

@ -8,10 +8,10 @@ import './videoPlay.less';
const timeFormat = 'YYYY-MM-DD HH:mm:ss' const timeFormat = 'YYYY-MM-DD HH:mm:ss'
const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name, videoObj, showTime, histroyTime, content, roll, videoStyle, player, resolution, playState }) => { const VideoHeader = ({ setShowTimeSelect,showTime_, setShowTime, operationState, changeSelectState, setProcessDisX, name, videoObj, showTime, histroyTime, content, roll, videoStyle, player, resolution, playState }) => {
const time = useRef(moment(showTime || undefined)) const time = useRef(moment(showTime || undefined))
const upTimeInterval = useRef(null) const upTimeInterval = useRef(null)
const [showTime_, setShowTime] = useState(' ')
const updateTime = () => { const updateTime = () => {
if (!showTime) { if (!showTime) {
@ -55,6 +55,7 @@ const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name,
const goBack = () => { const goBack = () => {
changeSelectState('histroy') changeSelectState('histroy')
setShowTimeSelect(false)
if (playState) { if (playState) {
player.stop().then(() => { player.stop().then(() => {
if (resolution == 'sd') { if (resolution == 'sd') {
@ -73,7 +74,7 @@ const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name,
const vcmp_videopla = document.getElementById('vcmp_videoplay' + videoObj.id)?.clientWidth const vcmp_videopla = document.getElementById('vcmp_videoplay' + videoObj.id)?.clientWidth
return ( return (
<div> vcmp_videopla < 300 ? '' : <div>
<div style={{ <div style={{
height: '12%', height: '12%',
lineHeight: `${vcmp_videoplay * 0.12 > 42 ? 42 : vcmp_videoplay * 0.12 < 30 ? 30 : vcmp_videoplay * 0.12}px`, lineHeight: `${vcmp_videoplay * 0.12 > 42 ? 42 : vcmp_videoplay * 0.12 < 30 ? 30 : vcmp_videoplay * 0.12}px`,
@ -86,8 +87,8 @@ const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name,
color: '#fff' color: '#fff'
}}> }}>
<Row> <Row>
<Col span={videoStyle == 'true' ? histroyTime.length ? 3 : 0 : 9} style={{ <Col span={videoStyle == 'true' ? (histroyTime.length ? 3 : 0) : (vcmp_videopla < 500 ? 14 : 9)} style={{
backgroundImage: videoStyle == 'true' ? "" : 'url(/assets/images/background/videoPlayBg.png)', backgroundImage: videoStyle == 'true' ? "" : `url(${__webpack_public_path__}assets/images/background/videoPlayBg.png)`,
backgroundSize: '100% 100%', backgroundSize: '100% 100%',
backgroundRepeat: 'no-repeat', backgroundRepeat: 'no-repeat',
padding: '0 12px' padding: '0 12px'
@ -103,14 +104,14 @@ const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name,
'' : `${showTime_} ${name || ''}` '' : `${showTime_} ${name || ''}`
} }
</Col> </Col>
<Col span={videoStyle == 'true' ? histroyTime.length ? 21 : 24 : vcmp_videopla > 480 ? 15 : 10} style={{}}> <Col span={videoStyle == 'true' ? histroyTime.length ? 21 : 24 : vcmp_videopla < 500 ? 10 : 15} style={{}}>
<div style={{ paddingRight: 12 }}> <div style={{ paddingRight: 12 }}>
{content && content?.length > 0 ? <TextScroll content={content || []} duration={6} videoObj={videoObj} /> : ""} {content && content?.length > 0 ? <TextScroll content={content || []} duration={6} videoObj={videoObj} /> : ""}
</div> </div>
</Col> </Col>
</Row> </Row>
</div> </div>
</div> </div >
) )
} }

3
code/VideoAccess-VCMP/web/client/src/layout/containers/layout/index.jsx

@ -49,7 +49,6 @@ const LayoutContainer = props => {
useEffect(() => { useEffect(() => {
NProgress.done(); NProgress.done();
console.log(user, authCrossLoading, props);
if ((!user || !user.authorized) && !authCrossLoading && props.location.pathname != '/video_play_status') { if ((!user || !user.authorized) && !authCrossLoading && props.location.pathname != '/video_play_status') {
history.push('/signin'); history.push('/signin');
} }
@ -84,7 +83,7 @@ const LayoutContainer = props => {
// websocket 使 // websocket 使
useEffect(() => { useEffect(() => {
console.log(socket) // console.log(socket)
if (socket) { if (socket) {
socket.on('CAMERA_ONLINE', function (msg) { socket.on('CAMERA_ONLINE', function (msg) {
console.info(msg); console.info(msg);

30
code/VideoAccess-VCMP/web/client/src/layout/index.jsx

@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react';
import moment from 'moment'; import moment from 'moment';
import configStore from './store'; import configStore from './store';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import { createBrowserHistory } from 'history'; import { createBrowserHistory, push as pushs } from 'history';
import { ConnectedRouter } from 'connected-react-router' import { ConnectedRouter } from 'connected-react-router'
import { Layout, NoMatch } from './containers'; import { Layout, NoMatch } from './containers';
import { BrowserRouter, Switch, Route } from "react-router-dom"; import { BrowserRouter, Switch, Route } from "react-router-dom";
@ -20,7 +20,7 @@ const { initLayout, initApiRoot, resize, initWebSocket } = layoutActions;
const Root = props => { const Root = props => {
const { sections, title, copyright, actions } = props; const { sections, title, copyright, actions } = props;
const [history, setHistory] = useState(null) const [historys, setHistorys] = useState(null)
const [store, setStore] = useState(null) const [store, setStore] = useState(null)
const [outerRoutes, setOuterRoutes] = useState([]) const [outerRoutes, setOuterRoutes] = useState([])
const [combineRoutes, setCombineRoutes] = useState([]) const [combineRoutes, setCombineRoutes] = useState([])
@ -135,7 +135,7 @@ const Root = props => {
const combineRoutes = flatRoutes(innerRoutes); const combineRoutes = flatRoutes(innerRoutes);
setInnerRoutes(combineRoutes) setInnerRoutes(combineRoutes)
setHistory(history) setHistorys(history)
setStore(store) setStore(store)
setOuterRoutes(outerRoutes.map(route => ( setOuterRoutes(outerRoutes.map(route => (
<Route <Route
@ -165,15 +165,13 @@ const Root = props => {
await store.dispatch(actions.auth.logout()) await store.dispatch(actions.auth.logout())
} }
} }
console.log(data);
setAuthCrossLoading(false) setAuthCrossLoading(false)
}); });
// setAuthCrossLoading(false) // setAuthCrossLoading(false)
// MicroApp // MicroApp
const microAppListen = async (data) => { const microAppListen = async (data) => {
console.log(actions); // console.log('mid' + data.data.mid);
console.log('mid:' + data.data.mid);
if (data.action == 'initMicro') { if (data.action == 'initMicro') {
await store.dispatch(actions.auth.initAuth({ await store.dispatch(actions.auth.initAuth({
@ -183,13 +181,19 @@ const Root = props => {
...(data.data || {}) ...(data.data || {})
})) }))
if (data?.data?.mid) { if (data?.data?.mid) {
console.log(22315348);
await store.dispatch(push('/callService')); await store.dispatch(push('/callService'));
} else { } else {
await store.dispatch(push('/noMatch')); await store.dispatch(push('/noMatch'));
} }
setMicroAppWaiting(false) setMicroAppWaiting(false)
} else if (data.action == 'videoImplant') {
history.push({
pathname: '/video_play_cross',
query: {
video: true,
...(data.data || {})
}
})
} }
} }
if (window.__MICRO_APP_ENVIRONMENT__) { if (window.__MICRO_APP_ENVIRONMENT__) {
@ -208,7 +212,7 @@ const Root = props => {
} }
}, []) }, [])
console.log(authCrossLoading, microAppWaiting); // console.log(authCrossLoading, microAppWaiting);
return ( return (
<> <>
@ -217,12 +221,12 @@ const Root = props => {
<ConfigProvider locale={zhCN}> <ConfigProvider locale={zhCN}>
<Provider store={store}> <Provider store={store}>
<BrowserRouter basename={window.__MICRO_APP_BASE_ROUTE__ || '/'}> <BrowserRouter basename={window.__MICRO_APP_BASE_ROUTE__ || '/'}>
<ConnectedRouter history={history}> <ConnectedRouter history={historys}>
<Switch> <Switch>
{outerRoutes} {outerRoutes}
<Layout <Layout
history={history} history={historys}
routes={innnerRoutes} routes={innnerRoutes}
authCrossLoading={authCrossLoading} authCrossLoading={authCrossLoading}
microAppWaiting={microAppWaiting} microAppWaiting={microAppWaiting}
@ -244,8 +248,8 @@ const Root = props => {
{ {
resourceRoot.iotAuthWeb && !window.__MICRO_APP_ENVIRONMENT__ ? resourceRoot.iotAuthWeb && !window.__MICRO_APP_ENVIRONMENT__ ?
<iframe id="iotAuth" src={`${resourceRoot.iotAuthWeb}/cross`} style={{ position: 'absolute', top: 0, height: 1, visibility: 'hidden' }} frameBorder={0} > <iframe id="iotAuth" src={`${resourceRoot.iotAuthWeb}/cross`} style={{ position: 'absolute', top: 0, height: 1, visibility: 'hidden' }} frameBorder={0} >
<p>你的浏览器不支持 iframe</p> <p p > 你的浏览器不支持 iframe</p >
</iframe> </iframe >
: '' : ''
} }
</> </>

6
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx

@ -55,7 +55,6 @@ function cameraModal (props) {
cameraData.type == "nvr" || addNvr ? setcameraList(cameraList.slice(1, 4)) : ""; cameraData.type == "nvr" || addNvr ? setcameraList(cameraList.slice(1, 4)) : "";
//axyData //axyData
if (axyData) { if (axyData) {
console.log(axyData)
switch (axyData.openCamera) { switch (axyData.openCamera) {
case "nvr": case "nvr":
setcameraList(cameraList.slice(1, 4)) setcameraList(cameraList.slice(1, 4))
@ -146,7 +145,6 @@ function cameraModal (props) {
if (cameraData.id) { if (cameraData.id) {
values.id = cameraData.id; values.id = cameraData.id;
} }
console.log(values);
dispatch(equipmentWarehouse.postCameraIpc(values)).then((res) => { dispatch(equipmentWarehouse.postCameraIpc(values)).then((res) => {
if (res.success) { if (res.success) {
onReset(); onReset();
@ -159,9 +157,7 @@ function cameraModal (props) {
return { id: v.id, name: v.name, }; return { id: v.id, name: v.name, };
}); });
cascadeRef.current.cascadeCameraForm().then((values) => { cascadeRef.current.cascadeCameraForm().then((values) => {
console.log(values);
dispatch(equipmentWarehouse.postAddCascade({ ...values, camera: data })).then((res) => { dispatch(equipmentWarehouse.postAddCascade({ ...values, camera: data })).then((res) => {
console.log(res);
if (res.success) { if (res.success) {
onReset(); onReset();
} }
@ -273,7 +269,6 @@ function cameraModal (props) {
.ipcCameraForm() .ipcCameraForm()
.then((values) => { .then((values) => {
// //
console.log(values);
var front = new moment(); // var front = new moment(); //
setloading(true); setloading(true);
dispatch( dispatch(
@ -304,7 +299,6 @@ function cameraModal (props) {
}) })
.catch((errors) => { .catch((errors) => {
// //
console.log();
}); });
} else if (clickNum == 4) { } else if (clickNum == 4) {
cascadeRef.current cascadeRef.current

2
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx

@ -152,7 +152,7 @@ function nvrModal(props) {
labelPosition="left" labelPosition="left"
labelAlign="left" labelAlign="left"
labelWidth="90px" labelWidth="90px"
onValueChange={(values) => console.log(values)} // onValueChange={(values) => console.log(values)}
getFormApi={(formApi) => (form.current = formApi)} getFormApi={(formApi) => (form.current = formApi)}
> >
<Row> <Row>

2
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx

@ -588,7 +588,7 @@ const CameraHeader = (props) => {
</div> </div>
<div style={{ display: "flex" }}> <div style={{ display: "flex" }}>
<Form <Form
onSubmit={(values) => console.log(values)} // onSubmit={(values) => console.log(values)}
// onValueChange={values=>console.log(values)} // onValueChange={values=>console.log(values)}
getFormApi={(formApi) => (api.current = formApi)} getFormApi={(formApi) => (api.current = formApi)}
layout="horizontal" layout="horizontal"

2
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

@ -399,7 +399,7 @@ const NvrHeader = (props) => {
</div> </div>
<div style={{ display: "flex" }}> <div style={{ display: "flex" }}>
<Form <Form
onSubmit={(values) => console.log(values)} // onSubmit={(values) => console.log(values)}
// onValueChange={values=>console.log(values)} // onValueChange={values=>console.log(values)}
getFormApi={(formApi) => (api.current = formApi)} getFormApi={(formApi) => (api.current = formApi)}
layout="horizontal" layout="horizontal"

129
code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/videoPlayCross.jsx

@ -4,63 +4,98 @@ import qs from "qs";
import { VideoPlay } from '$components' import { VideoPlay } from '$components'
import '../style.less' import '../style.less'
import { useRef } from 'react'; import { useRef } from 'react';
import './videoPlayCross.less'
const VideoPlayCross = (props) => { const VideoPlayCross = (props) => {
const [videoParams, setVideoParams] = useState(null) const { user, history } = props;
const [sizeWh, setSizeWh] = useState() const [videoParams, setVideoParams] = useState(null)
const viideoData = useRef(videoParams) const [sizeWh, setSizeWh] = useState()
const viideoData = useRef(videoParams)
useEffect(() => { useEffect(() => {
// console.log(props); // iframe
if (props.location.search) { if (props.location.search) {
decodeURIComponent(props.location.search) decodeURIComponent(props.location.search)
const params = qs.parse(props.location.search.slice(1)) const params = qs.parse(props.location.search.slice(1))
if (params.videoObj) { if (params.videoObj) {
// params.videoObj = (new Function("return " + params.videoObj))() // params.videoObj = (new Function("return " + params.videoObj))()
decodeURIComponent(params.videoObj) decodeURIComponent(params.videoObj)
params.videoObj = JSON.parse(params.videoObj) params.videoObj = JSON.parse(params.videoObj)
// params.height = JSON.parse(params.height) // params.height = JSON.parse(params.height)
setVideoParams(params) setVideoParams(params)
viideoData.current = params viideoData.current = params
} }
} }
function messageListen (e) { function messageListen (e) {
// //
const { data } = e const { data } = e
if (data && data.action) { if (data && data.action) {
if (data.action == 'init_video' || data.action == 'epidemic_video') { if (data.action == 'init_video' || data.action == 'epidemic_video') {
setVideoParams({ ...(viideoData.current || {}), ...data.params }) setVideoParams({ ...(viideoData.current || {}), ...data.params })
}
} }
} }
const resize_ = () => { }
const resize_ = () => {
if (props.location.search) {
const params = qs.parse(props.location.search.slice(1)) const params = qs.parse(props.location.search.slice(1))
setSizeWh({ parentWidth: document.body.clientWidth, parentHeight: document.body.clientHeight, width: params.width || document.body.clientWidth, height: params.height || document.body.clientHeight }) setSizeWh({ parentWidth: document.body.clientWidth, parentHeight: document.body.clientHeight, width: params.width || document.body.clientWidth, height: params.height || document.body.clientHeight })
} }
resize_() }
if (window.parent) { resize_()
window.addEventListener('message', messageListen);
} if (window.parent) {
window.addEventListener('resize', resize_); // window.addEventListener('message', messageListen);
return () => { }
window.addEventListener('resize', resize_) //
return () => {
if (!history?.location?.query?.video) {
window.removeEventListener('message', messageListen); window.removeEventListener('message', messageListen);
window.removeEventListener('resize', resize_); }
} window.removeEventListener('resize', resize_);
}, []) }
return ( }, [])
<>
{ useEffect(() => {
videoParams && <VideoPlay {...videoParams} sizeWh={sizeWh} />
} let data = history?.location?.query
</> console.log(data);
)
//
const resize = () => {
if (history?.location?.query) {
setSizeWh({
parentWidth: document.getElementById('VcmpApp')?.clientWidth,
parentHeight: document.getElementById('VcmpApp')?.clientHeight,
width: data?.width || document.getElementById('VcmpApp')?.clientWidth,
height: data?.height || document.getElementById('VcmpApp')?.clientHeight
})
}
}
resize()
window.addEventListener('resize', resize)
return () => {
window.removeEventListener('resize', resize);
}
}, [history?.location?.query])
return (
<>
{history?.location?.query?.video ?
<div style={{ width: '100%', height: '100%' }}>
{sizeWh && <VideoPlay videoObj={history?.location?.query?.videoObj || {}} sizeWh={sizeWh} />}
</div>
: videoParams && <VideoPlay {...videoParams} sizeWh={sizeWh} />
}
</>
)
} }
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth } = state; const { auth } = state;
return { return {
user: auth.user, user: auth.user,
}; };
} }
export default connect(mapStateToProps)(VideoPlayCross); export default connect(mapStateToProps)(VideoPlayCross);

3
code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/videoPlayCross.less

@ -0,0 +1,3 @@
semi-portal-inner {
background: white;
}

2
code/VideoAccess-VCMP/web/client/src/sections/offline/containers/carrierpigeon.jsx

@ -328,7 +328,7 @@ const Carrierpigeon = (props) => {
</div> </div>
<div style={{ display: "flex" }}> <div style={{ display: "flex" }}>
<Form <Form
onSubmit={(values) => console.log(values)} // onSubmit={(values) => console.log(values)}
// onValueChange={values=>console.log(values)} // onValueChange={values=>console.log(values)}
getFormApi={(formApi) => (api.current = formApi)} getFormApi={(formApi) => (api.current = formApi)}
layout="horizontal" layout="horizontal"

2
code/VideoAccess-VCMP/web/client/src/sections/offline/containers/statuscode.jsx

@ -291,7 +291,7 @@ const Statuscode = (props) => {
</div> </div>
<div style={{ display: "flex" }}> <div style={{ display: "flex" }}>
<Form <Form
onSubmit={(values) => console.log(values)} // onSubmit={(values) => console.log(values)}
// onValueChange={values=>console.log(values)} // onValueChange={values=>console.log(values)}
getFormApi={(formApi) => (api.current = formApi)} getFormApi={(formApi) => (api.current = formApi)}
layout="horizontal" layout="horizontal"

1
code/VideoAccess-VCMP/web/client/src/sections/openness/containers/callService.jsx

@ -63,7 +63,6 @@ const CallService = (props) => {
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth, global, members } = state; const { auth, global, members } = state;
console.log('ccccccccccc', state)
return { return {
loading: members.isRequesting, loading: members.isRequesting,
user: auth.user, user: auth.user,

2
code/VideoAccess-VCMP/web/package.json

@ -68,7 +68,7 @@
"moment": "^2.29.3", "moment": "^2.29.3",
"npm": "^7.20.6", "npm": "^7.20.6",
"perfect-scrollbar": "^1.5.5", "perfect-scrollbar": "^1.5.5",
"qs": "^6.10.5", "qs": "^6.11.0",
"screenfull": "5.2.0", "screenfull": "5.2.0",
"socket.io-client": "^1.7.4", "socket.io-client": "^1.7.4",
"socket.io-parser": "^3.4.1", "socket.io-parser": "^3.4.1",

Loading…
Cancel
Save