Browse Source

增加初始化时默认有按钮被按下,窗口切换至默认按下按钮控制的窗口

liuwei 4 years ago
parent
commit
042f613d09

+ 7 - 3
src/renderer/assets/less/splitscreen.less

@@ -10,9 +10,6 @@
 
   /*分屏项(信号源)*/
   .sitem {
-    //border: 1px solid #000000;
-    //color:#fff;
-    //background-color: #000000;
 
     // 关闭信号源开窗按钮
     .closeBtn {
@@ -60,6 +57,13 @@
   grid-template-rows: repeat(3,100%/3);
 }
 
+/*12分屏*/
+.split_screen_twelve {
+  display: grid;
+  grid-template-rows: repeat(3,100%/3);
+  grid-template-columns: repeat(4,100%/4);
+}
+
 /*16分屏*/
 .split_screen_sixteen {
   display: grid;

+ 1 - 6
src/renderer/components/BigShow.vue

@@ -10,6 +10,7 @@
                 bigScreenObj[item.ID].splitStatus === 0 ? 'split_screen_one' :
                 bigScreenObj[item.ID].splitStatus === 1 ? 'split_screen_four' :
                 bigScreenObj[item.ID].splitStatus === 2 ? 'split_screen_nine' :
+                bigScreenObj[item.ID].splitStatus > 2.4 && bigScreenObj[item.ID].splitStatus < 2.5 ? 'split_screen_twelve' :
                 bigScreenObj[item.ID].splitStatus === 3 ? 'split_screen_sixteen' : '']"
                 :style="{
                     float:'left',
@@ -57,7 +58,6 @@
     import {elePosition, getElementLeft, getElementTop, getStaticFile, guId} from "../../utils/tools"
     import {reqPreviewSourceList, reqRefreshView} from "../api"
     import VideoPlayer from "./player.vue"
-    import {CLEAR_SCREEN} from "../../utils/constant"
 
     export default {
         data() {
@@ -331,8 +331,3 @@
 
 
 
-
-
-
-
-

+ 11 - 2
src/renderer/components/Button.vue

@@ -40,13 +40,16 @@
             return {
                 buttonJson: [], // 当前window中按钮
                 staticUrl:this.$store.state.staticUrl, // 静态资源路径
-                window:this.$attrs.window
+                window:this.$attrs.window,
+                isPressDownButtons:[], // 初始化时默认按下的按钮
             }
         },
 
         async beforeCreate() {
             const arr = await getStaticFile('EnityButton.Data')
             this.buttonJson = arr.filter(item => item.WindowID === this.window.ID)
+            const isPressDownButtons = this.buttonJson.filter(item => item.IsPressDown)
+            this.isPressDownButtons = isPressDownButtons
         },
 
         updated() {
@@ -55,6 +58,13 @@
             keyArr.forEach((item,index) => {
                 this.$refs[item][0].style.backgroundImage = this.buttonJson[index].BackIcon ? 'url('+`${this.staticUrl}/Data/${this.buttonJson[index].BackIcon}`+')' : null
             })
+            // 默认按下的按钮背景显示为ActionIcon
+            this.isPressDownButtons.forEach((item,index) => {
+                this.$refs[item.ID][0].style.backgroundImage = this.isPressDownButtons[index].ActionIcon ? 'url('+`${this.staticUrl}/Data/${this.isPressDownButtons[index].ActionIcon}`+')' : null
+                // 发布消息控制窗口显示
+                let windowIds = item.MouseDownActionList.map(item => item.SourceID)
+                PubSub.publish(OPEN_WINDOWS,windowIds)
+            })
         },
 
         computed: {
@@ -70,7 +80,6 @@
                 const controlBtns = this.buttonJson.filter(item => item.ButtonType === 1 && item.GroupNumber === e.GroupNumber)
                 if(controlBtns.some(item => item === e)){
                     // 1.当前按下的按钮处于激活状态
-                    // this.$refs[e.ID][0].style.backgroundImage = 'url(' + require(`../../../static/Data/${e.ActionIcon}`) + ')'
                     this.$refs[e.ID][0].style.backgroundImage = 'url('+`${this.staticUrl}/Data/${e.ActionIcon}`+')'
 
                     // 2.同一组的其他按钮处于未激活状态

+ 9 - 0
src/utils/tools.js

@@ -63,6 +63,15 @@ export function elePosition(width,height,count,top,left,splitNum) {
         }else{
             return {top:top+2*height,left:left+(count-7)*width}
         }
+    }else if(splitNum > 3.4 && splitNum < 3.5){
+        // 十二分屏
+        if(count<=4){
+            return {top:top,left:left+(count-1)*width}
+        }else if(count<=8){
+            return {top:top+height,left:left+(count-5)*width}
+        }else{
+            return {top:top+2*height,left:left+(count-9)*width}
+        }
     }else if(splitNum === 4){
         // 十六分屏
         if(count<=4){