Newer
Older
import {Component, OnInit, ViewChild, ElementRef, OnDestroy} from '@angular/core';
import {AlarmService} from '../alarm.service';
import {NzMessageService} from 'ng-zorro-antd';
import {SendLogComponent} from '../modal/send-log/send-log.component';
import {WarnListComponent} from '../../modal/warn-list/warn-list.component';
import {CommonService} from '../../shared/common/common.service';
import {WorkService} from '../../work/work.service';
selector: 'smart-now-alarm',
templateUrl: './now-alarm.component.html',
styles: [
`
.tag-warn{
padding: 5px;
}
.tag-warn span{
border: 1px solid #ccc;
margin-right: 10px;
display: inline-block;
margin-bottom: 10px;
padding: 2px 4px;
border-radius: 4px;
}
.tag-warn span.select-border {
border: 1px solid #1626e2;
border-radius: 5px;
padding: 2px;
margin-right: 5px;
}
@ViewChild('sendLog') sendLog: SendLogComponent;
@ViewChild('warnList') warnList: WarnListComponent;
loading = false;
pageCount = pageSize;
pageNum = 1;
totalNum;
constructor(public alarmSer: AlarmService, public message: NzMessageService, private workSer: WorkService,
public overAllSer: OverAllService, private commonSer: CommonService) {
this.search();
this.time_ = setInterval(() => {
this.search();
}, 2 * 60 * 1000);
(res) => {
if (res.errCode == 10000) {
this.workSer.downloadTemplate('alarm', res.data).subscribe(
(data) => {
this.message.error(res.errMsg);
}
this.isDownload = false;
}