| | |
| | | import * as moment from 'moment'; |
| | | import { DeviceService } from '@business/services/http/device.service'; |
| | | import * as echarts from 'echarts'; |
| | | import * as $ from 'jquery'; |
| | | |
| | | @Component({ |
| | | selector: 'environment-management', |
| | |
| | | providers: [DeviceService] |
| | | }) |
| | | export class EnvironmentManagementComponent implements OnInit, OnDestroy { |
| | | |
| | | offlineChartData: any[] = []; |
| | | |
| | | constructor( |
| | | private deviceService: DeviceService, |
| | |
| | | data: ['本月数据', '上月同期'] |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: [] |
| | | type: 'category' |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | |
| | | }, |
| | | series: [ |
| | | { |
| | | data: [], |
| | | type: 'line', |
| | | smooth: true, |
| | | name: '本月数据' |
| | | }, { |
| | | data: [], |
| | | type: 'line', |
| | | smooth: true, |
| | | name: '上月同期' |
| | |
| | | ])
|
| | | }; |
| | | this.http2.get(environment.SERVER_BASH_URL + 'report/compare', {params: params}).subscribe((res: any) => { |
| | | this.option.xAxis.data = res.data.times; |
| | | this.option.series[0].data = res.data.datas[0]['e1']; |
| | | this.option.series[1].data = res.data.datas[1]['e1']; |
| | | PM25.setOption(this.option, false); |
| | | const PM25Option = $.extend(true, |
| | | {
|
| | | xAxis: {data: res.data.times}, |
| | | series: [ |
| | | {data: res.data.datas[0]['e1']}, |
| | | {data: res.data.datas[1]['e1']} |
| | | ]
|
| | | }, |
| | | this.option); |
| | | PM25.setOption(PM25Option, false); |
| | | window.onresize = PM25.resize; |
| | | PM25.hideLoading(); |
| | | }); |