Browse Source

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

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

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

@ -263,7 +263,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.animationTime = setTimeout(() => { this.animationTime = setTimeout(() => {
this.animation?.pause(); this.animation?.pause();
this.animationIcon?.scale.set(1); this.animationIcon?.scale.set(1);
}, 5000); }, 3000);
} }
} }
/** /**
@ -303,6 +303,22 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
} else { } else {
obj.filters = [this.outlineFilterGreen]; 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 => { this.on('deselect', obj => {
if (this.allowEdit) { if (this.allowEdit) {
@ -316,6 +332,18 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
} else { } else {
obj.filters = []; 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.on('backgroundScale', scale => {
this.previewSinglePointIcon.scale.set(1 / this.backgroundImage.scale.x); this.previewSinglePointIcon.scale.set(1 / this.backgroundImage.scale.x);
@ -2065,6 +2093,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
} }
}); });
break; break;
case PaintMode.MoveCar:
this.previewSinglePointIcon.visible = true;
break;
} }
} }
/** /**
@ -2198,7 +2229,8 @@ enum PaintMode {
endPaint, endPaint,
Pipeline, Pipeline,
Arrows, 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.data = event.data;
event.currentTarget.parent.alpha = 0.5; event.currentTarget.parent.alpha = 0.5;
event.currentTarget.parent.dragging = true; event.currentTarget.parent.dragging = true;
@ -3049,8 +3085,10 @@ export class Selection {
if (this.isMultiselection) { if (this.isMultiselection) {
this.selectOrDeselect(obj); this.selectOrDeselect(obj);
} else { } else {
this.deselectAll(); if (!this.contains(obj)) {
this.select(obj); this.deselectAll();
this.select(obj);
}
} }
} }
/** /**

Loading…
Cancel
Save