Commit ce6139e0 authored by wangqinghua's avatar wangqinghua

update

parent bd4560ea
......@@ -102,7 +102,6 @@ export class AlarmSetComponent implements OnInit {
arr = res;
}
});
console.log(arr);
this.smartAlarmGroup.editModal(arr);
}
......
......@@ -40,7 +40,6 @@ export class AlarmTargetComponent implements OnInit {
}
toNode(data){
console.log(data);
// const arr = this.toTree.listToTree(1,2,data)
this.nodes = data.map(res=>{
return new NzTreeNode(res);
......@@ -49,8 +48,6 @@ export class AlarmTargetComponent implements OnInit {
//下级
mouseAction(name: string, event: NzFormatEmitEvent): void {
console.log(name);
console.log(event);
// if (name === 'expand') {
setTimeout(_ => {
// if (e.node.getChildren().length === 0 && e.node.isExpanded) {
......
......@@ -53,7 +53,6 @@ export class MediaTypeComponent implements OnInit {
this.alarmSer.getMediaType(this.mediatypeid).subscribe(
(res)=>{
if(res.errCode == 10000){
console.log(this.validateForm.value.type);
const data = res.data[0];
data.type += "";
this.validateForm.patchValue(data);
......
......@@ -87,7 +87,8 @@ Logo styles
}
.span-hov{
overflow: hidden;
display: inline-flex;
display: -webkit-inline-flex;
display: -moz-box;
}
.addBtn{
overflow: hidden;
......
......@@ -101,8 +101,6 @@ export class AlarmModalComponent implements OnInit {
//下级
mouseAction(name: string, event: NzFormatEmitEvent) {
console.log(name);
console.log(event);
const index = <any>event.node.key - 1;
const data = {
'groupids': [event.node.origin.groupid],
......
import {Component, OnInit, ViewChild} from '@angular/core';
import {Component, EventEmitter, OnInit, Output, ViewChild} from '@angular/core';
import {OverAllService} from '../../overAll/overAll.service';
import {
FormBuilder,
......@@ -26,10 +26,12 @@ import {NewTypeComponent} from '../new-type/new-type.component';
export class BasiCheckComponent implements OnInit {
@ViewChild('basicKey') basicKey: BasicKeyComponent;
@ViewChild('newType') newType: NewTypeComponent;
@Output() done = new EventEmitter<any>();
title;
isCheck = false;
hostId; //主机ID
itemId; //监控项id
interfaceList: any[];
validateForm;
checkList; //监测点分类
......@@ -102,6 +104,7 @@ export class BasiCheckComponent implements OnInit {
this.title = "编辑监测点";
this.hostId = hostId;
this.isCheck = true;
this.itemId = id;
this.overAllSer.findItemDetail(id).subscribe(
(res) => {
......@@ -171,10 +174,36 @@ export class BasiCheckComponent implements OnInit {
data.faultCondition = this.validateForm.faultCondition_high;
}
if(this.title == "添加监测点"){
this.create(data);
}
if(this.title == "编辑监测点"){
this.update(data);
}
}
create(data){
this.overAllSer.create(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.isCheck = false;
this.done.emit();
}
this.message.info(res.errMsg);
},
(err) => {
this.message.info('系统错误');
}
);
}
update(data){
data.itemid = this.itemId;
this.overAllSer.itemUpdata(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.isCheck = false;
this.done.emit();
}
this.message.info(res.errMsg);
},
......
......@@ -60,7 +60,7 @@ export class NeTopologyComponent implements OnInit {
addTopo() {
this.topoType = '添加模式';
this.message.info('添加模式');
editor.utils.clearTopology();
editor.utils.editTopology();
}
//编辑拓扑图
......
......@@ -17,7 +17,6 @@
</nz-breadcrumb>
</div>
<div nz-col nzSpan="8" class="text-right">
<button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
<button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button>
</div>
......@@ -28,8 +27,8 @@
<!--<button nz-button nzType="default">编辑</button>-->
<button nz-button nzType="default">删除</button>
</div>
<div class="releative">
<div class="checkTags tag-form">
<div class="releative" #checkEle>
<div #colorEle class="checkTags tag-form">
<span> <nz-tag [nzColor]="color.green"></nz-tag>
<i *ngIf="!checkStatus.normal && checkStatus.normal !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{checkStatus.normal}}
......@@ -139,7 +138,7 @@
</div>
</section>
</nz-tab>
<nz-tab nzTitle="监测点列表 ">
<nz-tab nzTitle="监测点列表">
<div nz-row>
<div class="padding-15-0">
<nz-radio-group [(ngModel)]="itemTypeValue" [nzButtonStyle]="'solid'">
......@@ -173,8 +172,8 @@
<td class="handle cursor">
<span (click)="showEditModal(data)">编辑</span>
<span (click)="deleteCheckItem(data)">删除</span>
<span *ngIf="data.itemState == 0" (click)="updateItem(data.itemid,1)">停止</span>
<span *ngIf="data.itemState == 1" (click)="updateItem(data.itemid,0)">启用</span>
<span *ngIf="data.status == 0" (click)="updateItem(data.itemid,1)">停止</span>
<span *ngIf="data.status == 1" (click)="updateItem(data.itemid,0)">启用</span>
</td>
</tr>
</tbody>
......@@ -189,12 +188,10 @@
</nz-tab>
</nz-tabset>
</div>
</div>
<!--添加监测点-->
<smart-basi-check #smartCheck></smart-basi-check>
<smart-basi-check #smartCheck (done)="getList()"></smart-basi-check>
<nz-modal [nzFooter]="null" nzWidth="1080" [(nzVisible)]="isGrapha" nzTitle="" (nzOnCancel)="handleImageCancel()">
<div class="releative">
......
......@@ -35,6 +35,8 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
@ViewChild('smartCheck') smartCheck: BasiCheckComponent;
@ViewChild('thirdTabs') thirdTabs: ElementRef;
@ViewChild('warnList') warnList: WarnListComponent;
@ViewChild('colorEle') colorEle:ElementRef;
@ViewChild('checkEle') checkEle:ElementRef;
color = color;
loading = false;
hostId: string;
......@@ -119,9 +121,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
this.inOutInfo();
//监测点
this.getCheckList();
this.getCheckStatus();
this.findItemType();
this.getList()
//历史告警
const obj = {};
......@@ -129,7 +129,9 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
}
ngAfterViewInit() {
// this.renderer.setElementStyle(this.thirdTabs.nativeElement,'margin-left','108px');
console.log(this.colorEle.nativeElement.offsetWidth);
this.checkEle.nativeElement.children[1].children[0].children[0].children[2].children[0].children[0].children[2].style.marginRight = this.colorEle.nativeElement.offsetWidth +'px';
console.log(this.checkEle.nativeElement.children[1].children[0].children[0].children[2].children[0].children[0].children[2].style.marginRight);
}
//平均响应时间
......@@ -599,6 +601,13 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
this.smartCheck.showEditModal(this.hostId,item.itemid);
}
//添加or编辑监测点 之后
getList(){
this.getCheckList();
this.getCheckStatus();
this.findItemType();
}
handleCheckCancel() {
this.isCheck = false;
}
......@@ -761,6 +770,11 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
this.overAllSer.findItemType(data).subscribe(
(res) => {
this.itemTypeList = res.data;
const data = {
applicationid:'',
name:'全部'
}
this.itemTypeList.push(data);
}
);
}
......
......@@ -527,6 +527,7 @@ export class BasicComponent implements OnInit {
if (res.errCode == 10000) {
this.message.info('修改成功');
this.batchDelList = [];
this.findOpStatus();
this.select();
} else {
this.message.info(res.errMsg);
......
......@@ -179,11 +179,15 @@ export class OverAllService {
return this.http.post(SERVER_API_URL + '/graph/findGraphData/' ,data);
}
//监控项编辑
//监控项修改状态
itemUpdate(data): Observable<any>{
return this.http.put(SERVER_API_URL + '/item/updata/' , data);
}
itemUpdata(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/item/updata/' , data);
}
//临时暂停
tempStop(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/host/tempStop', data);
......
......@@ -27,10 +27,8 @@ export class AuthServerProvider {
password: credentials.password,
rememberMe: credentials.rememberMe
};
console.log(data);
return this.http.post(SERVER_API_URL + '/login', data, {observe : 'response'}).map(authenticateSuccess.bind(this));
function authenticateSuccess(resp) {
console.log(resp);
const bearerToken = resp.body.data;
if (bearerToken ) {
this.$localStorage.store('accessToken', bearerToken);
......
......@@ -92,7 +92,6 @@ export class JhiLoginModalComponent implements AfterViewInit,OnInit {
this.notification.create('error', '登录失败', '用户名或密码错误',{nzDuration:2000});
}
}).catch(() => {
console.log('123');
this.authenticationError = true;
});
}
......
......@@ -17,13 +17,11 @@ export class LoginService {
return new Promise((resolve, reject) => {
this.authServerProvider.login(credentials).subscribe((data) => {
console.log(data);
this.principal.identity(true).then((account) => {
resolve(data);
});
return data;
}, (err) => {
console.log(err);
this.logout();
reject(err);
return cb(err);
......
......@@ -32,7 +32,6 @@ export class SystemService {
//用户列表
user(data): Observable<any>{
console.log(this.toTree.toQuery(data));
return this.http.get(SERVER_API_URL + '/user?' + this.toTree.toQuery(data));
}
......
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