Commit dbf69768 authored by wangqinghua's avatar wangqinghua

log

parent 7bfbcb9d
...@@ -72,4 +72,4 @@ ...@@ -72,4 +72,4 @@
</nz-table> </nz-table>
<!--告警组--> <!--告警组-->
<smart-alarm-group #smartAlarmGroup></smart-alarm-group> <smart-alarm-group #smartAlarmGroup (add)="getGroupAlarm()"></smart-alarm-group>
\ No newline at end of file \ No newline at end of file
import {Component, OnInit} from '@angular/core'; import {Component, EventEmitter, OnInit, Output} from '@angular/core';
import {AlarmService} from '../../alarm.service'; import {AlarmService} from '../../alarm.service';
import { import {
FormBuilder, FormBuilder,
...@@ -15,6 +15,7 @@ import {NzMessageService} from 'ng-zorro-antd'; ...@@ -15,6 +15,7 @@ import {NzMessageService} from 'ng-zorro-antd';
styles: [] styles: []
}) })
export class AlarmGroupComponent implements OnInit { export class AlarmGroupComponent implements OnInit {
@Output() add = new EventEmitter<any>();
title; title;
isVisible = false; isVisible = false;
...@@ -63,6 +64,7 @@ export class AlarmGroupComponent implements OnInit { ...@@ -63,6 +64,7 @@ export class AlarmGroupComponent implements OnInit {
(res)=>{ (res)=>{
if(res.errCode == 10000){ if(res.errCode == 10000){
this.isVisible = false; this.isVisible = false;
this.add.emit();
} }
this.message.info(res.errMsg); this.message.info(res.errMsg);
} }
......
...@@ -45,17 +45,20 @@ export class UserComponent implements OnInit { ...@@ -45,17 +45,20 @@ export class UserComponent implements OnInit {
} }
handleOk(){ handleOk(){
this.isVisible = true;
for(const i in this.validateForm.controls){ for(const i in this.validateForm.controls){
this.validateForm.controls[i].markAsDirty(); this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity(); this.validateForm.controls[i].updateValueAndValidity();
} }
this.validateForm.value.gender = Number(this.validateForm.value.gender); this.validateForm.value.gender = Number(this.validateForm.value.gender);
this.validateForm.value.status = Number(this.validateForm.value.status); this.validateForm.value.status = Number(this.validateForm.value.status);
if(this.validateForm.invalid){
return false;
}
this.systemSer.adduser(this.validateForm.value).subscribe( this.systemSer.adduser(this.validateForm.value).subscribe(
(res)=>{ (res)=>{
if(res.errCode == 10000){
this.isVisible = 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