xufenglei
2018-08-03 ba26f3f66151ee19b0230c38fdbb989886e84c8c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import {environment} from '../../../../environments/environment';
import {HttpClient} from '@angular/common/http';
import {Component, OnInit} from '@angular/core';
import * as moment from 'moment';
 
@Component({
  selector: 'app-image-grabbing',
  templateUrl: './image-grabbing.component.html',
})
export class ImageGrabbingComponent implements OnInit {
 
  [x: string]: any;
  
  constructor(
    private http: HttpClient
  ) {}
 
  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.device = null;
    this.times = null;
    this.http.get(environment.SERVER_BASH_URL + 'device/professionId', {params: {monitorPointId: id}}).subscribe((res: any) => {
      this.deviceOptions = res.data;
    });
  }
 
  deviceChange(id) {
    const format = 'DD日HH时';
    this.base = id % 10 % 5;
    this.times = [moment().subtract(2, 'h').format(format), moment().subtract(1, 'h').format(format), moment().format(format)];
  }
}