Browse Source

'问题修改'

zhangyu 4 năm trước cách đây
mục cha
commit
6baef5819a

+ 2 - 2
package.json

@@ -9,10 +9,10 @@
   },
   "dependencies": {
     "@saga-web/base": "2.1.25",
-    "@saga-web/big": "1.0.102",
+    "@saga-web/big": "1.0.105",
     "@saga-web/draw": "2.1.106",
     "@saga-web/feng-map": "1.0.35",
-    "@saga-web/graph": "2.1.119",
+    "@saga-web/graph": "2.1.121",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",
     "element-ui": "^2.13.2",

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

@@ -751,8 +751,13 @@ export class EditScence extends SGraphScene {
                 let arr = item.data.AttachObjectIds;
                 if (arr && arr.length && arr[arr.length - 1].name) {
                     let name = item.name;
-                    item.name = name + `\n${arr[arr.length - 1].name}`;
-                    item.text = name + `\n${arr[arr.length - 1].name}`;
+                    if (name) {
+                        item.name = name + `\n${arr[arr.length - 1].name}`;
+                        item.text = name + `\n${arr[arr.length - 1].name}`;
+                    } else {
+                        item.name = arr[arr.length - 1].name;
+                        item.text = arr[arr.length - 1].name;
+                    }
                 }
                 // 绑定工程信息化数据后设置状态
                 if (item.data.AttachObjectIds && item.data.AttachObjectIds.length) {

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

@@ -5,6 +5,7 @@ import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
 import { hexify, uuid } from "@/components/mapClass/until"
 import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
+import { SMouseEvent } from '@saga-web/base/lib';
 /**
  * 图例节点Item(区域类型)
  *
@@ -93,9 +94,11 @@ export class SCustomLegendItem extends SPolygonItem {
         }
         this._showText = v;
         if (v) {
-            this.textItem.show();
+            this.cursor = "pointer";
+            this.textItem.cursor = "pointer";
         } else {
-            this.textItem.hide();
+            this.cursor = "auto";
+            this.textItem.cursor = "auto";
         }
     }
 
@@ -199,6 +202,18 @@ export class SCustomLegendItem extends SPolygonItem {
         })
     }
 
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        if (event.buttons == 1)
+        this.$emit("legendItemClick", event);
+        return super.onMouseDown(event);
+    } // Function onMouseDown()
+
     toData(): any {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Name = this.name;

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

@@ -5,6 +5,7 @@ import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
 import { hexify, uuid } from "@/components/mapClass/until"
 import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
+import { SMouseEvent } from '@saga-web/base/lib';
 /**
  * 图例节点Item(区域类型 --防火分区)
  *
@@ -76,8 +77,10 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
         this._isActive = v;
         if (v) {
             this.cursor = "pointer";
+            this.textItem.cursor = "pointer";
         } else {
             this.cursor = "auto";
+            this.textItem.cursor = "auto";
         }
         this.update();
     } // Set isActive
@@ -198,6 +201,18 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
         })
     }
 
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        if (event.buttons == 1)
+        this.$emit("legendItemClick", event);
+        return super.onMouseDown(event);
+    } // Function onMouseDown()
+
     toData(): any {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Name = this.name;

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

@@ -124,6 +124,18 @@ export class SImageLegendItem extends SIconTextItem {
         }
     }
 
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        if (event.buttons == 1)
+        this.$emit("legendItemClick", event);
+        return super.onMouseDown(event);
+    } // Function onMouseDown()
+
     toData(): Legend {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Size = { Width: this.width, Height: this.height };

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

@@ -5,6 +5,7 @@ import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
 import { hexify, uuid } from "@/components/mapClass/until"
 import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
+import { SMouseEvent } from '@saga-web/base/lib';
 /**
  * 图例节点Item(区域类型 --石材铺装)
  *
@@ -76,8 +77,10 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
         this._isActive = v;
         if (v) {
             this.cursor = "pointer";
+            this.textItem.cursor = "pointer";
         } else {
             this.cursor = "auto";
+            this.textItem.cursor = "auto";
         }
         this.update();
     } // Set isActive
@@ -206,6 +209,18 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
         })
     }
 
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        if (event.buttons == 1)
+        this.$emit("legendItemClick", event);
+        return super.onMouseDown(event);
+    } // Function onMouseDown()
+
     toData(): any {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Name = this.name;

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

@@ -5,6 +5,7 @@ import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
 import { hexify, uuid } from "@/components/mapClass/until"
 import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
+import { SMouseEvent } from '@saga-web/base/lib';
 /**
  * 图例节点Item(区域类型)
  *
@@ -76,8 +77,10 @@ export class SZoneLegendItem extends SPolygonItem {
         this._isActive = v;
         if (v) {
             this.cursor = "pointer";
+            this.textItem.cursor = "pointer";
         } else {
             this.cursor = "auto";
+            this.textItem.cursor = "auto";
         }
         this.update();
     } // Set isActive
@@ -199,6 +202,18 @@ export class SZoneLegendItem extends SPolygonItem {
         })
     }
 
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        if (event.buttons == 1)
+        this.$emit("legendItemClick", event);
+        return super.onMouseDown(event);
+    } // Function onMouseDown()
+
     toData(): any {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Name = this.name;

+ 13 - 0
src/lib/items/TipelineItem.ts

@@ -5,6 +5,7 @@ import { Relation } from '../types/Relation';
 import { SPoint } from "@saga-web/draw/lib";
 import { Point } from "@saga-web/big/lib/types/Point";
 import { uuid } from '@/components/mapClass/until';
+import { SMouseEvent } from '@saga-web/base/lib';
 
 /**
  * 管道item
@@ -145,6 +146,18 @@ export class TipelineItem extends SPolylineItem {
     }
   }
 
+  /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+      if (event.buttons == 1)
+      this.$emit("legendItemClick", event);
+      return super.onMouseDown(event);
+  } // Function onMouseDown()
+
   /** 获取data数据  */
   toData(): Relation | null {
     let pointList: Point[] = this.pointList.map(item => {