New file |
| | |
| | | import { Component, OnInit, OnDestroy } from '@angular/core'; |
| | | import { NzMessageService } from 'ng-zorro-antd'; |
| | | import { _HttpClient } from '@delon/theme'; |
| | | import { HttpClient } from '@angular/common/http'; |
| | | import * as moment from 'moment'; |
| | | import { DeviceService } from '@business/services/http/device.service'; |
| | | |
| | | @Component({ |
| | | selector: 'environment-management', |
| | | templateUrl: './management.component.html', |
| | | styleUrls: ['./management.component.less'], |
| | | providers: [DeviceService] |
| | | }) |
| | | export class EnvironmentManagementComponent implements OnInit, OnDestroy { |
| | | |
| | | offlineChartData: any[] = []; |
| | | |
| | | constructor( |
| | | private deviceService: DeviceService, |
| | | private http: _HttpClient, |
| | | public msg: NzMessageService, |
| | | private http2: HttpClient) { |
| | | } |
| | | |
| | | ngOnInit() { |
| | | const searchData = []; |
| | | for (let i = 0; i < 50; i += 1) { |
| | | searchData.push({ |
| | | index: i + 1, |
| | | point: `监测站点-${i}`, |
| | | value: Math.floor(Math.random() * 100) |
| | | }); |
| | | } |
| | | |
| | | const offlineChartData = []; |
| | | for (let i = 0; i < 20; i += 1) { |
| | | offlineChartData.push({ |
| | | x: new Date().getTime() + 1000 * 60 * 30 * i, |
| | | y1: Math.floor(Math.random() * 100) + 10, |
| | | y2: Math.floor(Math.random() * 100) + 10 |
| | | }); |
| | | } |
| | | this.offlineChartData = offlineChartData; |
| | | } |
| | | |
| | | ngOnDestroy(): void { |
| | | } |
| | | } |