guoxiaohuan 4 years ago
parent
commit
ef56b18d9f

+ 1 - 1
public/systemConf.js

@@ -33,4 +33,4 @@ var __systemConf = {
         wandaBmGuideUrl: 'http://localhost:8090/wandaBmGuide/', //管理书地址
     },
 }
-window.__systemConf = __systemConf
+window.__systemConf = __systemConf

+ 0 - 86
src/lib/items/HighlightItem.js

@@ -1,86 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *                      :*$@@%$*:                         ;:                ;;    ;;
- *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
- *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
- *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
- *                   =@*                                  %!              @ $= % %@=   =%@!      %=
- *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
- *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
- *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
- *          $@*   ;@@@%=!:                *@*
- *          =@$    ;;;!=%@@@@=!           =@!
- *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
- *            ;%@@$=$@@%*       *@@@$=%@@%;
- *               ::;::             ::;::                                              All rights reserved.
- *
- * ********************************************************************************************************************
- */
-import { SGraphItem } from "@saga-web/graph/lib";
-import { SColor, SLine, SPoint, SRect } from "@saga-web/draw/lib";
-import { ItemOrder, ItemColor } from '@saga-web/big/lib';
-/**
- * 吸附时高亮对象
- *
- * @author  郝建龙
- */
-export class HighlightItem extends SGraphItem {
-    /**
-     * 构造函数
-     *
-     * @param   parent  指向父对象
-     */
-    constructor(parent) {
-        super(parent);
-        /** 对象与鼠标位置距离   */
-        this.distance = 0;
-        /** 对象类型   */
-        this.type = 1;
-        /** 点对象数据-当吸附的为线时,此点为垂线与线段的交点   */
-        this._point = new SPoint();
-        /** 点对象数据   */
-        this._line = new SLine();
-        this.visible = false;
-        this.zOrder = ItemOrder.highLightOrder;
-    } // Constructor
-    get point() {
-        return this._point;
-    } // Get point
-    set point(v) {
-        this._point = v;
-        this.type = 1;
-        this.update();
-    } // Set point
-    get line() {
-        return this._line;
-    } // Get line
-    set line(v) {
-        this._line = v;
-        this.type = 2;
-        this.update();
-    } // Set line
-    /**
-     * Item对象边界区域
-     *
-     * @return	SRect
-     */
-    boundingRect() {
-        return new SRect(this.point.x, this.point.y, 10, 10);
-    } // Function boundingRect()
-    /**
-     * Item绘制操作
-     *
-     * @param   painter painter对象
-     */
-    onDraw(painter) {
-        if (this.type == 2) {
-            painter.pen.color = ItemColor.highLightLineColor;
-            painter.pen.lineWidth = painter.toPx(6);
-            painter.drawLine(this.line);
-        }
-        painter.pen.color = SColor.Transparent;
-        painter.brush.color = ItemColor.highLightPointColor;
-        painter.drawCircle(this.point.x, this.point.y, painter.toPx(5));
-    } // Function onDraw()
-} // Class HighlightItem

+ 0 - 196
src/lib/items/SFHFQZoneLegendItem.js

@@ -1,196 +0,0 @@
-import { SColor, SFont, SPoint, SLineCapStyle } from '@saga-web/draw'
-import { STextItem } from '@saga-web/graph/lib'
-import { hexify } from '@/components/mapClass/until'
-import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
-/**
- *图例节点Item(区域类型 --防火分区)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SFHFQZoneLegendItem extends SPolygonItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent)
-        /** text item   */
-        this.textItem = new STextItem(this)
-        /** 是否显示文字  */
-        this._showText = true
-        /** 是否蒙版遮罩  */
-        this._maskFlag = false
-        this.textItem.isTransform = false
-        this.zOrder = ItemOrder.polygonOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.text = data.Name
-        if (data) {
-            this.setPointList = []
-            let setPointList
-            if (data.OutLine) {
-                if (data.OutLine[0] instanceof SPoint) {
-                    this.setPointList = data.OutLine
-                } else {
-                    setPointList = data.OutLine.map((i) => {
-                        return new SPoint(i.X, i.Y)
-                    })
-                    this.setPointList = setPointList
-                }
-            }
-            // 设置线宽
-            if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
-            }
-            if (data.Properties.StrokeColor) {
-                this.strokeColor = data.Properties.StrokeColor.includes('#')
-                    ? new SColor(data.Properties.StrokeColor)
-                    : new SColor(hexify(data.Properties.StrokeColor))
-            }
-            if (data.Properties.FillColor) {
-                this.fillColor = data.Properties.FillColor.includes('#')
-                    ? new SColor(data.Properties.FillColor)
-                    : new SColor(hexify(data.Properties.FillColor))
-            }
-            if (data.Properties.TextPos) {
-                this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y)
-            }
-            if (data.Properties.color) {
-                this.color = new SColor(data.Properties.color)
-            }
-            if (data.Properties.font) {
-                this.font = new SFont('sans-serif', data.Properties.font)
-            }
-            //    if( data.Properties.LineDash){
-            //     this.LineDash =this._legend.Properties.LineDash
-            //    }
-        }
-        // 监听多边形创建完成事件,并动态计算文本位置
-        this.connect('finishCreated', this, () => {
-            // 计算文本位置
-            let x = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.x / arr.length
-                }, 0),
-                y = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.y / arr.length
-                }, 0)
-            this.textItem.moveTo(x, y)
-        })
-    }
-    get text() {
-        return this.textItem.text
-    }
-    set text(v) {
-        this.textItem.text = v
-        this.update()
-    }
-    get color() {
-        return this.textItem.color
-    }
-    set color(v) {
-        this.textItem.color = v
-    }
-    get font() {
-        return this.textItem.font
-    }
-    set font(v) {
-        this.textItem.font = v
-    }
-    get status() {
-        return this._status
-    }
-    // 编辑当前状态
-    set status(value) {
-        this._status = value
-        // 如果状态为show则需清栈
-        if (value == SItemStatus.Normal) {
-            // 切换显示状态显示文本
-            this.showText = true
-            // 切换显示状态不可移动文本
-            this.textItem.moveable = false
-            if (this.undoStack) {
-                this.undoStack.clear()
-            }
-        } else if (value == SItemStatus.Edit) {
-            // 切换编辑状态显示文本
-            this.showText = true
-            // 切换编辑状态可移动文本
-            this.textItem.moveable = true
-        } else if (value == SItemStatus.Create) {
-            // 切换创建状态不显示文本
-            this.showText = false
-            // 切换创建状态不可移动文本
-            this.textItem.moveable = false
-        }
-        this.update()
-    }
-    get showText() {
-        return this._showText
-    }
-    set showText(v) {
-        if (v === this._showText) {
-            return
-        }
-        this._showText = v
-        if (v) {
-            this.textItem.show()
-        } else {
-            this.textItem.hide()
-        }
-    }
-    get maskFlag() {
-        return this._maskFlag
-    }
-    set maskFlag(v) {
-        if (v === this._maskFlag) {
-            return
-        }
-        this._maskFlag = v
-        this.update()
-    }
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Name = this.name
-        this.data.Properties.FillColor = this.fillColor.value
-        this.data.Properties.StrokeColor = this.strokeColor.value
-        this.data.Properties.LineWidth = this.lineWidth
-        this.data.OutLine = this.getPointList.map((pos) => {
-            return {
-                X: pos.x,
-                Y: pos.y,
-            }
-        })
-        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
-        return this.data
-    }
-    onDraw(painter) {
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            let color = new SColor(this.strokeColor)
-            color.alpha = color.alpha / 2
-            let brushcolor = new SColor(this.fillColor)
-            brushcolor.alpha = brushcolor.alpha / 2
-            painter.pen.color = color
-            painter.pen.lineCapStyle = SLineCapStyle.Square
-            painter.pen.lineWidth = painter.toPx(this._lineWidth)
-            painter.brush.color = brushcolor
-
-            if (this.selected) {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-                painter.shadow.shadowBlur = 10;
-                painter.shadow.shadowColor = new SColor(`#00000033`);
-                painter.shadow.shadowOffsetX = 5;
-                painter.shadow.shadowOffsetY = 5;
-            }
-
-            // @ts-ignore
-            painter.drawPolygon([...this.pointList])
-        } else {
-            super.onDraw(painter)
-        }
-    }
-} // Class SZoneLegendItem

+ 114 - 94
src/lib/items/SFHFQZoneLegendItem.ts

@@ -1,9 +1,9 @@
-import { SGraphItem, SLineStyle } from '@saga-web/graph/lib'
-import { Legend } from '../types/Legend'
-import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from '@saga-web/draw'
-import { STextItem } from '@saga-web/graph/lib'
-import { hexify } from '@/components/mapClass/until'
-import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
+import { SGraphItem, SLineStyle } from "@saga-web/graph/lib";
+import { Legend } from '../types/Legend';
+import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
+import { STextItem } from '@saga-web/graph/lib';
+import { hexify } from "@/components/mapClass/until"
+import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
 /**
  *图例节点Item(区域类型 --防火分区)
  *
@@ -11,23 +11,23 @@ import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
  */
 export class SFHFQZoneLegendItem extends SPolygonItem {
     /** 图例节点对象数据 */
-    data: Legend
+    data: Legend;
 
     /** text item   */
-    textItem: STextItem = new STextItem(this)
+    textItem: STextItem = new STextItem(this);
 
     get text(): string {
-        return this.textItem.text
+        return this.textItem.text;
     }
     set text(v: string) {
-        this.textItem.text = v
-        this.update()
+        this.textItem.text = v;
+        this.update();
     }
     get color(): SColor {
-        return this.textItem.color
+        return this.textItem.color;
     }
     set color(v: SColor) {
-        this.textItem.color = v
+        this.textItem.color = v;
     }
     get font(): SFont {
         return this.textItem.font
@@ -37,62 +37,77 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
     }
 
     get status(): SItemStatus {
-        return this._status
+        return this._status;
     }
     // 编辑当前状态
     set status(value: SItemStatus) {
-        this._status = value
+        this._status = value;
         // 如果状态为show则需清栈
         if (value == SItemStatus.Normal) {
             // 切换显示状态显示文本
-            this.showText = true
+            this.showText = true;
             // 切换显示状态不可移动文本
-            this.textItem.moveable = false
+            this.textItem.moveable = false;
 
             if (this.undoStack) {
-                this.undoStack.clear()
+                this.undoStack.clear();
             }
         } else if (value == SItemStatus.Edit) {
             // 切换编辑状态显示文本
-            this.showText = true
+            this.showText = true;
             // 切换编辑状态可移动文本
-            this.textItem.moveable = true
+            this.textItem.moveable = true;
         } else if (value == SItemStatus.Create) {
             // 切换创建状态不显示文本
-            this.showText = false
+            this.showText = false;
             // 切换创建状态不可移动文本
-            this.textItem.moveable = false
+            this.textItem.moveable = false;
         }
-        this.update()
-    }
+        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
+    _showText: boolean = true;
     get showText(): boolean {
-        return this._showText
+        return this._showText;
     }
     set showText(v: boolean) {
         if (v === this._showText) {
             return
         }
-        this._showText = v
+        this._showText = v;
         if (v) {
-            this.textItem.show()
+            this.textItem.show();
         } else {
-            this.textItem.hide()
+            this.textItem.hide();
         }
     }
 
     /** 是否蒙版遮罩  */
-    _maskFlag: boolean = false
+    _maskFlag: boolean = false;
     get maskFlag(): boolean {
-        return this._maskFlag
+        return this._maskFlag;
     }
     set maskFlag(v: boolean) {
         if (v === this._maskFlag) {
             return
         }
-        this._maskFlag = v
+        this._maskFlag = v;
         this.update()
     }
 
@@ -103,105 +118,112 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
      * @param data      图例节点对象数据
      */
     constructor(parent: SGraphItem | null, data: Legend) {
-        super(parent)
-        this.textItem.isTransform = false
-        this.zOrder = ItemOrder.polygonOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.text = data.Name
+        super(parent);
+        this.textItem.isTransform = false;
+        this.zOrder = ItemOrder.polygonOrder;
+        this.data = data;
+        this.id = data.ID;
+        this.name = data.Name;
+        this.text = data.Name;
         if (data) {
-            this.setPointList = []
-            let setPointList: SPoint[]
+            this.setPointList = [];
+            let setPointList: SPoint[];
             if (data.OutLine) {
                 if (data.OutLine[0] instanceof SPoint) {
-                    this.setPointList = data.OutLine
+                    this.setPointList = data.OutLine;
                 } else {
-                    setPointList = data.OutLine.map((i) => {
-                        return new SPoint(i.X, i.Y)
+                    setPointList = data.OutLine.map(i => {
+                        return (new SPoint(i.X, i.Y))
                     })
-                    this.setPointList = setPointList
+                    this.setPointList = setPointList;
                 }
             }
+            if (data.Properties.Zorder) {
+                this.zOrder = data.Properties.Zorder;
+            }
             // 设置线宽
             if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
+                this.lineWidth = data.Properties.LineWidth;
             }
             if (data.Properties.StrokeColor) {
-                this.strokeColor = data.Properties.StrokeColor.includes('#')
-                    ? new SColor(data.Properties.StrokeColor)
-                    : new SColor(hexify(data.Properties.StrokeColor))
+                this.strokeColor = data.Properties.StrokeColor.includes('#') ? new SColor(data.Properties.StrokeColor) : new SColor(hexify(data.Properties.StrokeColor));
             }
             if (data.Properties.FillColor) {
-                this.fillColor = data.Properties.FillColor.includes('#')
-                    ? new SColor(data.Properties.FillColor)
-                    : new SColor(hexify(data.Properties.FillColor))
+                this.fillColor = data.Properties.FillColor.includes('#') ? new SColor(data.Properties.FillColor) : new SColor(hexify(data.Properties.FillColor));
             }
             if (data.Properties.TextPos) {
-                this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y)
+                this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
             }
             if (data.Properties.color) {
-                this.color = new SColor(data.Properties.color)
+                this.color = new SColor(data.Properties.color);
             }
             if (data.Properties.font) {
-                this.font = new SFont('sans-serif', 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
-                    break
-                case 'dotted':
-                    this.lineStyle = SLineStyle.Dotted
-                    break
-                case 'dashed':
-                    this.lineStyle = SLineStyle.Dashed
-                    break
+                case "solid":
+                    this.lineStyle = SLineStyle.Solid;
+                    break;
+                case "dotted":
+                    this.lineStyle = SLineStyle.Dotted;
+                    break;
+                case "dashed":
+                    this.lineStyle = SLineStyle.Dashed;
+                    break;
                 default:
-                    this.lineStyle = SLineStyle.Solid
+                    this.lineStyle = SLineStyle.Solid;
             }
         }
         // 监听多边形创建完成事件,并动态计算文本位置
-        this.connect('finishCreated', this, () => {
+        this.connect("finishCreated", this, () => {
             // 计算文本位置
             let x: number = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.x / arr.length
-                }, 0),
+                return pre + (cur.x / arr.length)
+            }, 0),
                 y: number = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.y / arr.length
-                }, 0)
-            this.textItem.moveTo(x, y)
+                    return pre + (cur.y / arr.length)
+                }, 0);
+            this.textItem.moveTo(x, y);
         })
     }
 
     toData(): any {
-        this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Name = this.name
-        this.data.Properties.FillColor = this.fillColor.value
-        this.data.Properties.StrokeColor = this.strokeColor.value
-        this.data.Properties.LineWidth = this.lineWidth
+        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;
         switch (this.lineStyle) {
             case SLineStyle.Solid:
-                this.data.Properties.LineDash = 'solid'
-                break
+                this.data.Properties.LineDash = "solid";
+                break;
             case SLineStyle.Dotted:
-                this.data.Properties.LineDash = 'dotted'
-                break
+                this.data.Properties.LineDash = "dotted";
+                break;
             case SLineStyle.Dashed:
-                this.data.Properties.LineDash = 'dashed'
-                break
+                this.data.Properties.LineDash = "dashed";
+                break;
             default:
-                this.data.Properties.LineDash = 'solid'
+                this.data.Properties.LineDash = "solid";
         }
-        this.data.OutLine = this.getPointList.map((pos) => {
+        this.data.OutLine = this.getPointList.map(pos => {
             return {
                 X: pos.x,
-                Y: pos.y,
+                Y: pos.y
             }
-        })
-        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
-        return this.data
+        });
+        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;
     }
 
     onDraw(painter: SPainter) {
@@ -214,7 +236,6 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
             painter.pen.lineCapStyle = SLineCapStyle.Square
             painter.pen.lineWidth = painter.toPx(this._lineWidth)
             painter.brush.color = brushcolor
-
             if (this.selected) {
                 painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
                 painter.shadow.shadowBlur = 10;
@@ -222,11 +243,10 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
                 painter.shadow.shadowOffsetX = 5;
                 painter.shadow.shadowOffsetY = 5;
             }
-
             // @ts-ignore
-            painter.drawPolygon([...this.pointList])
+            painter.drawPolygon([...this.pointList]);
         } else {
-            super.onDraw(painter)
+            super.onDraw(painter);
         }
     }
 } // Class SZoneLegendItem

+ 0 - 155
src/lib/items/SImageLegendItem.js

@@ -1,155 +0,0 @@
-import { SIconTextItem } from '@saga-web/big/lib/items/SIconTextItem';
-import { ItemOrder, SItemStatus } from '@saga-web/big/lib';
-import { SFont, SColor } from '@saga-web/draw/lib';
-/**
- * 图例节点Item(图标类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SImageLegendItem extends SIconTextItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent, data.AnchorList);
-        /** 图例数量 */
-        this._num = 1;
-        /** 是否蒙版遮罩  */
-        this._maskFlag = false;
-        this.isTransform = false;
-        this.zOrder = ItemOrder.markOrder;
-        this.data = data;
-        this.id = data.ID;
-        this.name = data.Name;
-        this.text = data.Name;
-        this.moveTo(data.Pos.X, data.Pos.Y);
-        if (data.Num) {
-            this.num = data.Num;
-        }
-        if (data.Size) {
-            this.width = data.Size.Width;
-            this.height = data.Size.Height;
-        }
-        if (data.Properties && data.Properties.Url) {
-            this.img.url = data.Properties.Url;
-        }
-        if (data.Properties && data.Properties.sWidth) {
-            this.sWidth = data.Properties.sWidth;
-        }
-        if (data.Properties && data.Properties.sHeight) {
-            this.sHeight = data.Properties.sHeight;
-        }
-        if (data.Properties.ImgPos) {
-            this.img.moveTo(data.Properties.ImgPos.X, data.Properties.ImgPos.Y);
-        }
-        if (data.Properties && data.Properties.font) {
-            this.font = new SFont("sans-serif", data.Properties.font);
-        }
-        if (data.Properties.TextPos) {
-            this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
-        }
-        else {
-            // 偏移二分之一文本高度
-            this.textItem.moveTo((this.img.width * 0.5), -(this.font.size * 1.25 * 0.5));
-        }
-        if (data.Properties && data.Properties.color) {
-            this.color = new SColor(data.Properties.color);
-        }
-        if (data.Properties && data.Properties.IsActive) {
-            this.isActive = data.Properties.IsActive;
-        }
-        if (data.AttachObjectIds && data.AttachObjectIds.length) {
-            this.isActive = true;
-        }
-        if (data.Properties && data.Properties.FrameColor) {
-            this.activeColor = new SColor(data.Properties.FrameColor);
-        }
-    }
-    get num() {
-        return this._num;
-    }
-    set num(v) {
-        if (v) {
-            this._num = v;
-            this.data.Num = v;
-        }
-        else {
-            this._num = 1;
-            this.data.Num = 1;
-        }
-        this.data.Properties.Num = this._num;
-        this.textItem.text = `${this.name}${this.num > 1 ? `×${this.num}` : ''}`;
-        this.update();
-    }
-    get text() {
-        return this.textItem.text;
-    }
-    set text(v) {
-        this.name = v;
-        this.data.Name = v;
-        this.textItem.text = `${this.name}${this.num > 1 ? `×${this.num}` : ''}`;
-        this.update();
-    }
-    get maskFlag() {
-        return this._maskFlag;
-    }
-    set maskFlag(v) {
-        if (v === this._maskFlag) {
-            return;
-        }
-        this._maskFlag = v;
-        if (v) {
-            this.textItem.visible = false;
-        }
-        else {
-            this.textItem.visible = true;
-        }
-        this.update();
-    }
-    toData() {
-        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.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.Properties.FrameColor = this.activeColor.value;
-        this.data.Properties.IsActive = this.isActive;
-        this.data.AnchorList = this.anchorList.map(t => {
-            return {
-                ID: t.id,
-                Pos: {
-                    X: t.x,
-                    Y: t.y
-                }
-            };
-        });
-        return this.data;
-    }
-    /**
-     * Item绘制框架
-     *
-     * @param   painter       painter对象
-     * @param   rect          绘制区域
-     */
-    onPaint(painter, rect) {
-        super.onPaint(painter, rect);
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            painter.pen.color = SColor.Transparent;
-            painter.brush.color = new SColor("#ffffffa1");
-            if (this.selected) {
-                painter.drawCircle(this.img.x, this.img.y, (this.sWidth / 2.0) * 1.25);
-            }
-            else {
-                painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0);
-            }
-        }
-    } // Function onPaint()
-} // Class SImageLegendItem

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

@@ -79,6 +79,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;
         }
@@ -118,6 +121,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 };

File diff suppressed because it is too large
+ 0 - 57
src/lib/items/SImageMarkerItem.js


+ 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;

+ 0 - 47
src/lib/items/SLineLegendItem.js

@@ -1,47 +0,0 @@
-import { SPoint } from "@saga-web/draw/lib";
-import { SPolylineItem } from '@saga-web/big/lib';
-/**
- * 图例节点Item(线类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SLineLegendItem extends SPolylineItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent, []);
-        this.data = data;
-        this.id = data.ID;
-        this.name = data.Name;
-        this.moveTo(data.Pos.X, data.Pos.Y);
-        if (data.Properties && data.Properties.Line) {
-            let setPointList;
-            setPointList = data.Properties.Line.map(i => {
-                return new SPoint(i.x, i.y);
-            });
-            this.pointList = setPointList;
-        }
-        if (data.Properties && data.Properties.LineWidth) {
-            this.lineWidth = data.Properties.LineWidth;
-        }
-        if (data.Properties && data.Properties.StrokeColor) {
-            this.strokeColor = data.Properties.StrokeColor;
-        }
-    }
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y };
-        this.data.Properties.Line = this.pointList.map(pos => {
-            return {
-                X: pos.x,
-                Y: pos.y
-            };
-        });
-        this.data.Properties.LineWidth = this.lineWidth;
-        this.data.Properties.StrokeColor = this.strokeColor;
-        return this.data;
-    }
-} // Class SLineLegendItem

+ 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;

+ 0 - 121
src/lib/items/SLineMarkerItem.js

@@ -1,121 +0,0 @@
-import { SLineStyle } from '@saga-web/graph/lib'
-import { SPoint, SColor } from '@saga-web/draw/lib'
-import { ItemOrder, SLineItem, SItemStatus } from '@saga-web/big/lib'
-/**
- * 标识对象Item(线类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SLineMarkerItem extends SLineItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      标识对象数据
-     */
-    constructor(parent, data) {
-        super(parent)
-        /** 起始锚点  */
-        this.startItem = null
-        /** 结束锚点  */
-        this.endItem = null
-        /** 是否蒙版遮罩  */
-        this._maskFlag = false
-        this.zOrder = ItemOrder.lineOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.moveTo(data.Pos.X, data.Pos.Y)
-        if (data.Properties && data.Properties.Line) {
-            let setPointList
-            setPointList = data.Properties.Line.map((i) => {
-                return new SPoint(i.X, i.Y)
-            })
-            this.line = setPointList
-        }
-        if (data.Properties && data.Properties.LineWidth) {
-            this.lineWidth = data.Properties.LineWidth
-        }
-        if (data.Properties && data.Properties.LineStyle) {
-            this.lineStyle = data.Properties.LineStyle
-        }
-        if (data.Properties && data.Properties.StrokeColor) {
-            this.strokeColor = new SColor(data.Properties.StrokeColor)
-        }
-    } // Constructor
-    /** 是否完成绘制  */
-    get status() {
-        return this._status
-    }
-    set status(v) {
-        this._status = v
-        if (v == SItemStatus.Edit) {
-            this.zOrder = ItemOrder.markOrder
-        } else {
-            this.zOrder = ItemOrder.lineOrder
-        }
-        this.update()
-    }
-    get maskFlag() {
-        return this._maskFlag
-    }
-    set maskFlag(v) {
-        if (v === this._maskFlag) {
-            return
-        }
-        this._maskFlag = v
-        this.update()
-    }
-    /** 接收事件作出修改  */
-    changePos() {
-        if (this.startItem) {
-            // 判断删除equip后,不移动
-            if (this.startItem.parent) {
-                let scenePoint = this.startItem.boundingRect().center()
-                this.line[0] = this.startItem.mapToScene(scenePoint.x, scenePoint.y)
-            }
-        }
-        if (this.endItem) {
-            // 删除equip后
-            if (this.endItem.parent) {
-                let scenePoint = this.endItem.boundingRect().center()
-                this.line[1] = this.endItem.mapToScene(scenePoint.x, scenePoint.y)
-            }
-        }
-    }
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Properties.Line = this.line.map((pos) => {
-            return {
-                X: pos.x,
-                Y: pos.y,
-            }
-        })
-        this.data.Properties.LineWidth = this.lineWidth
-        this.data.Properties.StrokeColor = this.strokeColor.value
-        this.data.Properties.LineStyle = this.lineStyle
-        if (this.startItem && this.startItem.parent) {
-            this.data.Properties.StartItemId = this.startItem.id
-        }
-        if (this.endItem && this.endItem.parent) {
-            this.data.Properties.EndItemId = this.endItem.id
-        }
-        return this.data
-    }
-    onDraw(painter) {
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            let color = new SColor(this.strokeColor)
-            color.alpha = color.alpha / 2
-            painter.pen.color = new SColor(this.strokeColor)
-            if (this.lineStyle == SLineStyle.Dashed) {
-                painter.pen.lineDash = [painter.toPx(this.lineWidth * 3), painter.toPx(this.lineWidth * 7)]
-            } else if (this.lineStyle == SLineStyle.Dotted) {
-                painter.pen.lineDash = [painter.toPx(this.lineWidth), painter.toPx(this.lineWidth)]
-            }
-            painter.drawLine(this.line[0], this.line[1])
-        } else {
-            this.selected = true
-            super.onDraw(painter)
-        }
-    }
-} // Class SLineMarkerItem

+ 60 - 50
src/lib/items/SLineMarkerItem.ts

@@ -1,7 +1,7 @@
-import { SGraphItem, SLineStyle } from '@saga-web/graph/lib'
-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 { SGraphItem, SLineStyle } from "@saga-web/graph/lib";
+import { SPoint, SPainter, SColor, SLineCapStyle } from "@saga-web/draw/lib";
+import { ItemOrder, SLineItem, SItemStatus } from '@saga-web/big/lib';
+import { Marker } from '../types/Marker';
 
 /**
  * 标识对象Item(线类型)
@@ -10,37 +10,37 @@ import { Marker } from '../types/Marker'
  */
 export class SLineMarkerItem extends SLineItem {
     /** 起始锚点  */
-    startItem: SGraphItem | null = null
+    startItem: SGraphItem | null = null;
     /** 结束锚点  */
-    endItem: SGraphItem | null = null
+    endItem: SGraphItem | null = null;
 
     /** 标识对象数据 */
-    data: Marker
+    data: Marker;
 
     /** 是否完成绘制  */
     get status(): SItemStatus {
-        return this._status
+        return this._status;
     }
     set status(v: SItemStatus) {
-        this._status = v
+        this._status = v;
         if (v == SItemStatus.Edit) {
-            this.zOrder = ItemOrder.markOrder
+            this.zOrder = ItemOrder.markOrder;
         } else {
-            this.zOrder = ItemOrder.lineOrder
+            this.zOrder = ItemOrder.lineOrder;
         }
-        this.update()
+        this.update();
     }
 
     /** 是否蒙版遮罩  */
-    _maskFlag: boolean = false
+    _maskFlag: boolean = false;
     get maskFlag(): boolean {
-        return this._maskFlag
+        return this._maskFlag;
     }
     set maskFlag(v: boolean) {
         if (v === this._maskFlag) {
             return
         }
-        this._maskFlag = v
+        this._maskFlag = v;
         this.update()
     }
 
@@ -51,27 +51,30 @@ export class SLineMarkerItem extends SLineItem {
      * @param data      标识对象数据
      */
     constructor(parent: SGraphItem | null, data: Marker) {
-        super(parent)
-        this.zOrder = ItemOrder.lineOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.moveTo(data.Pos.X, data.Pos.Y)
+        super(parent);
+        this.zOrder = ItemOrder.lineOrder;
+        this.data = data;
+        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) => {
+            let setPointList: SPoint[];
+            setPointList = data.Properties.Line.map(i => {
                 return new SPoint(i.X, i.Y)
             })
-            this.line = setPointList
+            this.line = setPointList;
         }
         if (data.Properties && data.Properties.LineWidth) {
-            this.lineWidth = data.Properties.LineWidth
+            this.lineWidth = data.Properties.LineWidth;
         }
         if (data.Properties && data.Properties.LineStyle) {
-            this.lineStyle = data.Properties.LineStyle
+            this.lineStyle = data.Properties.LineStyle;
         }
         if (data.Properties && data.Properties.StrokeColor) {
-            this.strokeColor = new SColor(data.Properties.StrokeColor)
+            this.strokeColor = new SColor(data.Properties.StrokeColor);
         }
     } // Constructor
 
@@ -80,53 +83,60 @@ export class SLineMarkerItem extends SLineItem {
         if (this.startItem) {
             // 判断删除equip后,不移动
             if (this.startItem.parent) {
-                let scenePoint: SPoint = this.startItem.boundingRect().center()
-                this.line[0] = this.startItem.mapToScene(scenePoint.x, scenePoint.y)
+                let scenePoint: SPoint = this.startItem.boundingRect().center();
+                this.line[0] = this.startItem.mapToScene(scenePoint.x, scenePoint.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 scenePoint: SPoint = this.endItem.boundingRect().center();
+                this.line[1] = this.endItem.mapToScene(scenePoint.x, scenePoint.y);
             }
         }
     }
 
     toData(): Marker {
-        this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Properties.Line = this.line.map((pos) => {
+        this.data.Pos = { X: this.x, Y: this.y };
+        this.data.Properties.Line = this.line.map(pos => {
             return {
                 X: pos.x,
-                Y: pos.y,
+                Y: pos.y
             }
-        })
-        this.data.Properties.LineWidth = this.lineWidth
-        this.data.Properties.StrokeColor = this.strokeColor.value
-        this.data.Properties.LineStyle = this.lineStyle
+        });
+        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;
         if (this.startItem && this.startItem.parent) {
-            this.data.Properties.StartItemId = this.startItem.id
+            this.data.Properties.StartItemId = this.startItem.id;
         }
         if (this.endItem && this.endItem.parent) {
-            this.data.Properties.EndItemId = this.endItem.id
+            this.data.Properties.EndItemId = this.endItem.id;
         }
-        return this.data
+        return this.data;
     }
 
     onDraw(painter: SPainter) {
         if (this.maskFlag && this.status == SItemStatus.Normal) {
-            let color = new SColor(this.strokeColor)
-            color.alpha = color.alpha / 2
-            painter.pen.color = new SColor(this.strokeColor)
+            let color = new SColor(this.strokeColor);
+            color.alpha = 100;
+            painter.pen.color = new SColor(this.strokeColor);
             if (this.lineStyle == SLineStyle.Dashed) {
-                painter.pen.lineDash = [painter.toPx(this.lineWidth * 3), painter.toPx(this.lineWidth * 7)]
-            } else if (this.lineStyle == SLineStyle.Dotted) {
-                painter.pen.lineDash = [painter.toPx(this.lineWidth), painter.toPx(this.lineWidth)]
+                painter.pen.lineDash = [
+                    painter.toPx(this.lineWidth * 3),
+                    painter.toPx(this.lineWidth * 7)
+                ];
+            }
+            else if (this.lineStyle == SLineStyle.Dotted) {
+                painter.pen.lineDash = [
+                    painter.toPx(this.lineWidth),
+                    painter.toPx(this.lineWidth)
+                ];
             }
-            painter.drawLine(this.line[0], this.line[1])
+            painter.drawLine(this.line[0], this.line[1]);
         } else {
-            this.selected = true
-            super.onDraw(painter)
+            super.onDraw(painter);
         }
     }
 } // Class SLineMarkerItem

+ 0 - 22
src/lib/items/SNoneLegendItem.js

@@ -1,22 +0,0 @@
-import { SGraphItem } from "@saga-web/graph/lib";
-/**
- * 图例节点Item(非图例类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SNoneLegendItem extends SGraphItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent);
-        this.data = data;
-        this.id = data.ID;
-    }
-    toData() {
-        return this.data;
-    }
-} // Class SNoneLegendItem

+ 0 - 203
src/lib/items/SSCPZZoneLegendItem.js

@@ -1,203 +0,0 @@
-import { SColor, SFont, SPoint, SLineCapStyle } from '@saga-web/draw'
-import { STextItem } from '@saga-web/graph/lib'
-import { hexify } from '@/components/mapClass/until'
-import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
-/**
- * 图例节点Item(区域类型 --石材铺装)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SSCPZZoneLegendItem extends SPolygonItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent)
-        /** text item   */
-        this.textItem = new STextItem(this)
-        /** 是否显示文字  */
-        this._showText = true
-        /** 是否蒙版遮罩  */
-        this._maskFlag = false
-        this.textItem.isTransform = false
-        this.zOrder = ItemOrder.polygonOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.text = data.Name
-        if (data) {
-            this.setPointList = []
-            let setPointList
-            if (data.OutLine) {
-                if (data.OutLine[0] instanceof SPoint) {
-                    this.setPointList = data.OutLine
-                } else {
-                    setPointList = data.OutLine.map((i) => {
-                        return new SPoint(i.X, i.Y)
-                    })
-                    this.setPointList = setPointList
-                }
-            }
-            // 设置线宽
-            if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
-            }
-            if (data.Properties.StrokeColor) {
-                this.strokeColor = data.Properties.StrokeColor.includes('#')
-                    ? new SColor(data.Properties.StrokeColor)
-                    : new SColor(hexify(data.Properties.StrokeColor))
-            }
-            if (data.Properties.FillColor) {
-                this.fillColor = data.Properties.FillColor.includes('#')
-                    ? new SColor(data.Properties.FillColor)
-                    : new SColor(hexify(data.Properties.FillColor))
-            }
-            if (data.Properties.TextPos) {
-                this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y)
-            }
-            if (data.Properties.color) {
-                this.color = new SColor(data.Properties.color)
-            }
-            if (data.Properties.font) {
-                this.font = new SFont('sans-serif', data.Properties.font)
-            }
-            //    if( data.Properties.LineDash){
-            //     this.LineDash =this._legend.Properties.LineDash
-            //    }
-        }
-        // 监听多边形创建完成事件,并动态计算文本位置
-        this.connect('finishCreated', this, () => {
-            // 计算文本位置
-            let x = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.x / arr.length
-                }, 0),
-                y = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.y / arr.length
-                }, 0)
-            this.textItem.moveTo(x, y)
-        })
-    }
-    get text() {
-        return this.textItem.text
-    }
-    set text(v) {
-        this.textItem.text = v
-        this.update()
-    }
-    get color() {
-        return this.textItem.color
-    }
-    set color(v) {
-        this.textItem.color = v
-    }
-    get font() {
-        return this.textItem.font
-    }
-    set font(v) {
-        this.textItem.font = v
-    }
-    get status() {
-        return this._status
-    }
-    // 编辑当前状态
-    set status(value) {
-        this._status = value
-        // 如果状态为show则需清栈
-        if (value == SItemStatus.Normal) {
-            // 切换显示状态显示文本
-            this.showText = true
-            // 切换显示状态不可移动文本
-            this.textItem.moveable = false
-            if (this.undoStack) {
-                this.undoStack.clear()
-            }
-        } else if (value == SItemStatus.Edit) {
-            // 切换编辑状态显示文本
-            this.showText = true
-            // 切换编辑状态可移动文本
-            this.textItem.moveable = true
-        } else if (value == SItemStatus.Create) {
-            // 切换创建状态不显示文本
-            this.showText = false
-            // 切换创建状态不可移动文本
-            this.textItem.moveable = false
-        }
-        this.update()
-    }
-    get showText() {
-        return this._showText
-    }
-    set showText(v) {
-        if (v === this._showText) {
-            return
-        }
-        this._showText = v
-        if (v) {
-            this.textItem.show()
-        } else {
-            this.textItem.hide()
-        }
-    }
-    get maskFlag() {
-        return this._maskFlag
-    }
-    set maskFlag(v) {
-        if (v === this._maskFlag) {
-            return
-        }
-        this._maskFlag = v
-        this.update()
-    }
-    /** 图例说明  */
-    set itemExplain(v) {
-        this.data.Properties.ItemExplain = v
-    }
-    get itemExplain() {
-        return this.data.Properties.ItemExplain
-    }
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Name = this.name
-        this.data.Properties.FillColor = this.fillColor.value
-        this.data.Properties.StrokeColor = this.strokeColor.value
-        this.data.Properties.LineWidth = this.lineWidth
-        this.data.OutLine = this.getPointList.map((pos) => {
-            return {
-                X: pos.x,
-                Y: pos.y,
-            }
-        })
-        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
-        return this.data
-    }
-    onDraw(painter) {
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            let color = new SColor(this.strokeColor)
-            color.alpha = color.alpha / 2
-            let brushcolor = new SColor(this.fillColor)
-            brushcolor.alpha = brushcolor.alpha / 2
-            painter.pen.color = color
-            painter.pen.lineCapStyle = SLineCapStyle.Square
-            painter.pen.lineWidth = painter.toPx(this._lineWidth)
-            painter.brush.color = brushcolor
-
-            if (this.selected) {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-                painter.shadow.shadowBlur = 10;
-                painter.shadow.shadowColor = new SColor(`#00000033`);
-                painter.shadow.shadowOffsetX = 5;
-                painter.shadow.shadowOffsetY = 5;
-            }
-
-            // @ts-ignore
-            painter.drawPolygon([...this.pointList])
-        } else {
-            super.onDraw(painter)
-        }
-    }
-} // Class SZoneLegendItem

+ 115 - 94
src/lib/items/SSCPZZoneLegendItem.ts

@@ -1,9 +1,10 @@
-import { SGraphItem, SLineStyle } from '@saga-web/graph/lib'
-import { Legend } from '../types/Legend'
-import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from '@saga-web/draw'
-import { STextItem } from '@saga-web/graph/lib'
-import { hexify } from '@/components/mapClass/until'
-import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
+
+import { SGraphItem, SLineStyle } from "@saga-web/graph/lib";
+import { Legend } from '../types/Legend';
+import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
+import { STextItem } from '@saga-web/graph/lib';
+import { hexify } from "@/components/mapClass/until"
+import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
 /**
  * 图例节点Item(区域类型 --石材铺装)
  *
@@ -11,23 +12,23 @@ import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
  */
 export class SSCPZZoneLegendItem extends SPolygonItem {
     /** 图例节点对象数据 */
-    data: Legend
+    data: Legend;
 
     /** text item   */
-    textItem: STextItem = new STextItem(this)
+    textItem: STextItem = new STextItem(this);
 
     get text(): string {
-        return this.textItem.text
+        return this.textItem.text;
     }
     set text(v: string) {
-        this.textItem.text = v
-        this.update()
+        this.textItem.text = v;
+        this.update();
     }
     get color(): SColor {
-        return this.textItem.color
+        return this.textItem.color;
     }
     set color(v: SColor) {
-        this.textItem.color = v
+        this.textItem.color = v;
     }
     get font(): SFont {
         return this.textItem.font
@@ -37,62 +38,77 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
     }
 
     get status(): SItemStatus {
-        return this._status
+        return this._status;
     }
     // 编辑当前状态
     set status(value: SItemStatus) {
-        this._status = value
+        this._status = value;
         // 如果状态为show则需清栈
         if (value == SItemStatus.Normal) {
             // 切换显示状态显示文本
-            this.showText = true
+            this.showText = true;
             // 切换显示状态不可移动文本
-            this.textItem.moveable = false
+            this.textItem.moveable = false;
 
             if (this.undoStack) {
-                this.undoStack.clear()
+                this.undoStack.clear();
             }
         } else if (value == SItemStatus.Edit) {
             // 切换编辑状态显示文本
-            this.showText = true
+            this.showText = true;
             // 切换编辑状态可移动文本
-            this.textItem.moveable = true
+            this.textItem.moveable = true;
         } else if (value == SItemStatus.Create) {
             // 切换创建状态不显示文本
-            this.showText = false
+            this.showText = false;
             // 切换创建状态不可移动文本
-            this.textItem.moveable = false
+            this.textItem.moveable = false;
         }
-        this.update()
-    }
+        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
+    _showText: boolean = true;
     get showText(): boolean {
-        return this._showText
+        return this._showText;
     }
     set showText(v: boolean) {
         if (v === this._showText) {
             return
         }
-        this._showText = v
+        this._showText = v;
         if (v) {
-            this.textItem.show()
+            this.textItem.show();
         } else {
-            this.textItem.hide()
+            this.textItem.hide();
         }
     }
 
     /** 是否蒙版遮罩  */
-    _maskFlag: boolean = false
+    _maskFlag: boolean = false;
     get maskFlag(): boolean {
-        return this._maskFlag
+        return this._maskFlag;
     }
     set maskFlag(v: boolean) {
         if (v === this._maskFlag) {
             return
         }
-        this._maskFlag = v
+        this._maskFlag = v;
         this.update()
     }
 
@@ -111,105 +127,112 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
      * @param data      图例节点对象数据
      */
     constructor(parent: SGraphItem | null, data: Legend) {
-        super(parent)
-        this.textItem.isTransform = false
-        this.zOrder = ItemOrder.polygonOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.text = data.Name
+        super(parent);
+        this.textItem.isTransform = false;
+        this.zOrder = ItemOrder.polygonOrder;
+        this.data = data;
+        this.id = data.ID;
+        this.name = data.Name;
+        this.text = data.Name;
         if (data) {
-            this.setPointList = []
-            let setPointList: SPoint[]
+            this.setPointList = [];
+            let setPointList: SPoint[];
             if (data.OutLine) {
                 if (data.OutLine[0] instanceof SPoint) {
-                    this.setPointList = data.OutLine
+                    this.setPointList = data.OutLine;
                 } else {
-                    setPointList = data.OutLine.map((i) => {
-                        return new SPoint(i.X, i.Y)
+                    setPointList = data.OutLine.map(i => {
+                        return (new SPoint(i.X, i.Y))
                     })
-                    this.setPointList = setPointList
+                    this.setPointList = setPointList;
                 }
             }
+            if (data.Properties.Zorder) {
+                this.zOrder = data.Properties.Zorder;
+            }
             // 设置线宽
             if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
+                this.lineWidth = data.Properties.LineWidth;
             }
             if (data.Properties.StrokeColor) {
-                this.strokeColor = data.Properties.StrokeColor.includes('#')
-                    ? new SColor(data.Properties.StrokeColor)
-                    : new SColor(hexify(data.Properties.StrokeColor))
+                this.strokeColor = data.Properties.StrokeColor.includes('#') ? new SColor(data.Properties.StrokeColor) : new SColor(hexify(data.Properties.StrokeColor));
             }
             if (data.Properties.FillColor) {
-                this.fillColor = data.Properties.FillColor.includes('#')
-                    ? new SColor(data.Properties.FillColor)
-                    : new SColor(hexify(data.Properties.FillColor))
+                this.fillColor = data.Properties.FillColor.includes('#') ? new SColor(data.Properties.FillColor) : new SColor(hexify(data.Properties.FillColor))
             }
             if (data.Properties.TextPos) {
-                this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y)
+                this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
             }
             if (data.Properties.color) {
-                this.color = new SColor(data.Properties.color)
+                this.color = new SColor(data.Properties.color);
             }
             if (data.Properties.font) {
-                this.font = new SFont('sans-serif', 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
-                    break
-                case 'dotted':
-                    this.lineStyle = SLineStyle.Dotted
-                    break
-                case 'dashed':
-                    this.lineStyle = SLineStyle.Dashed
-                    break
+                case "solid":
+                    this.lineStyle = SLineStyle.Solid;
+                    break;
+                case "dotted":
+                    this.lineStyle = SLineStyle.Dotted;
+                    break;
+                case "dashed":
+                    this.lineStyle = SLineStyle.Dashed;
+                    break;
                 default:
-                    this.lineStyle = SLineStyle.Solid
+                    this.lineStyle = SLineStyle.Solid;
             }
         }
         // 监听多边形创建完成事件,并动态计算文本位置
-        this.connect('finishCreated', this, () => {
+        this.connect("finishCreated", this, () => {
             // 计算文本位置
             let x: number = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.x / arr.length
-                }, 0),
+                return pre + (cur.x / arr.length)
+            }, 0),
                 y: number = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.y / arr.length
-                }, 0)
-            this.textItem.moveTo(x, y)
+                    return pre + (cur.y / arr.length)
+                }, 0);
+            this.textItem.moveTo(x, y);
         })
     }
 
     toData(): any {
-        this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Name = this.name
-        this.data.Properties.FillColor = this.fillColor.value
-        this.data.Properties.StrokeColor = this.strokeColor.value
-        this.data.Properties.LineWidth = this.lineWidth
+        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;
         switch (this.lineStyle) {
             case SLineStyle.Solid:
-                this.data.Properties.LineDash = 'solid'
-                break
+                this.data.Properties.LineDash = "solid";
+                break;
             case SLineStyle.Dotted:
-                this.data.Properties.LineDash = 'dotted'
-                break
+                this.data.Properties.LineDash = "dotted";
+                break;
             case SLineStyle.Dashed:
-                this.data.Properties.LineDash = 'dashed'
-                break
+                this.data.Properties.LineDash = "dashed";
+                break;
             default:
-                this.data.Properties.LineDash = 'solid'
+                this.data.Properties.LineDash = "solid";
         }
-        this.data.OutLine = this.getPointList.map((pos) => {
+        this.data.OutLine = this.getPointList.map(pos => {
             return {
                 X: pos.x,
-                Y: pos.y,
+                Y: pos.y
             }
-        })
-        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
-        return this.data
+        });
+        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;
     }
 
     onDraw(painter: SPainter) {
@@ -222,7 +245,6 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
             painter.pen.lineCapStyle = SLineCapStyle.Square
             painter.pen.lineWidth = painter.toPx(this._lineWidth)
             painter.brush.color = brushcolor
-
             if (this.selected) {
                 painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
                 painter.shadow.shadowBlur = 10;
@@ -230,11 +252,10 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
                 painter.shadow.shadowOffsetX = 5;
                 painter.shadow.shadowOffsetY = 5;
             }
-
             // @ts-ignore
-            painter.drawPolygon([...this.pointList])
+            painter.drawPolygon([...this.pointList]);
         } else {
-            super.onDraw(painter)
+            super.onDraw(painter);
         }
     }
 } // Class SZoneLegendItem

+ 0 - 59
src/lib/items/STextMarkerItem.js

@@ -1,59 +0,0 @@
-import { STextItem } from "@saga-web/graph/lib";
-import { SColor, SFont, SPoint } from "@saga-web/draw";
-import { ItemOrder } from '@saga-web/big/lib';
-/**
- * 标识对象Item(文本类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class STextMarkerItem extends STextItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      标识对象数据
-     */
-    constructor(parent, data) {
-        super(parent);
-        this.zOrder = ItemOrder.textOrder;
-        this.isTransform = false;
-        this.data = data;
-        this.id = data.ID;
-        this.name = data.Name;
-        this.moveTo(data.Pos.X, data.Pos.Y);
-        if (data.Size) {
-            this.width = data.Size.Width;
-            this.height = data.Size.Height;
-        }
-        if (data.Properties && data.Properties.Text) {
-            this.text = data.Properties.Text;
-        }
-        if (data.Properties && data.Properties.Color) {
-            this.color = new SColor(data.Properties.Color);
-        }
-        if (data.Properties && data.Properties.Font) {
-            this.font = new SFont("sans-serif", data.Properties.Font);
-            ;
-        }
-        if (data.Properties && data.Properties.BackgroundColor) {
-            this.backgroundColor = new SColor(data.Properties.BackgroundColor);
-        }
-    } // Constructor
-    /**
-     * 根据换行切割文本,绘制多行并计算外轮廓宽高
-     *
-     */
-    drawFormatText() {
-        super.drawFormatText();
-        this.origin = new SPoint(this.width / 2, this.height / 2);
-    } // Function drawFormatText()
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y };
-        this.data.Size = { Width: this.width, Height: this.height };
-        this.data.Properties.Text = this.text;
-        this.data.Properties.Color = this.color.value;
-        this.data.Properties.Font = this.font.size;
-        this.data.Properties.BackgroundColor = this.backgroundColor.value;
-        return this.data;
-    }
-} // Class STextMarkerItem

+ 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;

+ 0 - 197
src/lib/items/SZoneLegendItem.js

@@ -1,197 +0,0 @@
-import { SColor, SFont, SPoint, SLineCapStyle } from '@saga-web/draw'
-import { STextItem } from '@saga-web/graph/lib'
-import { hexify } from '@/components/mapClass/until'
-import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
-/**
- * 图例节点Item(区域类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SZoneLegendItem extends SPolygonItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent)
-        /** text item   */
-        this.textItem = new STextItem(this)
-        /** 是否显示文字  */
-        this._showText = true
-        /** 是否蒙版遮罩  */
-        this._maskFlag = false
-        this.textItem.isTransform = false
-        this.zOrder = ItemOrder.polygonOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.text = data.Name
-        if (data) {
-            this.setPointList = []
-            let setPointList
-            if (data.OutLine) {
-                if (data.OutLine[0] instanceof SPoint) {
-                    // @ts-ignore
-                    this.setPointList = data.OutLine
-                } else {
-                    setPointList = data.OutLine.map((i) => {
-                        return new SPoint(i.X, i.Y)
-                    })
-                    this.setPointList = setPointList
-                }
-            }
-            // 设置线宽
-            if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
-            }
-            if (data.Properties.StrokeColor) {
-                this.strokeColor = data.Properties.StrokeColor.includes('#')
-                    ? new SColor(data.Properties.StrokeColor)
-                    : new SColor(hexify(data.Properties.StrokeColor))
-            }
-            if (data.Properties.FillColor) {
-                this.fillColor = data.Properties.FillColor.includes('#')
-                    ? new SColor(data.Properties.FillColor)
-                    : new SColor(hexify(data.Properties.FillColor))
-            }
-            if (data.Properties.TextPos) {
-                this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y)
-            }
-            if (data.Properties.color) {
-                this.color = new SColor(data.Properties.color)
-            }
-            if (data.Properties.font) {
-                this.font = new SFont('sans-serif', data.Properties.font)
-            }
-            //    if( data.Properties.LineDash){
-            //     this.LineDash =this._legend.Properties.LineDash
-            //    }
-        }
-        // 监听多边形创建完成事件,并动态计算文本位置
-        this.connect('finishCreated', this, () => {
-            // 计算文本位置
-            let x = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.x / arr.length
-                }, 0),
-                y = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.y / arr.length
-                }, 0)
-            this.textItem.moveTo(x, y)
-        })
-    }
-    get text() {
-        return this.textItem.text
-    }
-    set text(v) {
-        this.textItem.text = v
-        this.update()
-    }
-    get color() {
-        return this.textItem.color
-    }
-    set color(v) {
-        this.textItem.color = v
-    }
-    get font() {
-        return this.textItem.font
-    }
-    set font(v) {
-        this.textItem.font = v
-    }
-    get status() {
-        return this._status
-    }
-    // 编辑当前状态
-    set status(value) {
-        this._status = value
-        // 如果状态为show则需清栈
-        if (value == SItemStatus.Normal) {
-            // 切换显示状态显示文本
-            this.showText = true
-            // 切换显示状态不可移动文本
-            this.textItem.moveable = false
-            if (this.undoStack) {
-                this.undoStack.clear()
-            }
-        } else if (value == SItemStatus.Edit) {
-            // 切换编辑状态显示文本
-            this.showText = true
-            // 切换编辑状态可移动文本
-            this.textItem.moveable = true
-        } else if (value == SItemStatus.Create) {
-            // 切换创建状态不显示文本
-            this.showText = false
-            // 切换创建状态不可移动文本
-            this.textItem.moveable = false
-        }
-        this.update()
-    }
-    get showText() {
-        return this._showText
-    }
-    set showText(v) {
-        if (v === this._showText) {
-            return
-        }
-        this._showText = v
-        if (v) {
-            this.textItem.show()
-        } else {
-            this.textItem.hide()
-        }
-    }
-    get maskFlag() {
-        return this._maskFlag
-    }
-    set maskFlag(v) {
-        if (v === this._maskFlag) {
-            return
-        }
-        this._maskFlag = v
-        this.update()
-    }
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Name = this.name
-        this.data.Properties.FillColor = this.fillColor.value
-        this.data.Properties.StrokeColor = this.strokeColor.value
-        this.data.Properties.LineWidth = this.lineWidth
-        this.data.OutLine = this.getPointList.map((pos) => {
-            return {
-                X: pos.x,
-                Y: pos.y,
-            }
-        })
-        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
-        return this.data
-    }
-    onDraw(painter) {
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            let color = new SColor(this.strokeColor)
-            color.alpha = color.alpha / 2
-            let brushcolor = new SColor(this.fillColor)
-            brushcolor.alpha = brushcolor.alpha / 2
-            painter.pen.color = color
-            painter.pen.lineCapStyle = SLineCapStyle.Square
-            painter.pen.lineWidth = painter.toPx(this._lineWidth)
-            painter.brush.color = brushcolor
-
-            if (this.selected) {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-                painter.shadow.shadowBlur = 10;
-                painter.shadow.shadowColor = new SColor(`#00000033`);
-                painter.shadow.shadowOffsetX = 5;
-                painter.shadow.shadowOffsetY = 5;
-            }
-
-            // @ts-ignore
-            painter.drawPolygon([...this.pointList])
-        } else {
-            super.onDraw(painter)
-        }
-    }
-} // Class SZoneLegendItem

+ 116 - 97
src/lib/items/SZoneLegendItem.ts

@@ -1,10 +1,9 @@
-import { SGraphItem, SLineStyle } from '@saga-web/graph/lib'
-import { Legend } from '../types/Legend'
-import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from '@saga-web/draw'
-import { STextItem } from '@saga-web/graph/lib'
-import { hexify } from '@/components/mapClass/until'
-import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
-import { SMouseEvent } from '@saga-web/base/lib'
+import { SGraphItem, SLineStyle } from "@saga-web/graph/lib";
+import { Legend } from '../types/Legend';
+import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
+import { STextItem } from '@saga-web/graph/lib';
+import { hexify } from "@/components/mapClass/until"
+import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
 /**
  * 图例节点Item(区域类型)
  *
@@ -12,88 +11,103 @@ import { SMouseEvent } from '@saga-web/base/lib'
  */
 export class SZoneLegendItem extends SPolygonItem {
     /** 图例节点对象数据 */
-    data: Legend
+    data: Legend;
 
     /** text item   */
-    textItem: STextItem = new STextItem(this)
+    textItem: STextItem = new STextItem(this);
 
     get text(): string {
-        return this.textItem.text
+        return this.textItem.text;
     }
     set text(v: string) {
-        this.textItem.text = v
-        this.update()
+        this.textItem.text = v;
+        this.update();
     }
     get color(): SColor {
-        return this.textItem.color
+        return this.textItem.color;
     }
     set color(v: SColor) {
-        this.textItem.color = v
+        this.textItem.color = v;
     }
     get font(): SFont {
-        return this.textItem.font
+        return this.textItem.font;
     }
     set font(v: SFont) {
-        this.textItem.font = v
+        this.textItem.font = v;
     }
 
     get status(): SItemStatus {
-        return this._status
+        return this._status;
     }
     // 编辑当前状态
     set status(value: SItemStatus) {
-        this._status = value
+        this._status = value;
         // 如果状态为show则需清栈
         if (value == SItemStatus.Normal) {
             // 切换显示状态显示文本
-            this.showText = true
+            this.showText = true;
             // 切换显示状态不可移动文本
-            this.textItem.moveable = false
+            this.textItem.moveable = false;
 
             if (this.undoStack) {
-                this.undoStack.clear()
+                this.undoStack.clear();
             }
         } else if (value == SItemStatus.Edit) {
             // 切换编辑状态显示文本
-            this.showText = true
+            this.showText = true;
             // 切换编辑状态可移动文本
-            this.textItem.moveable = true
+            this.textItem.moveable = true;
         } else if (value == SItemStatus.Create) {
             // 切换创建状态不显示文本
-            this.showText = false
+            this.showText = false;
             // 切换创建状态不可移动文本
-            this.textItem.moveable = false
+            this.textItem.moveable = false;
         }
-        this.update()
-    }
+        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
+    _showText: boolean = true;
     get showText(): boolean {
-        return this._showText
+        return this._showText;
     }
     set showText(v: boolean) {
         if (v === this._showText) {
             return
         }
-        this._showText = v
+        this._showText = v;
         if (v) {
-            this.textItem.show()
+            this.textItem.show();
         } else {
-            this.textItem.hide()
+            this.textItem.hide();
         }
     }
 
     /** 是否蒙版遮罩  */
-    _maskFlag: boolean = false
+    _maskFlag: boolean = false;
     get maskFlag(): boolean {
-        return this._maskFlag
+        return this._maskFlag;
     }
     set maskFlag(v: boolean) {
         if (v === this._maskFlag) {
             return
         }
-        this._maskFlag = v
+        this._maskFlag = v;
         this.update()
     }
 
@@ -104,106 +118,113 @@ export class SZoneLegendItem extends SPolygonItem {
      * @param data      图例节点对象数据
      */
     constructor(parent: SGraphItem | null, data: Legend) {
-        super(parent)
-        this.textItem.isTransform = false
-        this.zOrder = ItemOrder.polygonOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.text = data.Name
+        super(parent);
+        this.textItem.isTransform = false;
+        this.zOrder = ItemOrder.polygonOrder;
+        this.data = data;
+        this.id = data.ID;
+        this.name = data.Name;
+        this.text = data.Name;
         if (data) {
-            this.setPointList = []
-            let setPointList: SPoint[]
+            this.setPointList = [];
+            let setPointList: SPoint[];
             if (data.OutLine) {
                 if (data.OutLine[0] instanceof SPoint) {
                     // @ts-ignore
-                    this.setPointList = data.OutLine
+                    this.setPointList = data.OutLine;
                 } else {
-                    setPointList = data.OutLine.map((i) => {
-                        return new SPoint(i.X, i.Y)
+                    setPointList = data.OutLine.map(i => {
+                        return (new SPoint(i.X, i.Y))
                     })
-                    this.setPointList = setPointList
+                    this.setPointList = setPointList;
                 }
             }
+            if (data.Properties.Zorder) {
+                this.zOrder = data.Properties.Zorder;
+            }
             // 设置线宽
             if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
+                this.lineWidth = data.Properties.LineWidth;
             }
             if (data.Properties.StrokeColor) {
-                this.strokeColor = data.Properties.StrokeColor.includes('#')
-                    ? new SColor(data.Properties.StrokeColor)
-                    : new SColor(hexify(data.Properties.StrokeColor))
+                this.strokeColor = data.Properties.StrokeColor.includes('#') ? new SColor(data.Properties.StrokeColor) : new SColor(hexify(data.Properties.StrokeColor));
             }
             if (data.Properties.FillColor) {
-                this.fillColor = data.Properties.FillColor.includes('#')
-                    ? new SColor(data.Properties.FillColor)
-                    : new SColor(hexify(data.Properties.FillColor))
+                this.fillColor = data.Properties.FillColor.includes('#') ? new SColor(data.Properties.FillColor) : new SColor(hexify(data.Properties.FillColor))
             }
             if (data.Properties.TextPos) {
-                this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y)
+                this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
             }
             if (data.Properties.color) {
-                this.color = new SColor(data.Properties.color)
+                this.color = new SColor(data.Properties.color);
             }
             if (data.Properties.font) {
-                this.font = new SFont('sans-serif', 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
-                    break
-                case 'dotted':
-                    this.lineStyle = SLineStyle.Dotted
-                    break
-                case 'dashed':
-                    this.lineStyle = SLineStyle.Dashed
-                    break
+                case "solid":
+                    this.lineStyle = SLineStyle.Solid;
+                    break;
+                case "dotted":
+                    this.lineStyle = SLineStyle.Dotted;
+                    break;
+                case "dashed":
+                    this.lineStyle = SLineStyle.Dashed;
+                    break;
                 default:
-                    this.lineStyle = SLineStyle.Solid
+                    this.lineStyle = SLineStyle.Solid;
             }
         }
         // 监听多边形创建完成事件,并动态计算文本位置
-        this.connect('finishCreated', this, () => {
+        this.connect("finishCreated", this, () => {
             // 计算文本位置
             let x: number = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.x / arr.length
-                }, 0),
+                return pre + (cur.x / arr.length)
+            }, 0),
                 y: number = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.y / arr.length
-                }, 0)
-            this.textItem.moveTo(x, y)
+                    return pre + (cur.y / arr.length)
+                }, 0);
+            this.textItem.moveTo(x, y);
         })
     }
 
     toData(): any {
-        this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Name = this.name
-        this.data.Properties.FillColor = this.fillColor.value
-        this.data.Properties.StrokeColor = this.strokeColor.value
-        this.data.Properties.LineWidth = this.lineWidth
+        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;
         switch (this.lineStyle) {
             case SLineStyle.Solid:
-                this.data.Properties.LineDash = 'solid'
-                break
+                this.data.Properties.LineDash = "solid";
+                break;
             case SLineStyle.Dotted:
-                this.data.Properties.LineDash = 'dotted'
-                break
+                this.data.Properties.LineDash = "dotted";
+                break;
             case SLineStyle.Dashed:
-                this.data.Properties.LineDash = 'dashed'
-                break
+                this.data.Properties.LineDash = "dashed";
+                break;
             default:
-                this.data.Properties.LineDash = 'solid'
+                this.data.Properties.LineDash = "solid";
         }
-        this.data.OutLine = this.getPointList.map((pos) => {
+        this.data.OutLine = this.getPointList.map(pos => {
             return {
                 X: pos.x,
-                Y: pos.y,
+                Y: pos.y
             }
-        })
-        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
-        return this.data
+        });
+        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;
     }
 
     onDraw(painter: SPainter) {
@@ -216,7 +237,6 @@ export class SZoneLegendItem extends SPolygonItem {
             painter.pen.lineCapStyle = SLineCapStyle.Square
             painter.pen.lineWidth = painter.toPx(this._lineWidth)
             painter.brush.color = brushcolor
-
             if (this.selected) {
                 painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
                 painter.shadow.shadowBlur = 10;
@@ -224,11 +244,10 @@ export class SZoneLegendItem extends SPolygonItem {
                 painter.shadow.shadowOffsetX = 5;
                 painter.shadow.shadowOffsetY = 5;
             }
-            
             // @ts-ignore
-            painter.drawPolygon([...this.pointList])
+            painter.drawPolygon([...this.pointList]);
         } else {
-            super.onDraw(painter)
+            super.onDraw(painter);
         }
     }
 } // Class SZoneLegendItem

+ 0 - 190
src/lib/items/TipelineItem.js

@@ -1,190 +0,0 @@
-import { SPolylineItem, ItemOrder, SItemStatus } from '@saga-web/big/lib'
-import { SColor } from '@saga-web/draw'
-import { SPoint } from '@saga-web/draw/lib'
-/**
- * 管道item
- *
- * */
-export class TipelineItem extends SPolylineItem {
-    constructor(parent, data) {
-        super(parent, [])
-        /** 起始锚点  */
-        this.startAnchor = null
-        /** 结束锚点  */
-        this.endAnchor = null
-        /** 对应的图例ID  */
-        this._graphElementId = ''
-        /** 关联节点1ID  */
-        this._node1Id = ''
-        /** 关联节点2ID  */
-        this._node2Id = ''
-        /** 关联锚点1ID  */
-        this._anchor1ID = ''
-        /** 关联锚点2ID  */
-        this._anchor2ID = ''
-        /** 是否蒙版遮罩  */
-        this._maskFlag = false
-        /** 数据存储  */
-        this.data = null
-        this.zOrder = ItemOrder.polylineOrder
-        this.pointList = data.PointList.map((item) => {
-            return new SPoint(item.X, item.Y)
-        })
-        this.data = data
-        this.name = data.Name
-        this.id = data.ID
-        if (data.GraphElementId) {
-            this._graphElementId = data.GraphElementId
-        }
-        if (data.Node1ID) {
-            this._node1Id = data.Node1ID
-        }
-        if (data.Node2ID) {
-            this._node2Id = data.Node2ID
-        }
-        if (data.Anchor1ID) {
-            this._anchor1ID = data.Anchor1ID
-        }
-        if (data.Anchor2ID) {
-            this._anchor2ID = data.Anchor2ID
-        }
-        if (data.Properties && data.Properties.Color) {
-            this.strokeColor = new SColor(data.Properties.Color)
-        }
-        // if(data.Properties && data.Properties.LineDash){
-        //   this.LineDash = data.Properties.LineDash
-        // }
-        if (data.Properties && data.Properties.LineWidth) {
-            this.lineWidth = data.Properties.LineWidth
-        }
-    }
-    get graphElementId() {
-        return this._graphElementId
-    }
-    set graphElementId(v) {
-        this._graphElementId = v
-        if (this.data) {
-            this.data.GraphElementId = this._graphElementId
-        }
-    }
-    get node1Id() {
-        return this._node1Id
-    }
-    set node1Id(v) {
-        this._node1Id = v
-        if (this.data) {
-            this.data.Node1ID = this._node1Id
-        }
-    }
-    get node2Id() {
-        return this._node2Id
-    }
-    set node2Id(v) {
-        this._node2Id = v
-        if (this.data) {
-            this.data.Node2ID = this._node2Id
-        }
-    }
-    get anchor1ID() {
-        return this._anchor1ID
-    }
-    set anchor1ID(v) {
-        this._anchor1ID = v
-        if (this.data) {
-            this.data.Anchor1ID = this._anchor1ID
-        }
-    }
-    get anchor2ID() {
-        return this._anchor2ID
-    }
-    set anchor2ID(v) {
-        this._anchor2ID = v
-        if (this.data) {
-            this.data.Anchor2ID = this._anchor2ID
-        }
-    }
-    get maskFlag() {
-        return this._maskFlag
-    }
-    set maskFlag(v) {
-        if (v === this._maskFlag) {
-            return
-        }
-        this._maskFlag = v
-        this.update()
-    }
-    /** 接收事件作出修改  */
-    changePos() {
-        if (this.startAnchor) {
-            // 判断删除equip后,不移动
-            if (this.startAnchor.parent && this.startAnchor.parent.parent) {
-                this.pointList[0] = this.startAnchor.mapToScene(0, 0)
-            }
-        }
-        if (this.endAnchor) {
-            // 删除equip后
-            if (this.endAnchor.parent && this.endAnchor.parent.parent) {
-                this.pointList[this.pointList.length - 1] = this.endAnchor.mapToScene(0, 0)
-            }
-        }
-    }
-    /** 获取data数据  */
-    toData() {
-        let pointList = this.pointList.map((item) => {
-            return {
-                X: item.x,
-                Y: item.y,
-            }
-        })
-        if (this.data) {
-            this.data.Name = this.name;
-            this.data.PointList = pointList
-            this.data.Properties.LineWidth = this.lineWidth
-            // this.data.Properties.LineDash = this.LineDash;
-            this.data.Properties.Color = this.strokeColor.value
-        }
-        return this.data
-    }
-   // onDraw(painter: SPainter) {
-    //     if (this.maskFlag && this.status == SItemStatus.Normal) {
-    //         let color = new SColor(this.strokeColor)
-    //         color.alpha = color.alpha / 8
-    //         painter.pen.color = color
-
-    //         if (this.selected) {
-    //             painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-    //             painter.shadow.shadowBlur = 10;
-    //             painter.shadow.shadowColor = new SColor(`#00000033`);
-    //             painter.shadow.shadowOffsetX = 5;
-    //             painter.shadow.shadowOffsetY = 5;
-    //         } else {
-    //             painter.pen.lineWidth = painter.toPx(this.lineWidth);
-    //             painter.shadow.shadowColor = SColor.Transparent
-    //         }
-    //         painter.drawPolyline(this.pointList)
-
-    //         painter.pen.color = new SColor('#ffffff80')
-    //         painter.drawPolyline(this.pointList)
-    //     } else {
-    //         super.onDraw(painter)
-    //     }
-    // }
-    /**
-     * Item绘制框架
-     *
-     * @param   painter       painter对象
-     * @param   rect          绘制区域
-     */
-    onPaint(painter, rect) {
-        super.onPaint(painter, rect);
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            if (this.selected) {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-            } else {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth);
-            }
-            painter.pen.color = new SColor('#ffffff80')
-            painter.drawPolyline(this.pointList)
-        }
-    } // Function onPaint()
-}

+ 159 - 153
src/lib/items/TipelineItem.ts

@@ -1,161 +1,167 @@
-import { SPolylineItem, ItemOrder, SItemStatus } from '@saga-web/big/lib'
-import { SPainter, SColor, SRect } from '@saga-web/draw'
-import { SAnchorItem, SGraphItem } from '@saga-web/graph/lib'
-import { Relation } from '../types/Relation'
-import { SPoint } from '@saga-web/draw/lib'
-import { Point } from '@saga-web/big/lib/types/Point'
+import { SPolylineItem, ItemOrder, SItemStatus } from '@saga-web/big/lib';
+import { SPainter, SColor, SRect } from '@saga-web/draw';
+import { SAnchorItem, SGraphItem } from '@saga-web/graph/lib';
+import { Relation } from '../types/Relation';
+import { SPoint } from "@saga-web/draw/lib";
+import { Point } from "@saga-web/big/lib/types/Point";
 
 /**
  * 管道item
  *
  * */
 export class TipelineItem extends SPolylineItem {
-    /** 起始锚点  */
-    startAnchor: SAnchorItem | null = null
-    /** 结束锚点  */
-    endAnchor: SAnchorItem | null = null
-    /** 对应的图例ID  */
-    _graphElementId: string = ''
-    get graphElementId(): string {
-        return this._graphElementId
-    }
-    set graphElementId(v: string) {
-        this._graphElementId = v
-        if (this.data) {
-            this.data.GraphElementId = this._graphElementId
-        }
-    }
-    /** 关联节点1ID  */
-    _node1Id: string = ''
-    get node1Id(): string {
-        return this._node1Id
-    }
-    set node1Id(v: string) {
-        this._node1Id = v
-        if (this.data) {
-            this.data.Node1ID = this._node1Id
-        }
-    }
-    /** 关联节点2ID  */
-    _node2Id: string = ''
-    get node2Id(): string {
-        return this._node2Id
-    }
-    set node2Id(v: string) {
-        this._node2Id = v
-        if (this.data) {
-            this.data.Node2ID = this._node2Id
-        }
-    }
-    /** 关联锚点1ID  */
-    _anchor1ID: string = ''
-    get anchor1ID(): string {
-        return this._anchor1ID
-    }
-    set anchor1ID(v: string) {
-        this._anchor1ID = v
-        if (this.data) {
-            this.data.Anchor1ID = this._anchor1ID
-        }
-    }
-    /** 关联锚点2ID  */
-    _anchor2ID: string = ''
-    get anchor2ID(): string {
-        return this._anchor2ID
-    }
-    set anchor2ID(v: string) {
-        this._anchor2ID = v
-        if (this.data) {
-            this.data.Anchor2ID = this._anchor2ID
-        }
+  /** 起始锚点  */
+  startAnchor: SAnchorItem | null = null;
+  /** 结束锚点  */
+  endAnchor: SAnchorItem | null = null;
+  /** 对应的图例ID  */
+  _graphElementId: string = "";
+  get graphElementId(): string {
+    return this._graphElementId;
+  }
+  set graphElementId(v: string) {
+    this._graphElementId = v;
+    if (this.data) {
+      this.data.GraphElementId = this._graphElementId;
     }
-
-    /** 是否蒙版遮罩  */
-    _maskFlag: boolean = false
-    get maskFlag(): boolean {
-        return this._maskFlag
-    }
-    set maskFlag(v: boolean) {
-        if (v === this._maskFlag) {
-            return
-        }
-        this._maskFlag = v
-        this.update()
+  }
+  /** 关联节点1ID  */
+  _node1Id: string = "";
+  get node1Id(): string {
+    return this._node1Id;
+  }
+  set node1Id(v: string) {
+    this._node1Id = v;
+    if (this.data) {
+      this.data.Node1ID = this._node1Id;
+    }
+  }
+  /** 关联节点2ID  */
+  _node2Id: string = "";
+  get node2Id(): string {
+    return this._node2Id;
+  }
+  set node2Id(v: string) {
+    this._node2Id = v;
+    if (this.data) {
+      this.data.Node2ID = this._node2Id;
+    }
+  }
+  /** 关联锚点1ID  */
+  _anchor1ID: string = "";
+  get anchor1ID(): string {
+    return this._anchor1ID;
+  }
+  set anchor1ID(v: string) {
+    this._anchor1ID = v;
+    if (this.data) {
+      this.data.Anchor1ID = this._anchor1ID;
+    }
+  }
+  /** 关联锚点2ID  */
+  _anchor2ID: string = "";
+  get anchor2ID(): string {
+    return this._anchor2ID;
+  }
+  set anchor2ID(v: string) {
+    this._anchor2ID = v;
+    if (this.data) {
+      this.data.Anchor2ID = this._anchor2ID;
     }
+  }
 
-    /** 数据存储  */
-    data: Relation | null = null
-    /** 接收事件作出修改  */
-    changePos() {
-        if (this.startAnchor) {
-            // 判断删除equip后,不移动
-            if (this.startAnchor.parent && this.startAnchor.parent.parent) {
-                this.pointList[0] = this.startAnchor.mapToScene(0, 0)
-            }
-        }
-        if (this.endAnchor) {
-            // 删除equip后
-            if (this.endAnchor.parent && this.endAnchor.parent.parent) {
-                this.pointList[this.pointList.length - 1] = this.endAnchor.mapToScene(0, 0)
-            }
-        }
+  /** 是否蒙版遮罩  */
+  _maskFlag: boolean = false;
+  get maskFlag(): boolean {
+    return this._maskFlag;
+  }
+  set maskFlag(v: boolean) {
+    if (v === this._maskFlag) {
+      return
     }
+    this._maskFlag = v;
+    this.update()
+  }
 
-    constructor(parent: SGraphItem | null, data: Relation) {
-        super(parent, [])
-        this.zOrder = ItemOrder.polylineOrder
-        this.pointList = data.PointList.map((item) => {
-            return new SPoint(item.X, item.Y)
-        })
-        this.data = data
-        this.name = data.Name
-        this.id = data.ID
-        if (data.GraphElementId) {
-            this._graphElementId = data.GraphElementId
-        }
-        if (data.Node1ID) {
-            this._node1Id = data.Node1ID
-        }
-        if (data.Node2ID) {
-            this._node2Id = data.Node2ID
-        }
-        if (data.Anchor1ID) {
-            this._anchor1ID = data.Anchor1ID
-        }
-        if (data.Anchor2ID) {
-            this._anchor2ID = data.Anchor2ID
-        }
-        if (data.Properties && data.Properties.Color) {
-            this.strokeColor = new SColor(data.Properties.Color)
-        }
-        // if(data.Properties && data.Properties.LineDash){
-        //   this.LineDash = data.Properties.LineDash
-        // }
-        if (data.Properties && data.Properties.LineWidth) {
-            this.lineWidth = data.Properties.LineWidth
-        }
+  /** 数据存储  */
+  data: Relation | null = null;
+  /** 接收事件作出修改  */
+  changePos() {
+    if (this.startAnchor) {
+      // 判断删除equip后,不移动
+      if (this.startAnchor.parent && this.startAnchor.parent.parent) {
+        this.pointList[0] = this.startAnchor.mapToScene(0, 0);
+      }
     }
+    if (this.endAnchor) {
+      // 删除equip后
+      if (this.endAnchor.parent && this.endAnchor.parent.parent) {
+        this.pointList[
+          this.pointList.length - 1
+        ] = this.endAnchor.mapToScene(0, 0);
+      }
+    }
+  }
 
-    /** 获取data数据  */
-    toData(): Relation | null {
-        let pointList: Point[] = this.pointList.map((item) => {
-            return {
-                X: item.x,
-                Y: item.y,
-            }
-        })
+  constructor(parent: SGraphItem | null, data: Relation) {
+    super(parent, []);
+    this.zOrder = ItemOrder.polylineOrder;
+    this.pointList = data.PointList.map(item => {
+      return new SPoint(item.X, item.Y);
+    });
+    this.data = data;
+    this.name = data.Name;
+    this.id = data.ID;
+    if (data.GraphElementId) {
+      this._graphElementId = data.GraphElementId
+    }
+    if (data.Node1ID) {
+      this._node1Id = data.Node1ID
+    }
+    if (data.Node2ID) {
+      this._node2Id = data.Node2ID
+    }
+    if (data.Anchor1ID) {
+      this._anchor1ID = data.Anchor1ID
+    }
+    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);
+    }
+    // if(data.Properties && data.Properties.LineDash){
+    //   this.LineDash = data.Properties.LineDash
+    // }
+    if (data.Properties && data.Properties.LineWidth) {
+      this.lineWidth = data.Properties.LineWidth;
+    }
+  }
 
-        if (this.data) {
-            this.data.Name = this.name;
-            this.data.PointList = pointList
-            this.data.Properties.LineWidth = this.lineWidth
-            // this.data.Properties.LineDash = this.LineDash;
-            this.data.Properties.Color = this.strokeColor.value
-        }
+  /** 获取data数据  */
+  toData(): Relation | null {
+    let pointList: Point[] = this.pointList.map(item => {
+      return {
+        X: item.x,
+        Y: item.y
+      }
+    });
 
-        return this.data
+    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;
     }
 
+    return this.data
+  }
+
     // onDraw(painter: SPainter) {
     //     if (this.maskFlag && this.status == SItemStatus.Normal) {
     //         let color = new SColor(this.strokeColor)
@@ -187,15 +193,15 @@ export class TipelineItem extends SPolylineItem {
      * @param   rect          绘制区域
      */
     onPaint(painter: SPainter, rect: SRect): void {
-        super.onPaint(painter, rect);
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            if (this.selected) {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-            } else {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth);
-            }
-            painter.pen.color = new SColor('#ffffff80')
-            painter.drawPolyline(this.pointList)
-        }
-    } // Function onPaint()
-}
+      super.onPaint(painter, rect);
+      if (this.maskFlag && this.status == SItemStatus.Normal) {
+          if (this.selected) {
+              painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
+          } else {
+              painter.pen.lineWidth = painter.toPx(this.lineWidth);
+          }
+          painter.pen.color = new SColor('#ffffff80')
+          painter.drawPolyline(this.pointList)
+      }
+  } // Function onPaint()
+}

+ 3 - 3
src/views/legendLibrary/index.vue

@@ -121,13 +121,13 @@
                 <el-table-column prop='Unit' label='单位' width='60'>
                     <template slot-scope='{row}'>{{row.Unit}}</template>
                 </el-table-column>
-                <el-table-column prop='position' label='对应广场说明书的位置' show-overflow-tooltip width='560'>
+                <el-table-column prop='position' label='对应广场说明书的位置' show-overflow-tooltip>
                     <template slot-scope='{row}'>
                         <span>{{ row.GraphCategorys.length?row.GraphCategorys.map(item => item.Name).join(' ,'):'' }}</span>
                     </template>
                 </el-table-column>
 
-                <el-table-column label='对应工程信息化中的专业/位置、设备分类' show-overflow-tooltip width='462'>
+                <el-table-column label='对应工程信息化中的专业/位置、设备分类' show-overflow-tooltip>
                     <template slot-scope='{row}'>
                         <span>{{row.InfoLocal.length?row.InfoLocal.map(item => item.name).join(' ,') :''}}</span>
                     </template>
@@ -138,7 +138,7 @@
                         </template>
                 </el-table-column>-->
 
-                <el-table-column prop='typeId' resizable label='铺位可视化typeid' width='364' show-overflow-tooltip>
+                <el-table-column prop='typeId' resizable label='铺位可视化typeid' show-overflow-tooltip>
                     <template slot-scope='{row}'>
                         <span>{{row.InfoTypes.length ?row.InfoTypes.map(item => `${item.Id }-${item.Name}`).join(' ,'):'' }}</span>
                     </template>