Browse Source

[修正] 修正子组件 几率问题未加载完成BUG

develop
陈鹏飞 4 years ago
parent
commit
16d6ac1535
  1. 7
      src/app/ui/collection-tools/collection-tools.component.ts
  2. 7
      src/app/working-area/working-area.component.ts

7
src/app/ui/collection-tools/collection-tools.component.ts

@ -417,9 +417,10 @@ export class CollectionToolsComponent implements OnInit {
ngOnInit(): void {
this.getAllLibrary()
this.getSitePlan()
this.getAllBuildings()
this.getSitePlan()
let that = this
window.setTimeout(()=>{
document.getElementById("functionalDomainContent").oncontextmenu = function (event) {
@ -430,7 +431,7 @@ export class CollectionToolsComponent implements OnInit {
}
ngAfterViewInit(): void {
// 监听canvas组件选中素材事件
@ -945,7 +946,7 @@ export class CollectionToolsComponent implements OnInit {
let dadHeight = document.querySelector('.functionalDomainContent').clientHeight
let left = document.querySelector('.functionalDomainLeft').clientWidth
let right = document.querySelector('.functionalDomainRight').clientWidth
let imgWidth = dad - left - right//可区域内 宽度
let imgWidth = dad - left - right//可区域内 宽度
let img = new Image()
img.src = this.selectingSitePlan.imageUrl;
img.onload = function(){

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

@ -135,13 +135,14 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.eventManager.addGlobalEventListener('window', 'keypress', (event: any) => {
});
}
ngAfterViewInit(): void {
setTimeout(() => {
this.createCanvas();
}, 0);
}
ngAfterViewInit(): void {
}
/**
*
* @param event

Loading…
Cancel
Save