Commit ce6139e0 authored by wangqinghua's avatar wangqinghua

update

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