YaolongHan 4 gadi atpakaļ
vecāks
revīzija
af938d91d9

+ 3 - 3
package.json

@@ -9,10 +9,10 @@
   },
   "dependencies": {
     "@saga-web/base": "2.1.27",
-    "@saga-web/big": "1.0.112",
+    "@saga-web/big": "1.0.113",
     "@saga-web/draw": "2.1.107",
-    "@saga-web/feng-map": "1.0.45",
-    "@saga-web/graph": "2.1.125",
+    "@saga-web/feng-map": "1.0.46",
+    "@saga-web/graph": "2.1.126",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",
     "element-ui": "^2.13.2",

+ 18 - 0
src/components/edit/top_toolbar.vue

@@ -218,6 +218,7 @@
                 scaleStep: 0.05, // +-缩放步进
                 locationQuery: null,
                 urlMsg: {},
+                focusItemList: []
             };
         },
         computed: {
@@ -281,6 +282,7 @@
             },
             FocusItemChanged(itemMsg) {
                 this.focusItem = null;
+                this.focusItemList = [];
                 this.alignmentOptions.forEach(el => {
                     el.disable = true;
                 });
@@ -291,12 +293,28 @@
                     this.alignmentOptions.forEach(el => {
                         el.disable = false;
                     });
+                    // 批量解锁/锁定
+                    this.focusItemList = itemMsg.itemList;
+                    let flag = true;
+                    for(let i = 0; i < itemMsg.itemList.length; i++) {
+                      const t = itemMsg.itemList[i];
+                      if (!t.moveable) {
+                        flag = false;
+                        break
+                      }
+                    }
+                    this.isLock = flag
                 }
             },
             lockItem() {
                 if (this.focusItem) {
                     this.isLock = !this.isLock;
                     this.focusItem.moveable = this.isLock;
+                } else if (this.focusItemList.length){
+                  this.isLock = !this.isLock;
+                  this.focusItemList.forEach(t => {
+                    t.moveable = this.isLock;
+                  })
                 } else {
                     this.$message.error("请选择指定对象!", 1);
                 }

+ 10 - 8
src/components/mapClass/EditScence.ts

@@ -1046,11 +1046,11 @@ export class EditScence extends SGraphScene {
             return this.grabItem.onMouseDown(event);
         }
         switch (this.cmd) {
-            // case 'choice':
-            //     if (!super.onMouseDown(event)){
-            //         this.addRectSelect(event);
-            //     }
-            //     break
+            case 'choice':
+                if (!super.onMouseDown(event)){
+                    this.addRectSelect(event);
+                }
+                break
             case 'baseLine':
                 this.addLine(event);
                 break;
@@ -1119,7 +1119,7 @@ export class EditScence extends SGraphScene {
                 this.updateTipeAnc(event);
                 return true;
             } else if (this.grabItem instanceof SRectSelectItem) {
-                this.groupSelect();
+                this.groupSelect(event.ctrlKey);
                 this.removeItem(this.grabItem);
                 this.grabItem = null;
                 if (this.view) {
@@ -1908,8 +1908,10 @@ export class EditScence extends SGraphScene {
     /**
      * 计算框选交集
     */
-    groupSelect() {
-        this.selectContainer.clear()
+    groupSelect(ctrl:boolean){
+        if(!ctrl){
+            this.selectContainer.clear()
+        }
         if (this.grabItem instanceof SRectSelectItem) {
             const rect = this.grabItem.boundingRect();
             this.arrToSelect(this.Nodes, rect)

+ 2 - 1
src/lib/items/SCustomLegendItem.ts

@@ -211,7 +211,8 @@ export class SCustomLegendItem extends SPolygonItem {
     onMouseDown(event: SMouseEvent): boolean {
         if (event.buttons == 1)
         this.$emit("legendItemClick", event);
-        return super.onMouseDown(event);
+        super.onMouseDown(event)
+        return true;
     } // Function onMouseDown()
 
     toData(): any {

+ 2 - 1
src/lib/items/SFHFQZoneLegendItem.ts

@@ -210,7 +210,8 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
     onMouseDown(event: SMouseEvent): boolean {
         if (event.buttons == 1)
         this.$emit("legendItemClick", event);
-        return super.onMouseDown(event);
+        super.onMouseDown(event);
+        return true
     } // Function onMouseDown()
 
     toData(): any {

+ 12 - 1
src/lib/items/SImageLegendItem.ts

@@ -136,9 +136,20 @@ export class SImageLegendItem extends SIconTextItem {
     onMouseDown(event: SMouseEvent): boolean {
         if (event.buttons == 1)
         this.$emit("legendItemClick", event);
-        return super.onMouseDown(event);
+        super.onMouseDown(event);
+        return true;
     } // Function onMouseDown()
 
+    /**
+     * 移动item后的处理,计算其他信息,将原点置为场景原点
+     *
+     * @param   x   x坐标
+     * @param   y   y坐标
+     * */
+    moveToOrigin(x: number, y: number): void {
+        // 不做处理
+    } // Function moveToOrigin()
+
     toData(): Legend {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Size = { Width: this.width, Height: this.height };

+ 12 - 0
src/lib/items/SImageMarkerItem.ts

@@ -4,6 +4,7 @@ import { SPainter, SColor, SPoint } from "@saga-web/draw";
 import { Marker } from '../types/Marker';
 import { ItemOrder } from '@saga-web/big/lib';
 import { hexify, uuid } from "@/components/mapClass/until";
+import { SMouseEvent } from '@saga-web/base/lib';
 
 /**
  * 标识对象Item(图标类型)
@@ -60,6 +61,17 @@ export class SImageMarkerItem extends SImageItem {
         this.update();
     } // Function computeImgSize()
 
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event)
+        return true;
+    } // Function onMouseDown()
+
     toData(): Marker {
         this.data.Pos = {X: this.x, Y: this.y};
         this.data.Size = {Width: this.width, Height: this.height};

+ 12 - 0
src/lib/items/SLineLegendItem.ts

@@ -4,6 +4,7 @@ import { SPoint } from "@saga-web/draw/lib";
 import { SPolylineItem } from '@saga-web/big/lib';
 import { Legend } from '../types/Legend';
 import { uuid } from '@/components/mapClass/until';
+import { SMouseEvent } from '@saga-web/base/lib';
 
 /**
  * 图例节点Item(线类型)
@@ -44,6 +45,17 @@ export class SLineLegendItem extends SPolylineItem {
         }
     }
 
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event)
+        return true;
+    } // Function onMouseDown()
+    
     toData(): Legend {
         this.data.Pos = {X: this.x, Y: this.y};
         this.data.Properties.Line = this.pointList.map(pos => {

+ 16 - 2
src/lib/items/SLineMarkerItem.ts

@@ -4,6 +4,7 @@ import { SPoint, SPainter, SColor, SLineCapStyle } from "@saga-web/draw/lib";
 import { ItemOrder, SLineItem, SItemStatus } from '@saga-web/big/lib';
 import { Marker } from '../types/Marker';
 import { uuid } from '@/components/mapClass/until';
+import { SMouseEvent } from '@saga-web/base/lib';
 
 /**
  * 标识对象Item(线类型)
@@ -89,18 +90,31 @@ export class SLineMarkerItem extends SLineItem {
             // 判断删除equip后,不移动
             if (this.startItem.parent) {
                 let scenePoint: SPoint = this.startItem.boundingRect().center();
-                this.line[0] = this.startItem.mapToScene(scenePoint.x, scenePoint.y);
+                let p = this.startItem.mapToScene(scenePoint.x, scenePoint.y);
+                this.line[0] = new SPoint(p.x - this.x, p.y - this.y)
             }
         }
         if (this.endItem) {
             // 删除equip后
             if (this.endItem.parent) {
                 let scenePoint: SPoint = this.endItem.boundingRect().center();
-                this.line[1] = this.endItem.mapToScene(scenePoint.x, scenePoint.y);
+                let p = this.endItem.mapToScene(scenePoint.x, scenePoint.y);
+                this.line[1] = new SPoint(p.x - this.x, p.y - this.y)
             }
         }
     }
 
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event)
+        return true;
+    } // Function onMouseDown()
+    
     toData(): Marker {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Properties.Line = this.line.map(pos => {

+ 2 - 1
src/lib/items/SSCPZZoneLegendItem.ts

@@ -218,7 +218,8 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
     onMouseDown(event: SMouseEvent): boolean {
         if (event.buttons == 1)
         this.$emit("legendItemClick", event);
-        return super.onMouseDown(event);
+        super.onMouseDown(event);
+        return true;
     } // Function onMouseDown()
 
     toData(): any {

+ 22 - 0
src/lib/items/STextMarkerItem.ts

@@ -3,6 +3,7 @@ import { SPainter, SColor,SFont, SPoint } from "@saga-web/draw";
 import { Marker } from '../types/Marker';
 import { ItemOrder } from '@saga-web/big/lib';
 import { uuid } from '@/components/mapClass/until';
+import { SMouseEvent } from '@saga-web/base/lib';
 
 /**
  * 标识对象Item(文本类型)
@@ -60,6 +61,27 @@ export class STextMarkerItem extends STextItem {
         this.origin = new SPoint(this.width / 2, this.height / 2);
     } // Function drawFormatText()
 
+    /**
+     * 移动item后的处理,计算其他信息,将原点置为场景原点
+     *
+     * @param   x   x坐标
+     * @param   y   y坐标
+     * */
+    moveToOrigin(x: number, y: number): void {
+        // 不做处理
+    } // Function moveToOrigin()
+
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event)
+        return true;
+    } // Function onMouseDown()
+    
     toData(): Marker {
         this.data.Pos = {X: this.x, Y: this.y};
         this.data.Size = {Width: this.width, Height: this.height};

+ 2 - 1
src/lib/items/SZoneLegendItem.ts

@@ -211,7 +211,8 @@ export class SZoneLegendItem extends SPolygonItem {
     onMouseDown(event: SMouseEvent): boolean {
         if (event.buttons == 1)
         this.$emit("legendItemClick", event);
-        return super.onMouseDown(event);
+        super.onMouseDown(event);
+        return true;
     } // Function onMouseDown()
 
     toData(): any {

+ 6 - 3
src/lib/items/TipelineItem.ts

@@ -92,15 +92,17 @@ export class TipelineItem extends SPolylineItem {
     if (this.startAnchor) {
       // 判断删除equip后,不移动
       if (this.startAnchor.parent && this.startAnchor.parent.parent) {
-        this.pointList[0] = this.startAnchor.mapToScene(0, 0);
+        let p = this.startAnchor.mapToScene(0, 0);
+        this.pointList[0] = new SPoint(p.x - this.x, p.y - this.y)
       }
     }
     if (this.endAnchor) {
       // 删除equip后
       if (this.endAnchor.parent && this.endAnchor.parent.parent) {
+        let p = this.endAnchor.mapToScene(0, 0);
         this.pointList[
           this.pointList.length - 1
-        ] = this.endAnchor.mapToScene(0, 0);
+        ] = new SPoint(p.x - this.x, p.y - this.y)
       }
     }
   }
@@ -155,7 +157,8 @@ export class TipelineItem extends SPolylineItem {
     onMouseDown(event: SMouseEvent): boolean {
       if (event.buttons == 1)
       this.$emit("legendItemClick", event);
-      return super.onMouseDown(event);
+      super.onMouseDown(event);
+      return true;
   } // Function onMouseDown()
 
   /** 获取data数据  */