Browse Source

big: fix: 格式化 lint检查

haojianlong 4 years ago
parent
commit
4d3ad46e81

+ 13 - 7
persagy-web-big/.eslintrc.js

@@ -45,14 +45,20 @@ module.exports = {
         sourceType: "module"
     },
     rules: {
+        // 注释
+        // 文件
+        "max-classes-per-file": ["error", 1],           // 一个文件中只能定义一个类
+        "max-lines-per-function": ["error", 200],       // 一个函数最多200行代码
+        "max-statements-per-line": ["error", {max: 1}], // 一行只允许有一条语句
         // 缩进
-        'indent': ['error', 4, { SwitchCase: 1 }],                         // 缩进控制4空格
-        'max-len': ['error', 120],                      // 每行字符不超过120
-        'no-mixed-spaces-and-tabs': 'error',            // 禁止使用空格和tab混合缩进
+        "indent": ["error", 4, { SwitchCase: 1 }],                         // 缩进控制4空格
+        "max-len": ["error", 120],                      // 每行字符不超过120
+        "no-mixed-spaces-and-tabs": "error",            // 禁止使用空格和tab混合缩进
         // 语句
-        'curly': ["error", "multi-line"],               // if、else if、else、for、while强制使用大括号,但允许在单行中省略大括号。
-        'semi': ['error', 'always'],                    //不得省略语句结束的分号
-        '@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }],       // public访问不需加访问修饰符
-        "@typescript-eslint/no-explicit-any": ["off"]
+        "curly": ["error", "multi-line"],               // if、else if、else、for、while强制使用大括号,但允许在单行中省略大括号。
+        "semi": ["error", "always"],                    // 不得省略语句结束的分号
+        "@typescript-eslint/explicit-member-accessibility": ["error", { accessibility: "no-public" }],       // public访问不需加访问修饰符
+        "@typescript-eslint/no-explicit-any": ["off"],
+        "@typescript-eslint/no-unused-vars": ["off"],
     }
 };

+ 8 - 8
persagy-web-big/src/factories/SItemFactory.ts

@@ -47,7 +47,7 @@ import { Zone } from "../types/floor/Zone";
 export class SItemFactory {
     /**
      * 构造函数
-    */
+     */
     constructor() {} // Constructor
 
     /**
@@ -55,7 +55,7 @@ export class SItemFactory {
      *
      * @param data    柱子数据
      * @return 柱子 item
-    */
+     */
     createColumn(data: Column): SColumnItem {
         return new SColumnItem(null, data);
     } // Function createColumn()
@@ -65,7 +65,7 @@ export class SItemFactory {
      *
      * @param data    墙数据
      * @return 墙 item
-    */
+     */
     createWall(data: Wall): SWallItem {
         return new SWallItem(null, data);
     } // Function createWall()
@@ -75,7 +75,7 @@ export class SItemFactory {
      *
      * @param data    虚拟墙数据
      * @return 虚拟墙 item
-    */
+     */
     createVirtualWall(data: VirtualWall): SVirtualWallItem {
         return new SVirtualWallItem(null, data);
     } // Function createVirtualWall()
@@ -85,7 +85,7 @@ export class SItemFactory {
      *
      * @param data    空间数据
      * @return 空间 item
-    */
+     */
     createSpace(data: Space): SSpaceItem {
         return new SSpaceItem(null, data);
     } // Function createSpace()
@@ -95,7 +95,7 @@ export class SItemFactory {
      *
      * @param data    门数据
      * @return 门item
-    */
+     */
     createDoor(data: Door): SDoorItem {
         return new SDoorItem(null, data);
     } // Function createDoor()
@@ -105,7 +105,7 @@ export class SItemFactory {
      *
      * @param data    窗户数据
      * @return 窗户 item
-    */
+     */
     createWindow(data: Casement): SWindowItem {
         return new SWindowItem(null, data);
     } // Function createWindow()
@@ -115,7 +115,7 @@ export class SItemFactory {
      *
      * @param data    业务空间数据
      * @return 业务空间 item
-    */
+     */
     createZone(data: Zone): SZoneItem {
         return new SZoneItem(null, data);
     } // Function createZone()

+ 3 - 2
persagy-web-big/src/items/SArrowItem.ts

@@ -58,7 +58,7 @@ export class SArrowItem extends SPolylineItem {
      * 绘制基本图形
      *
      * @param painter   绘制对象
-    */
+     */
     drawBaseLine(painter: SPainter): void {
         // 绘制基本图形,线样式是虚线时
         if (this.lineStyle == SLineStyle.Dashed) {
@@ -66,7 +66,8 @@ export class SArrowItem extends SPolylineItem {
                 painter.toPx(this.lineWidth * 3),
                 painter.toPx(this.lineWidth * 7)
             ];
-        } else if (this.lineStyle == SLineStyle.Dotted) { // 绘制基本图形,线样式是点线时
+        } else if (this.lineStyle == SLineStyle.Dotted) {
+            // 绘制基本图形,线样式是点线时
             painter.pen.lineDash = [
                 painter.toPx(this.lineWidth),
                 painter.toPx(this.lineWidth)

+ 5 - 5
persagy-web-big/src/items/SArrowPoly.ts

@@ -24,10 +24,10 @@
  * *********************************************************************************************************************
  */
 
-import {SLineItem} from "./SLineItem";
-import {SColor, SLine, SPainter, SPoint} from "@persagy-web/draw";
-import {SMathUtil} from "@persagy-web/graph/lib/utils/SMathUtil";
-import {SItemStatus} from "..";
+import { SLineItem } from "./SLineItem";
+import { SColor, SLine, SPainter, SPoint } from "@persagy-web/draw";
+import { SMathUtil } from "@persagy-web/graph/lib/utils/SMathUtil";
+import { SItemStatus } from "..";
 
 /**
  * 箭头多边形类型
@@ -133,7 +133,7 @@ export class SArrowPoly extends SLineItem {
                 this.status == SItemStatus.Edit ||
                 this.status == SItemStatus.Create
             ) {
-                this.line.forEach((p, i) => {
+                this.line.forEach((p, i): void => {
                     painter.brush.color = this.fillColor;
                     if (i == this.curIndex) {
                         painter.brush.color = this.activeFillColor;

+ 12 - 10
persagy-web-big/src/items/SIconTextItem.ts

@@ -209,7 +209,7 @@ export class SIconTextItem extends SObjectItem {
 
     set showAnchor(v: boolean) {
         this._showAnchor = v;
-        this.anchorList.forEach(t => {
+        this.anchorList.forEach((t): void => {
             t.visible = v;
         });
     }
@@ -268,7 +268,7 @@ export class SIconTextItem extends SObjectItem {
         let anchorPoint;
         // 锚点数据存在时
         if (data && data.length) {
-            anchorPoint = data.map(t => {
+            anchorPoint = data.map((t): any => {
                 return {
                     x: t.pos.x,
                     y: t.pos.y,
@@ -287,14 +287,16 @@ export class SIconTextItem extends SObjectItem {
                 // { x: this.img.x + this.img.width / 2, y: this.img.y, id: "" }
             ];
         }
-        this.anchorList = anchorPoint.map(t => {
-            let item = new SAnchorItem(this);
-            if (t.id) {
-                item.id = t.id;
+        this.anchorList = anchorPoint.map(
+            (t): SAnchorItem => {
+                let item = new SAnchorItem(this);
+                if (t.id) {
+                    item.id = t.id;
+                }
+                item.moveTo(t.x, t.y);
+                return item;
             }
-            item.moveTo(t.x, t.y);
-            return item;
-        });
+        );
         this.showAnchor = false;
         this.textItem.text = "";
         this.textItem.font.size = 12;
@@ -323,7 +325,7 @@ export class SIconTextItem extends SObjectItem {
                 // { x: this.img.x - this.img.width / 2, y: this.img.y },
                 // { x: this.img.x + this.img.width / 2, y: this.img.y }
             ];
-            this.anchorList.forEach((item, index) => {
+            this.anchorList.forEach((item, index): void => {
                 item.moveTo(anchorPoint[index].x, anchorPoint[index].y);
             });
         }

+ 40 - 24
persagy-web-big/src/items/SLineItem.ts

@@ -24,10 +24,10 @@
  * *********************************************************************************************************************
  */
 
-import {SColor, SLine, SPainter, SPoint, SRect} from "@persagy-web/draw";
-import {SMouseButton, SMouseEvent, SUndoStack} from "@persagy-web/base";
-import {SMathUtil} from "../utils/SMathUtil";
-import {SItemStatus} from "..";
+import { SColor, SLine, SPainter, SPoint, SRect } from "@persagy-web/draw";
+import { SMouseButton, SMouseEvent, SUndoStack } from "@persagy-web/base";
+import { SMathUtil } from "../utils/SMathUtil";
+import { SItemStatus } from "..";
 import {
     SGraphItem,
     SGraphPointListInsert,
@@ -179,10 +179,12 @@ export class SLineItem extends SGraphItem {
             // 坐标集合出现在 SPoint 的实例对象上
             if (line instanceof SPoint) {
                 this.line.push(line);
-            } else { // 没有在 SPoint 的实例对象上
+            } else {
+                // 没有在 SPoint 的实例对象上
                 this.line = line;
             }
-        } else { // 坐标集合不存在时
+        } else {
+            // 坐标集合不存在时
             this.line = [];
         }
     }
@@ -204,7 +206,8 @@ export class SLineItem extends SGraphItem {
         if (this.line.length < 2) {
             this.line.push(p);
             this.recordAction(SGraphPointListInsert, [this.line, p]);
-        } else {  // 坐标集合长度不大于2时
+        } else {
+            // 坐标集合长度不大于2时
             this.line[1] = p;
             this.recordAction(SGraphPointListInsert, [this.line, p, 1]);
             this.status = SItemStatus.Normal;
@@ -226,7 +229,8 @@ export class SLineItem extends SGraphItem {
         if (this.status == SItemStatus.Normal) {
             this.status = SItemStatus.Edit;
             this.grabItem(this);
-        } else if (this.status == SItemStatus.Edit) { // 处于编辑状态时
+        } else if (this.status == SItemStatus.Edit) {
+            // 处于编辑状态时
             this.status = SItemStatus.Normal;
             this.releaseItem();
         }
@@ -249,12 +253,15 @@ export class SLineItem extends SGraphItem {
         }
         // 按下鼠标左键
         if (event.buttons == SMouseButton.LeftButton) {
-            if (this.status == SItemStatus.Normal) { //标准状态时
+            if (this.status == SItemStatus.Normal) {
+                //标准状态时
                 return super.onMouseDown(event);
-            } else if (this.status == SItemStatus.Edit) { // 编辑状态时
+            } else if (this.status == SItemStatus.Edit) {
+                // 编辑状态时
                 // 判断是否点击到端点上(获取端点索引值)
                 this.findNearestPoint(new SPoint(event.x, event.y));
-            } else if (this.status == SItemStatus.Create) { // 创建状态时
+            } else if (this.status == SItemStatus.Create) {
+                // 创建状态时
                 this.addPoint(new SPoint(event.x, event.y));
                 return true;
             }
@@ -285,7 +292,8 @@ export class SLineItem extends SGraphItem {
                     this.curIndex
                 ]);
             }
-        } else if (this.status == SItemStatus.Normal) { // 标准状态时
+        } else if (this.status == SItemStatus.Normal) {
+            // 标准状态时
             this.moveToOrigin(this.x, this.y);
             return super.onMouseUp(event);
         }
@@ -313,7 +321,8 @@ export class SLineItem extends SGraphItem {
                 this.line[1] = new SPoint(event.x, event.y);
                 this.pointChange();
             }
-        } else if (this.status == SItemStatus.Edit) { // 处于编辑状态时
+        } else if (this.status == SItemStatus.Edit) {
+            // 处于编辑状态时
             // 当前索引不等于 -1 时
             if (-1 != this.curIndex) {
                 this.line[this.curIndex].x = event.x;
@@ -373,11 +382,13 @@ export class SLineItem extends SGraphItem {
      */
     moveToOrigin(x: number, y: number): void {
         super.moveToOrigin(x, y);
-        this.line = this.line.map(t => {
-            t.x = t.x + x;
-            t.y = t.y + y;
-            return t;
-        });
+        this.line = this.line.map(
+            (t): SPoint => {
+                t.x = t.x + x;
+                t.y = t.y + y;
+                return t;
+            }
+        );
         this.x = 0;
         this.y = 0;
     }
@@ -395,11 +406,13 @@ export class SLineItem extends SGraphItem {
             // 处于创建状态时
             if (this.status == SItemStatus.Create) {
                 last = this.line[0];
-            } else if (this.status == SItemStatus.Edit) {   // 处于编辑状态时
+            } else if (this.status == SItemStatus.Edit) {
+                // 处于编辑状态时
                 // 当前索引等于 1 时
                 if (this.curIndex == 1) {
                     last = this.line[0];
-                } else if (this.curIndex == 0) { // 当前索引等于 0 时
+                } else if (this.curIndex == 0) {
+                    // 当前索引等于 0 时
                     last = this.line[1];
                 }
             }
@@ -466,7 +479,8 @@ export class SLineItem extends SGraphItem {
         if (this.status == SItemStatus.Create) {
             this.parent = null;
             this.releaseItem();
-        } else if (this.status == SItemStatus.Edit) { // 处于编辑状态时
+        } else if (this.status == SItemStatus.Edit) {
+            // 处于编辑状态时
             this.status = SItemStatus.Normal;
             this.releaseItem();
         }
@@ -484,7 +498,7 @@ export class SLineItem extends SGraphItem {
             this.maxX = this.line[0].x;
             this.minY = this.line[0].y;
             this.maxY = this.line[0].y;
-            this.line.forEach(it => {
+            this.line.forEach((it): void => {
                 let x = it.x,
                     y = it.y;
 
@@ -537,7 +551,8 @@ export class SLineItem extends SGraphItem {
                     painter.toPx(this.lineWidth * 3),
                     painter.toPx(this.lineWidth * 7)
                 ];
-            } else if (this.lineStyle == SLineStyle.Dotted) { // 绘制基本图形,线样式是点线时
+            } else if (this.lineStyle == SLineStyle.Dotted) {
+                // 绘制基本图形,线样式是点线时
                 painter.pen.lineDash = [
                     painter.toPx(this.lineWidth),
                     painter.toPx(this.lineWidth)
@@ -569,7 +584,8 @@ export class SLineItem extends SGraphItem {
                     painter.drawCircle(p.x, p.y, painter.toPx(5));
                 });
             }
-        } else if (this.line.length == 1) { // 线段长度等于 1 时
+        } else if (this.line.length == 1) {
+            // 线段长度等于 1 时
             // 处于编辑状态或创建状态时
             if (
                 this.status == SItemStatus.Edit ||

+ 17 - 17
persagy-web-big/src/items/SPolygonItem.ts

@@ -31,7 +31,7 @@ import {
     SGraphPointListUpdate,
     SLineStyle
 } from "@persagy-web/graph";
-import {SKeyCode, SMouseEvent, SUndoStack} from "@persagy-web/base/";
+import { SKeyCode, SMouseEvent, SUndoStack } from "@persagy-web/base/";
 import {
     SColor,
     SLine,
@@ -41,8 +41,8 @@ import {
     SPolygonUtil,
     SRect
 } from "@persagy-web/draw";
-import {SItemStatus} from "..";
-import {SMathUtil} from "../utils/SMathUtil";
+import { SItemStatus } from "..";
+import { SMathUtil } from "../utils/SMathUtil";
 
 /**
  * 编辑多边形
@@ -292,7 +292,7 @@ export class SPolygonItem extends SGraphItem {
             // 绘制顶点块
             painter.pen.color = SColor.Black;
             painter.brush.color = SColor.White;
-            pointList.forEach(item => {
+            pointList.forEach((item): void => {
                 painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2));
             });
             // 如果最后一个点在第一个点的灵敏度范围内,第一个点填充变红
@@ -336,7 +336,7 @@ export class SPolygonItem extends SGraphItem {
         // 绘制顶点块
         painter.pen.color = SColor.Black;
         painter.brush.color = SColor.White;
-        pointList.forEach((item, index) => {
+        pointList.forEach((item, index): void => {
             painter.brush.color = SColor.White;
             if (index == this.curIndex) {
                 painter.brush.color = new SColor("#2196f3");
@@ -357,7 +357,7 @@ export class SPolygonItem extends SGraphItem {
             // 1 判断是否点击在多边形顶点
             let lenIndex = -1; // 当前点击到的点位索引;
             let curenLen = this.scenceLen; // 当前的灵敏度
-            this.pointList.forEach((item, index) => {
+            this.pointList.forEach((item, index): void => {
                 let dis = SMathUtil.pointDistance(
                     event.x,
                     event.y,
@@ -393,7 +393,7 @@ export class SPolygonItem extends SGraphItem {
             this.curPoint = null;
             let lenIndex = -1; // 当前点击到的点位索引;
             let curenLen = this.scenceLen; // 当前的灵敏度
-            this.pointList.forEach((item, index) => {
+            this.pointList.forEach((item, index): void => {
                 let dis = SMathUtil.pointDistance(
                     event.x,
                     event.y,
@@ -409,8 +409,8 @@ export class SPolygonItem extends SGraphItem {
             // 2判断是否点击在多边形得边上
             if (-1 == lenIndex) {
                 let len = SMathUtil.pointToLine(
-                    new SPoint(event.x, event.y),
-                    new SLine(this.pointList[0], this.pointList[1])
+                        new SPoint(event.x, event.y),
+                        new SLine(this.pointList[0], this.pointList[1])
                     ),
                     index = 0;
                 if (this.pointList.length > 2) {
@@ -463,7 +463,6 @@ export class SPolygonItem extends SGraphItem {
 
     /////////////////////
 
-
     /**
      * 记录相关动作并推入栈中
      *
@@ -734,11 +733,13 @@ export class SPolygonItem extends SGraphItem {
      */
     moveToOrigin(x: number, y: number): void {
         super.moveToOrigin(x, y);
-        this.pointList = this.pointList.map(t => {
-            t.x = t.x + x;
-            t.y = t.y + y;
-            return t;
-        });
+        this.pointList = this.pointList.map(
+            (t): SPoint => {
+                t.x = t.x + x;
+                t.y = t.y + y;
+                return t;
+            }
+        );
         this.x = 0;
         this.y = 0;
     }
@@ -780,7 +781,7 @@ export class SPolygonItem extends SGraphItem {
             this.maxX = this.pointList[0].x;
             this.minY = this.pointList[0].y;
             this.maxY = this.pointList[0].y;
-            this.pointList.forEach(it => {
+            this.pointList.forEach((it): void => {
                 let x = it.x,
                     y = it.y;
                 if (x < this.minX) {
@@ -798,7 +799,6 @@ export class SPolygonItem extends SGraphItem {
                 if (y > this.maxY) {
                     this.maxY = y;
                 }
-
             });
         }
 

+ 35 - 31
persagy-web-big/src/items/SPolylineItem.ts

@@ -121,7 +121,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param parent    父级
      * @param list      坐标集合
-    */
+     */
     constructor(parent: null | SGraphItem, list: SPoint[]);
 
     /**
@@ -129,7 +129,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param parent    父级
      * @param list      第一个坐标
-    */
+     */
     constructor(parent: null | SGraphItem, list: SPoint);
 
     /**
@@ -137,7 +137,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param parent    父级
      * @param list      第一个坐标|坐标集合
-    */
+     */
     constructor(parent: null | SGraphItem, list: SPoint | SPoint[]) {
         super(parent);
         if (list instanceof SPoint) {
@@ -152,7 +152,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param p         添加的点
      * @param index     添加到的索引
-    */
+     */
     private addPoint(p: SPoint, index?: number): void {
         if (index && this.canHandle(index)) {
             this.pointList.splice(index, 0, p);
@@ -174,7 +174,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param index     要添加到的索引
      * @return 是否可添加
-    */
+     */
     private canHandle(index: number): boolean {
         return index >= 0 && index <= this.pointList.length;
     } // Function canHandle()
@@ -183,7 +183,7 @@ export class SPolylineItem extends SGraphItem {
      * 根据索引删除点
      *
      * @param index     删除点
-    */
+     */
     deletePoint(index: number): void {
         if (this.canHandle(index) && this.pointList.length > 2) {
             const p = new SPoint(
@@ -207,7 +207,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param event     鼠标事件
      * @return 是否处理事件
-    */
+     */
     onMouseDown(event: SMouseEvent): boolean {
         this.curIndex = -1;
         this.curPoint = null;
@@ -247,7 +247,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param event     鼠标事件
      * @return 是否处理事件
-    */
+     */
     onMouseMove(event: SMouseEvent): boolean {
         if (event.shiftKey) {
             event = this.compare(event);
@@ -283,7 +283,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param event     鼠标事件
      * @return 是否处理事件
-    */
+     */
     onMouseUp(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Edit) {
             if (this.curIndex > -1) {
@@ -311,16 +311,18 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理
-    */
+     */
     onDoubleClick(event: SMouseEvent): boolean {
         // 如果为show状态 双击改对象则需改为编辑状态
         if (this.status == SItemStatus.Normal) {
             this.status = SItemStatus.Edit;
             this.grabItem(this);
-        } else if (this.status == SItemStatus.Edit) { // 编辑状态
+        } else if (this.status == SItemStatus.Edit) {
+            // 编辑状态
             this.status = SItemStatus.Normal;
             this.releaseItem();
-        } else if (this.status == SItemStatus.Create) { // 创建状态
+        } else if (this.status == SItemStatus.Create) {
+            // 创建状态
             if (this.pointList.length > 1) {
                 this.status = SItemStatus.Normal;
                 this.releaseItem();
@@ -336,7 +338,7 @@ export class SPolylineItem extends SGraphItem {
      * 键盘按键弹起事件
      *
      * @param event     事件参数
-    */
+     */
     onKeyUp(event: KeyboardEvent): void {
         if (event.keyCode == SKeyCode.Enter) {
             if (this.pointList.length > 1) {
@@ -363,14 +365,16 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param x     x 坐标
      * @param y     y 坐标
-    */
+     */
     moveToOrigin(x: number, y: number): void {
         super.moveToOrigin(x, y);
-        this.pointList = this.pointList.map(t => {
-            t.x = t.x + x;
-            t.y = t.y + y;
-            return t;
-        });
+        this.pointList = this.pointList.map(
+            (t): SPoint => {
+                t.x = t.x + x;
+                t.y = t.y + y;
+                return t;
+            }
+        );
         this.x = 0;
         this.y = 0;
     } // Function moveToOrigin()
@@ -379,7 +383,7 @@ export class SPolylineItem extends SGraphItem {
      * 获取点击点与点集中距离最近点
      *
      * @param p     鼠标点击点
-    */
+     */
     findNearestPoint(p: SPoint): void {
         let len = this.sceneDis;
         for (let i = 0; i < this.pointList.length; i++) {
@@ -404,7 +408,7 @@ export class SPolylineItem extends SGraphItem {
      * 计算增加点的位置
      *
      * @param p     鼠标点击点
-    */
+     */
     findAddPos(p: SPoint): void {
         let len = SMathUtil.pointToLine(
                 p,
@@ -434,7 +438,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param event     事件
      * @return 事件对象
-    */
+     */
     compare(event: SMouseEvent): SMouseEvent {
         if (this.pointList.length) {
             let last = new SPoint(event.x, event.y);
@@ -463,7 +467,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param SGraphCommand     相关命令类
      * @param any               对应传入参数
-    */
+     */
     protected recordAction(SGraphCommand: any, any: any[]): void {
         // 记录相关命令并推入堆栈中
         const command = new SGraphCommand(this.scene, this, ...any);
@@ -474,14 +478,14 @@ export class SPolylineItem extends SGraphItem {
      * Item 对象边界区域
      *
      * @return 外接矩阵
-    */
+     */
     boundingRect(): SRect {
         if (this.pointList.length) {
             this.minX = this.pointList[0].x;
             this.maxX = this.pointList[0].x;
             this.minY = this.pointList[0].y;
             this.maxY = this.pointList[0].y;
-            this.pointList.forEach(it => {
+            this.pointList.forEach((it): void => {
                 let x = it.x,
                     y = it.y;
                 if (x < this.minX) {
@@ -516,7 +520,7 @@ export class SPolylineItem extends SGraphItem {
      * @param x     x 坐标
      * @param y     y 坐标
      * @return 是否在区域内
-    */
+     */
     contains(x: number, y: number): boolean {
         let p = new SPoint(x, y);
         for (let i = 1; i < this.pointList.length; i++) {
@@ -538,7 +542,7 @@ export class SPolylineItem extends SGraphItem {
 
     /**
      * 撤销操作
-    */
+     */
     undo(): void {
         if (this._status != SItemStatus.Normal) {
             this.undoStack.undo();
@@ -547,7 +551,7 @@ export class SPolylineItem extends SGraphItem {
 
     /**
      * 重做操作
-    */
+     */
     redo(): void {
         if (this._status != SItemStatus.Normal) {
             this.undoStack.redo();
@@ -556,7 +560,7 @@ export class SPolylineItem extends SGraphItem {
 
     /**
      * 取消操作执行
-    */
+     */
     cancelOperate(): void {
         if (this.status == SItemStatus.Create) {
             this.parent = null;
@@ -571,7 +575,7 @@ export class SPolylineItem extends SGraphItem {
      * 绘制基本图形
      *
      * @param painter   绘制对象
-    */
+     */
     drawBaseLine(painter: SPainter): void {
         // 绘制基本图形
         if (this.lineStyle == SLineStyle.Dashed) {
@@ -594,7 +598,7 @@ export class SPolylineItem extends SGraphItem {
      * Item 绘制操作
      *
      * @param painter   绘制对象
-    */
+     */
     onDraw(painter: SPainter): void {
         // 缓存场景长度
         this.sceneDis = painter.toPx(this.dis);

+ 4 - 4
persagy-web-big/src/items/SRectSelectItem.ts

@@ -45,7 +45,7 @@ export class SRectSelectItem extends SGraphItem {
      *
      * @param parent    指向父对象
      * @param point     起点数据
-    */
+     */
     constructor(parent: SGraphItem | null, point: SPoint) {
         super(parent);
         this.startPoint = point;
@@ -58,7 +58,7 @@ export class SRectSelectItem extends SGraphItem {
      * Item 对象边界区域
      *
      * @return 边界区域
-    */
+     */
     boundingRect(): SRect {
         return new SRect(this.startPoint, this.endPoint);
     } // Function boundingRect()
@@ -68,7 +68,7 @@ export class SRectSelectItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理
-    */
+     */
     onMouseMove(event: SMouseEvent): boolean {
         this.endPoint.x = event.x;
         this.endPoint.y = event.y;
@@ -80,7 +80,7 @@ export class SRectSelectItem extends SGraphItem {
      * Item 绘制操作
      *
      * @param painter   绘制对象
-    */
+     */
     onDraw(painter: SPainter): void {
         painter.pen.lineWidth = painter.toPx(2);
         painter.pen.color = ItemColor.rectSelectOutColor;

+ 3 - 3
persagy-web-big/src/items/floor/SBoardItem.ts

@@ -47,7 +47,7 @@ export class SBoardItem extends SGraphItem {
      *
      * @param parent    指向父对象
      * @param data      建筑轮廓数据
-    */
+     */
     constructor(parent: SGraphItem | null, data: Zone) {
         super(parent);
         this.data = data;
@@ -84,7 +84,7 @@ export class SBoardItem extends SGraphItem {
      * @param x     x 坐标
      * @param y     y 坐标
      * @return 是否在区域内
-    */
+     */
     contains(x: number, y: number): boolean {
         return false;
     }
@@ -93,7 +93,7 @@ export class SBoardItem extends SGraphItem {
      * Item 绘制操作
      *
      * @param painter   绘制对象
-    */
+     */
     onDraw(painter: SPainter): void {
         painter.pen.lineWidth = painter.toPx(1);
         painter.brush.color = ItemColor.spaceColor;

+ 3 - 3
persagy-web-big/src/items/floor/SColumnItem.ts

@@ -42,7 +42,7 @@ export class SColumnItem extends SGraphPolyGroupItem {
      *
      * @param parent    指向父对象
      * @param data      柱子数据
-    */
+     */
     constructor(parent: SGraphItem | null, data: Column) {
         const style = {
             default: {
@@ -55,8 +55,8 @@ export class SColumnItem extends SGraphPolyGroupItem {
         let tempArr = data.OutLine;
         let outline: Point[][] = [];
         if (tempArr && tempArr.length) {
-            outline = tempArr.map(t => {
-                return t.map(it => ({x: it.X, y: -it.Y}));
+            outline = tempArr.map((t): any => {
+                return t.map((it): any => ({ x: it.X, y: -it.Y }));
             });
         }
 

+ 5 - 5
persagy-web-big/src/items/floor/SDoorItem.ts

@@ -24,11 +24,11 @@
  * *********************************************************************************************************************
  */
 
-import {Door} from "../../types/floor/Door";
-import {SPainter, SPoint, SRect} from "@persagy-web/draw";
-import {SMathUtil} from "../../utils/SMathUtil";
-import {ItemOrder, ItemColor} from "../..";
-import {SGraphItem} from "@persagy-web/graph";
+import { Door } from "../../types/floor/Door";
+import { SPainter, SPoint, SRect } from "@persagy-web/draw";
+import { SMathUtil } from "../../utils/SMathUtil";
+import { ItemOrder, ItemColor } from "../..";
+import { SGraphItem } from "@persagy-web/graph";
 
 /**
  * 门 item

+ 3 - 3
persagy-web-big/src/items/floor/SHighlightItem.ts

@@ -65,7 +65,7 @@ export class SHighlightItem extends SGraphItem {
      * 构造函数
      *
      * @param parent  指向父对象
-    */
+     */
     constructor(parent: SGraphItem | null) {
         super(parent);
         this.visible = false;
@@ -76,7 +76,7 @@ export class SHighlightItem extends SGraphItem {
      * Item 对象边界区域
      *
      * @return	边界矩形
-    */
+     */
     boundingRect(): SRect {
         return new SRect(this.point.x, this.point.y, 10, 10);
     }
@@ -85,7 +85,7 @@ export class SHighlightItem extends SGraphItem {
      * Item绘制操作
      *
      * @param painter   绘制对象
-    */
+     */
     onDraw(painter: SPainter): void {
         if (this.type == 2) {
             painter.pen.color = ItemColor.highLightLineColor;

+ 11 - 11
persagy-web-big/src/items/floor/SSpaceItem.ts

@@ -24,14 +24,10 @@
  * *********************************************************************************************************************
  */
 
-import {
-    SColor,
-    SPainter,
-    STextAlign
-} from "@persagy-web/draw";
-import {Space} from "../../types/floor/Space";
-import {ItemOrder, ItemColor} from "../..";
-import {SGraphItem, SGraphAreaGroupItem} from "@persagy-web/graph";
+import { SColor, SPainter, STextAlign } from "@persagy-web/draw";
+import { Space } from "../../types/floor/Space";
+import { ItemOrder, ItemColor } from "../..";
+import { SGraphItem, SGraphAreaGroupItem } from "@persagy-web/graph";
 
 /**
  * 模型空间 item
@@ -105,7 +101,9 @@ export class SSpaceItem extends SGraphAreaGroupItem {
     constructor(parent: SGraphItem | null, data: Space) {
         super(parent, {
             outline: [
-                data.OutLine.map(t => t.map(it => ({x: it.X, y: -it.Y})))
+                data.OutLine.map((t): any =>
+                    t.map((it): any => ({ x: it.X, y: -it.Y }))
+                )
             ],
             style: {
                 default: {
@@ -152,8 +150,10 @@ export class SSpaceItem extends SGraphAreaGroupItem {
             // 如果处于高亮状态
             if (this.highLightFlag) {
                 status = "highlight";
-            } else if (this.enabled) { // 是否可用,true 可用
-                if (this.selected) { // 是否选中
+            } else if (this.enabled) {
+                // 是否可用,true 可用
+                if (this.selected) {
+                    // 是否选中
                     status = "selected";
                 }
             } else {

+ 0 - 279
persagy-web-big/src/items/floor/SSpaceItems.ts

@@ -1,279 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .F88X
- *        X8888Y
- *      .}888888N;
- *        i888888N;        .:!              .I$WI:
- *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
- *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
- *            +888888N;  .8888888Y                                  "&&8Y.}8,
- *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
- *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
- *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
- *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
- *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
- *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
- *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
- *      .:R888888I
- *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-import {
-    SColor,
-    SPainter,
-    SPoint,
-    SPolygonUtil,
-    SRect,
-    STextAlign
-} from "@persagy-web/draw";
-import {Space} from "../../types/floor/Space";
-import {ItemOrder, ItemColor} from "../..";
-import {SGraphItem} from "@persagy-web/graph";
-
-/**
- * 模型空间 item
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- * @deprecated 万达
- */
-export class SSpaceItems extends SGraphItem {
-    /** 空间所有数据 */
-    data: Space;
-    /** 空间轮廓线坐标 list */
-    readonly pointArr: SPoint[][] = [];
-    /** X 坐标最小值 */
-    minX = Number.MAX_SAFE_INTEGER;
-    /** X 坐标最大值 */
-    maxX = Number.MIN_SAFE_INTEGER;
-    /** Y 坐标最小值 */
-    minY = Number.MAX_SAFE_INTEGER;
-    /** Y 坐标最大值 */
-    maxY = Number.MIN_SAFE_INTEGER;
-    /** path 对象 */
-    // private path = new SPath2D();
-    /** 高亮状态 */
-    private _highLightFlag: boolean = false;
-    get highLightFlag(): boolean {
-        return this._highLightFlag;
-    }
-
-    set highLightFlag(value: boolean) {
-        this._highLightFlag = value;
-        this.update();
-    }
-
-    /** 是否显示名字 */
-    private _showBaseName: boolean = false;
-    get showBaseName(): boolean {
-        return this._showBaseName;
-    }
-
-    set showBaseName(value: boolean) {
-        this._showBaseName = value;
-        this.update();
-    }
-
-    /** 是否名字大小 */
-    private _nameSize: number = 10;
-    get nameSize(): number {
-        return this._nameSize;
-    }
-
-    set nameSize(value: number) {
-        this._nameSize = value;
-        this.update();
-    }
-
-    /** 名字是否缩放 */
-    private _nameTransform: boolean = false;
-    get nameTransform(): boolean {
-        return this._nameTransform;
-    }
-
-    set nameTransform(value: boolean) {
-        this._nameTransform = value;
-        this.update();
-    }
-
-    /** 名字颜色   */
-    private _nameColor: string = "#000000";
-    get nameColor(): string {
-        return this._nameColor;
-    }
-
-    set nameColor(value: string) {
-        this._nameColor = value;
-        this.update();
-    }
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      空间数据
-     */
-    constructor(parent: SGraphItem | null, data: Space) {
-        super(parent);
-        this.data = data;
-        this.zOrder = ItemOrder.spaceOrder;
-        let tempArr = this.data.OutLine;
-        this.name = data.Name || "";
-        // 如果数据存在
-        if (tempArr && tempArr.length) {
-            this.minX = tempArr[0][0].X;
-            this.maxX = this.minX;
-            this.minY = -tempArr[0][0].Y;
-            this.maxY = this.minY;
-            this.pointArr = tempArr.map((t): SPoint[] => {
-                let temp = t.map(
-                    (it): SPoint => {
-                        let x = it.X,
-                            y = -it.Y;
-
-                        // 如果数据 x 坐标小于 x 坐标最小值
-                        if (x < this.minX) {
-                            this.minX = x;
-                        }
-
-                        // 如果数据 y 坐标小于 y 坐标最小值
-                        if (y < this.minY) {
-                            this.minY = y;
-                        }
-
-                        // 如果数据 x 坐标大于 x 坐标最小值
-                        if (x > this.maxX) {
-                            this.maxX = x;
-                        }
-
-                        // 如果数据 y 坐标大于 y 坐标最小值
-                        if (y > this.maxY) {
-                            this.maxY = y;
-                        }
-
-                        return new SPoint(x, y);
-                    }
-                );
-                // this.path.polygon(temp);
-                return temp;
-            });
-        }
-    }
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    }
-
-    // /**
-    //  * 鼠标单击事件
-    //  *
-    //  * @param	event         事件参数
-    //  * @return	boolean
-    // */
-    // onMouseDown(event: SMouseEvent): boolean {
-    //     console.log("spaceDown");
-    //     this.$emit("click", event);
-    //     return true;
-    // }
-
-    // /**
-    //  * 鼠标移动事件
-    //  *
-    //  * @param event 事件参数
-    // */
-    // onMouseMove(event: SMouseEvent): boolean {
-    //     return false;
-    // }
-
-    // /**
-    //  * 鼠标抬起事件
-    //  *
-    //  * @param	event         事件参数
-    //  * @return	boolean
-    // */
-    // onMouseUp(event: SMouseEvent): boolean {
-    //     console.log("spaceUp");
-    //     return false;
-    // }
-
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x
-     * @param y
-     */
-    contains(x: number, y: number): boolean {
-        let arr = this.pointArr;
-        // 空间轮廓线不存在或者不在多边形内
-        if (arr.length < 1 || !SPolygonUtil.pointIn(x, y, arr[0])) {
-            return false;
-        }
-
-        for (let i = 1; i < arr.length; i++) {
-            // 在多边形内
-            if (SPolygonUtil.pointIn(x, y, arr[i])) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Item 绘制操作
-     *
-     * @param painter    绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        painter.pen.color = ItemColor.spaceBorderColor;
-        // 是否选中
-        if (this.selected) {
-            painter.brush.color = ItemColor.selectColor;
-        } else if (this.highLightFlag) { // 如果处于高亮状态
-            painter.brush.color = ItemColor.spaceHighColor;
-        } else {
-            painter.brush.color = ItemColor.spaceColor;
-        }
-        painter.pen.lineWidth = painter.toPx(1);
-        // painter.drawPath(this.path);
-        // 如果轮廓坐标 list 存在
-        if (this.pointArr.length) {
-            painter.drawPolygon(this.pointArr[0]);
-        }
-
-        // 如果显示名字
-        if (this.showBaseName) {
-            // name 存在并且不为 null
-            if (this.name && this.name != "null") {
-                painter.brush.color = new SColor(this.nameColor);
-                // 如果需要缩放
-                if (this.nameTransform) {
-                    painter.font.size = this.nameSize;
-                } else {
-                    painter.font.size = painter.toPx(this.nameSize);
-                }
-                // painter.font.size = 500;
-                painter.font.textAlign = STextAlign.Center;
-                painter.drawText(
-                    this.name,
-                    this.data.Location.Points[0].X,
-                    -this.data.Location.Points[0].Y
-                );
-            }
-        }
-    }
-}

+ 4 - 4
persagy-web-big/src/items/floor/SVirtualWallItem.ts

@@ -24,10 +24,10 @@
  * *********************************************************************************************************************
  */
 
-import {SPainter, SPoint, SRect} from "@persagy-web/draw";
-import {VirtualWall} from "../../types/floor/VirtualWall";
-import {ItemOrder, ItemColor} from "../..";
-import {SGraphItem} from "@persagy-web/graph";
+import { SPainter, SPoint, SRect } from "@persagy-web/draw";
+import { VirtualWall } from "../../types/floor/VirtualWall";
+import { ItemOrder, ItemColor } from "../..";
+import { SGraphItem } from "@persagy-web/graph";
 
 /**
  * 虚拟墙 item

+ 4 - 2
persagy-web-big/src/items/floor/SWallItem.ts

@@ -43,7 +43,7 @@ export class SWallItem extends SGraphAreaGroupItem {
      *
      * @param parent    指向父对象
      * @param data      墙数据
-    */
+     */
     constructor(parent: SGraphItem | null, data: Wall) {
         const style = {
             default: {
@@ -57,7 +57,9 @@ export class SWallItem extends SGraphAreaGroupItem {
         let outline: Point[][] = [];
         // 如果数据存在
         if (tempArr && tempArr.length) {
-            outline = tempArr.map(t => t.map(it => ({ x: it.X, y: -it.Y })));
+            outline = tempArr.map((t): any =>
+                t.map((it): any => ({ x: it.X, y: -it.Y }))
+            );
         }
 
         super(parent, {

+ 0 - 169
persagy-web-big/src/items/floor/SWallItems.ts

@@ -1,169 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .F88X
- *        X8888Y
- *      .}888888N;
- *        i888888N;        .:!              .I$WI:
- *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
- *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
- *            +888888N;  .8888888Y                                  "&&8Y.}8,
- *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
- *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
- *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
- *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
- *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
- *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
- *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
- *      .:R888888I
- *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-import {SPainter, SPath, SPoint, SRect} from "@persagy-web/draw";
-import {Wall} from "../../types/floor/Wall";
-import {ItemOrder, ItemColor} from "../..";
-import {SGraphItem} from "@persagy-web/graph";
-
-/**
- * 墙item
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- * @deprecated 万达
- */
-export class SWallItems extends SGraphItem {
-    /** 墙数据 */
-    data: Wall;
-    /** X 坐标最小值 */
-    private minX = Number.MAX_SAFE_INTEGER;
-    /** X 坐标最大值 */
-    private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y 坐标最小值 */
-    private minY = Number.MAX_SAFE_INTEGER;
-    /** Y 坐标最大值 */
-    private maxY = Number.MIN_SAFE_INTEGER;
-    /** 墙轮廓线坐标 list */
-    private readonly pointArr: SPoint[][] = [];
-    /** 墙内轮廓线坐标 list */
-    private readonly holesArr: SPoint[][] = [];
-    /** path 对象 */
-    private path = new SPath();
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      墙数据
-     */
-    constructor(parent: SGraphItem | null, data: Wall) {
-        super(parent);
-        this.data = data;
-        this.zOrder = ItemOrder.wallOrder;
-        let tempArr = this.data.OutLine;
-        let holes = data.Holes;
-        // 如果数据存在
-        if (tempArr && tempArr.length) {
-            this.minX = tempArr[0][0].X;
-            this.maxX = this.minX;
-            this.minY = -tempArr[0][0].Y;
-            this.maxY = this.minY;
-            this.pointArr = [];
-            let WLine = tempArr[0].map(
-                (it): SPoint => {
-                    let x = it.X,
-                        y = -it.Y;
-
-                    // 如果数据 x 坐标小于 x 坐标最小值
-                    if (x < this.minX) {
-                        this.minX = x;
-                    }
-
-                    // 如果数据 y 坐标小于 y 坐标最小值
-                    if (y < this.minY) {
-                        this.minY = y;
-                    }
-
-                    // 如果数据 x 坐标大于 x 坐标最小值
-                    if (x > this.maxX) {
-                        this.maxX = x;
-                    }
-
-                    // 如果数据 y 坐标大于 y 坐标最小值
-                    if (y > this.maxY) {
-                        this.maxY = y;
-                    }
-                    return new SPoint(x, y);
-                }
-            );
-            // 外轮廓
-            this.path.polygon(WLine);
-            // 外轮廓
-            this.pointArr.push(WLine);
-            // 内轮廓存在
-            if (holes && holes.length) {
-                this.holesArr = holes.map(t => {
-                    let temp = t.map(
-                        (it): SPoint => {
-                            let x = it.X,
-                                y = -it.Y;
-
-                            // 如果数据 x 坐标小于 x 坐标最小值
-                            if (x < this.minX) {
-                                this.minX = x;
-                            }
-
-                            // 如果数据 y 坐标小于 y 坐标最小值
-                            if (y < this.minY) {
-                                this.minY = y;
-                            }
-
-                            // 如果数据 x 坐标大于 x 坐标最小值
-                            if (x > this.maxX) {
-                                this.maxX = x;
-                            }
-
-                            // 如果数据 y 坐标大于 y 坐标最小值
-                            if (y > this.maxY) {
-                                this.maxY = y;
-                            }
-
-                            return new SPoint(x, y);
-                        }
-                    );
-                    this.path.polygon(temp);
-                    return temp;
-                });
-            }
-        }
-    }
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    }
-
-    /**
-     * Item绘制操作
-     *
-     * @param painter    绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        painter.pen.color = ItemColor.wallColor;
-        painter.pen.lineWidth = painter.toPx(1);
-        painter.brush.color = ItemColor.wallColor;
-        painter.drawPath(this.path);
-    }
-}

+ 4 - 4
persagy-web-big/src/items/floor/SWindowItem.ts

@@ -24,10 +24,10 @@
  * *********************************************************************************************************************
  */
 
-import {SPainter, SPoint, SRect} from "@persagy-web/draw";
-import {Casement} from "../../types/floor/Casement";
-import {ItemOrder, ItemColor} from "../..";
-import {SGraphItem} from "@persagy-web/graph";
+import { SPainter, SPoint, SRect } from "@persagy-web/draw";
+import { Casement } from "../../types/floor/Casement";
+import { ItemOrder, ItemColor } from "../..";
+import { SGraphItem } from "@persagy-web/graph";
 
 /**
  * 窗户 item

+ 12 - 9
persagy-web-big/src/items/floor/ZoneItem.ts

@@ -24,11 +24,11 @@
  * *********************************************************************************************************************
  */
 
-import {SColor, SPainter, SPoint, SRect} from "@persagy-web/draw";
-import {SMouseEvent} from "@persagy-web/base";
-import {Zone} from "../../types/floor/Zone";
-import {ItemColor, ItemOrder, Transparency} from "../..";
-import {Point, SGraphAreaGroupItem, SGraphItem} from "@persagy-web/graph";
+import { SColor, SPainter, SPoint, SRect } from "@persagy-web/draw";
+import { SMouseEvent } from "@persagy-web/base";
+import { Zone } from "../../types/floor/Zone";
+import { ItemColor, ItemOrder, Transparency } from "../..";
+import { Point, SGraphAreaGroupItem, SGraphItem } from "@persagy-web/graph";
 
 /**
  * 业务空间 item
@@ -85,7 +85,7 @@ export class SZoneItem extends SGraphAreaGroupItem {
                 return t.map((it): Point[] => {
                     return it.map(
                         (item): Point => {
-                            return {x: item.X, y: -item.Y};
+                            return { x: item.X, y: -item.Y };
                         }
                     );
                 });
@@ -173,13 +173,16 @@ export class SZoneItem extends SGraphAreaGroupItem {
                 // 是否选中
                 if (this.selected) {
                     status = "selected";
-                } else if (this.highLightFlag) { // 高亮状态
+                } else if (this.highLightFlag) {
+                    // 高亮状态
                     status = "highlight";
-                } else if (this.isInfected) { // 受影响
+                } else if (this.isInfected) {
+                    // 受影响
                     status = "infected";
                 } else {
                     status = "default";
-                    if (this.data.Color) { // 数据是否存在 color
+                    if (this.data.Color) {
+                        // 数据是否存在 color
                         this.style.default.fill = `${this.data.Color}${
                             Transparency[this.transparency]
                         }`;

+ 7 - 7
persagy-web-big/src/parser/SFloorParser.ts

@@ -62,7 +62,7 @@ export class SFloorParser extends SParser {
      * 解析数据
      *
      * @param data  楼层数据
-    */
+     */
     parseData(data: FloorData): void {
         if (data.Walls) {
             data.Walls.forEach((t: Wall): void => {
@@ -105,7 +105,7 @@ export class SFloorParser extends SParser {
      * 添加墙至场景中
      *
      * @param t     墙数据
-    */
+     */
     private addWall(t: Wall): void {
         let item = this.factory.createWall(t);
         this.wallList.push(item);
@@ -115,7 +115,7 @@ export class SFloorParser extends SParser {
      * 添加柱子至场景中
      *
      * @param t   柱子数据
-    */
+     */
     private addColumn(t: Column): void {
         let item = this.factory.createColumn(t);
         this.columnList.push(item);
@@ -125,7 +125,7 @@ export class SFloorParser extends SParser {
      * 添加窗户至场景中
      *
      * @param t     窗户数据
-    */
+     */
     private addCasement(t: Casement): void {
         let item = this.factory.createWindow(t);
         this.casementList.push(item);
@@ -135,7 +135,7 @@ export class SFloorParser extends SParser {
      * 添加虚拟墙至场景中
      *
      * @param t     虚拟墙数据
-    */
+     */
     private addVirtualWall(t: VirtualWall): void {
         let item = this.factory.createVirtualWall(t);
         this.virtualWallList.push(item);
@@ -145,7 +145,7 @@ export class SFloorParser extends SParser {
      * 添加门至场景中
      *
      * @param t     门数据
-    */
+     */
     private addDoor(t: Door): void {
         let item = this.factory.createDoor(t);
         this.doorList.push(item);
@@ -155,7 +155,7 @@ export class SFloorParser extends SParser {
      * 添加空间至场景中
      *
      * @param t     空间数据
-    */
+     */
     private addSpace(t: Space): void {
         let item = this.factory.createSpace(t);
         this.spaceList.push(item);

+ 1 - 1
persagy-web-big/src/parser/SParser.ts

@@ -39,7 +39,7 @@ export abstract class SParser {
      * 构造函数
      *
      * @param factory   解析工厂
-    */
+     */
     constructor(factory: SItemFactory | null = null) {
         if (factory) {
             this.factory = factory;

+ 4 - 4
persagy-web-big/src/parser/STopologyParser.ts

@@ -47,7 +47,7 @@ export class STopologyParser extends SParser {
      * 解析数据
      *
      * @param data  楼层数据
-    */
+     */
     parseData(data: TopologyData): void {
         if (data.Marks) {
             data.Marks.forEach((t: MarkerTopo): void => {
@@ -70,16 +70,16 @@ export class STopologyParser extends SParser {
 
     /**
      * 添加标识对象
-    */
+     */
     private addMarks(t: MarkerTopo): void {} // Function addMarks
 
     /**
      * 添加关系对象
-    */
+     */
     private addRelations(t: Relation): void {} // Function addRelations
 
     /**
      * 添加节点对象
-    */
+     */
     private addNodes(t: Node): void {} // Function addNodes
 } // class STopologyParser

+ 2 - 2
persagy-web-big/src/parser/SZoneParser.ts

@@ -41,7 +41,7 @@ export class SZoneParser extends SParser {
      * 解析业务空间数据
      *
      * @param data  业务空间数据
-    */
+     */
     parseData(data: Zone[]): void {
         if (data && data.length) {
             data.forEach((z): void => this.addZone(z));
@@ -52,7 +52,7 @@ export class SZoneParser extends SParser {
      * 添加业务空间至场景中
      *
      * @param z     业务空间数据
-    */
+     */
     private addZone(z: Zone): void {
         let item = this.factory.createZone(z);
         this.zoneList.push(item);

+ 14 - 13
persagy-web-big/src/utils/SMathUtil.ts

@@ -46,7 +46,7 @@ export class SMathUtil {
      * @param x2    点 2 的 x 坐标
      * @param y2    点 2 的 y 坐标
      * @return 距离
-    */
+     */
     static pointDistance(
         x1: number,
         y1: number,
@@ -62,7 +62,7 @@ export class SMathUtil {
      * @param p     第一个点
      * @param arr   点集
      * @return 距离,点坐标
-    */
+     */
     static getMinDisPoint(p: SPoint, arr: Point[]): MinDis | null {
         if (!arr.length) {
             return null;
@@ -103,7 +103,7 @@ export class SMathUtil {
      * @param p     点
      * @param l     线段
      * @return 距离
-    */
+     */
     static pointToLine(p: SPoint, l: SLine): PointToLine {
         let d = {
             MinDis: Number.MAX_SAFE_INTEGER,
@@ -154,7 +154,7 @@ export class SMathUtil {
      * @param p     第一个点
      * @param arr   点集
      * @return 距离,点坐标
-    */
+     */
     static getMinDisLine(p: SPoint, arr: Point[]): PointToLine | null {
         if (arr.length < 2) {
             return null;
@@ -200,7 +200,7 @@ export class SMathUtil {
      * @param rect1     矩形1
      * @param rect2     矩形2
      * @return 是否有交集
-    */
+     */
     static rectIntersection(rect1: SRect, rect2: SRect): boolean {
         let minX = rect1.x < rect2.x ? rect1.x : rect2.x;
         let minY = rect1.y < rect2.y ? rect1.y : rect2.y;
@@ -218,7 +218,7 @@ export class SMathUtil {
      * @param line1     线段1
      * @param line2     线段2
      * @return 交点 null 平行但不重合 'repeat' 重合
-    */
+     */
     static lineIntersection(
         line1: SLine,
         line2: SLine
@@ -251,9 +251,9 @@ export class SMathUtil {
      *
      * @param SP    点数组
      * @return 点二维数组
-    */
+     */
     static transferToArray(SP: SPoint[]): number[][] {
-        return SP.map((t): number[] =>([t.x, t.y]));
+        return SP.map((t): number[] => [t.x, t.y]);
     } // Function transferToArray()
 
     /**
@@ -261,7 +261,7 @@ export class SMathUtil {
      *
      * @param arr 点二维数组
      * @return 点数组
-    */
+     */
     static transferToSPoint(arr: number[][]): SPoint[] {
         return arr.map((t): SPoint => new SPoint(t[0], t[1]));
     } // Function transferToSPoint()
@@ -271,7 +271,7 @@ export class SMathUtil {
      *
      * @param array     三维数组描述轮廓
      * @return outline 列表
-    */
+     */
     static getIntersectInArray(array: number[][][]): Outline[] {
         let outlineList: Outline[] = [];
         if (!array.length) {
@@ -323,9 +323,10 @@ export class SMathUtil {
                     Inner: []
                 };
                 outline.Outer = array[indexArr[i + 1]].map(
-                    (t): SPoint =>  new SPoint(t[0], t[1]));
+                    (t): SPoint => new SPoint(t[0], t[1])
+                );
                 outline.Inner = axArr.map((t): SPoint[] =>
-                    t.map((item): SPoint =>  new SPoint(item[0], item[1]))
+                    t.map((item): SPoint => new SPoint(item[0], item[1]))
                 );
                 outlineList.push(outline);
             }
@@ -338,7 +339,7 @@ export class SMathUtil {
      *
      * @param arr   轮廓线
      * @return 面积(毫米)
-    */
+     */
     static calculateArea(arr: SPoint[]): number {
         let sum = 0;
         let n = arr.length;