Commit 261b434f authored by wangqinghua's avatar wangqinghua

update

parent e1012384
......@@ -72,8 +72,6 @@ export class SelectGroupComponent implements OnInit {
//获取下级
mouseAction(name: string, event: NzFormatEmitEvent) {
let type;
setTimeout(_ => {
}, 1000);
if (event.node.level == 0) {
type = 'host'; //主机
}
......@@ -83,6 +81,11 @@ export class SelectGroupComponent implements OnInit {
if (this.title == '选择资源' && event.node.level == 1) {
return false;
}
if (this.title == '添加设备' && event.node.level == 1) {
return false;
}
const index = <any>event.node.key - 1;
const data = {
'id': event.node.origin.id,
......@@ -95,7 +98,7 @@ export class SelectGroupComponent implements OnInit {
dataSet.forEach(res => {
res.title = res.name;
res.key = res.id;
if (this.title == '选择资源') {
if (this.title == '选择资源' || this.title == '添加设备') {
res.isLeaf = true;
}
});
......
......@@ -33,6 +33,8 @@ export class IconComponent implements OnInit {
initForm() {
this.fileList = [];
this.firstTypeId = null; //分类ID
this.iconId = null; //图标ID
}
//一级分类
......
......@@ -5,10 +5,10 @@
首页
</nz-breadcrumb-item>
<nz-breadcrumb-item>
<a>告警管理</a>
<a>网络拓扑</a>
</nz-breadcrumb-item>
<nz-breadcrumb-item>
告警推送设置
网络拓扑图
</nz-breadcrumb-item>
</nz-breadcrumb>
</div>
......@@ -141,5 +141,5 @@
<!--添加监测点-->
<smart-check #smartCheck (done)="setCheckList($event)"></smart-check>
<!--添加设备-->
<smart-device #smartDevice (done)="setImg($event)"></smart-device>
\ No newline at end of file
<!--选择资源-->
<smart-select-group #smartSelectGroup (done)="getItem($event)"></smart-select-group>
\ No newline at end of file
......@@ -6,6 +6,7 @@ import * as $ from 'jquery';
import {TopologyComponent} from '../model/topology/topology.component';
import {CheckComponent} from '../model/check/check.component';
import {DeviceComponent} from '../model/device/device.component';
import {SelectGroupComponent} from '../../modal/select-group/select-group.component';
declare let editor: any;
declare var layui: any;
......@@ -58,7 +59,7 @@ export class NeTopologyComponent implements OnInit, AfterViewInit {
@ViewChild('topologyCanvas') topologyCanvas: ElementRef;
@ViewChild('smartTopology') smartTopology:TopologyComponent;
@ViewChild('smartCheck') smartCheck:CheckComponent;
@ViewChild('smartDevice') smartDevice:DeviceComponent;
@ViewChild('smartSelectGroup') smartSelectGroup:SelectGroupComponent;
dataSet;
isVisible = false;
......@@ -116,7 +117,7 @@ export class NeTopologyComponent implements OnInit, AfterViewInit {
this.message.warning("请选择需要编辑的拓扑图");
return false;
}
this.smartDevice.showAddModal("添加设备");
this.smartSelectGroup.showAddModal("添加设备");
}
//获取设备图片
......@@ -172,6 +173,9 @@ export class NeTopologyComponent implements OnInit, AfterViewInit {
let json = JSON.parse(res.data.json);
editor.loadTopologyByJson(JSON.parse(json.topology), 'img/backimg.png');
this.checkJson = json.check;
}else{
editor.utils.clearTopology();
this.checkJson = [];
}
this.name = res.data.name;
this.refreshRete = res.data.refreshRete;
......@@ -282,7 +286,7 @@ export class NeTopologyComponent implements OnInit, AfterViewInit {
const formData = new FormData();
this.fileList.forEach((file:any)=>{
formData.append('file',file);
})
});
this.topologySer.addPic(formData).subscribe(
(res)=>{
if(res.errCode == 10000){
......
......@@ -310,6 +310,7 @@ ui bootstrap tweaks
height: 200px;
overflow: auto;
margin-top: 10px;
padding: 5px 10px;
}
.time-div{
position: absolute;
......
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