From 37942aefeb8986a97c0310a9fe3fe2d613519dab Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Tue, 31 Jul 2018 14:47:41 +0800 Subject: [PATCH] 风速单位调整 --- src/app/routes/statistics/calendar/calendar.component.ts | 52 +++++++++++++++++++++++++++------------------------- 1 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/app/routes/statistics/calendar/calendar.component.ts b/src/app/routes/statistics/calendar/calendar.component.ts index 77ed98b..09e03c1 100644 --- a/src/app/routes/statistics/calendar/calendar.component.ts +++ b/src/app/routes/statistics/calendar/calendar.component.ts @@ -14,7 +14,13 @@ export class CalendarComponent implements OnInit, OnDestroy { data: any = {}; - + public calendarDayCells:{ + [key : string] : { + 'status': string, + 'statusName': string, + 'data': {} + } + } = {}; constructor( private deviceService: DeviceService, private http: _HttpClient, @@ -23,34 +29,30 @@ } 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 day = Number(moment().format('DD')); + for(let index = 1;index <= day; index++) { + this.calendarDayCells[('0'+index).slice(-2)] = { + status: 'processing', + statusName: '���������', + data: {} + } } - - this.data = { - searchData: searchData - }; + // console.log(this.calendarDayCells); } ngOnDestroy(): void { } - - sort(sortName, sortValue) { - this.data.searchData = [ - ...(<any[]>this.data.searchData).sort((a, b) => { - if (a[sortName] > b[sortName]) { - return (sortValue === 'ascend') ? 1 : -1; - } else if (a[sortName] < b[sortName]) { - return (sortValue === 'ascend') ? -1 : 1; - } else { - return 0; - } - }) - ]; + // ��������������� ��������� + 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); } } -- Gitblit v1.8.0