Browse Source

优化图形界面

YaolongHan 6 years ago
parent
commit
71dc92ba81

+ 7 - 6
src/assets/graphy/SGraphy/newItems/SGraphyPolygonItem.js

@@ -36,24 +36,24 @@ var SGraphyPolygonItem = /** @class */ (function (_super) {
      */
     function SGraphyPolygonItem(PolygonItemData) {
         var _this = _super.call(this, PolygonItemData.parent) || this;
-        _this.fillColor = SColor.White;
+        _this.fillColor = new SColor('#F2F6FC');
         _this.color = SColor.Black;
-        _this.width = 100;
+        _this.width = 0;
         _this.isBusiness = 1;
         _this.cacheColor = SColor.Black; //需要缓存的边框
-        _this.cacheFillColor = SColor.White; //需要缓存的填充色
-        _this.cacheWidth = 100;
+        _this.cacheFillColor = new SColor('#F2F6FC'); //需要缓存的填充色
+        _this.cacheWidth = 0;
         // 修改绘制路径格式
         var newSpacePaths = PolygonItemData.space.Paths[0].map(function (item) {
             return new SPoint(item.X, -item.Y);
         });
         _this.pointArr = newSpacePaths;
         // // 填充色
-        PolygonItemData.fillColor ? _this.fillColor = PolygonItemData.fillColor : _this.fillColor = SColor.White;
+        PolygonItemData.fillColor ? _this.fillColor = PolygonItemData.fillColor : _this.fillColor = new SColor('#F2F6FC');
         // 边框色
         PolygonItemData.color ? _this.color = PolygonItemData.color : _this.color = SColor.Black;
         //边框宽度
-        PolygonItemData.width ? _this.width = PolygonItemData.width : _this.width = 100;
+        PolygonItemData.width ? _this.width = PolygonItemData.width : _this.width = 0;
         //中心点
         _this.centerOfGravityPoint = {
             x: PolygonItemData.space.LocationPoint.X,
@@ -142,6 +142,7 @@ var SGraphyPolygonItem = /** @class */ (function (_super) {
                 text = '⬇️   ' + this.businessName;
             }
             painter.font.size = this.scale * 200;
+            painter.brush.color = SColor.Black;
             painter.drawText(text, this.centerOfGravityPoint.x, this.centerOfGravityPoint.y);
         }
     };

+ 8 - 7
src/assets/graphy/SGraphy/newItems/SGraphyPolygonItem.ts

@@ -9,17 +9,17 @@ import { dataItemPath, dataItem, dataSpaceItem, dataInterface, PolygonItemInterf
  */
 export class SGraphyPolygonItem extends SGraphyItem {
 	pointArr: SPoint[];
-	fillColor: SColor = SColor.White;
+	fillColor: SColor =new SColor('#F2F6FC');
 	color: SColor = SColor.Black;
-	width: number = 100;
+	width: number =0;
 	businessId: string | null;
 	id: string | null;
 	centerOfGravityPoint: { x: number, y: number };
 	businessName: null | string | undefined;
 	isBusiness: number = 1;
 	cacheColor:SColor= SColor.Black             //需要缓存的边框
-	cacheFillColor:SColor = SColor.White        //需要缓存的填充色
-	cacheWidth:number = 100;
+	cacheFillColor:SColor =	 new SColor('#F2F6FC');        //需要缓存的填充色
+	cacheWidth:number = 0;
 	// actived: boolean = false; 				//是否激活
 	/**
 	 * 构造函数
@@ -42,11 +42,11 @@ export class SGraphyPolygonItem extends SGraphyItem {
 		});
 		this.pointArr = newSpacePaths;
 		// // 填充色
-		PolygonItemData.fillColor ? this.fillColor = PolygonItemData.fillColor : this.fillColor = SColor.White;
+		PolygonItemData.fillColor ? this.fillColor = PolygonItemData.fillColor : this.fillColor = new SColor('#F2F6FC');
 		// 边框色
 		PolygonItemData.color ? this.color = PolygonItemData.color : this.color = SColor.Black;
 		//边框宽度
-		PolygonItemData.width ? this.width = PolygonItemData.width : this.width = 100;
+		PolygonItemData.width ? this.width = PolygonItemData.width : this.width = 0;
 		//中心点
 		this.centerOfGravityPoint = {
 			x: PolygonItemData.space.LocationPoint.X,
@@ -147,7 +147,8 @@ export class SGraphyPolygonItem extends SGraphyItem {
 				text = '⬇️   ' + this.businessName
 			}
 			painter.font.size = this.scale*200;
-			painter.drawText(text, this.centerOfGravityPoint.x,this.centerOfGravityPoint.y)
+			painter.brush.color = SColor.Black;
+			painter.drawText(text,this.centerOfGravityPoint.x,this.centerOfGravityPoint.y)
 		}
 	}
 	onClick(event: SMouseEvent): boolean {

+ 8 - 8
src/components/business_space/graphy/business.vue

@@ -752,33 +752,33 @@
             isBusinessToColor(item){
                 if (item.isBusiness == 1) {
                     item.color =  item.cacheColor || new SColor('#000');
-                    item.fillColor = SColor.White;
+                    item.fillColor = new SColor('#000');
                     item.width = item.cacheWidth;
                 } else if (item.isBusiness == 2) {
                     //已有id 的业务空间
                     item.color = item.cacheColor || new SColor('#000');
-                    item.fillColor =item.cacheFillColor || new SColor('#fff');
+                    item.fillColor =item.cacheFillColor || new SColor('#F2F6FC');
                     item.width = item.cacheWidth;
                 } else if (item.isBusiness == 3) {
                     //被选择的元空间
                     item.color = item.cacheColor|| new SColor('#000');
-                    item.width = 800;
+                    // item.width = 800;
                     item.fillColor =new SColor('#1abc9c')
                 } else if (item.isBusiness == 4) {
                     item.color =  new SColor(251,226,1,.8) || new SColor('#000');
-                    item.fillColor = item.cacheFillColor || new SColor('#fff');
+                    item.fillColor = item.cacheFillColor || new SColor('#F2F6FC');
                      item.width = item.cacheWidth;
                 } else if (item.isBusiness == 5) {
                     item.width = item.cacheWidth;
-                    item.fillColor = new SColor(11,12,12,.2) || new SColor('#fff')
+                    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.width = 800;
                     item.fillColor =new SColor('#1abc9c');
                 } else if (item.isBusiness == 7) {
                     item.width = item.cacheWidth;
                     item.color = item.cacheColor || new SColor('#000');
-                    item.fillColor = item.cacheFillColor || new SColor('#fff');
+                    item.fillColor = item.cacheFillColor || new SColor('#F2F6FC');
                 }
             },
             /**  搜索 ------------------------------------------------------------------------------ */
@@ -888,7 +888,7 @@
                 items.map(item => {
                     item.businessId = null;
                     item.businessName = null;
-                    item.fillColor = new SColor(0,0,0,0);
+                    item.fillColor = new SColor('#F2F6FC');
                     item.isBusiness = 1;
                 });
                 list.map((item, index) => {