Browse Source

异步更新位置

dev
陈鹏飞 3 years ago
parent
commit
f403a1b853
  1. 13
      src/app/pages/plan/plan.component.ts

13
src/app/pages/plan/plan.component.ts

@ -104,7 +104,6 @@ export class PlanComponent implements OnInit {
else //非内部制作模式,不开启 else //非内部制作模式,不开启
{ {
console.log("没有单位" + simpleData.key); console.log("没有单位" + simpleData.key);
} }
} }
} else { } else {
@ -121,6 +120,12 @@ export class PlanComponent implements OnInit {
}) })
} }
ngAfterViewChecked () {
if (this.isShowNature && this.beforeOnePropertyData && (this.selectFence === 1 || this.selectFence === 2)) { //刷新弹窗 位置
this.renovateDialogPosition()
}
}
ngOnDestroy(): void { //组件销毁前 销毁canvas ngOnDestroy(): void { //组件销毁前 销毁canvas
this.game.dispose(); this.game.dispose();
this.game = null; this.game = null;
@ -395,8 +400,10 @@ export class PlanComponent implements OnInit {
//刷新设备属性 弹窗位置 //刷新设备属性 弹窗位置
renovateDialogPosition() { renovateDialogPosition() {
this.naturePosition.left = `${this.beforeOnePropertyData.getHeadUIPos().x - 150}px` window.setTimeout(()=>{
this.naturePosition.top = `${this.beforeOnePropertyData.getHeadUIPos().y + 100}px` this.naturePosition.left = `${this.beforeOnePropertyData.getHeadUIPos().x - 150}px`
this.naturePosition.top = `${this.beforeOnePropertyData.getHeadUIPos().y + 100}px`
},0)
} }
//上传设备 图片 //上传设备 图片

Loading…
Cancel
Save