|
@@ -45,7 +45,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<el-row :gutter="4">
|
|
<el-row :gutter="4">
|
|
|
<el-col :span="screenSpan" v-for="(item,index) in screenData" :key="index">
|
|
<el-col :span="screenSpan" v-for="(item,index) in screenData" :key="index">
|
|
|
- <player class="itemClass" :jessibucaId="'jessibucaId' + index" :container="'container' + index" :buttonsBoxId="'buttonsBoxId' + index" :ref="'videoPlayer' + index" :hasaudio="hasaudio" fluent autoplay live ></player>
|
|
|
|
|
|
|
+ <player class="itemClass" :container="'container' + index" :ref="'videoPlayer' + index" fluent autoplay live @click.native="screenClick"></player>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</basic-container>
|
|
</basic-container>
|
|
@@ -56,11 +56,13 @@
|
|
|
<script>
|
|
<script>
|
|
|
import {getGbChannelLazyTree, startPlay, stopPlay} from "@/api/device/gb/gbdevicechannel";
|
|
import {getGbChannelLazyTree, startPlay, stopPlay} from "@/api/device/gb/gbdevicechannel";
|
|
|
import player from './jessibuca.vue'
|
|
import player from './jessibuca.vue'
|
|
|
|
|
+ import {select} from "../../../api/base/region";
|
|
|
export default {
|
|
export default {
|
|
|
name: "videowall",
|
|
name: "videowall",
|
|
|
components: {player},
|
|
components: {player},
|
|
|
data () {
|
|
data () {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ screenSelectedId: "container0",
|
|
|
screenSpan: 12,
|
|
screenSpan: 12,
|
|
|
screen: 4,
|
|
screen: 4,
|
|
|
screenData:[],
|
|
screenData:[],
|
|
@@ -110,9 +112,18 @@
|
|
|
item16 : true
|
|
item16 : true
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
methods:{
|
|
methods:{
|
|
|
|
|
+ screenClick(ele){
|
|
|
|
|
+ let oldSelectedDom = document.getElementById(this.screenSelectedId);
|
|
|
|
|
+ if(oldSelectedDom){
|
|
|
|
|
+ oldSelectedDom.classList.remove("screenSelectedClass");
|
|
|
|
|
+ }
|
|
|
|
|
+ let containerDom = document.getElementById(ele.srcElement.id);
|
|
|
|
|
+ containerDom.classList.add("screenSelectedClass");
|
|
|
|
|
+ this.screenSelectedId = ele.srcElement.id;
|
|
|
|
|
+ },
|
|
|
initData(){
|
|
initData(){
|
|
|
for(let i = 0; i < 16; i++){
|
|
for(let i = 0; i < 16; i++){
|
|
|
let item = {name:"", isPlay:false, index:i, channelId:null, display:true};
|
|
let item = {name:"", isPlay:false, index:i, channelId:null, display:true};
|
|
@@ -137,11 +148,17 @@
|
|
|
for(let i = 0; i < this.screenData.length; i++){
|
|
for(let i = 0; i < this.screenData.length; i++){
|
|
|
let containerDom = document.getElementById("container" + i);
|
|
let containerDom = document.getElementById("container" + i);
|
|
|
containerDom.style.height = (9/16) * containerDom.clientWidth + "px";
|
|
containerDom.style.height = (9/16) * containerDom.clientWidth + "px";
|
|
|
- console.log(containerDom.style.height)
|
|
|
|
|
|
|
+ console.log(containerDom.style.height);
|
|
|
}
|
|
}
|
|
|
|
|
+ let containerDom = document.getElementById(this.screenSelectedId);
|
|
|
|
|
+ containerDom.classList.add("screenSelectedClass");
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
screenChange(value){
|
|
screenChange(value){
|
|
|
|
|
+ let oldSelectedDom = document.getElementById(this.screenSelectedId);
|
|
|
|
|
+ if(oldSelectedDom){
|
|
|
|
|
+ oldSelectedDom.classList.remove("screenSelectedClass");
|
|
|
|
|
+ }
|
|
|
if(value === 4){
|
|
if(value === 4){
|
|
|
this.screenSpan = 12;
|
|
this.screenSpan = 12;
|
|
|
this.screenData = this.data4;
|
|
this.screenData = this.data4;
|
|
@@ -163,6 +180,9 @@
|
|
|
this.$refs['videoPlayer' + i][0].resize();
|
|
this.$refs['videoPlayer' + i][0].resize();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ let containerDom = document.getElementById("container0");
|
|
|
|
|
+ containerDom.classList.add("screenSelectedClass");
|
|
|
|
|
+ this.screenSelectedId = "container0";
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
treeLoad(node, resolve){
|
|
treeLoad(node, resolve){
|
|
@@ -210,23 +230,28 @@
|
|
|
return data.label.indexOf(value) !== -1;
|
|
return data.label.indexOf(value) !== -1;
|
|
|
},
|
|
},
|
|
|
handleNodeClick(node, resolve){},
|
|
handleNodeClick(node, resolve){},
|
|
|
- clickPlay(data){
|
|
|
|
|
|
|
+ clickPlay(data) {
|
|
|
this.$message.success("开始调取视频");
|
|
this.$message.success("开始调取视频");
|
|
|
//找到第一个没有播放的屏幕
|
|
//找到第一个没有播放的屏幕
|
|
|
- let emptyIndex = this.screenData.findIndex((item) => item.isPlay == false);
|
|
|
|
|
- if(emptyIndex >= 0){ //表示找到
|
|
|
|
|
- this.playVideo(data, emptyIndex).then(res => {
|
|
|
|
|
- this.screenData[emptyIndex].isPlay = true;
|
|
|
|
|
- this.screenData[emptyIndex].channelId = data.channelId;
|
|
|
|
|
- });
|
|
|
|
|
- return false;
|
|
|
|
|
- }else{
|
|
|
|
|
- this.playVideo(data, 0).then(res => {
|
|
|
|
|
- this.screenData[0].isPlay = true;
|
|
|
|
|
- this.screenData[0].channelId = data.channelId;
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ let emptyIndex = this.screenSelectedId.charAt(this.screenSelectedId.length - 1);
|
|
|
|
|
+ this.playVideo(data, 0).then(res => {
|
|
|
|
|
+ this.screenData[emptyIndex].isPlay = true;
|
|
|
|
|
+ this.screenData[emptyIndex].channelId = data.channelId;
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
|
|
+ // let emptyIndex = this.screenData.findIndex((item) => item.isPlay == false);
|
|
|
|
|
+ // if(emptyIndex >= 0){ //表示找到
|
|
|
|
|
+ // this.playVideo(data, emptyIndex).then(res => {
|
|
|
|
|
+ // this.screenData[emptyIndex].isPlay = true;
|
|
|
|
|
+ // this.screenData[emptyIndex].channelId = data.channelId;
|
|
|
|
|
+ // });
|
|
|
|
|
+ // return false;
|
|
|
|
|
+ // }else{
|
|
|
|
|
+ // this.playVideo(data, 0).then(res => {
|
|
|
|
|
+ // this.screenData[0].isPlay = true;
|
|
|
|
|
+ // this.screenData[0].channelId = data.channelId;
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
playVideo(treeItem, index){
|
|
playVideo(treeItem, index){
|
|
|
let deviceId = treeItem.deviceId;
|
|
let deviceId = treeItem.deviceId;
|
|
|
let channelId = treeItem.channelId;
|
|
let channelId = treeItem.channelId;
|
|
@@ -249,7 +274,7 @@
|
|
|
this.screenData[channelVideoIndex].channelId = null;
|
|
this.screenData[channelVideoIndex].channelId = null;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
@@ -307,6 +332,12 @@
|
|
|
.itemClass {
|
|
.itemClass {
|
|
|
position: sticky;
|
|
position: sticky;
|
|
|
}
|
|
}
|
|
|
|
|
+ .screenSelectedClass{
|
|
|
|
|
+ box-sizing:border-box;
|
|
|
|
|
+ -moz-box-sizing:border-box; /* Firefox */
|
|
|
|
|
+ -webkit-box-sizing:border-box; /* Safari */
|
|
|
|
|
+ border:0.3rem solid red;
|
|
|
|
|
+ }
|
|
|
//}
|
|
//}
|
|
|
.custom-tree-node {
|
|
.custom-tree-node {
|
|
|
flex: 1;
|
|
flex: 1;
|