Browse Source

add polygon type

haojianlong 5 years ago
parent
commit
675b4f6076

+ 1 - 0
src/assets/graphy/SGraphy/dataType.ts

@@ -60,5 +60,6 @@ interface businessDataInterface {
 interface PolygonItemInterface {
     parent: SGraphyPolygonItem | null //父类
     space: dataSpaceItem,       //传入的item 参数
+    businessType?: string
 }
 export { dataItemPath, dataItem, dataSpaceItem, dataInterface, businessDataInterface, PolygonItemInterface }

+ 4 - 2
src/assets/graphy/SGraphy/mainScene.js

@@ -158,7 +158,8 @@ var mainScene = /** @class */ (function (_super) {
                 if (space[i].Paths[1] && space[i].Paths[1].length >= 2) {
                     this.addItem(this.constructeItem({
                         parent: null,
-                        space: space[i]
+                        space: space[i],
+                        businessType: 'space'
                     }));
                 }
             }
@@ -166,7 +167,8 @@ var mainScene = /** @class */ (function (_super) {
                 if (space[i].Paths[0] && space[i].Paths[0].length >= 2 && !space[i].Paths[1]) {
                     this.addItem(this.constructeItem({
                         parent: null,
-                        space: space[i]
+                        space: space[i],
+                        businessType: 'space'
                     }));
                 }
             }

+ 4 - 2
src/assets/graphy/SGraphy/mainScene.ts

@@ -145,7 +145,8 @@ export default class mainScene extends SGraphyScene {
                     this.addItem(this.constructeItem(
                         {
                             parent: null,
-                            space: space[i]
+                            space: space[i],
+                            businessType:'space'
                         }));
                 }
             }
@@ -154,7 +155,8 @@ export default class mainScene extends SGraphyScene {
                     this.addItem(this.constructeItem(
                         {
                             parent: null,
-                            space: space[i]
+                            space: space[i],
+                            businessType:'space'
                         }));
                 }
             }

+ 2 - 2
src/assets/graphy/SGraphy/newItems/SGraphyPolygonItem.js

@@ -44,7 +44,7 @@ var SGraphyPolygonItem = /** @class */ (function (_super) {
         _this.cacheColor = SColor.Black; //需要缓存的边框
         _this.cacheFillColor = new SColor('#F2F6FC'); //需要缓存的填充色
         _this.cacheWidth = 100;
-        _this.type = 1; //类型 1-墙 2-空间 
+        _this.businessType = ''; //类型
         // 修改绘制路径格式
         var newSpacePaths = PolygonItemData.space.Paths[0].map(function (item) {
             return new SPoint(item.X, item.Y);
@@ -72,7 +72,7 @@ var SGraphyPolygonItem = /** @class */ (function (_super) {
         _this.id = PolygonItemData.space.id;
         _this.viewText = PolygonItemData.space.Name;
         //类型
-        _this.type = PolygonItemData.space.type ? PolygonItemData.space.type : 1;
+        _this.businessType = PolygonItemData.businessType ? PolygonItemData.businessType : '';
         return _this;
     }
     /**

+ 2 - 2
src/assets/graphy/SGraphy/newItems/SGraphyPolygonItem.ts

@@ -22,7 +22,7 @@ export default class SGraphyPolygonItem extends SGraphyItem {
 	cacheColor: SColor = SColor.Black             //需要缓存的边框
 	cacheFillColor: SColor = new SColor('#F2F6FC');        //需要缓存的填充色
 	cacheWidth: number = 100;
-	type: number = 1;															//类型 1-墙 2-空间 
+	businessType: string = ''													//类型
 	// actived: boolean = false; 				//是否激活
 	/**
 	 * 构造函数
@@ -66,7 +66,7 @@ export default class SGraphyPolygonItem extends SGraphyItem {
 		this.id = PolygonItemData.space.id;
 		this.viewText = PolygonItemData.space.Name;
 		//类型
-		this.type = PolygonItemData.space.type ? PolygonItemData.space.type : 1
+		this.businessType = PolygonItemData.businessType ? PolygonItemData.businessType : ''
 	}
 
 	/**