|
@ -21,7 +21,10 @@ import moment from "moment"; |
|
|
import "./index.scss"; |
|
|
import "./index.scss"; |
|
|
import ajax from "@/services"; |
|
|
import ajax from "@/services"; |
|
|
import HistoryTable from "./HistoryTable"; |
|
|
import HistoryTable from "./HistoryTable"; |
|
|
|
|
|
// import {withErrorBoundary} from 'react-error-boundary' |
|
|
|
|
|
|
|
|
function OutMonitorMgm(props) { |
|
|
function OutMonitorMgm(props) { |
|
|
|
|
|
|
|
|
const [form] = Form.useForm(); |
|
|
const [form] = Form.useForm(); |
|
|
// session缓存 |
|
|
// session缓存 |
|
|
const [defaultParams, setDefaultParams] = useSessionStorageState( |
|
|
const [defaultParams, setDefaultParams] = useSessionStorageState( |
|
@ -211,7 +214,7 @@ function OutMonitorMgm(props) { |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
videoRef.current.changeUrl(res.data.url) |
|
|
videoRef.current.changeUrl(res.data.url) |
|
|
}, 300); |
|
|
}, 300); |
|
|
startIntervalToPlay() |
|
|
|
|
|
|
|
|
startIntervalToPlay(1) // 因为默认展示实时的视频播放 |
|
|
}else{ |
|
|
}else{ |
|
|
message.error(`播放数据暂未对接`); |
|
|
message.error(`播放数据暂未对接`); |
|
|
} |
|
|
} |
|
@ -222,10 +225,10 @@ function OutMonitorMgm(props) { |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const startIntervalToPlay = ()=>{ |
|
|
|
|
|
|
|
|
const startIntervalToPlay = (type)=>{ |
|
|
if(!intervalPlayRef.current){ |
|
|
if(!intervalPlayRef.current){ |
|
|
intervalPlayRef.current = setInterval(() => { |
|
|
intervalPlayRef.current = setInterval(() => { |
|
|
ajax.getOutRoadVideoPlaying({id: rowDataRef.current.id, type:1}).then((res)=>{ |
|
|
|
|
|
|
|
|
ajax.getOutRoadVideoPlaying({id: rowDataRef.current.id, type:type}).then((res)=>{ |
|
|
if(res.status == 20000){ |
|
|
if(res.status == 20000){ |
|
|
// console.log('') |
|
|
// console.log('') |
|
|
} |
|
|
} |
|
@ -245,6 +248,12 @@ function OutMonitorMgm(props) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const clickSwitch=(val)=>{ |
|
|
|
|
|
setPlayType(val); |
|
|
|
|
|
stopIntervalToClose(); |
|
|
|
|
|
startIntervalToPlay(val) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const handleDel = (item) => { |
|
|
const handleDel = (item) => { |
|
|
Modal.confirm({ |
|
|
Modal.confirm({ |
|
|
title: "确认删除?", |
|
|
title: "确认删除?", |
|
@ -899,7 +908,8 @@ function OutMonitorMgm(props) { |
|
|
title={rowData.device_name} |
|
|
title={rowData.device_name} |
|
|
> |
|
|
> |
|
|
<div className="out-monitor-switch-line"> |
|
|
<div className="out-monitor-switch-line"> |
|
|
<span onClick={()=>{setPlayType('1')}}>实时</span> <span onClick={()=>{setPlayType('2')}}>回放</span> |
|
|
|
|
|
|
|
|
<span className={`${playType == '1' ? 'active' : ""}`} onClick={()=>{clickSwitch(1)}}>实时</span>  |
|
|
|
|
|
<span className={`${playType == '2' ? 'active' : ""}`} onClick={()=>{clickSwitch(2)}}>回放</span> |
|
|
</div> |
|
|
</div> |
|
|
{ |
|
|
{ |
|
|
playType == '1' ? |
|
|
playType == '1' ? |
|
@ -918,4 +928,4 @@ function OutMonitorMgm(props) { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export default OutMonitorMgm; |
|
|
|
|
|
|
|
|
export default OutMonitorMgm |