Browse Source

将信号源固定定位改为绝对定位,解决信号源会被移动到大屏外部的bug

liuwei 4 năm trước cách đây
mục cha
commit
051b62dfe8

+ 1 - 1
src/renderer/assets/less/splitscreen.less

@@ -12,7 +12,7 @@
 
 
   /*分屏项(信号源)*/
   /*分屏项(信号源)*/
   .sitem {
   .sitem {
-    position: relative;
+    position: absolute;
     border: 1px solid #000000;
     border: 1px solid #000000;
     color:#fff;
     color:#fff;
     background-color: #717171;
     background-color: #717171;

+ 4 - 2
src/renderer/components/BigShow.vue

@@ -156,6 +156,7 @@
 
 
             // 处理信号源拖拽中
             // 处理信号源拖拽中
             handleDragging(obj,item) {
             handleDragging(obj,item) {
+                console.log('handleDragging触发了',obj)
                 const arr = this.$store.state.signalPreList.filter(a => a.Id !== item.Id)
                 const arr = this.$store.state.signalPreList.filter(a => a.Id !== item.Id)
                 item.top = this.screenPosition.top + obj.top
                 item.top = this.screenPosition.top + obj.top
                 item.left = this.screenPosition.left + obj.left
                 item.left = this.screenPosition.left + obj.left
@@ -229,8 +230,8 @@
                             let width = this.currentBigshow[0].Width*this.$store.state.bigScale/(signalObj.splitScreenStatus)
                             let width = this.currentBigshow[0].Width*this.$store.state.bigScale/(signalObj.splitScreenStatus)
                             let height = this.currentBigshow[0].Height*this.$store.state.bigScale/(signalObj.splitScreenStatus)
                             let height = this.currentBigshow[0].Height*this.$store.state.bigScale/(signalObj.splitScreenStatus)
                             const res = elePosition(width,height,this.newIndex,this.screenPosition.top,this.screenPosition.left,this.$store.state.splitScreenStatus+1)
                             const res = elePosition(width,height,this.newIndex,this.screenPosition.top,this.screenPosition.left,this.$store.state.splitScreenStatus+1)
-                            signalObj.top = res.top
-                            signalObj.left = res.left
+                            signalObj.top = res.top - this.screenPosition.top
+                            signalObj.left = res.left - this.screenPosition.left
                             this.$store.dispatch('updateSignalPreList', [...arr2,signalObj])
                             this.$store.dispatch('updateSignalPreList', [...arr2,signalObj])
                         })
                         })
                     }else {
                     }else {
@@ -255,6 +256,7 @@
                     animation: 0,
                     animation: 0,
                     group: "description",
                     group: "description",
                     disabled:false,
                     disabled:false,
+                    sort:false,
                 }
                 }
             },
             },
 
 

+ 1 - 0
src/renderer/components/SignalList.vue

@@ -91,6 +91,7 @@
                         pull: 'clone',
                         pull: 'clone',
                         put: false
                         put: false
                     },
                     },
+                    sort:false,
                     ghostClass: "ghost",
                     ghostClass: "ghost",
                 }
                 }
             },
             },