Browse Source

更新版本:1.0.2.20210108_beta

dev
徐振升 4 years ago
parent
commit
54de159a2e
  1. 2
      src/app/working-area/model/axArrowConnector.ts
  2. 2
      src/app/working-area/model/axImageShape.ts
  3. 22
      src/app/working-area/model/axLegend.ts
  4. 4
      src/app/working-area/model/multipointIcon.ts
  5. 2
      src/app/working-area/model/polygonIcon.ts
  6. 18
      src/app/working-area/working-area.component.ts

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

@ -50,6 +50,7 @@ export class AxArrowConnector extends AxShape {
this.sortableChildren = true;
this.text.zIndex = this.children.length;
this.text.visible = this.showName;
this.text.angle = -this.workingArea.backgroundImage.angle;
}
public drawPoints() {
@ -359,6 +360,7 @@ export class AxArrowConnector extends AxShape {
// c.end();
// }
// }
this.text.angle = -this.workingArea.backgroundImage.angle;
}
paintMarker(c: PIXI.Graphics, ptX: number, ptY: number, nx: number, ny: number,
size: number, arrowWidth: number, edgeWidth: number, spacing: number, initialMove: boolean) {

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

@ -50,6 +50,7 @@ export class AxImageShape extends AxShape {
downRight: PIXI.Sprite;
constructor(assetData: any, workingArea: WorkingAreaComponent) {
super(assetData, workingArea);
this.angle = -this.workingArea.backgroundImage.angle;
this.x = this.assetData.Point.x;
this.y = this.assetData.Point.y;
this.name = this.assetData.Id;
@ -265,5 +266,6 @@ export class AxImageShape extends AxShape {
+ this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue;
this.text.x = this.image.x;
this.text.y = this.image.y - this.image.height / 2;
this.angle = -this.workingArea.backgroundImage.angle;
}
}

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

@ -15,6 +15,7 @@ export class AxLegend extends AxShape {
*/
constructor(assetData: any, workingArea: WorkingAreaComponent,shapeMap:Map<string,Legend>) {
super(assetData, workingArea);
this.angle = -this.workingArea.backgroundImage.angle;
this.name = this.assetData.Id;
this.shapeMap = shapeMap;
this.refresh();
@ -42,15 +43,15 @@ export class AxLegend extends AxShape {
refresh() {
this.removeChildren();
let index = 1;
let offset = 50;
let offset = 25;
let number = 2;
let width = 450;
let height = 100;
let width = 300;
let height = 50;
for (let i = 0; i < number; i++){
if (i >= this.shapeMap.size) break;
let x = width * i;
var textImage = new Text('图例',{
fontSize: 36,
fontSize: 20,
fill: ['#0000ff'],
});
textImage.anchor.set(0.5)
@ -59,7 +60,7 @@ export class AxLegend extends AxShape {
this.addChild(textImage);
var textName = new Text("名称"+' 【数量】',{
fontSize: 36,
fontSize: 20,
fill: ['#0000ff'],
});
textName.anchor.set(0,0.5);
@ -71,14 +72,16 @@ export class AxLegend extends AxShape {
let x = index % number === 0 ? (number -1) * width : (index % number - 1) * width;
let y = Math.ceil(index / number) * height;
let image: Sprite = Sprite.from(item.ImageUrl);
image.width = 64;
image.height = 64;
image.width = 32;
image.height = 32;
image.anchor.set(0.5);
image.x = x;
image.y = y;
this.addChild(image);
var textName = new Text(item.Name+' 【'+item.Count.toString()+'】');
var textName = new Text(item.Name+' 【'+item.Count.toString()+'】',{
fontSize: 20,
});
textName.anchor.set(0,0.5);
textName.x = x + image.width/2 + offset;
textName.y = y;
@ -89,7 +92,7 @@ export class AxLegend extends AxShape {
let rect = this.getLocalBounds();
this.pen.clear();
this.pen.beginFill(0xffffff,0.01);
this.pen.lineStyle(5, 0x000000);
this.pen.lineStyle(3, 0x000000);
this.pen.moveTo(rect.left-offset, rect.top-offset);
this.pen.lineTo(rect.right+offset, rect.top-offset);
this.pen.lineTo(rect.right+offset, rect.bottom+offset);
@ -98,6 +101,7 @@ export class AxLegend extends AxShape {
this.pen.endFill();
}
this.addChild(this.pen);
this.angle = -this.workingArea.backgroundImage.angle;
}
}

4
src/app/working-area/model/multipointIcon.ts

@ -36,7 +36,7 @@ export class MultipointIcon extends AxShape {
* @param points
*/
constructor(assetData: any,workingArea: WorkingAreaComponent) {
super(assetData,workingArea);
super(assetData, workingArea);
this.name = this.assetData.Id;
this.pointsData = this.assetData.MultiPoint;
this.x = this.assetData.Point.x;
@ -46,6 +46,7 @@ export class MultipointIcon extends AxShape {
this.text.anchor.set(0.5,0.5);
// this.text.position = this.getLineCenter(this.pointsData[0], this.pointsData[1]);
this.text.visible = this.showName;
this.text.angle = -this.workingArea.backgroundImage.angle;
this.addChild(this.text);
// 画线图标
for (let i = 0, count = this.pointsData.length - 1; i < count; i++) {
@ -198,5 +199,6 @@ export class MultipointIcon extends AxShape {
this.text.text = this.assetData.Name
+ '\r\n'
+ this.assetData.PropertyInfos.find(item => item.PropertyName === '名称/编号')?.PropertyValue;
this.text.angle = -this.workingArea.backgroundImage.angle;
}
}

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

@ -75,6 +75,7 @@ export class PolygonIcon extends AxShape {
this.text.anchor.set(0.5);
this.text.position = this.calculatePolygonGravityCenter(this.pointsData);
this.text.visible = this.showName;
this.text.angle = -this.workingArea.backgroundImage.angle;
// console.log(this.calculatePolygonGravityCenter(this.pointsData));
this.polygonGraphics.addChild(this.text);
// 添加圆点事件
@ -194,5 +195,6 @@ export class PolygonIcon extends AxShape {
this.polygonGraphics.beginFill(color, angle);
this.polygonGraphics.drawPolygon(this.getPoints());
this.polygonGraphics.endFill();
this.text.angle = -this.workingArea.backgroundImage.angle;
}
}

18
src/app/working-area/working-area.component.ts

@ -141,7 +141,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
// Beta版: 该版本相对于α版已有了很大的改进,消除了严重的错误,但还是存在着一些缺陷,需要经过多次测试来进一步消除,此版本主要的修改对像是软件的UI。
// RC版: 该版本已经相当成熟了,基本上不存在导致错误的BUG,与即将发行的正式版相差无几。
// Release版: 该版本意味“最终版本”,在前面版本的一系列测试版之后,终归会有一个正式版本,是最终交付用户使用的一个版本。该版本有时也称为标准版。一般情况下,Release不会以单词形式出现在软件封面上,取而代之的是符号®。
public VERSION = '1.0.1.20210108_beta';
public VERSION = '1.0.2.20210108_beta';
/**
*
*/
@ -491,17 +491,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.selection.select(obj);
});
}
// /**
// * 创建背景图
// */
// public createBackground(imageUrl:string,imageAngle:number) {
// if (this.backgroundImage !== null) {
// this.backgroundImage.destroy();
// this.backgroundImage = null;
// }
// this.createBackgroundImage()
// this.refreshBackgroundImage(imageUrl,imageAngle);
// }
/**
*
*/
@ -908,6 +897,11 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
// 设置图片缩放
this.backgroundImage.scale.set(scale);
this.backgroundImage.visible = true;
this.backgroundImage.children.forEach((item) => {
if (item instanceof AxShape) {
item.refresh();
}
})
}
}
/**

Loading…
Cancel
Save