邵佳豪 4 years ago
parent
commit
b4abd277b3
  1. 2
      src/app/working-area/model/axLegend.ts
  2. 23
      src/app/working-area/working-area.component.ts

2
src/app/working-area/model/axLegend.ts

@ -44,7 +44,7 @@ export class AxLegend extends AxShape {
this.removeChildren(); this.removeChildren();
let index = 1; let index = 1;
let offset = 25; let offset = 25;
let number = 2; let number = this.assetData.PropertyInfos[0].PropertyValue;
let width = 300; let width = 300;
let height = 50; let height = 50;
for (let i = 0; i < number; i++){ for (let i = 0; i < number; i++){

23
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) { // 基本信息 if (axShape.assetData.GameMode === GameMode.BasicInformation) { // 基本信息
// 添加楼层数据 // 添加楼层数据
this.canvasData.originaleveryStoreyData.data[axShape.assetData.Id] = axShape.assetData; 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); var itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1);
temp.addItem(itemLegend); temp.addItem(itemLegend);
} }
this.emit('canvasDataChanged');
this.canvasData.isChange = true; this.canvasData.isChange = true;
}); });
/** /**
@ -420,6 +422,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
// } // }
this.backgroundImage.removeChild(axShape); this.backgroundImage.removeChild(axShape);
this.emit('canvasDataChanged');
this.canvasData.isChange = true; this.canvasData.isChange = true;
}); });
} }
@ -462,6 +465,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
icon.refresh(); icon.refresh();
} else if (icon instanceof AxArrowConnector) { } else if (icon instanceof AxArrowConnector) {
icon.redraw(); icon.redraw();
} else if (icon instanceof AxLegend) {
icon.refresh();
} }
} }
/** /**
@ -945,7 +950,21 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
const tempAssetData = { const tempAssetData = {
Id: "图例",//ObjectID.default.generate() Id: "图例",//ObjectID.default.generate()
Color: "#066EED80", Color: "#066EED80",
PropertyInfos:[] PropertyInfos: [
{
Tag : '',
Order : 0,
Enabled : true,
Visible : true,
Required : false,
RuleName : "",
RuleValue : "",
PhysicalUnit : "",
PropertyName : "列",
PropertyType : 2,
PropertyValue : 2,
},
]
}; };
let shapeMap: Map<string,Legend> = new Map<string,Legend>(); let shapeMap: Map<string,Legend> = new Map<string,Legend>();

Loading…
Cancel
Save