import { Component , ViewChild , ElementRef , Input } from '@angular/core' ; import { NavController } from '@ionic/angular' ; import { deviceName12 } from 'src/app/core/functions/func' ; import { ViewService } from 'src/app/core/services/view.service' ; import { ActivatedRoute } from '@angular/router' ; import { DeviceService } from 'src/app/core/services/device.service' ; import { DataService } from 'src/app/core/services/data.service' ; import { DeviceComponent } from 'src/app/core/model/device.model' ; @ Component ( { selector : 'own-airstation-dashboard' , templateUrl : 'own-airstation-dashboard.html' , styleUrls : [ 'own-airstation-dashboard.scss' ] } ) export class OwnAirStationDashboard implements DeviceComponent { id ; device ; get geolocation ( ) { return this . device . config . position . address ; } dataList1 = [ { name : '温度' , unit : '℃' , key : 'temp' } , { name : '湿度' , unit : '%' , key : 'humi' } , { name : '气压' , unit : 'hPa' , key : 'pressure' } , { name : '风速' , unit : 'm/s' , key : 'speed' } , { name : '风向' , unit : '' , key : 'direction' } , { name : '光照' , unit : 'lx' , key : 'lux' } ] ; dataList2 = [ { name : 'SO₂(二氧化硫)' , unit : 'ug/m³' , icon : 'so2.svg' , key : 'so2' } , { name : 'NO₂(二氧化氮)' , unit : 'ug/m³' , icon : 'no2.svg' , key : 'no2' } , { name : 'CO(一氧化碳)' , unit : 'mg/m³' , icon : 'co.svg' , key : 'co' } , { name : 'O₃(臭氧)' , unit : 'ug/m³' , icon : 'o3.svg' , key : 'o3' } , { name : 'PM10' , unit : 'ug/m³' , icon : 'pm10.svg' , key : 'pm10' } , { name : 'PM2.5' , unit : 'ug/m³' , icon : 'pm2_5.svg' , key : 'pm2_5' } , ] ; @ ViewChild ( 'chart' , { read : ElementRef , static : true } ) chart : ElementRef ; constructor ( private activatedRoute , private navCtrl , private viewService , private deviceService , private dataService ) { } ngOnInit ( ) { this . id = this . activatedRoute . snapshot . params [ 'id' ] ; this . device = this . dataService . device . dict [ this . id ] ; } ngAfterViewInit ( ) { this . viewService . setDarkStatusBar ( ) ; this . initChart ( ) ; } initChart ( ) { } changeToday ( ) { } change48Hour ( ) { } changeWeek ( ) { } changeYear ( ) { } changeMonth ( ) { } }