浏览代码

解决多屏操作问题,还未全部完善

liuwei 4 年之前
父节点
当前提交
81461453b3
共有 2 个文件被更改,包括 26 次插入12 次删除
  1. 3 7
      src/renderer/components/BigShow.vue
  2. 23 5
      src/renderer/components/Button.vue

+ 3 - 7
src/renderer/components/BigShow.vue

@@ -244,19 +244,15 @@
         },
 
         watch: {
-            // 监视大屏中的信号源,只要变动,就调用回调函数
-            signalPreList: function (arr) {
-                this.refreshBigScreen(arr)
-            },
-
             // 监视分屏的状态
-            splitScreenStatus: function(num) {
+            /*splitScreenStatus: function(num) {
+                console.log(num)
                 this.$data.bindList = []
                 for (let i=0;i<(num+1)*(num+1);i++){
                     this.$data.bindList.push(i+1)
                 }
                 this.rfreshBigScreen(this.$data.streamWindows)
-            }
+            }*/
         }
     }
 </script>

+ 23 - 5
src/renderer/components/Button.vue

@@ -82,6 +82,10 @@
         methods: {
             // 点击按钮
             clickBtn(e) {
+                const bigscreenObj = this.$store.state.bigScreenObj
+                // 只有一个大屏,获取对象的第一个key
+                const firstKey = Object.keys(bigscreenObj)[0]
+
                 // 预案管理声音开关
                 if (e.ID === '355d3c32-1502-40b4-9ddd-663d5b8469e7') {
                     if (this.count % 2 === 0) {
@@ -182,23 +186,37 @@
                 // 分屏和清屏操作
                 if (e.ID === '7775e508-c6a5-4044-8264-24772a24fa97' || e.ID === '95c5d676-46a5-4c46-b550-9bc013a59937' || e.ID === 'f47e84bb-c878-4b22-a9d6-eb2e307283bc') {
                     // 清屏
-                    this.$store.dispatch('clearScreen')
+                    bigscreenObj[firstKey].signalArr = []
+                    this.$store.dispatch('updateBigscreenObj',bigscreenObj)
                     return
                 } else if (e.ID === '49653a62-99cb-40e1-a513-60e42893adb7' || e.ID === 'd55c81a8-54d7-4d90-aad7-4f34c3ba3950' || e.ID === '4142ab5b-ce52-4655-a28d-724bfabb24f0') {
                     // 自由屏
-                    this.$store.dispatch('splitScreen', 0)
+                    bigscreenObj[firstKey].splitStatus = 0
+                    this.$store.dispatch('updateBigscreenObj',bigscreenObj)
                     return
                 } else if (e.ID === '52de9a2e-d171-423d-860f-3fe2750ec757' || e.ID === '0cabb1ba-bcae-45d9-b019-2b45486f98e3' || e.ID === '9bb5b3e3-9e21-4716-8059-f5b35b24e3fa') {
                     // 四分屏
-                    this.$store.dispatch('splitScreen', 1)
+                    bigscreenObj[firstKey].splitStatus = 1
+                    for (let i=0;i<4;i++){
+                        bigscreenObj[firstKey].bindList.push(i+1)
+                    }
+                    this.$store.dispatch('updateBigscreenObj',bigscreenObj)
                     return
                 } else if (e.ID === 'ac0cc31c-a9b8-4bdf-88cf-928964b93ac5' || e.ID === '201e4bb0-c039-46c7-a55a-049d00de4769') {
                     // 九分屏
-                    this.$store.dispatch('splitScreen', 2)
+                    bigscreenObj[firstKey].splitStatus = 2
+                    for (let i=0;i<9;i++){
+                        bigscreenObj[firstKey].bindList.push(i+1)
+                    }
+                    this.$store.dispatch('updateBigscreenObj',bigscreenObj)
                     return
                 } else if (e.ID === '2d4c49bc-905b-4f96-a65c-9b0a3e057b3f') {
                     // 16分屏
-                    this.$store.dispatch('splitScreen', 3)
+                    bigscreenObj[firstKey].splitStatus = 3
+                    for (let i=0;i<16;i++){
+                        bigscreenObj[firstKey].bindList.push(i+1)
+                    }
+                    this.$store.dispatch('updateBigscreenObj',bigscreenObj)
                     return
                 }