import { Component, OnInit } from '@angular/core';
import {Api} from '../../service/api';
import {NavController} from '@ionic/angular';

@Component({
  selector: 'v-env-alarm',
  templateUrl: './env-alarm.page.html',
  styleUrls: ['./env-alarm.page.scss'],
})
export class EnvAlarmPage implements OnInit {

  alarm = [{
      farm: '1号牛舍',
      devErr: 36,
      devErrTotal:136,
      alarm:21,
      alarmTotal:121
  },{
      farm: '2号牛舍',
      devErr: 1,
      devErrTotal:11,
      alarm:0,
      alarmTotal:10
  },{
      farm: '3号牛舍',
      devErr: 2,
      devErrTotal:12,
      alarm:3,
      alarmTotal:13
  },];

  constructor(private api: Api,public nav: NavController) { }

  ngOnInit() {
  }

    toControl(one){
        const query = '/env-alarmDetail?name=' + one.farm;
        // this.tf.transfer({
        //     url: '/' + one.url,
        //     query: query,
        //     hash: ''
        // });
        console.log(query);
        this.nav.navigateForward(query);
    }
}
