xufenglei
2018-07-24 fd35962de838e033a8964e0959c99572f02b15f0
src/app/routes/reports/query2/query2.component.ts
@@ -210,13 +210,25 @@
    ) { }
  
  _dataSet = [];
    sensorKey = 'e1';
    loading = false;
    sensorData = {};
    
    changeSensorKey(sensorKey) {
      this._dataSet = [];
      if (!!this.sensorData[sensorKey]) {
        this._dataSet = this.sensorData[sensorKey];
      } else {
        this.loading = true;
      const params = {sensorKey: sensorKey, dimension: 'monitorPoint', regionCode: '320583', accountId: '1', timeType: 'month'};
      this.http2.get(environment.SERVER_BASH_URL + 'screen/region_ranking_data', {params: params}).subscribe((res: any) => {
        this._dataSet = res.data;
          this._dataSet = this.sensorData[sensorKey] = res.data;
          this.loading = false;
      });
    }
    }
      sort(sortName, sortValue) {
        this._dataSet = [
            ...(<any[]>this._dataSet).sort((a, b) => {
@@ -232,7 +244,7 @@
    }
    ngOnInit() {
      this.changeSensorKey('e1');
      this.changeSensorKey(this.sensorKey);
//        const searchData = [];
//        for (let i = 0; i < 50; i += 1) {
//            searchData.push({