فهرست منبع

修改引入包sagaweb

haojianlong 5 سال پیش
والد
کامیت
5002d565c7

+ 13 - 14
package-lock.json

@@ -1,6 +1,6 @@
 {
     "name": "cad-engine",
-    "version": "2.0.219",
+    "version": "2.0.251",
     "lockfileVersion": 1,
     "requires": true,
     "dependencies": {
@@ -24,26 +24,25 @@
                 "js-tokens": "^4.0.0"
             }
         },
-        "@sybotan-web/base": {
-            "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=="
+        "@saga-web/base": {
+            "version": "2.1.8",
+            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@saga-web/base/-/base-2.1.8.tgz",
+            "integrity": "sha512-V9UT6B330kOQzKeYPIizpX9fEIHOMeJ0XFUZrq8tCTUg4Nmhzp1WBSEI9XcDSLS4WYAapVQqYrQ+tuIDeUxN5g=="
         },
-        "@sybotan-web/draw": {
+        "@saga-web/draw": {
             "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==",
+            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@saga-web/draw/-/draw-2.1.56.tgz",
+            "integrity": "sha512-OBOCmtx8vLtjc5XKxb8mNcJNwx9no660I1Q64OkazNOpdPPzZJY5eBqvQLkK5ZcWLdTVnZIXA4nh4OAdmpT3Ow==",
             "requires": {
-                "@sybotan-web/base": "^2.1.5"
+                "@saga-web/base": "^2.1.8"
             }
         },
-        "@sybotan-web/graphy": {
+        "@saga-web/graphy": {
             "version": "2.1.27",
-            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/graphy/-/graphy-2.1.27.tgz",
-            "integrity": "sha512-QShbvWqLL3I4a8r0RVBIcpodXYJOrHh0vkzqPcLO70YSCR2ZBkNN6rFcN6G1fLNMjhobL9XJkoLlfgymIiU7Sw==",
+            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@saga-web/graphy/-/graphy-2.1.27.tgz",
+            "integrity": "sha512-L6Lv9JDCesP3NJqC4lBTYc8L4bMP3+egFIlNXuTrGthE7879TJqcS5pYbYTlg8wT8aQNJpU0cRGxcaEQJ2YDpQ==",
             "requires": {
-                "@sybotan-web/base": "^2.1.5",
-                "@sybotan-web/draw": "^2.1.56"
+                "@saga-web/draw": "^2.1.56"
             }
         },
         "@types/eslint-visitor-keys": {

+ 4 - 4
package.json

@@ -1,6 +1,6 @@
 {
     "name": "cad-engine",
-    "version": "2.0.250",
+    "version": "2.0.252",
     "description": "上格云 CAD图形引擎。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -31,9 +31,9 @@
         "typescript": "^3.5.3"
     },
     "dependencies": {
-        "@sybotan-web/base": "2.1.5",
-        "@sybotan-web/draw": "2.1.56",
-        "@sybotan-web/graphy": "2.1.27",
+        "@saga-web/base": "2.1.8",
+        "@saga-web/draw": "2.1.56",
+        "@saga-web/graphy": "2.1.27",
         "axios": "^0.18.0",
         "pako": "^1.0.10"
     }

+ 3 - 3
src/DivideFloorScene.ts

@@ -19,12 +19,12 @@
  */
 
 import { FloorScene } from "./FloorScene";
-import { SPoint } from "@sybotan-web/draw/lib";
+import { SPoint } from "@saga-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";
-import { SGraphyItem } from "@sybotan-web/graphy/lib";
+import { SMouseEvent } from "@saga-web/base/lib";
+import { SGraphyItem } from "@saga-web/graphy/lib";
 
 /**
  * 划分业务空间

+ 1 - 1
src/FloorScene.ts

@@ -18,7 +18,7 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyScene } from "@sybotan-web/graphy/lib";
+import { SGraphyScene } from "@saga-web/graphy/lib";
 // @ts-ignore
 import pako from "pako";
 import { FloorData } from "./types/FloorData";

+ 1 - 1
src/LocationPointScene.ts

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

+ 2 - 2
src/items/ColumnItem.ts

@@ -18,10 +18,10 @@
  * ********************************************************************************************************************
  */
 
-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";
+import { SGraphyItem } from "@saga-web/graphy/lib";
+import { SPainter, SPoint, SRect } from "@saga-web/draw/lib";
 
 /**
  * 柱子item

+ 3 - 3
src/items/DoorItem.ts

@@ -18,10 +18,10 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyItem } from "@sybotan-web/graphy/lib";
-import { SPainter, SPoint, SRect } from "@sybotan-web/draw/lib";
 import { Door } from "../types/Door";
 import { Opt } from "../types/Opt";
+import { SGraphyItem } from "@saga-web/graphy/lib";
+import { SPainter, SPoint, SRect } from "@saga-web/draw/lib";
 
 /**
  * 门item
@@ -66,7 +66,7 @@ export class DoorItem extends SGraphyItem {
             );
             // 两点间距离
             this.r = Math.sqrt(
-                Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2)
+                (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y)
             );
             // 门朝向角度
             this.ang = this.data.FaceDirection.X > 0 ? fo : fo + Math.PI;

+ 3 - 3
src/items/MarkItem.ts

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

+ 4 - 4
src/items/SceneMarkItem.ts

@@ -18,7 +18,8 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyItem } from "@sybotan-web/graphy/lib";
+import { Opt } from "../types/Opt";
+import { SGraphyItem } from "@saga-web/graphy/lib";
 import {
     SColor,
     SLineCapStyle,
@@ -27,9 +28,8 @@ import {
     SPoint,
     SPolygonUtil,
     SRect
-} from "@sybotan-web/draw/lib";
-import { Opt } from "../types/Opt";
-import { SMouseEvent } from "@sybotan-web/base/lib";
+} from "@saga-web/draw/lib";
+import { SMouseEvent } from "@saga-web/base/lib";
 
 /**
  * 蒙版item

+ 3 - 3
src/items/SpaceItem.ts

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

+ 2 - 2
src/items/VirtualWallItem.ts

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

+ 2 - 2
src/items/WallItem.ts

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

+ 2 - 2
src/items/WindowItem.ts

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

+ 4 - 4
src/items/ZoneItem.ts

@@ -18,7 +18,7 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyItem } from "@sybotan-web/graphy/lib";
+import { SGraphyItem } from "@saga-web/graphy/lib";
 import {
     SColor,
     SPainter,
@@ -26,9 +26,9 @@ import {
     SPoint,
     SPolygonUtil,
     SRect
-} from "@sybotan-web/draw/lib";
+} from "@saga-web/draw/lib";
 import { Zone } from "../types/Zone";
-import { SMouseEvent } from "@sybotan-web/base/lib";
+import { SMouseEvent } from "@saga-web/base/lib";
 
 /**
  * 业务空间item
@@ -68,7 +68,7 @@ export class ZoneItem extends SGraphyItem {
     constructor(parent: SGraphyItem | null, data: Zone) {
         super(parent);
         this.data = data;
-        if (this.data.OutLine.length) {
+        if (this.data.OutLine.length && this.data.OutLine[0].length) {
             let tempArr = this.data.OutLine;
             this.minX = tempArr[0][0][0].X;
             this.maxX = this.minX;

+ 1 - 1
src/types/Opt.ts

@@ -18,7 +18,7 @@
  * ********************************************************************************************************************
  */
 
-import { SColor } from "@sybotan-web/draw/lib";
+import { SColor } from "@saga-web/draw/lib";
 
 /**
  * 接口

+ 1 - 2
src/types/Zone.ts

@@ -19,8 +19,7 @@
  */
 
 import { Point } from "./Point";
-import { Place } from "./Place";
-import { SColor } from "@sybotan-web/draw/lib";
+import { SColor } from "@saga-web/draw/lib";
 
 /**
  * 业务空间item接口