|
@@ -18,7 +18,7 @@
|
|
|
zIndex:item.ZIndex,
|
|
|
display:item.IsVisibility ? 'black' : 'none',
|
|
|
}"
|
|
|
- id="bigscreen"
|
|
|
+ :id="item.ID"
|
|
|
>
|
|
|
<VueDragResize
|
|
|
v-for="itemV in bigScreenObj[item.ID].signalArr" :key="itemV.Id" class="sitem"
|
|
@@ -34,7 +34,7 @@
|
|
|
:options="playerOptions"
|
|
|
:playsinline="true"
|
|
|
/>-->
|
|
|
- <div class="closeBtn" @click.stop="closeSignal(itemV)">×</div>
|
|
|
+ <div class="closeBtn" @click.stop="closeSignal(item,itemV)">×</div>
|
|
|
</div>
|
|
|
</VueDragResize>
|
|
|
|
|
@@ -116,16 +116,25 @@
|
|
|
},
|
|
|
|
|
|
updated() {
|
|
|
- // 获取大屏在视口中的位置
|
|
|
- const screenDiv = document.getElementById('bigscreen')
|
|
|
- this.screenPosition = {
|
|
|
- top:getElementTop(screenDiv),
|
|
|
- left:getElementLeft(screenDiv)
|
|
|
- }
|
|
|
- console.log(this.screenPosition)
|
|
|
-
|
|
|
- const bigscreenObj = this.$store.state.bigScreenObj
|
|
|
- console.log(bigscreenObj)
|
|
|
+ this.currentBigshow.forEach(item => {
|
|
|
+ // 获取大屏在视口中的位置
|
|
|
+ const screenDiv = document.getElementById(item.ID)
|
|
|
+ this.screenPosition[item.ID] = {
|
|
|
+ top:getElementTop(screenDiv),
|
|
|
+ left:getElementLeft(screenDiv)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ /*const bigscreenObj = this.$store.state.bigScreenObj
|
|
|
+ for(const key in bigscreenObj){
|
|
|
+ const signalArr = bigscreenObj[key].signalArr
|
|
|
+ let len = signalArr.length
|
|
|
+ if(len){
|
|
|
+ // 给新增的信号源进行赋值
|
|
|
+ const signalObj = signalArr[len-1]
|
|
|
+ signalObj.Id = guId()
|
|
|
+ }
|
|
|
+ }*/
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
@@ -194,10 +203,14 @@
|
|
|
},
|
|
|
|
|
|
// 关闭信号源
|
|
|
- closeSignal(signal) {
|
|
|
- const signalPreList = this.$store.state.signalPreList
|
|
|
- const newSignalPreList = signalPreList.filter(item => item.Id !== signal.Id)
|
|
|
- this.$store.dispatch('updateSignalPreList',newSignalPreList)
|
|
|
+ closeSignal(bigscreen,signal) {
|
|
|
+ const bigScreenObj = this.$store.state.bigScreenObj
|
|
|
+ // 1.找出是哪个大屏下的信号源发生了改变,过滤掉删除的那个
|
|
|
+ const newSignalPreList = bigScreenObj[bigscreen.ID].signalArr.filter(item => item.Id !== signal.Id)
|
|
|
+ // 2.重新赋值
|
|
|
+ bigScreenObj[bigscreen.ID].signalArr = newSignalPreList
|
|
|
+ // 3.更新
|
|
|
+ this.$store.dispatch('updateBigscreenObj',bigScreenObj)
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -273,7 +286,13 @@
|
|
|
// 监视大屏对象的变化(深度监视)
|
|
|
bigScreenObj: {
|
|
|
handler: function (val, oldVal) {
|
|
|
- // console.log(val,oldVal)
|
|
|
+ for (const key in val) {
|
|
|
+ val[key].signalArr.forEach(item => {
|
|
|
+ item.Id = guId()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log(val)
|
|
|
+ this.$store.dispatch('updateBigscreenObj',val)
|
|
|
},
|
|
|
deep: true
|
|
|
},
|