Browse Source

[新增] 选中车辆显示停放区/车辆可以拖动/点击已选中的车辆时不闪烁图标

develop
徐振升 4 years ago
parent
commit
e3a0edeea6
  1. 44
      src/app/working-area/working-area.component.ts

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

@ -263,7 +263,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.animationTime = setTimeout(() => {
this.animation?.pause();
this.animationIcon?.scale.set(1);
}, 5000);
}, 3000);
}
}
/**
@ -303,6 +303,22 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
} else {
obj.filters = [this.outlineFilterGreen];
}
if (obj.parent === this.backgroundImage && (
obj.assetData.Type === 1 ||
obj.assetData.Type === 2 ||
obj.assetData.Type === 3 ||
obj.assetData.Type === 4)) {
// 显示停放区域
this.backgroundImage.children.forEach(item => {
if (item instanceof PutCarArea) {
if (item.assetData.Type.indexOf(obj.assetData.Type) !== -1) {
item.visible = true;
} else {
item.visible = false;
}
}
});
}
});
this.on('deselect', obj => {
if (this.allowEdit) {
@ -316,6 +332,18 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
} else {
obj.filters = [];
}
if (obj.parent === this.backgroundImage && (
obj.assetData.Type === 1 ||
obj.assetData.Type === 2 ||
obj.assetData.Type === 3 ||
obj.assetData.Type === 4)) {
// 显示停放区域
this.backgroundImage.children.forEach(item => {
if (item instanceof PutCarArea) {
item.visible = false;
}
});
}
});
this.on('backgroundScale', scale => {
this.previewSinglePointIcon.scale.set(1 / this.backgroundImage.scale.x);
@ -2065,6 +2093,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
}
});
break;
case PaintMode.MoveCar:
this.previewSinglePointIcon.visible = true;
break;
}
}
/**
@ -2198,7 +2229,8 @@ enum PaintMode {
endPaint,
Pipeline,
Arrows,
Car
Car,
MoveCar
}
/**
*
@ -2279,7 +2311,11 @@ export class SinglePointIcon extends PIXI.Container {
}
}
// 如果链接对象不为空,禁止移动
if ((this.workingArea.allowEdit || this.parent !== this.workingArea.backgroundImage) ) {
if ((this.workingArea.allowEdit
|| this.assetData.Type === 1
|| this.assetData.Type === 2
|| this.assetData.Type === 3
|| this.assetData.Type === 4)) {
event.currentTarget.parent.data = event.data;
event.currentTarget.parent.alpha = 0.5;
event.currentTarget.parent.dragging = true;
@ -3049,10 +3085,12 @@ export class Selection {
if (this.isMultiselection) {
this.selectOrDeselect(obj);
} else {
if (!this.contains(obj)) {
this.deselectAll();
this.select(obj);
}
}
}
/**
*
* @param objects

Loading…
Cancel
Save