haojianlong 4 anni fa
parent
commit
aa6b82bcc9

+ 0 - 1
package.json

@@ -13,7 +13,6 @@
     "@saga-web/draw": "2.1.100",
     "@saga-web/feng-map": "1.0.15",
     "@saga-web/graph": "2.1.94",
-    "@saga-web/topology": "1.0.84",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",
     "element-ui": "^2.13.2",

+ 1 - 1
src/components/baseEditer.vue

@@ -39,7 +39,7 @@ export default {
     return {
       appName: "万达可视化系统",
       key: "23f30a832a862c58637a4aadbf50a566",
-      mapServerURL: "/wdfn",
+      mapServerURL: "http://map.wanda.cn/editor",
       canvasWidth: 700,
       canvasHeight: 800,
       fParser: null,

+ 26 - 11
src/components/mapClass/EditScence.ts

@@ -1,6 +1,6 @@
 import { SMouseEvent, SUndoStack } from "@saga-web/base";
 import { SGraphScene, SGraphLayoutType, SAnchorItem } from '@saga-web/graph/lib';
-import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder, STooltipItem } from "@saga-web/big";
+import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder, STooltipItem, ItemColor } from "@saga-web/big";
 import { SGraphItem, SLineStyle, SImageItem, STextItem, SGraphPointListInsert, SGraphPointListDelete, SGraphPointListUpdate, SGraphAddCommand } from "@saga-web/graph/lib";
 import { SZoneLegendItem } from "@/lib/items/SZoneLegendItem";
 import { SSCPZZoneLegendItem } from "@/lib/items/SSCPZZoneLegendItem";
@@ -71,6 +71,12 @@ export class EditScence extends SGraphScene {
         super();
         // // 选择绑定选额item事件
         this.selectContainer.connect("listChange", this, this.listChange);
+        ItemColor.spaceColor = new SColor("#A4ABB22B")
+        ItemColor.wallColor = new SColor("#A7AEB3FF")
+        ItemColor.columnColor = new SColor("#A7AEB3FF")
+        ItemColor.virtualWallColor = new SColor("#A7AEB3FF")
+        ItemColor.selectColor = new SColor("#84A0BB2B")
+        ItemColor.spaceBorderColor = new SColor("#A7AEB3FF")
     }
     /** 绘制图例样式 */
     _legend: any | null = null;
@@ -220,6 +226,8 @@ export class EditScence extends SGraphScene {
         item.startAnchor = anc;
         if (anc) {
             anc.parent?.connect('changePos', item, item.changePos)
+            item.anchor1ID = anc.id;
+            item.node1Id = anc.parent.id;
         }
         this.scenceUpdate(this);
         return true
@@ -832,17 +840,24 @@ export class EditScence extends SGraphScene {
     */
     setTipeEndanchor(event: SMouseEvent): void {
         if (this.grabItem instanceof TipelineItem) {
-            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.pointList.length) {
-                    this.grabItem.endAnchor = anc;
-                    anc.parent?.connect('changePos', this.grabItem, this.grabItem.changePos)
+            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;
+                    if (this.grabItem.pointList.length) {
+                        this.grabItem.endAnchor = anc;
+                        anc.parent?.connect('changePos', this.grabItem, this.grabItem.changePos)
+                    }
+                    this.grabItem.anchor2ID = anc.id
+                    this.grabItem.node2Id = anc.parent.id
+                    this.grabItem.onMouseDown(event)
+                    this.grabItem.status = SItemStatus.Normal;
+                    this.finishCreated(this.grabItem)
+                    return
                 }
-                this.grabItem.status = SItemStatus.Normal;
             }
             this.grabItem.onMouseDown(event)
         }

+ 15 - 7
src/lib/items/SImageLegendItem.ts

@@ -26,7 +26,7 @@ export class SImageLegendItem extends SIconTextItem {
             this.data.Num = 1;
         }
         this.data.Properties.Num = this._num;
-        this.text = `${this.data.Name}${this.data.Num > 1?` × ${this.data.Num}`:''}`;
+        this.text = `${this.data.Name}${this.data.Num > 1 ? ` × ${this.data.Num}` : ''}`;
         this.update();
     }
 
@@ -51,7 +51,7 @@ export class SImageLegendItem extends SIconTextItem {
             this.height = data.Size.Height;
         }
         if (data.Num) {
-            this.text = `${data.Name}${data.Num > 1?` × ${data.Num}`:''}`;
+            this.text = `${data.Name}${data.Num > 1 ? ` × ${data.Num}` : ''}`;
         }
         if (data.Properties && data.Properties.Url) {
             this.img.url = data.Properties.Url;
@@ -77,17 +77,25 @@ export class SImageLegendItem extends SIconTextItem {
     }
 
     toData(): Legend {
-        this.data.Pos = {X: this.x, Y: this.y};
-        this.data.Size = {Width: this.width, Height: this.height};
+        this.data.Pos = { X: this.x, Y: this.y };
+        this.data.Size = { Width: this.width, Height: this.height };
         this.data.Name = this.name;
         this.data.Properties.Url = this.img.url;
-        this.data.Properties.TextPos = {X: this.textItem.x, Y: this.textItem.y};
-        this.data.Properties.ImgPos = {X: this.img.x, Y: this.img.y};
+        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y };
+        this.data.Properties.ImgPos = { X: this.img.x, Y: this.img.y };
         this.data.Properties.sWidth = this.sWidth;
         this.data.Properties.sHeight = this.sHeight;
         this.data.Properties.font = this.font.size;
         this.data.Properties.color = this.color.value;
-
+        this.data.AnchorList = this.anchorList.map(t => {
+            return {
+                ID: t.id,
+                Pos: {
+                    X: t.x,
+                    Y: t.y
+                }
+            }
+        })
         return this.data;
     }
 } // Class SImageLegendItem

+ 1 - 1
src/views/drafts.vue

@@ -107,7 +107,7 @@ export default {
       view: null,
       urlMsg: null,
       floorList: {},
-      mapServerURL: "/wdfn",
+      mapServerURL: "http://map.wanda.cn/editor",
       key: "23f30a832a862c58637a4aadbf50a566",
       appName: "万达可视化系统",
       defaultProps: {