|
|
@ -6,6 +6,7 @@ import { useSelector } from "react-redux"; |
|
|
|
import "./index.scss"; |
|
|
|
import { VideoPlay } from "@/components"; |
|
|
|
import { Select, Tooltip } from "antd"; |
|
|
|
var timer = null; |
|
|
|
const OutRoadOverview = () => { |
|
|
|
const skin = useSelector((state) => { |
|
|
|
return state.common.skin; |
|
|
@ -303,19 +304,37 @@ const OutRoadOverview = () => { |
|
|
|
}); |
|
|
|
} |
|
|
|
//查看监控视频 |
|
|
|
function getOutRoadVideoPlay() { |
|
|
|
function getOutRoadVideoPlay(e) { |
|
|
|
ajax |
|
|
|
.getOutRoadVideoPlay() |
|
|
|
.getOutRoadVideoPlay(e) |
|
|
|
.then((res) => { |
|
|
|
if (res.status === 20000) { |
|
|
|
setVideoPlay(res.data.url); |
|
|
|
handleFlvPlay(res.data.url) |
|
|
|
handleFlvPlay(res.data.url); |
|
|
|
getOutRoadVideoPlaying(e) //轮询 |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.error(err); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
//轮询 |
|
|
|
function getOutRoadVideoPlaying(e) { |
|
|
|
timer = setInterval(() => { |
|
|
|
ajax |
|
|
|
.getOutRoadVideoPlaying(e) |
|
|
|
.then((res) => { |
|
|
|
if (res.status != 20000) { |
|
|
|
clearInterval(timer); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
clearInterval(timer); |
|
|
|
console.error(err); |
|
|
|
}); |
|
|
|
}, 5000) |
|
|
|
} |
|
|
|
// 概览-停车收入top5 |
|
|
|
function getIncomeTop5() { |
|
|
|
ajax |
|
|
@ -388,9 +407,7 @@ const OutRoadOverview = () => { |
|
|
|
const handleFlvPlay = (e) => { |
|
|
|
videoRef.current.closeVideo() |
|
|
|
setVideoType("mp4") |
|
|
|
//if(videoPlay){ |
|
|
|
videoRef.current.changeUrl(e) |
|
|
|
//} |
|
|
|
videoRef.current.changeUrl(e) |
|
|
|
} |
|
|
|
useEffect(() => { |
|
|
|
getBaseNumber(); |
|
|
@ -400,9 +417,12 @@ const OutRoadOverview = () => { |
|
|
|
getParkingRecord(); |
|
|
|
getPageConfig(); |
|
|
|
getOutRoadVideoRoad(); |
|
|
|
return () => { |
|
|
|
clearInterval(timer) |
|
|
|
} |
|
|
|
}, []); |
|
|
|
useEffect(() => { |
|
|
|
if(roadId){ |
|
|
|
if (roadId) { |
|
|
|
getOutRoadVideoDevice(roadId) |
|
|
|
} |
|
|
|
}, [roadId]); |
|
|
@ -532,7 +552,7 @@ const OutRoadOverview = () => { |
|
|
|
placeholder="请选择停车场" |
|
|
|
value={roadId} |
|
|
|
options={videoRoad} |
|
|
|
onChange={(e)=>setRoadId(e)} |
|
|
|
onChange={(e) => setRoadId(e)} |
|
|
|
/> |
|
|
|
<Select |
|
|
|
placeholder="请选择监控设备" |
|
|
|