Commit 6807e8a9 authored by wangqinghua's avatar wangqinghua

update

parent 118d86a8
......@@ -64,7 +64,7 @@
<td>发送对象</td>
<td>生成事件</td>
<td class="handle text-center">
<span (click)="editSend()">编辑</span>
<span (click)="showEditModal(data)">编辑</span>
<span (click)="deleteAlarm(data)">删除</span>
<span *ngIf="data.status == 1" (click)="changeStatus('启用','0',data)">启用</span>
<span *ngIf="data.status == 0" (click)="changeStatus('暂停','1',data)">暂停</span>
......
......@@ -114,7 +114,12 @@ export class AlarmSetComponent implements OnInit {
//新增告警推送
showAlarmModal() {
this.smartAlarmModal.showModal(null);
this.smartAlarmModal.showAddModal("添加告警");
}
//编辑告警推送
showEditModal(item){
this.smartAlarmModal.showEditModal("添加告警",item.id);
}
//启用或暂停告警组
......
<!--添加资源-->
<nz-modal [nzWidth]="1080" [nzFooter]="null" [(nzVisible)]="isShow" nzTitle="{{modalTitle}}"
<nz-modal [nzWidth]="1080" [nzFooter]="null" [(nzVisible)]="isShow" [nzTitle]="title"
(nzOnCancel)="handleEditCancel()" (nzOnOk)="handEditleOk()">
<nz-tabset [nzSelectedIndex]="tabNum" style="padding-bottom: 25px;min-height: 500px">
<nz-tab nzTitle="选定告警目标">
......@@ -205,10 +205,11 @@
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">恢复信息</nz-form-label>
<nz-form-control [nzSpan]="14">
<label nz-checkbox></label>
<label nz-checkbox [(ngModel)]="selectModal"></label>
</nz-form-control>
</nz-form-item>
<ng-container *ngIf="selectModal">
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">恢复主题</nz-form-label>
<nz-form-control [nzSpan]="14">
......@@ -222,6 +223,7 @@
<textarea nz-input nzPlaceholder="恢复信息" [nzAutosize]="{ minRows: 4, maxRows: 4 }" [(ngModel)]="validateForm.r_shortdata"></textarea>
</nz-form-control>
</nz-form-item>
</ng-container>
</div>
<div class="modal-footer-btn">
<button nz-button (click)="handleEditCancel()" nzType="primary">取消</button>
......
......@@ -23,11 +23,12 @@ export class AlarmModalComponent implements OnInit {
@ViewChild('nzTree') nzTree: NzTreeComponent;
@Output() done = new EventEmitter<any>();
modalTitle = '添加告警';
title;
tabNum = 0;
isShow = false;
nodes;
nodeList;
alarmId; //告警Id
groupList;
sendOption = [];
......@@ -36,6 +37,8 @@ export class AlarmModalComponent implements OnInit {
selectTreeList = [];
validateForm;
selectModal = false;
sendInfo; //f发送方式
constructor(private alarmSer: AlarmService, private message: NzMessageService,
private overAllSer: OverAllService) {
}
......@@ -60,7 +63,7 @@ export class AlarmModalComponent implements OnInit {
def_longdata:null,
r_longdata:null,
r_shortdata:null,
userIds:null,
sendInfos:null,
};
}
......@@ -170,11 +173,19 @@ export class AlarmModalComponent implements OnInit {
);
}
showModal(data) {
showAddModal(title) {
this.title = title;
this.isShow = true;
}
showEditModal(title,id) {
this.title = title;
this.isShow = true;
this.alarmId = id;
}
handleEditCancel() {
this.initForm();
this.isShow = false;
}
......@@ -183,24 +194,25 @@ export class AlarmModalComponent implements OnInit {
}
handEditleOk() {
if(this.title == '添加告警'){
this.create()
}
if(this.title == "编辑告警"){
this.update();
}
}
//创建
create(){
const optionArr = [];
this.sendOption.forEach(res=>{
if(res.checked){
optionArr.push(res.value);
}
});
if(this.validateForm.warn){
this.validateForm.warn = 1;
}else{
this.validateForm.warn = 0
}
if(this.validateForm.serious){
this.validateForm.serious = 1;
}else{
this.validateForm.serious = 0
}
this.validateForm.warn = this.validateForm.warn == true ? 1:0;
this.validateForm.serious = this.validateForm.serious == true?1:0;
const data = {
name: this.validateForm.name,
alertGroupId: this.validateForm.alertGroupId,
......@@ -224,4 +236,7 @@ export class AlarmModalComponent implements OnInit {
);
}
//修改
update(){}
}
......@@ -96,8 +96,8 @@
<nz-form-label [nzSpan]="6" nzFor="itemtype">监测点分类</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select style="width: 80%;display: inline-block" nzPlaceHolder="选择监测点分类" name="itemtype" [nzSize]="nzSize" nzMode="tags" formControlName="applications">
<nz-option *ngFor="let item of checkList" nzValue="{{item.applicationid}}"
nzLabel="{{item.name}}"></nz-option>
<nz-option *ngFor="let item of checkList" [nzValue]="item.applicationid"
[nzLabel]="item.name"></nz-option>
</nz-select>
<button nz-button nzType="primary" (click)="showTypeModal()">新建分类</button>
</nz-form-control>
......
......@@ -136,6 +136,9 @@ export class BasiCheckComponent implements OnInit {
data.type += '';
data.interfaceid += '';
data.value_type += '';
data.applications = data.applications.map(e=>{
return e.applicationid;
});
this.validateForm.patchValue(data);
data.triggers.forEach((value) => {
......
......@@ -374,8 +374,8 @@ export class BasicComponent implements OnInit {
}
//添加告警
showAlarm(item){
this.smartAlarmModal.showModal(item);
showAlarm(){
this.smartAlarmModal.showAddModal('添加告警');
}
handleOk(e) {
......
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