Commit 9fc847fa authored by wangqinghua's avatar wangqinghua

update

parent 72775e8f
<nz-modal [nzWidth]="880" [(nzVisible)]="isVisible" nzTitle="{{title}}" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"> <nz-modal [nzWidth]="880" [(nzVisible)]="isVisible" [nzTitle]="title" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()" [nzOkLoading]="isOkLoading">
<form nz-form [formGroup]="validateForm"> <form nz-form [formGroup]="validateForm">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="description">名称</nz-form-label> <nz-form-label [nzSpan]="7" nzRequired nzFor="description">名称</nz-form-label>
......
...@@ -11,6 +11,7 @@ import {NzMessageService} from 'ng-zorro-antd'; ...@@ -11,6 +11,7 @@ import {NzMessageService} from 'ng-zorro-antd';
export class MediaTypeComponent implements OnInit { export class MediaTypeComponent implements OnInit {
@Output() done = new EventEmitter<any>(); @Output() done = new EventEmitter<any>();
isVisible = false; isVisible = false;
isOkLoading = false;
title; title;
validateForm: FormGroup; validateForm: FormGroup;
...@@ -128,6 +129,7 @@ export class MediaTypeComponent implements OnInit { ...@@ -128,6 +129,7 @@ export class MediaTypeComponent implements OnInit {
return false; return false;
} }
this.isOkLoading = true;
if (this.title == '新增发送方式') { if (this.title == '新增发送方式') {
this.create(); this.create();
} }
...@@ -148,6 +150,7 @@ export class MediaTypeComponent implements OnInit { ...@@ -148,6 +150,7 @@ export class MediaTypeComponent implements OnInit {
}else{ }else{
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
this.isOkLoading = false;
} }
); );
} }
...@@ -161,7 +164,10 @@ export class MediaTypeComponent implements OnInit { ...@@ -161,7 +164,10 @@ export class MediaTypeComponent implements OnInit {
this.initForm(); this.initForm();
this.message.info('修改成功'); this.message.info('修改成功');
this.done.emit(); this.done.emit();
}else{
this.message.error(res.errMsg);
} }
this.isOkLoading = false;
} }
); );
} }
......
<nz-modal [(nzVisible)]="isCreate" nzTitle="{{title}}" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"> <nz-modal [(nzVisible)]="isCreate" nzTitle="{{title}}" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()" [nzOkLoading]="isOkLoading">
<form nz-form [formGroup]="validateForm"> <form nz-form [formGroup]="validateForm">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="name">组名称</nz-form-label> <nz-form-label [nzSpan]="7" nzRequired nzFor="name">组名称</nz-form-label>
......
...@@ -22,6 +22,7 @@ export class CreateGroupComponent implements OnInit { ...@@ -22,6 +22,7 @@ export class CreateGroupComponent implements OnInit {
title; title;
isCreate = false; isCreate = false;
isOkLoading = false;
validateForm: FormGroup; validateForm: FormGroup;
groupid; groupid;
...@@ -54,6 +55,7 @@ export class CreateGroupComponent implements OnInit { ...@@ -54,6 +55,7 @@ export class CreateGroupComponent implements OnInit {
if(this.validateForm.invalid){ if(this.validateForm.invalid){
return false; return false;
} }
this.isOkLoading = true;
if(this.title == '添加分组' || this.title == '添加模版组'){ if(this.title == '添加分组' || this.title == '添加模版组'){
this.create(); this.create();
...@@ -73,6 +75,7 @@ export class CreateGroupComponent implements OnInit { ...@@ -73,6 +75,7 @@ export class CreateGroupComponent implements OnInit {
} else { } else {
this.message.info(res.errMsg); this.message.info(res.errMsg);
} }
this.isOkLoading = false;
} }
); );
} }
...@@ -93,6 +96,7 @@ export class CreateGroupComponent implements OnInit { ...@@ -93,6 +96,7 @@ export class CreateGroupComponent implements OnInit {
} else { } else {
this.message.info(res.errMsg); this.message.info(res.errMsg);
} }
this.isOkLoading = false;
} }
); );
} }
......
<nz-modal [nzWidth]="880" [(nzVisible)]="isVisiable" [nzTitle]="title" (nzOnCancel)="handleCheckCancel()" <nz-modal [nzWidth]="880" [(nzVisible)]="isVisiable" [nzTitle]="title" (nzOnCancel)="handleCheckCancel()"
(nzOnOk)="handleCheckOk()"> (nzOnOk)="handleCheckOk()" [nzOkLoading]="isOkLoading">
<form [formGroup]="validateForm" nz-form> <form [formGroup]="validateForm" nz-form>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired nzFor="checkName">名称</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired nzFor="checkName">名称</nz-form-label>
......
...@@ -17,6 +17,7 @@ export class DiscoveryComponent implements OnInit { ...@@ -17,6 +17,7 @@ export class DiscoveryComponent implements OnInit {
title; title;
isVisiable = false; isVisiable = false;
isOkLoading = false;
nzSize = 'large'; nzSize = 'large';
hostId; //主机ID hostId; //主机ID
itemId; //监控项id itemId; //监控项id
...@@ -87,7 +88,8 @@ export class DiscoveryComponent implements OnInit { ...@@ -87,7 +88,8 @@ export class DiscoveryComponent implements OnInit {
this.validateForm.patchValue({ this.validateForm.patchValue({
status:d, status:d,
hostid:this.hostId hostid:this.hostId
}) });
this.isOkLoading = true;
if (this.title == '添加自动发现') { if (this.title == '添加自动发现') {
this.create(); this.create();
} }
...@@ -106,6 +108,7 @@ export class DiscoveryComponent implements OnInit { ...@@ -106,6 +108,7 @@ export class DiscoveryComponent implements OnInit {
} else { } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
this.isOkLoading = false;
}, },
(err) => { (err) => {
this.message.error('系统错误'); this.message.error('系统错误');
...@@ -125,6 +128,7 @@ export class DiscoveryComponent implements OnInit { ...@@ -125,6 +128,7 @@ export class DiscoveryComponent implements OnInit {
} else { } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
this.isOkLoading = false;
}, },
(err) => { (err) => {
this.message.error('系统错误'); this.message.error('系统错误');
......
<nz-modal [(nzVisible)]="isVisible" [nzTitle]="title" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"> <nz-modal [(nzVisible)]="isVisible" [nzTitle]="title" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()" [nzOkLoading]="isOkLoading">
<form nz-form [formGroup]="validateForm"> <form nz-form [formGroup]="validateForm">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="oldPassword">旧密码</nz-form-label> <nz-form-label [nzSpan]="7" nzRequired nzFor="oldPassword">旧密码</nz-form-label>
......
...@@ -13,6 +13,7 @@ import {LoginService} from '../../shared'; ...@@ -13,6 +13,7 @@ import {LoginService} from '../../shared';
export class ModifyPasswordComponent implements OnInit { export class ModifyPasswordComponent implements OnInit {
isVisible = false; isVisible = false;
isOkLoading = false;
title = '修改密码'; title = '修改密码';
validateForm: FormGroup; validateForm: FormGroup;
...@@ -41,6 +42,7 @@ export class ModifyPasswordComponent implements OnInit { ...@@ -41,6 +42,7 @@ export class ModifyPasswordComponent implements OnInit {
this.message.error("两次输入密码不一致"); this.message.error("两次输入密码不一致");
return false; return false;
} }
this.isOkLoading = true;
this.update(); this.update();
} }
...@@ -58,6 +60,7 @@ export class ModifyPasswordComponent implements OnInit { ...@@ -58,6 +60,7 @@ export class ModifyPasswordComponent implements OnInit {
} else { } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
this.isOkLoading = false;
} }
); );
} }
......
<nz-modal [(nzVisible)]="isNew" nzTitle="{{modalTitle}}" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"> <nz-modal [(nzVisible)]="isNew" nzTitle="{{modalTitle}}" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()" [nzOkLoading]="isOkLoading">
<form nz-form> <form nz-form>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="name">名称</nz-form-label> <nz-form-label [nzSpan]="7" nzRequired nzFor="name">名称</nz-form-label>
......
...@@ -12,6 +12,7 @@ import { Component, OnInit, EventEmitter, Output } from '@angular/core'; ...@@ -12,6 +12,7 @@ import { Component, OnInit, EventEmitter, Output } from '@angular/core';
export class NewTypeComponent implements OnInit { export class NewTypeComponent implements OnInit {
@Output() data = new EventEmitter<any>(); @Output() data = new EventEmitter<any>();
isNew = false; isNew = false;
isOkLoading = false;
modalTitle; modalTitle;
name; //名称 name; //名称
modalMsg = false; //message modalMsg = false; //message
......
<nz-modal [(nzVisible)]="isShow" nzTitle="{{modalTitle}}" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"> <nz-modal [(nzVisible)]="isShow" nzTitle="{{modalTitle}}" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()" [nzOkLoading]="isOkLoading">
<form nz-form> <form nz-form>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="startTime">开始时间</nz-form-label> <nz-form-label [nzSpan]="7" nzRequired nzFor="startTime">开始时间</nz-form-label>
......
...@@ -14,6 +14,7 @@ export class PauseComponent implements OnInit { ...@@ -14,6 +14,7 @@ export class PauseComponent implements OnInit {
modalTitle = '临时暂停(服务器时间)'; modalTitle = '临时暂停(服务器时间)';
typeTitle; typeTitle;
isShow = false; isShow = false;
isOkLoading = false;
data = { data = {
startTime: null, startTime: null,
time: '' time: ''
...@@ -44,6 +45,7 @@ export class PauseComponent implements OnInit { ...@@ -44,6 +45,7 @@ export class PauseComponent implements OnInit {
} }
handleOk() { handleOk() {
this.isOkLoading = true;
if(this.typeTitle == '基础资源'){ if(this.typeTitle == '基础资源'){
this.basic(); this.basic();
} }
...@@ -68,6 +70,7 @@ export class PauseComponent implements OnInit { ...@@ -68,6 +70,7 @@ export class PauseComponent implements OnInit {
}else{ }else{
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
this.isOkLoading = false;
} }
); );
} }
...@@ -83,8 +86,11 @@ export class PauseComponent implements OnInit { ...@@ -83,8 +86,11 @@ export class PauseComponent implements OnInit {
if(res.errCode == 10000){ if(res.errCode == 10000){
this.isShow = false; this.isShow = false;
this.done.emit(); this.done.emit();
this.message.success("临时暂停成功");
}else{
this.message.error(res.errMsg);
} }
this.message.info(res.errMsg); this.isOkLoading = false;
} }
); );
} }
......
<section> <nz-modal [nzWidth]="880" [(nzVisible)]="isVisiable" [nzTitle]="title" [nzOkLoading]="isOkLoading"
<nz-modal [nzWidth]="880" [(nzVisible)]="isVisiable" [nzTitle]="title" (nzOnCancel)="handleCheckCancel()" (nzOnOk)="saveTrigger()">
(nzOnCancel)="handleCheckCancel()"
(nzOnOk)="saveTrigger()">
<nz-form-item nzFlex> <nz-form-item nzFlex>
<nz-form-control [nzOffset]="4" [nzSpan]="14"> <nz-form-control [nzOffset]="4" [nzSpan]="14">
<nz-radio-group [(ngModel)]="conditionType"> <nz-radio-group [(ngModel)]="conditionType">
...@@ -43,7 +41,8 @@ ...@@ -43,7 +41,8 @@
</nz-form-control> </nz-form-control>
<nz-form-control nz-col [nzSpan]="2"> <nz-form-control nz-col [nzSpan]="2">
<button nz-button nzType="primary" (click)="deleteCondition(i)"><i style="color: #fff" <button nz-button nzType="primary" (click)="deleteCondition(i)"><i style="color: #fff"
class="anticon anticon-close-circle-o"></i></button> class="anticon anticon-close-circle-o"></i>
</button>
</nz-form-control> </nz-form-control>
</div> </div>
</nz-form-control> </nz-form-control>
...@@ -80,7 +79,8 @@ ...@@ -80,7 +79,8 @@
</nz-form-control> </nz-form-control>
<nz-form-control nz-col [nzSpan]="2"> <nz-form-control nz-col [nzSpan]="2">
<button nz-button nzType="primary" (click)="deleteFault(i)"><i style="color: #fff" <button nz-button nzType="primary" (click)="deleteFault(i)"><i style="color: #fff"
class="anticon anticon-close-circle-o"></i></button> class="anticon anticon-close-circle-o"></i>
</button>
</nz-form-control> </nz-form-control>
</div> </div>
</nz-form-control> </nz-form-control>
...@@ -96,7 +96,6 @@ ...@@ -96,7 +96,6 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</ng-container> </ng-container>
</nz-modal> </nz-modal>
</section>
...@@ -12,6 +12,7 @@ export class ThresholdComponent implements OnInit { ...@@ -12,6 +12,7 @@ export class ThresholdComponent implements OnInit {
@Output() done = new EventEmitter<any>(); @Output() done = new EventEmitter<any>();
isVisiable = false; isVisiable = false;
isOkLoading = false;
title; title;
itemId; //监控项ID itemId; //监控项ID
hostName; //主机name hostName; //主机name
...@@ -179,6 +180,8 @@ export class ThresholdComponent implements OnInit { ...@@ -179,6 +180,8 @@ export class ThresholdComponent implements OnInit {
return false; return false;
} }
this.isOkLoading = true;
if (this.title == '添加阈值') { if (this.title == '添加阈值') {
if (this.conditionList.length == 0 && this.faultConditionList.length == 0) { if (this.conditionList.length == 0 && this.faultConditionList.length == 0) {
this.isVisiable = false; this.isVisiable = false;
...@@ -229,6 +232,7 @@ export class ThresholdComponent implements OnInit { ...@@ -229,6 +232,7 @@ export class ThresholdComponent implements OnInit {
} else { } else {
this.message.error(response.errMsg); this.message.error(response.errMsg);
} }
this.isOkLoading = false;
} }
); );
} }
...@@ -256,6 +260,7 @@ export class ThresholdComponent implements OnInit { ...@@ -256,6 +260,7 @@ export class ThresholdComponent implements OnInit {
} else { } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
this.isOkLoading = 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