Commit 4ac7c507 authored by wangqinghua's avatar wangqinghua

update

parent f8da9b2d
......@@ -256,7 +256,7 @@
</ng-container>
<div class="modal-footer-btn">
<button nz-button (click)="handEditleOk()" nzType="primary">完成</button>
<button nz-button (click)="saveTrigger()" nzType="primary">完成</button>
</div>
</nz-tab>
</nz-tabset>
......
......@@ -82,7 +82,7 @@ export class BasiCheckComponent implements OnInit {
data_type:[null,[Validators.required]],
units:[null],
formula:[null,[Validators.required]],
history:[null],
history:['3600'],
trends:[null],
valuemapid:[null],
delay:[null,[Validators.required]],
......@@ -90,7 +90,12 @@ export class BasiCheckComponent implements OnInit {
snmp_community:[null],
delta:[null],
applicationids:[null],
})
});
this.triggerObj = {
condition:'',
faultCondition:'',
itemName:''
};
}
//新增
......@@ -114,16 +119,14 @@ export class BasiCheckComponent implements OnInit {
this.hostId = hostId;
this.isCheck = true;
this.itemId = id;
this.overAllSer.findItemDetail(id).subscribe(
(res) => {
this.validateForm = res.data[0];
this.validateForm.patchValue(res.date[0]);
// this.validateForm.type = this.validateForm.type +'';
// this.validateForm.interfaceid = this.validateForm.interfaceid +"";
// this.validateForm.value_type = this.validateForm.value_type +"";
// this.validateForm.data_type = this.validateForm.data_type +"";
// this.validateForm.applicationids = this.validateForm.applications[0].applicationid +"";
const data = res.data[0];
data.type += '';
data.interfaceid += "";
data.value_type += "";
data.data_type += "";
this.validateForm.patchValue(data);
}
);
......@@ -172,12 +175,11 @@ export class BasiCheckComponent implements OnInit {
this.overAllSer.create(this.validateForm.value).subscribe(
(res) => {
if (res.errCode == 10000) {
// this.isCheck = false;
// this.initForm();
// this.done.emit();
this.message.success("创建监测点成功");
this.tabNum = 1;
}else{
this.message.error(res.errMsg);
}
this.message.info(res.errMsg);
},
(err) => {
this.message.info('系统错误');
......@@ -188,8 +190,7 @@ export class BasiCheckComponent implements OnInit {
//修改监控项
update(){
this.validateForm.addControl('itemid',new FormControl(this.itemId));
// data.itemid = this.itemId;
this.overAllSer.itemUpdata(this.validateForm).subscribe(
this.overAllSer.itemUpdata(this.validateForm.value).subscribe(
(res) => {
if (res.errCode == 10000) {
this.isCheck = false;
......@@ -287,8 +288,8 @@ export class BasiCheckComponent implements OnInit {
data.faultCondition += '{' + this.hostName + ':' + this.validateForm.value.key_ + '.last()}' + res.equal + '' + res.value;
});
} else { //高级
data.condition = this.validateForm.value.condition_high;
data.faultCondition = this.validateForm.value.faultCondition_high;
data.condition = this.triggerObj.condition;
data.faultCondition = this.triggerObj.faultCondition;
}
if(this.title == "添加监测点"){
this.createTrigger(data);
......@@ -308,6 +309,9 @@ export class BasiCheckComponent implements OnInit {
(response)=>{
if(response.errCode == 10000){
this.message.success("创建阈值成功");
this.done.emit();
this.initForm();
this.isCheck = false;
}else{
this.message.error(response.errMsg);
}
......@@ -324,7 +328,14 @@ export class BasiCheckComponent implements OnInit {
condition:data.condition
};
this.overAllSer.updateTrigger(data).subscribe(res=>{
if(res.errCode == 10000){
this.message.success("修改阈值成功");
this.done.emit();
this.initForm();
this.isCheck = false;
}else{
this.message.error(res.errMsg);
}
})
}
//阈值--end
......
......@@ -591,7 +591,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//添加监测点
showCheckModal() {
this.smartCheck.showAddModal(this.hostId);
this.smartCheck.showAddModal(this.hostId,this.hostName);
}
//编辑监测点
......
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