| 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: 'statistics-calender', | 
|     templateUrl: './calendar.component.html', | 
|     styleUrls: ['./calendar.component.less'], | 
|     providers: [DeviceService] | 
| }) | 
| export class CalendarComponent implements OnInit, OnDestroy { | 
|   | 
|     data: any = {}; | 
|     public calendarDayCells:{ | 
|        [key : string] : { | 
|          'status': string, | 
|          'statusName': string, | 
|          'data': {} | 
|        } | 
|     } = {}; | 
|     constructor( | 
|         private deviceService: DeviceService, | 
|         private http: _HttpClient, | 
|         public msg: NzMessageService, | 
|         private http2: HttpClient) { | 
|     } | 
|   | 
|     ngOnInit() { | 
|         const day = Number(moment().format('DD')); | 
|         for(let index = 1;index <= day; index++) { | 
|             this.calendarDayCells[('0'+index).slice(-2)] = { | 
|                 status: 'processing', | 
|                 statusName: '加载中', | 
|                 data: {} | 
|             } | 
|         } | 
|         // console.log(this.calendarDayCells); | 
|     } | 
|   | 
|     ngOnDestroy(): void { | 
|     } | 
|     // 日历单元格 被点击 | 
|     calendarClick(mo: moment.Moment) { | 
|         console.log(mo.format('DD')); | 
|     } | 
|     public isExpire(mo: moment.Moment):boolean { | 
|         //  console.log(moment().valueOf()); | 
|         //  console.log(mo.valueOf()); | 
|         //  console.log(moment().valueOf() < mo.valueOf()); | 
|          return moment().valueOf() < mo.valueOf(); | 
|     } | 
|     loadCalendar(event) { | 
|         console.log(event); | 
|     } | 
| } |