浏览代码

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-editer into develop

YaolongHan 4 年之前
父节点
当前提交
d6ea111d30

+ 2 - 2
package.json

@@ -9,10 +9,10 @@
   },
   "dependencies": {
     "@saga-web/base": "2.1.22",
-    "@saga-web/big": "1.0.60",
+    "@saga-web/big": "1.0.61",
     "@saga-web/draw": "2.1.100",
     "@saga-web/feng-map": "1.0.16",
-    "@saga-web/graph": "2.1.97",
+    "@saga-web/graph": "2.1.98",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",
     "element-ui": "^2.13.2",

+ 74 - 7
src/components/mapClass/EditScence.ts

@@ -954,6 +954,9 @@ export class EditScence extends SGraphScene {
             if (this.grabItem instanceof SLineMarkerItem && this.grabItem.status == SItemStatus.Edit) {
                 this.setLineItem(event)
                 return true;
+            } else if (this.grabItem instanceof TipelineItem){
+                this.updateTipeAnc(event);
+                return true;
             }
             return this.grabItem.onMouseUp(event);
         }
@@ -1010,13 +1013,13 @@ export class EditScence extends SGraphScene {
     */
     setTipeEndanchor(event: SMouseEvent): void {
         if (this.grabItem instanceof TipelineItem) {
-            if (this.grabItem.status == SItemStatus.Create) {
-                const anc = this.clickIsAnchor(event);
-                if (anc) {
-                    const p = anc.mapToScene(0, 0)
-                    anc.isConnected = true;
-                    event.x = p.x;
-                    event.y = p.y;
+            const anc = this.clickIsAnchor(event);
+            if (anc) {
+                const p = anc.mapToScene(0, 0)
+                anc.isConnected = true;
+                event.x = p.x;
+                event.y = p.y;
+                if (this.grabItem.status == SItemStatus.Create) {
                     if (this.grabItem.pointList.length) {
                         this.grabItem.endAnchor = anc;
                         anc.parent ?.connect('changePos', this.grabItem, this.grabItem.changePos)
@@ -1034,6 +1037,70 @@ export class EditScence extends SGraphScene {
     }
 
     /**
+     * 管线item修改锚点 
+     * 
+    */
+    updateTipeAnc(event: SMouseEvent): void {
+        if (this.grabItem instanceof TipelineItem){
+            const anc = this.clickIsAnchor(event);
+            if (anc) {
+                const p = anc.mapToScene(0, 0)
+                event.x = p.x;
+                event.y = p.y;
+                if (this.grabItem.status == SItemStatus.Edit) {
+                    if (this.grabItem.curIndex == 0) {
+                        if (this.grabItem.startAnchor){
+                            this.grabItem.startAnchor.isConnected = false
+                            this.grabItem.startAnchor.parent.disconnect('changePos',this.grabItem);
+                        }
+                        anc.isConnected = true;
+                        this.grabItem.startAnchor = anc;
+                        this.grabItem.anchor1ID = anc.id
+                        this.grabItem.node1Id = anc.parent.id
+                        anc.parent.connect('changePos', this.grabItem, this.grabItem.changePos)
+                    }
+                    if (this.grabItem.curIndex == this.grabItem.pointList.length-1) {
+                        if (this.grabItem.endAnchor){
+                            this.grabItem.endAnchor.isConnected = false
+                            this.grabItem.endAnchor.parent.disconnect('changePos',this.grabItem);
+                        }
+                        anc.isConnected = true;
+                        this.grabItem.endAnchor = anc;
+                        this.grabItem.anchor2ID = anc.id
+                        this.grabItem.node2Id = anc.parent.id
+                        anc.parent.connect('changePos', this.grabItem, this.grabItem.changePos)
+                    }
+                }
+                this.grabItem.onMouseUp(event)
+                return
+            } else {
+                if (this.grabItem.status == SItemStatus.Edit) {
+                    if (this.grabItem.curIndex == 0) {
+                        if (this.grabItem.startAnchor){
+                            this.grabItem.startAnchor.isConnected = false
+                            this.grabItem.startAnchor.parent.disconnect('changePos',this.grabItem);
+                            this.grabItem.startAnchor = null;
+                            this.grabItem.anchor1ID = ''
+                            this.grabItem.node1Id = ''
+                        }
+                    }
+                    if (this.grabItem.curIndex == this.grabItem.pointList.length-1) {
+                        if (this.grabItem.endAnchor){
+                            this.grabItem.endAnchor.isConnected = false
+                            this.grabItem.endAnchor.parent.disconnect('changePos',this.grabItem);
+                            this.grabItem.endAnchor = null;
+                            this.grabItem.anchor2ID = ''
+                            this.grabItem.node2Id = ''
+                        }
+                    }
+                }
+                this.grabItem.onMouseUp(event)
+                return
+            }
+        }
+    }
+
+    /**
      * 设置直线结束Item
      *
     */

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

@@ -105,6 +105,7 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
      */
     constructor(parent: SGraphItem | null, data: Legend) {
         super(parent);
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;

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

@@ -38,8 +38,8 @@ export class SImageLegendItem extends SIconTextItem {
      */
     constructor(parent: SGraphItem | null, data: Legend) {
         super(parent, data.AnchorList);
-        this.zOrder = ItemOrder.markOrder;
         this.isTransform = false;
+        this.zOrder = ItemOrder.markOrder;
         this.data = data;
         this.id = data.ID;
         this.name = data.Name;

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

@@ -113,6 +113,7 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
      */
     constructor(parent: SGraphItem | null, data: Legend) {
         super(parent);
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;

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

@@ -105,6 +105,7 @@ export class SZoneLegendItem extends SPolygonItem {
      */
     constructor(parent: SGraphItem | null, data: Legend) {
         super(parent);
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;