Browse Source

点击空间着色

YaolongHan 6 years ago
parent
commit
af6d79d363

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

@@ -65,6 +65,7 @@ var SGraphyPolygonItem = /** @class */ (function (_super) {
         PolygonItemData.businessId ? _this.businessId = PolygonItemData.businessId : _this.businessId = null;
         //业务空间名称
         _this.businessName = PolygonItemData.space.Name;
+        _this.initName = PolygonItemData.space.Name;
         // 空间id
         _this.id = PolygonItemData.space.id;
         return _this;
@@ -139,7 +140,7 @@ var SGraphyPolygonItem = /** @class */ (function (_super) {
                 text = '👇   ' + this.businessName;
             }
             else {
-                text = '⬇️   ' + this.businessName;
+                text = '⬇️   ' + this.initName;
             }
             painter.font.size = this.scale * 200;
             painter.brush.color = SColor.Black;

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

@@ -15,7 +15,8 @@ export class SGraphyPolygonItem extends SGraphyItem {
 	businessId: string | null;
 	id: string | null;
 	centerOfGravityPoint: { x: number, y: number };
-	businessName: null | string | undefined;
+	businessName: null | string | undefined;    //业务空间名字
+	initName: null | string | undefined;        //空间名字
 	isBusiness: number = 1;
 	cacheColor:SColor= SColor.Black             //需要缓存的边框
 	cacheFillColor:SColor =	 new SColor('#F2F6FC');        //需要缓存的填充色
@@ -58,6 +59,7 @@ export class SGraphyPolygonItem extends SGraphyItem {
 		PolygonItemData.businessId ? this.businessId = PolygonItemData.businessId : this.businessId = null;
 		//业务空间名称
 		this.businessName = PolygonItemData.space.Name;
+		this.initName =  PolygonItemData.space.Name;
 		// 空间id
 		this.id = PolygonItemData.space.id;
 	}
@@ -144,7 +146,7 @@ export class SGraphyPolygonItem extends SGraphyItem {
 			if (this.businessName || this.businessId) {
 				text = '👇   ' + this.businessName
 			} else {
-				text = '⬇️   ' + this.businessName
+				text = '⬇️   ' + this.initName
 			}
 			painter.font.size = this.scale*200;
 			painter.brush.color = SColor.Black;

+ 5 - 3
src/components/business_space/graphy/business.vue

@@ -643,6 +643,7 @@
                 // this.view.canvasView.addEventListener("click", this.checkSpace);
                 //这里说是点击事件`
                 this.getGraphy();
+                console.log(data)
             },
             /** canvas事件------------------------------------------------------------------------------------*/
             //点击元空间
@@ -752,7 +753,7 @@
             isBusinessToColor(item){
                 if (item.isBusiness == 1) {
                     item.color =  item.cacheColor || new SColor('#000');
-                    item.fillColor = new SColor('#000');
+                    item.fillColor = new SColor('#F2F6FC');
                     item.width = item.cacheWidth;
                 } else if (item.isBusiness == 2) {
                     //已有id 的业务空间
@@ -773,8 +774,9 @@
                     item.fillColor = new SColor(11,12,12,.2) || new SColor('#F2F6FC')
                 } else if (item.isBusiness == 6) {
                     item.color = new SColor(68,161,140,.4) || new SColor('#000');
-                    // item.width = 800;
-                    item.fillColor =new SColor('#1abc9c');
+                    item.width = item.cacheWidth;
+                     item.fillColor =new SColor('#1abc9c');
+                     console.log('click item isbusiness',item)
                 } else if (item.isBusiness == 7) {
                     item.width = item.cacheWidth;
                     item.color = item.cacheColor || new SColor('#000');