Commit 6807e8a9 authored by wangqinghua's avatar wangqinghua

update

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