Commit 261b434f authored by wangqinghua's avatar wangqinghua

update

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