|
@@ -3,12 +3,12 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<draggable
|
|
|
- v-for="(item,index) in currentBigshow"
|
|
|
+ v-for="item in currentBigshow"
|
|
|
element="div"
|
|
|
- v-model="signalPreList"
|
|
|
+ v-model="bigScreenObj[item.ID].signalArr"
|
|
|
:options="dragOptions2"
|
|
|
@change="log"
|
|
|
- :class="['split_screen', splitScreenStatus === 0 ? 'split_screen_one' : splitScreenStatus === 1 ? 'split_screen_four' : splitScreenStatus === 2 ? 'split_screen_nine' : 'split_screen_sixteen']"
|
|
|
+ :class="['split_screen', bigScreenObj[item.ID].splitStatus === 0 ? 'split_screen_one' : bigScreenObj[item.ID].splitStatus === 1 ? 'split_screen_four' : bigScreenObj[item.ID].splitStatus === 2 ? 'split_screen_nine' : 'split_screen_sixteen']"
|
|
|
:style="{
|
|
|
float:'left',
|
|
|
width:item.Width*bigScale + 'px',
|
|
@@ -21,25 +21,24 @@
|
|
|
id="bigscreen"
|
|
|
>
|
|
|
<VueDragResize
|
|
|
- v-for="itemV in signalPreList" :key="itemV.Id" class="sitem"
|
|
|
- :w="item.Width*bigScale/itemV.splitScreenStatus" :h="item.Height*bigScale/itemV.splitScreenStatus" :parentLimitation="false"
|
|
|
+ v-for="itemV in bigScreenObj[item.ID].signalArr" :key="itemV.Id" class="sitem"
|
|
|
+ :w="item.Width*bigScale/bigScreenObj[item.ID].splitStatus" :h="item.Height*bigScale/bigScreenObj[item.ID].splitStatus" :parentLimitation="false"
|
|
|
:x="itemV.left" :y="itemV.top"
|
|
|
@dragstop="(obj) => dragStop(obj,itemV)"
|
|
|
@resizestop="(obj) => reSizeSignal(obj,itemV)"
|
|
|
>
|
|
|
<div ref="signal">
|
|
|
{{itemV.deviceID}}
|
|
|
- <!--<video-player
|
|
|
+ <!--<VideoPlayer
|
|
|
ref="videoPlayer"
|
|
|
:options="playerOptions"
|
|
|
:playsinline="true"
|
|
|
- >
|
|
|
- </video-player>-->
|
|
|
+ />-->
|
|
|
<div class="closeBtn" @click.stop="closeSignal(itemV)">×</div>
|
|
|
</div>
|
|
|
</VueDragResize>
|
|
|
|
|
|
- <div v-for="itemD in bindList" :key="itemD" class="sitem2">
|
|
|
+ <div v-for="itemD in bigScreenObj[item.ID].bindList" :key="itemD" class="sitem2">
|
|
|
{{itemD}}
|
|
|
</div>
|
|
|
</draggable>
|
|
@@ -59,11 +58,8 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- isDragging: false, // 是否可拖动标志
|
|
|
- bindList:[], // 拼接屏的数量
|
|
|
streamWindows:[], // 传递出去的信号源位置信息
|
|
|
- bigScreenJson:[], // 大屏配置json文件
|
|
|
- currentBigshow:[], // 当前大屏
|
|
|
+ currentBigshow:[], // 当前显示的大屏
|
|
|
playerOptions: { // rtmp视频流配置
|
|
|
sources: [
|
|
|
{
|
|
@@ -87,17 +83,37 @@
|
|
|
components: {
|
|
|
draggable,
|
|
|
VueDragResize,
|
|
|
- "video-player": VideoPlayer
|
|
|
+ VideoPlayer
|
|
|
},
|
|
|
|
|
|
async beforeCreate() {
|
|
|
- this.bigScreenJson = await getStaticFile('EnityBigScreen.Data')
|
|
|
- this.currentBigshow = this.bigScreenJson.filter(item => item.IsVisibility === true)
|
|
|
- const num = this.currentBigshow[0].BindList.length
|
|
|
+ const bigScreenJson = await getStaticFile('EnityBigScreen.Data')
|
|
|
+ this.currentBigshow = bigScreenJson.filter(item => item.IsVisibility === true)
|
|
|
+
|
|
|
+ // 给大屏对象进行初始化显示
|
|
|
+ const obj = {}
|
|
|
+ this.currentBigshow.forEach(item => {
|
|
|
+ obj[item.ID] = {
|
|
|
+ bindList:[],
|
|
|
+ splitStatus:0,
|
|
|
+ signalArr:[]
|
|
|
+ }
|
|
|
+ const num = item.BindList.length
|
|
|
+ // 拼接屏数量
|
|
|
+ for(let i=0;i<num;i++){
|
|
|
+ obj[item.ID].bindList.push(i+1)
|
|
|
+ }
|
|
|
+ // 根据拼接屏数量得到分屏状态
|
|
|
+ obj[item.ID].splitStatus = Math.floor(Math.sqrt(num)-1)
|
|
|
+ })
|
|
|
+ console.log(obj)
|
|
|
+ this.$store.dispatch('updateBigscreenObj',obj)
|
|
|
+
|
|
|
+ /*const num = this.currentBigshow[0].BindList.length
|
|
|
for(let i=0;i<num;i++){
|
|
|
this.$data.bindList.push(i+1)
|
|
|
}
|
|
|
- this.$store.dispatch('splitScreen', Math.sqrt(num)-1)
|
|
|
+ this.$store.dispatch('splitScreen', Math.sqrt(num)-1)*/
|
|
|
},
|
|
|
|
|
|
updated() {
|
|
@@ -183,7 +199,7 @@
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
- ...mapState(['splitScreenStatus', 'bigScale','positionNum']),
|
|
|
+ ...mapState(['splitScreenStatus', 'bigScale','positionNum','bigScreenObj']),
|
|
|
|
|
|
signalPreList: {
|
|
|
get() {
|