Newer
Older
import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core';
import {AlarmService} from '../alarm.service';
import {pageSize} from '../../app.constants';
import {WarnListComponent} from '../../modal/warn-list/warn-list.component';
import {OverAllService} from '../../overAll/overAll.service';
import {NzMessageService} from 'ng-zorro-antd';
selector: 'smart-alarm-list',
templateUrl: './alarm-list.component.html',
border: 1px solid #ccc;
margin-right: 10px;
display: inline-block;
margin-bottom: 10px;
padding: 2px 4px;
border-radius: 4px;
}
priorityName: null,
groupid: null,
equipmentType: null,
startTime: '',
endTime: '',
name: ''
constructor(public alarmSer: AlarmService, public overAllSer: OverAllService, public message: NzMessageService,
public datePipe: DatePipe) {
let day1, day2;
switch (this.timeType) {
case'1': {
this.obj.startTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59';
break;
case'2': {
day1 = nowDate - 1 * 24 * 60 * 60 * 1000;
this.obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 23:59:59';
case'3': {
day1 = nowDate - 3 * 24 * 60 * 60 * 1000;
day2 = nowDate - 1 * 24 * 60 * 60 * 1000;
this.obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(day2, 'yyyy-MM-dd') + ' 23:59:59';
case'4': {
day1 = nowDate - 7 * 24 * 60 * 60 * 1000;
day2 = nowDate - 1 * 24 * 60 * 60 * 1000;
this.obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(day2, 'yyyy-MM-dd') + ' 23:59:59';
if(this.timeType == "5"){
this.obj.startTime = this.datePipe.transform(this.dateBegin, 'yyyy-MM-dd HH:mm:ss');
this.obj.endTime = this.datePipe.transform(this.dateEnd, 'yyyy-MM-dd HH:mm:ss');
}