Commit 202c661b authored by wangqinghua's avatar wangqinghua

告警模块

parent b67de964
<nz-modal [(nzVisible)]="isShow" nzTitle="{{modalTitle}}" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
<form nz-form>
<nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="startTime">开始时间</nz-form-label>
<nz-form-control [nzSpan]="12">
<nz-date-picker nzShowTime name="startTime" [(ngModel)]="data.startTime" nzFormat="yyyy-MM-dd HH:mm:ss"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="time">禁止时长</nz-form-label>
<nz-form-control [nzSpan]="12">
<input style="width: 60%;margin-right: 10px" type="text" nz-input name="time" [(ngModel)]="data.time">分钟
</nz-form-control>
</nz-form-item>
</form>
</nz-modal>
import {Component, OnInit} from '@angular/core';
import {OverAllService} from '../../overAll/overAll.service';
import { DatePipe } from '@angular/common';
@Component({
selector: 'smart-pause',
templateUrl: './pause.component.html',
styles: []
})
export class PauseComponent implements OnInit {
modalTitle = '临时暂停(服务器时间)';
isShow = false;
data = {
startTime: null,
time: ''
};
hostId; //主机id
constructor(public overAllSer: OverAllService,public datePipe:DatePipe) {
}
ngOnInit() {
}
showModal(id) {
this.hostId = id;
this.isShow = true;
}
handleCancel() {
this.isShow = false;
}
handleOk() {
const params = this.hostId;
const data = {
startTime: this.datePipe.transform(this.data.startTime,'yyyy-MM-dd HH:MM:ss'),
time: Number(this.data.time)
};
this.overAllSer.tempStop(params, data).subscribe(
(res) => {
// this.isShow = false;
}
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment