Explorar o código

修改 库 引入位置 添加业务空间画法颜色

haojianlong %!s(int64=5) %!d(string=hai) anos
pai
achega
e03693e5e3

+ 13 - 13
package-lock.json

@@ -1,6 +1,6 @@
 {
     "name": "cad-engine",
-    "version": "2.0.206",
+    "version": "2.0.211",
     "lockfileVersion": 1,
     "requires": true,
     "dependencies": {
@@ -25,25 +25,25 @@
             }
         },
         "@sybotan-web/base": {
-            "version": "2.1.2",
-            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/base/-/base-2.1.2.tgz",
-            "integrity": "sha512-sBFWAn/cqOT9P4r+CSgj381QbLp9XavDkKNRRm9iQZbMv2+/AkYcXcmDhI7wJIJNwz8kR6wjRvMBeUEpFIvqnA=="
+            "version": "2.1.5",
+            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/base/-/base-2.1.5.tgz",
+            "integrity": "sha512-9yZQHJc0k8j6xph/XSUGyB6JrnaDw+dOfaQC9ozInhz3H8k1UalJDE/qUpIgUIOvcl9ZE3lh+cHkpOrAwEc0cw=="
         },
         "@sybotan-web/draw": {
-            "version": "2.1.52",
-            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/draw/-/draw-2.1.52.tgz",
-            "integrity": "sha512-opzaLit9BcYFrf4kMyyR104UQnnQlMFjPeVLX00vTs/Ks2ip+Xr24cSTGXXuoM7PfqiPdvVsGB60LNmkQ1PHIA==",
+            "version": "2.1.56",
+            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/draw/-/draw-2.1.56.tgz",
+            "integrity": "sha512-7SgPZa+JiWAm/lUxOy0lsva4SmFuI32Qu2wW+brDTV+04GWx/PlQTUzrTht3jx22c1b9cws+ORnOeqBLMaFxhw==",
             "requires": {
-                "@sybotan-web/base": "^2.1.2"
+                "@sybotan-web/base": "^2.1.5"
             }
         },
         "@sybotan-web/graphy": {
-            "version": "2.1.16",
-            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/graphy/-/graphy-2.1.16.tgz",
-            "integrity": "sha512-3U8JwV1U+2BRPqtVyUVl0sON13CaeKpwgqmemCILQ1z1XtCySVUNCQD+GNMoMbiH7dWGlEe4LMJeA5EyoYV76g==",
+            "version": "2.1.18",
+            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/graphy/-/graphy-2.1.18.tgz",
+            "integrity": "sha512-MGvjb593kmjkXTx2zM1z+zlj5j6Ca6ph+rNXWikDB28ZcwzyR54/v0kXlS9AbAbafSuLagpCUDk/81rttRJc6w==",
             "requires": {
-                "@sybotan-web/base": "^2.1.2",
-                "@sybotan-web/draw": "^2.1.51"
+                "@sybotan-web/base": "^2.1.5",
+                "@sybotan-web/draw": "^2.1.56"
             }
         },
         "@types/eslint-visitor-keys": {

+ 3 - 3
package.json

@@ -31,9 +31,9 @@
         "typescript": "^3.5.3"
     },
     "dependencies": {
-        "@sybotan-web/base": "2.1.2",
-        "@sybotan-web/draw": "2.1.52",
-        "@sybotan-web/graphy": "2.1.16",
+        "@sybotan-web/base": "2.1.5",
+        "@sybotan-web/draw": "2.1.56",
+        "@sybotan-web/graphy": "2.1.18",
         "axios": "^0.18.0",
         "pako": "^1.0.10"
     }

+ 1 - 1
src/divideFloorScene.ts

@@ -19,11 +19,11 @@
  */
 
 import { FloorScene } from "./FloorScene";
-import { SMouseEvent } from "@sybotan-web/graphy/lib";
 import { SColor, SPoint, SRect } from "@sybotan-web/draw/lib";
 import { SceneMarkItem } from "./items/SceneMarkItem";
 import { ZoneItem } from "./items/ZoneItem";
 import { Zone } from "./types/Zone";
+import { SMouseEvent } from "@sybotan-web/base/lib";
 
 /**
  * 划分业务空间

+ 1 - 1
src/LocationPointScene.ts

@@ -20,8 +20,8 @@
 
 import { FloorScene } from "./FloorScene";
 import { MarkerItem } from "./items/MarkItem";
-import { SMouseEvent } from "@sybotan-web/graphy/lib";
 import { Marker } from "./types/Marker";
+import { SMouseEvent } from "@sybotan-web/base/lib";
 
 /**
  * 位置标签绘制标志

+ 1 - 1
src/index.ts

@@ -1,5 +1,5 @@
 import { FloorScene } from "./FloorScene";
 import { LocationPointScene } from "./LocationPointScene";
-import { DivideFloorScene } from "./divideFloorScene";
+import { DivideFloorScene } from "./DivideFloorScene";
 
 export { FloorScene, LocationPointScene, DivideFloorScene };

+ 1 - 1
src/items/ColumnItem.ts

@@ -18,7 +18,7 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyItem, SMouseEvent } from "@sybotan-web/graphy/lib";
+import { SGraphyItem } from "@sybotan-web/graphy/lib";
 import { SColor, SPainter, SPoint, SRect } from "@sybotan-web/draw/lib";
 import { Column } from "../types/Column";
 import { Opt } from "../types/Opt";

+ 1 - 1
src/items/DoorItem.ts

@@ -18,7 +18,7 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyItem, SMouseEvent } from "@sybotan-web/graphy/lib";
+import { SGraphyItem } from "@sybotan-web/graphy/lib";
 import { SColor, SPainter, SPoint, SRect } from "@sybotan-web/draw/lib";
 import { Door } from "../types/Door";
 import { Opt } from "../types/Opt";

+ 2 - 1
src/items/MarkItem.ts

@@ -18,9 +18,10 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyItem, SMouseEvent } from "@sybotan-web/graphy/lib";
+import { SGraphyItem } from "@sybotan-web/graphy/lib";
 import { SColor, SPainter, SPoint, SRect } from "@sybotan-web/draw/lib";
 import { Marker } from "../types/Marker";
+import { SMouseEvent } from "@sybotan-web/base/lib";
 
 /**
  * 标志item

+ 2 - 1
src/items/SceneMarkItem.ts

@@ -18,7 +18,7 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyItem, SMouseEvent } from "@sybotan-web/graphy/lib";
+import { SGraphyItem } from "@sybotan-web/graphy/lib";
 import {
     SColor,
     SPainter,
@@ -28,6 +28,7 @@ import {
     SRect
 } from "@sybotan-web/draw/lib";
 import { Opt } from "../types/Opt";
+import { SMouseEvent } from "@sybotan-web/base/lib";
 
 /**
  * 蒙版item

+ 2 - 1
src/items/SpaceItem.ts

@@ -18,7 +18,7 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyItem, SMouseEvent } from "@sybotan-web/graphy/lib";
+import { SGraphyItem } from "@sybotan-web/graphy/lib";
 import {
     SColor,
     SPainter,
@@ -29,6 +29,7 @@ import {
 } from "@sybotan-web/draw/lib";
 import { Space } from "../types/Space";
 import { Opt } from "../types/Opt";
+import {SMouseEvent} from "@sybotan-web/base/lib";
 
 /**
  * 模型空间item

+ 1 - 1
src/items/VirtualWallItem.ts

@@ -18,7 +18,7 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyItem, SMouseEvent } from "@sybotan-web/graphy/lib";
+import { SGraphyItem } from "@sybotan-web/graphy/lib";
 import { SColor, SPainter, SPoint, SRect } from "@sybotan-web/draw/lib";
 import { VirtualWall } from "../types/VirtualWall";
 import { Opt } from "../types/Opt";

+ 1 - 1
src/items/WallItem.ts

@@ -18,7 +18,7 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyItem, SMouseEvent } from "@sybotan-web/graphy/lib";
+import { SGraphyItem } from "@sybotan-web/graphy/lib";
 import { SColor, SPainter, SPoint, SRect } from "@sybotan-web/draw/lib";
 import { Wall } from "../types/Wall";
 import { Opt } from "../types/Opt";

+ 1 - 1
src/items/WindowItem.ts

@@ -18,7 +18,7 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyItem, SMouseEvent } from "@sybotan-web/graphy/lib";
+import { SGraphyItem } from "@sybotan-web/graphy/lib";
 import { SColor, SPainter, SPoint, SRect } from "@sybotan-web/draw/lib";
 import { Casement } from "../types/Casement";
 import { Opt } from "../types/Opt";

+ 8 - 10
src/items/ZoneItem.ts

@@ -18,7 +18,7 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyItem, SMouseEvent } from "@sybotan-web/graphy/lib";
+import { SGraphyItem } from "@sybotan-web/graphy/lib";
 import {
     SColor,
     SPainter,
@@ -29,6 +29,7 @@ import {
 } from "@sybotan-web/draw/lib";
 import { Opt } from "../types/Opt";
 import { Zone } from "../types/Zone";
+import { SMouseEvent } from "@sybotan-web/base/lib";
 
 /**
  * 业务空间item
@@ -110,7 +111,6 @@ export class ZoneItem extends SGraphyItem {
         );
     } // Function boundingRect()
 
-
     /**
      * 鼠标单击事件
      *
@@ -160,13 +160,11 @@ export class ZoneItem extends SGraphyItem {
      * @param   rect          绘制区域
      */
     onDraw(painter: SPainter, rect?: SRect): void {
-        if (this.visible) {
-            painter.pen.color = SColor.Transparent;
-            painter.brush.color = Opt.spaceColor;
-            painter.pen.lineWidth = 200;
-            this.pathList.map(t => {
-                painter.drawPath(t);
-            });
-        }
+        painter.pen.color = SColor.Transparent;
+        painter.brush.color = this.data.Color;
+        painter.pen.lineWidth = 200;
+        this.pathList.map(t => {
+            painter.drawPath(t);
+        });
     } // Function onDraw()
 } // Class ZoneItem

+ 7 - 2
src/types/Zone.ts

@@ -20,15 +20,20 @@
 
 import { Point } from "./Point";
 import { Place } from "./Place";
+import { SColor } from "@sybotan-web/draw/lib";
 
 /**
- * 空间item接口
+ * 业务空间item接口
  *
  * @author  郝建龙
  */
 export interface Zone {
     /** 名称  */
-    Name: string;
+    RoomLocalName: string;
     /** 轮廓线  */
     OutLine: Point[][][];
+    /** 业务空间id  */
+    RoomID: string;
+    /** 颜色  */
+    Color: SColor;
 } // Interface Space