|
|
|
@ -4,7 +4,6 @@ import { Router } from '@angular/router';
|
|
|
|
|
import { EchartsDataService } from '../echarts-data.service'; |
|
|
|
|
declare var echarts: any; |
|
|
|
|
declare var AMap: any; |
|
|
|
|
|
|
|
|
|
declare var AMapUI: any; |
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-home', |
|
|
|
@ -20,26 +19,30 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
ngOnInit() { |
|
|
|
|
this.emitService.eventEmit.subscribe((value: any) => { |
|
|
|
|
if (value == 'echarts') { |
|
|
|
|
this.updateEcharts() |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.updateEcharts() |
|
|
|
|
}, 500); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
window.setTimeout(()=>{ |
|
|
|
|
this.unitType() |
|
|
|
|
this.unitData() |
|
|
|
|
this.keyUnit() |
|
|
|
|
this.mapInit() //初始化地图
|
|
|
|
|
let that = this |
|
|
|
|
window.addEventListener('resize', () => { |
|
|
|
|
},0) |
|
|
|
|
window.addEventListener('resize', () => { |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.updateEcharts() |
|
|
|
|
}) |
|
|
|
|
window.addEventListener('keydown', (e) => { |
|
|
|
|
if(e.keyCode == 122){ |
|
|
|
|
}, 500); |
|
|
|
|
}) |
|
|
|
|
window.addEventListener('keydown', (e) => { |
|
|
|
|
if(e.keyCode == 122){ |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.updateEcharts() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
},0) |
|
|
|
|
}, 500); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//更新echarts视图
|
|
|
|
|