From 42af896944dc8718c127dc1ff5c9c53bb4153423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Sat, 9 Jan 2021 11:50:22 +0800 Subject: [PATCH] 1.0.4.20210109b --- src/app/working-area/model/axLegend.ts | 2 +- .../working-area/working-area.component.ts | 23 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/app/working-area/model/axLegend.ts b/src/app/working-area/model/axLegend.ts index 55359cf..55f4d8f 100644 --- a/src/app/working-area/model/axLegend.ts +++ b/src/app/working-area/model/axLegend.ts @@ -44,7 +44,7 @@ export class AxLegend extends AxShape { this.removeChildren(); let index = 1; let offset = 25; - let number = 2; + let number = this.assetData.PropertyInfos[0].PropertyValue; let width = 300; let height = 50; for (let i = 0; i < number; i++){ diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index f010069..55b32e7 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -353,7 +353,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV /** * 创建图标事件(数据处理) */ - this.on('createIcon', (axShape:AxShape)=> { + this.on('createIcon', (axShape: AxShape) => { + console.log("新增图标:"+axShape.assetData.Name); if (axShape.assetData.GameMode === GameMode.BasicInformation) { // 基本信息 // 添加楼层数据 this.canvasData.originaleveryStoreyData.data[axShape.assetData.Id] = axShape.assetData; @@ -383,6 +384,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV var itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); temp.addItem(itemLegend); } + this.emit('canvasDataChanged'); this.canvasData.isChange = true; }); /** @@ -420,6 +422,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // } this.backgroundImage.removeChild(axShape); + this.emit('canvasDataChanged'); this.canvasData.isChange = true; }); } @@ -462,6 +465,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV icon.refresh(); } else if (icon instanceof AxArrowConnector) { icon.redraw(); + } else if (icon instanceof AxLegend) { + icon.refresh(); } } /** @@ -945,7 +950,21 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV const tempAssetData = { Id: "图例",//ObjectID.default.generate() Color: "#066EED80", - PropertyInfos:[] + PropertyInfos: [ + { + Tag : '', + Order : 0, + Enabled : true, + Visible : true, + Required : false, + RuleName : "", + RuleValue : "", + PhysicalUnit : "", + PropertyName : "列", + PropertyType : 2, + PropertyValue : 2, + }, + ] }; let shapeMap: Map = new Map();