From e3a0edeea68611f74378294df18ab6958c9a53fc Mon Sep 17 00:00:00 2001 From: "DESKTOP-474NEJQ\\xzsjob" <359059686@qq.com> Date: Sun, 27 Sep 2020 14:36:57 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=20=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E8=BD=A6=E8=BE=86=E6=98=BE=E7=A4=BA=E5=81=9C=E6=94=BE=E5=8C=BA?= =?UTF-8?q?/=E8=BD=A6=E8=BE=86=E5=8F=AF=E4=BB=A5=E6=8B=96=E5=8A=A8/?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=B7=B2=E9=80=89=E4=B8=AD=E7=9A=84=E8=BD=A6?= =?UTF-8?q?=E8=BE=86=E6=97=B6=E4=B8=8D=E9=97=AA=E7=83=81=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../working-area/working-area.component.ts | 48 +++++++++++++++++-- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 9b21638..67253f6 100644 --- a/src/app/working-area/working-area.component.ts +++ b/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,8 +3085,10 @@ export class Selection { if (this.isMultiselection) { this.selectOrDeselect(obj); } else { - this.deselectAll(); - this.select(obj); + if (!this.contains(obj)) { + this.deselectAll(); + this.select(obj); + } } } /**