| | |
| | | import { Component, OnInit } from '@angular/core';
|
| | | import { _HttpClient } from '@delon/theme';
|
| | | import {environment} from '../../../../environments/environment';
|
| | | import {Component, OnInit} from '@angular/core';
|
| | | import {HttpClient} from '@angular/common/http';
|
| | | import {zip} from 'rxjs/observable/zip';
|
| | |
|
| | | @Component({
|
| | | selector: 'app-real-time',
|
| | |
| | | })
|
| | | export class RealTimeComponent implements OnInit {
|
| | |
|
| | | constructor(
|
| | | private http: _HttpClient
|
| | | ) { }
|
| | | public monitorPointOptions = [];
|
| | | public avgs = {};
|
| | | public levels = [35, 115, 200];
|
| | | public devices = [];
|
| | | constructor(
|
| | | private http: HttpClient
|
| | | ) {}
|
| | |
|
| | | ngOnInit() {
|
| | | }
|
| | | ngOnInit() {
|
| | | this.http.get(environment.SERVER_BASH_URL + 'monitor-point/list/region', {params: {name: 'areaCode', value: '320583'}}).subscribe((res: any) => {
|
| | | this.monitorPointOptions = res.data;
|
| | | });
|
| | | }
|
| | |
|
| | | monitorPointChange(id) {
|
| | | this.avgs = {};
|
| | | this.devices = [];
|
| | | zip(
|
| | | this.http.get(environment.SERVER_BASH_URL + 'demo/avg', {params: {monitorPointId: id}}),
|
| | | this.http.get(environment.SERVER_BASH_URL + 'device/professionId', {params: {monitorPointId: id}})
|
| | | ).subscribe(
|
| | | ([avgs, devices]) => {
|
| | | if (!!avgs) {
|
| | | this.avgs = avgs;
|
| | | }
|
| | | if (!!devices['data']) {
|
| | | this.devices = devices['data'];
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|