|
|
@@ -2,9 +2,22 @@
|
|
|
<template>
|
|
|
<div class="videoSurveillance">
|
|
|
<titleComponent :titleData="titleData"></titleComponent>
|
|
|
+ <div class="video-max-big-box" v-if="videoType">
|
|
|
+ <H5PlayerVideo class="for-video-box"
|
|
|
+ v-for="(item,index) in videoUrlList" :key="index"
|
|
|
+ :videoProps="item"></H5PlayerVideo>
|
|
|
+ </div>
|
|
|
+ <div class="video-max-big-box" v-if="videoNullType">
|
|
|
+ <img class="for-video-box" src="@/assets/ZDimages/video_img.png">
|
|
|
+ <img class="for-video-box" src="@/assets/ZDimages/video_img.png">
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+ import {
|
|
|
+ iotCameraFindByCondition
|
|
|
+ } from "@/api/index";
|
|
|
+ import { dashboardsMonitorConfig } from "@/api/yiLi";
|
|
|
import titleComponent from './components/titleComponent.vue'
|
|
|
export default {
|
|
|
name: 'videoSurveillance',
|
|
|
@@ -17,17 +30,106 @@
|
|
|
name:'实时视频监控',
|
|
|
text:'Real-time video surveillance',
|
|
|
},
|
|
|
+ videoTimer:null,
|
|
|
+ videoSwitchTime:30000,
|
|
|
+ videoRooms:[],
|
|
|
+ videoCheckIndex:0,
|
|
|
+ videoUrlList:[],
|
|
|
+ videoType:false,
|
|
|
+ videoNullType:false,
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
|
|
|
|
},
|
|
|
mounted(){
|
|
|
-
|
|
|
+ this.dashboardsMonitorConfig();
|
|
|
},
|
|
|
methods:{
|
|
|
-
|
|
|
+ dashboardsMonitorConfig(){
|
|
|
+ dashboardsMonitorConfig().then(res => {
|
|
|
+ // this.$set(this,'videoRooms',res.data.rooms);
|
|
|
+ this.$set(this,'videoRooms',[]);
|
|
|
+ this.checkSubUpdates();
|
|
|
+ this.videoTimerFunction();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ videoTimerFunction(){
|
|
|
+ this.videoTimer = window.setInterval(this.checkSubUpdates, this.videoSwitchTime);
|
|
|
+ },
|
|
|
+ checkSubUpdates() {
|
|
|
+ const self = this;
|
|
|
+ self.$set(self,'videoType',false);
|
|
|
+ let subIdList = [];
|
|
|
+ let videoList = [];
|
|
|
+ if(self.videoRooms[self.videoCheckIndex]){
|
|
|
+ subIdList.push(self.videoRooms[self.videoCheckIndex].subId)
|
|
|
+ if(self.videoRooms[self.videoCheckIndex+1]){
|
|
|
+ subIdList.push(self.videoRooms[self.videoCheckIndex+1].subId)
|
|
|
+ }else{
|
|
|
+ subIdList.push(self.videoRooms[self.videoCheckIndex].subId)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ self.$set(self,'videoCheckIndex',0);
|
|
|
+ if(self.videoRooms[self.videoCheckIndex]){
|
|
|
+ subIdList.push(self.videoRooms[self.videoCheckIndex].subId)
|
|
|
+ if(self.videoRooms[self.videoCheckIndex+1]){
|
|
|
+ subIdList.push(self.videoRooms[self.videoCheckIndex+1].subId)
|
|
|
+ }else{
|
|
|
+ subIdList.push(self.videoRooms[self.videoCheckIndex].subId)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ self.$set(self,'videoNullType',true);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let videoObj = {
|
|
|
+ page:'1',
|
|
|
+ pageSize:'10',
|
|
|
+ buildId:'',
|
|
|
+ floorId:'',
|
|
|
+ passageway:'',
|
|
|
+ subIds:subIdList,
|
|
|
+ protocol:window.location.href.indexOf('https') !== -1?'wss':'ws',
|
|
|
+ streamType:1,
|
|
|
+ source:1,
|
|
|
+ };
|
|
|
+ iotCameraFindByCondition(videoObj).then(response => {
|
|
|
+ videoList.push(
|
|
|
+ {
|
|
|
+ fullShow:true,
|
|
|
+ width: 599, //(宽度:非必传-默认600)
|
|
|
+ height: 367, //(高度:非必传-默认338)
|
|
|
+ url: response.data.records[0].streamUrl,
|
|
|
+ cameraIndexCode: response.data.records[0].deviceNo,
|
|
|
+ }
|
|
|
+ )
|
|
|
+ videoList.push(
|
|
|
+ {
|
|
|
+ fullShow:true,
|
|
|
+ width: 599, //(宽度:非必传-默认600)
|
|
|
+ height: 367, //(高度:非必传-默认338)
|
|
|
+ url: response.data.records[response.data.records.length-1].streamUrl,
|
|
|
+ cameraIndexCode: response.data.records[response.data.records.length-1].deviceNo,
|
|
|
+ }
|
|
|
+ )
|
|
|
+ self.$set(self,'videoCheckIndex',self.videoCheckIndex+2);
|
|
|
+ self.$set(self,'videoUrlList',videoList);
|
|
|
+ setTimeout(function(){
|
|
|
+ self.$set(self,'videoType',true);
|
|
|
+ self.$set(self,'videoNullType',false);
|
|
|
+ },1000);
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
+ beforeDestroy() {
|
|
|
+ //清除定时器
|
|
|
+ clearInterval(this.videoTimer);
|
|
|
+ },
|
|
|
+ destroyed() {
|
|
|
+ //清除定时器
|
|
|
+ clearInterval(this.videoTimer);
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
@@ -37,6 +139,19 @@
|
|
|
margin-top:31px;
|
|
|
background-image: url("../../assets/ZDimages/img_ssspjk_bg@1x.png");
|
|
|
background-size: 100% 100%;
|
|
|
+ .video-max-big-box{
|
|
|
+ width:1263px;
|
|
|
+ height:367px;
|
|
|
+ margin:75px 26px 0;
|
|
|
+ display: flex;
|
|
|
+ .for-video-box{
|
|
|
+ width:599px;
|
|
|
+ height:367px;
|
|
|
+ }
|
|
|
+ .for-video-box:nth-child(1){
|
|
|
+ margin-right:65px;
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|