Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqinghua
smart
Commits
c768a812
Commit
c768a812
authored
Dec 06, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
7d72f113
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
3 deletions
+51
-3
ne-topology.component.html
...pp/app/netTopology/ne-topology/ne-topology.component.html
+0
-0
ne-topology.component.ts
...bapp/app/netTopology/ne-topology/ne-topology.component.ts
+44
-2
topology.service.ts
src/main/webapp/app/netTopology/topology.service.ts
+5
-0
jtopo-editor.js
src/main/webapp/content/javascript/jtopo/js/jtopo-editor.js
+2
-1
No files found.
src/main/webapp/app/netTopology/ne-topology/ne-topology.component.html
View file @
c768a812
This diff is collapsed.
Click to expand it.
src/main/webapp/app/netTopology/ne-topology/ne-topology.component.ts
View file @
c768a812
import
{
AfterViewChecked
,
AfterViewInit
,
Component
,
ElementRef
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
AfterViewChecked
,
AfterViewInit
,
Component
,
ElementRef
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
TopologyService
}
from
'../topology.service'
;
import
{
TopologyService
}
from
'../topology.service'
;
import
{
NzMessageService
,
NzModalService
}
from
'ng-zorro-antd'
;
import
{
NzMessageService
,
NzModalService
,
UploadFile
}
from
'ng-zorro-antd'
;
import
{
DomSanitizer
}
from
'@angular/platform-browser'
;
import
{
DomSanitizer
}
from
'@angular/platform-browser'
;
import
*
as
$
from
'jquery'
;
import
*
as
$
from
'jquery'
;
import
{
TopologyComponent
}
from
'../model/topology/topology.component'
;
import
{
TopologyComponent
}
from
'../model/topology/topology.component'
;
...
@@ -58,13 +58,13 @@ export class NeTopologyComponent implements OnInit, AfterViewInit {
...
@@ -58,13 +58,13 @@ export class NeTopologyComponent implements OnInit, AfterViewInit {
topoType
=
'只读模式'
;
topoType
=
'只读模式'
;
checkJson
=
[];
checkJson
=
[];
fileList
:
UploadFile
[]
=
[];
constructor
(
private
topologySer
:
TopologyService
,
private
message
:
NzMessageService
,
constructor
(
private
topologySer
:
TopologyService
,
private
message
:
NzMessageService
,
private
sanitizer
:
DomSanitizer
,
private
modalSer
:
NzModalService
)
{
private
sanitizer
:
DomSanitizer
,
private
modalSer
:
NzModalService
)
{
}
}
ngOnInit
()
{
ngOnInit
()
{
this
.
loadCanvas
();
this
.
getList
();
this
.
getList
();
}
}
...
@@ -73,6 +73,7 @@ export class NeTopologyComponent implements OnInit, AfterViewInit {
...
@@ -73,6 +73,7 @@ export class NeTopologyComponent implements OnInit, AfterViewInit {
let
element
=
layui
.
element
;
let
element
=
layui
.
element
;
element
.
init
();
element
.
init
();
});
});
this
.
loadCanvas
();
}
}
//新增拓扑图
//新增拓扑图
...
@@ -299,4 +300,45 @@ export class NeTopologyComponent implements OnInit, AfterViewInit {
...
@@ -299,4 +300,45 @@ export class NeTopologyComponent implements OnInit, AfterViewInit {
editor
.
loadTopology
(
''
,
'img/backimg.png'
);
editor
.
loadTopology
(
''
,
'img/backimg.png'
);
}
}
//添加图片-----start
showAddImg
(){
this
.
isVisible
=
true
;
}
beforeUpload
=
(
file
:
UploadFile
):
boolean
=>
{
const
isLt2M
=
file
.
size
/
1024
<
300
;
if
(
!
isLt2M
)
{
this
.
message
.
error
(
'图标必须小于300kb!'
);
}
else
{
this
.
fileList
.
push
(
file
);
}
return
false
;
};
handleCancel
(){
this
.
isVisible
=
false
;
}
handleOk
(){
if
(
this
.
fileList
.
length
==
0
){
this
.
message
.
error
(
"请选择图片"
);
return
false
;
}
const
formData
=
new
FormData
();
this
.
fileList
.
forEach
((
file
:
any
)
=>
{
formData
.
append
(
'file'
,
file
);
})
this
.
topologySer
.
addPic
(
formData
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
isVisible
=
false
;
editor
.
utils
.
addNode
(
res
.
data
,
'text'
);
}
else
{
this
.
message
.
error
(
"添加失败"
)
}
}
)
}
// end
}
}
src/main/webapp/app/netTopology/topology.service.ts
View file @
c768a812
...
@@ -68,4 +68,9 @@ export class TopologyService {
...
@@ -68,4 +68,9 @@ export class TopologyService {
findDefaultIcon
(
data
):
Observable
<
any
>
{
findDefaultIcon
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/icon/findDefaultIcon'
,
data
);
return
this
.
http
.
post
(
SERVER_API_URL
+
'/icon/findDefaultIcon'
,
data
);
}
}
//添加图片
addPic
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/sysmapJson/addPic'
,
data
);
}
}
}
src/main/webapp/content/javascript/jtopo/js/jtopo-editor.js
View file @
c768a812
...
@@ -1071,7 +1071,8 @@ editor.utils = {
...
@@ -1071,7 +1071,8 @@ editor.utils = {
var
node
=
new
JTopo
.
Node
()
var
node
=
new
JTopo
.
Node
()
node
.
fontColor
=
editor
.
config
.
nodeFontColor
node
.
fontColor
=
editor
.
config
.
nodeFontColor
// 节点坐标
// 节点坐标
node
.
setBound
(
20
,
20
,
50
,
50
)
node
.
setBound
(
320
,
-
200
,
50
,
50
);
console
.
log
(
node
);
// 默认节点图片
// 默认节点图片
node
.
setImage
(
topoImgPath
+
img
)
node
.
setImage
(
topoImgPath
+
img
)
// 节点数据
// 节点数据
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment