Browse Source

'添加hover鼠标样式和zorder存储'

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

+ 4 - 4
package.json

@@ -9,10 +9,10 @@
   },
   "dependencies": {
     "@saga-web/base": "2.1.22",
-    "@saga-web/big": "1.0.80",
-    "@saga-web/draw": "2.1.100",
-    "@saga-web/feng-map": "1.0.23",
-    "@saga-web/graph": "2.1.108",
+    "@saga-web/big": "1.0.81",
+    "@saga-web/draw": "2.1.101",
+    "@saga-web/feng-map": "1.0.24",
+    "@saga-web/graph": "2.1.109",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",
     "element-ui": "^2.13.2",

+ 1 - 4
src/components/mapClass/EditScence.ts

@@ -733,10 +733,7 @@ export class EditScence extends SGraphScene {
                     item.text = arr[arr.length-1].name;
                     item.name = arr[arr.length-1].name;
                 }
-            }
-
-            // 图标绑定工程信息化数据后设置状态
-            if (item instanceof SImageLegendItem) {
+                // 绑定工程信息化数据后设置状态
                 if (item.data.AttachObjectIds && item.data.AttachObjectIds.length) {
                     item.isActive = true;
                 } else {

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

@@ -67,6 +67,21 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
         this.update();
     };
 
+    /** 是否激活  */
+    _isActive: boolean = false;
+    get isActive(): boolean {
+        return this._isActive;
+    } // Get isActive
+    set isActive(v: boolean) {
+        this._isActive = v;
+        if (v) {
+            this.cursor = "pointer";
+        } else {
+            this.cursor = "auto";
+        }
+        this.update();
+    } // Set isActive
+
     /** 是否显示文字  */
     _showText: boolean = true;
     get showText(): boolean {
@@ -124,6 +139,9 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
                     this.setPointList = setPointList;
                 }
             }
+            if (data.Properties.Zorder) {
+                this.zOrder = data.Properties.Zorder;
+            }
             // 设置线宽
             if (data.Properties.LineWidth) {
                 this.lineWidth = data.Properties.LineWidth;
@@ -143,6 +161,12 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
             if (data.Properties.font) {
                 this.font = new SFont("sans-serif", data.Properties.font);
             }
+            if (data.Properties && data.Properties.IsActive) {
+                this.isActive = data.Properties.IsActive;
+            }
+            if (data.AttachObjectIds && data.AttachObjectIds.length) {
+                this.isActive = true;
+            }
             switch (data.Properties.LineDash) {
                 case "solid":
                     this.lineStyle = SLineStyle.Solid;
@@ -173,6 +197,7 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
     toData(): any {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Name = this.name;
+        this.data.Properties.Zorder = this.zOrder;
         this.data.Properties.FillColor = this.fillColor.value;
         this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineWidth = this.lineWidth;
@@ -198,6 +223,7 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
         this.data.Properties.TextPos = {X: this.textItem.x, Y: this.textItem.y};
         this.data.Properties.font =  this.font.size;
         this.data.Properties.color =  this.color.value;
+        this.data.Properties.IsActive = this.isActive;
         return this.data;
     }
 

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

@@ -80,6 +80,9 @@ export class SImageLegendItem extends SIconTextItem {
             this.width = data.Size.Width;
             this.height = data.Size.Height;
         }
+        if (data.Properties.Zorder) {
+            this.zOrder = data.Properties.Zorder;
+        }
         if (data.Properties && data.Properties.Url) {
             this.img.url = data.Properties.Url;
         }
@@ -119,6 +122,7 @@ export class SImageLegendItem extends SIconTextItem {
         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.Zorder = this.zOrder;
         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 };

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

@@ -33,6 +33,9 @@ export class SImageMarkerItem extends SImageItem {
             this.width = data.Size.Width;
             this.height = data.Size.Height;
         }
+        if (data.Properties.Zorder) {
+            this.zOrder = data.Properties.Zorder;
+        }
         if (data.Properties && data.Properties.Url) {
             this.url = data.Properties.Url;
         }
@@ -57,6 +60,7 @@ export class SImageMarkerItem extends SImageItem {
     toData(): Marker {
         this.data.Pos = {X: this.x, Y: this.y};
         this.data.Size = {Width: this.width, Height: this.height};
+        this.data.Properties.Zorder = this.zOrder;
         this.data.Properties.Url = this.url;
         this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineWidth = this.lineWidth;

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

@@ -25,6 +25,9 @@ export class SLineLegendItem extends SPolylineItem {
         this.id = data.ID;
         this.name = data.Name;
         this.moveTo(data.Pos.X, data.Pos.Y);
+        if (data.Properties.Zorder) {
+            this.zOrder = data.Properties.Zorder;
+        }
         if (data.Properties && data.Properties.Line) {
             let setPointList: SPoint[];
             setPointList = data.Properties.Line.map(i => {
@@ -48,6 +51,7 @@ export class SLineLegendItem extends SPolylineItem {
                 Y: pos.y
             }
         });
+        this.data.Properties.Zorder = this.zOrder;
         this.data.Properties.LineWidth = this.lineWidth;
         this.data.Properties.StrokeColor = this.strokeColor;
         return this.data;

+ 4 - 0
src/lib/items/SLineMarkerItem.ts

@@ -58,6 +58,9 @@ export class SLineMarkerItem extends SLineItem {
         this.id = data.ID;
         this.name = data.Name;
         this.moveTo(data.Pos.X, data.Pos.Y);
+        if (data.Properties.Zorder) {
+            this.zOrder = data.Properties.Zorder;
+        }
         if (data.Properties && data.Properties.Line) {
             let setPointList: SPoint[];
             setPointList = data.Properties.Line.map(i => {
@@ -102,6 +105,7 @@ export class SLineMarkerItem extends SLineItem {
                 Y: pos.y
             }
         });
+        this.data.Properties.Zorder = this.zOrder;
         this.data.Properties.LineWidth = this.lineWidth;
         this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineStyle = this.lineStyle;

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

@@ -67,6 +67,21 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
         this.update();
     };
 
+    /** 是否激活  */
+    _isActive: boolean = false;
+    get isActive(): boolean {
+        return this._isActive;
+    } // Get isActive
+    set isActive(v: boolean) {
+        this._isActive = v;
+        if (v) {
+            this.cursor = "pointer";
+        } else {
+            this.cursor = "auto";
+        }
+        this.update();
+    } // Set isActive
+
     /** 是否显示文字  */
     _showText: boolean = true;
     get showText(): boolean {
@@ -132,6 +147,9 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
                     this.setPointList = setPointList;
                 }
             }
+            if (data.Properties.Zorder) {
+                this.zOrder = data.Properties.Zorder;
+            }
             // 设置线宽
             if (data.Properties.LineWidth) {
                 this.lineWidth = data.Properties.LineWidth;
@@ -151,6 +169,12 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
             if (data.Properties.font) {
                 this.font = new SFont("sans-serif", data.Properties.font);
             }
+            if (data.Properties && data.Properties.IsActive) {
+                this.isActive = data.Properties.IsActive;
+            }
+            if (data.AttachObjectIds && data.AttachObjectIds.length) {
+                this.isActive = true;
+            }
             switch (data.Properties.LineDash) {
                 case "solid":
                     this.lineStyle = SLineStyle.Solid;
@@ -181,6 +205,7 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
     toData(): any {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Name = this.name;
+        this.data.Properties.Zorder = this.zOrder;
         this.data.Properties.FillColor = this.fillColor.value;
         this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineWidth = this.lineWidth;
@@ -206,6 +231,7 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
         this.data.Properties.TextPos = {X: this.textItem.x, Y: this.textItem.y};
         this.data.Properties.font =  this.font.size;
         this.data.Properties.color =  this.color.value;
+        this.data.Properties.IsActive = this.isActive;
         return this.data;
     }
 

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

@@ -30,6 +30,9 @@ export class STextMarkerItem extends STextItem {
             this.width = data.Size.Width;
             this.height = data.Size.Height;
         }
+        if (data.Properties.Zorder) {
+            this.zOrder = data.Properties.Zorder;
+        }
         if (data.Properties && data.Properties.Text) {
             this.text = data.Properties.Text;
         }
@@ -56,6 +59,7 @@ export class STextMarkerItem extends STextItem {
     toData(): Marker {
         this.data.Pos = {X: this.x, Y: this.y};
         this.data.Size = {Width: this.width, Height: this.height};
+        this.data.Properties.Zorder = this.zOrder;
         this.data.Properties.Text = this.text;
         this.data.Properties.Color = this.color.value;
         this.data.Properties.Font = this.font.size;

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

@@ -67,6 +67,21 @@ export class SZoneLegendItem extends SPolygonItem {
         this.update();
     };
 
+    /** 是否激活  */
+    _isActive: boolean = false;
+    get isActive(): boolean {
+        return this._isActive;
+    } // Get isActive
+    set isActive(v: boolean) {
+        this._isActive = v;
+        if (v) {
+            this.cursor = "pointer";
+        } else {
+            this.cursor = "auto";
+        }
+        this.update();
+    } // Set isActive
+
     /** 是否显示文字  */
     _showText: boolean = true;
     get showText(): boolean {
@@ -125,6 +140,9 @@ export class SZoneLegendItem extends SPolygonItem {
                     this.setPointList = setPointList;
                 }
             }
+            if (data.Properties.Zorder) {
+                this.zOrder = data.Properties.Zorder;
+            }
             // 设置线宽
             if (data.Properties.LineWidth) {
                 this.lineWidth = data.Properties.LineWidth;
@@ -144,6 +162,12 @@ export class SZoneLegendItem extends SPolygonItem {
             if (data.Properties.font) {
                 this.font = new SFont("sans-serif", data.Properties.font);
             }
+            if (data.Properties && data.Properties.IsActive) {
+                this.isActive = data.Properties.IsActive;
+            }
+            if (data.AttachObjectIds && data.AttachObjectIds.length) {
+                this.isActive = true;
+            }
             switch (data.Properties.LineDash) {
                 case "solid":
                     this.lineStyle = SLineStyle.Solid;
@@ -174,6 +198,7 @@ export class SZoneLegendItem extends SPolygonItem {
     toData(): any {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Name = this.name;
+        this.data.Properties.Zorder = this.zOrder;
         this.data.Properties.FillColor = this.fillColor.value;
         this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineWidth = this.lineWidth;
@@ -199,6 +224,7 @@ export class SZoneLegendItem extends SPolygonItem {
         this.data.Properties.TextPos = {X: this.textItem.x, Y: this.textItem.y};
         this.data.Properties.font =  this.font.size;
         this.data.Properties.color =  this.color.value;
+        this.data.Properties.IsActive = this.isActive;
         return this.data;
     }
 

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

@@ -127,6 +127,9 @@ export class TipelineItem extends SPolylineItem {
     if (data.Anchor2ID) {
       this._anchor2ID = data.Anchor2ID
     }
+    if (data.Properties.Zorder) {
+      this.zOrder = data.Properties.Zorder;
+    }
     if (data.Properties && data.Properties.Color) {
       this.strokeColor = new SColor(data.Properties.Color);
     }
@@ -150,6 +153,7 @@ export class TipelineItem extends SPolylineItem {
     if (this.data) {
       this.data.Name = this.name;
       this.data.PointList = pointList;
+      this.data.Properties.Zorder = this.zOrder;
       this.data.Properties.LineWidth = this.lineWidth;
       // this.data.Properties.LineDash = this.LineDash;
       this.data.Properties.Color = this.strokeColor.value;

+ 2 - 2
vue.config.js

@@ -15,9 +15,9 @@ module.exports = {
                 },
             },
             '/serve': {
-                target: 'http://192.168.200.87:8088/',
+                // target: 'http://192.168.200.87:8088/',
                 // target: 'http://192.168.200.83:8085/',
-                // target: 'http://60.205.177.43:8080', //阿里云
+                target: 'http://60.205.177.43:8080', //阿里云
                 changeOrigin: true,
                 secure: false,
                 pathRewrite: {