fengxiang
2018-08-02 c69ddde7828d777f04c6468c269aaa0aa03d72c9
src/app/routes/environment/management/management.component.ts
@@ -1,4 +1,4 @@
import { environment } from '../../../../environments/environment';
import { environment } from '@env/environment';
import { Component, OnInit, OnDestroy, AfterViewInit } from '@angular/core';
import { NzMessageService } from 'ng-zorro-antd';
import { _HttpClient } from '@delon/theme';
@@ -58,22 +58,22 @@
    ngAfterViewInit() {
      const PM25 = echarts.init(document.getElementById('PM25'));
      PM25.showLoading();
      const params = {
      const params = {
        type: 'month',
        sensors: JSON.stringify(['e1']),
        items: JSON.stringify([
          {areaCode: 320583, formatTime: moment().format('YYYY-MM')},
          {areaCode: 320583, formatTime: moment().subtract(1, 'M').format('YYYY-MM')}
        ])
        ])
      };
      this.http2.get(environment.SERVER_BASH_URL + 'report/compare', {params: params}).subscribe((res: any) => {
        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);