Toggle navigation
Toggle navigation
This project
Loading...
Sign in
monitor_v3
/
hg-monitor-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
张凯
2 years ago
Commit
10bd61d3039f19d828f66170168511902c259f94
2 parents
0413a6cd
9fa10b51
Merge branch 'master-mj' of
http://113.200.75.45:82/monitor_v3/hg-monitor-web
into master-mj-joke
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
11 deletions
hg-monitor-web-base/src/main/resources/static/src/controller/mxgraphView.js
hg-monitor-web-base/src/main/resources/static/src/controller/mxgraphView.js
View file @
10bd61d
...
...
@@ -131,7 +131,7 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun
// 旧版拓扑
$
(
'#newViewGraphContainer'
).
addClass
(
'hide'
);
$
(
'#viewGraphContainer'
).
removeClass
(
'hide'
);
var
xml
=
res
.
object
.
xmlInfo
;
var
xml
=
res
.
object
.
xmlInfo
.
replace
(
/image=/g
,
"image=/monitor-web"
)
;
nodeInfo
=
res
.
map
;
if
(
res
.
object
.
topoName
)
{
...
...
@@ -141,7 +141,7 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun
// 拓扑背景及样式
viewGraphcontainer
.
style
.
position
=
'absolute'
;
viewGraphcontainer
.
style
.
overflow
=
'hidden'
;
viewGraphcontainer
.
style
.
background
=
'url("/
src/lib/mxgraph/editors
/images/grid.gif")'
;
viewGraphcontainer
.
style
.
background
=
'url("/
grapheditor-web/jgraph/grapheditor
/images/grid.gif")'
;
// 开启方块上的文字编辑功能,解决分组块不能收缩问题
viewGraph
.
setCellsEditable
(
false
);
...
...
@@ -220,8 +220,13 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun
if
(
evt
.
properties
.
event
.
button
==
0
)
{
//左键菜单
var
cell
=
evt
.
getProperty
(
'cell'
);
if
(
cell
&&
cell
!=
null
&&
cell
.
edge
!=
1
&&
cell
.
childTopoId
)
{
$
(
"#topo_view_childtop"
).
attr
(
"lay-href"
,
"/mxgraph/view/from=v/id="
+
cell
.
childTopoId
);
$
(
"#topo_view_childtop"
).
trigger
(
"click"
);
// $("#topo_view_childtop").attr("lay-href", "/mxgraph/view/from=v/id=" + cell.childTopoId);
// $("#topo_view_childtop").trigger("click");
var
url
=
"/grapheditor-web/jgraph/grapheditor/index.html?access_token="
+
accessToken
+
'&id='
+
cell
.
childTopoId
;
window
.
top
.
postMessage
({
type
:
'dialog'
,
message
:
{
'params'
:{},
'title'
:
'子拓扑'
,
'url'
:
url
}
},
'*'
)
}
}
//渲染线条
...
...
@@ -248,8 +253,19 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun
menu
.
addSeparator
();
//分割线
menu
.
addItem
(
'查看告警信息'
,
null
,
function
()
{
if
(
topoNodesAlarmFlag
[
cell
.
cellId
])
{
$
(
"#topo_view_alarm_info"
).
attr
(
"lay-href"
,
"/alarm/activewarning/resId="
+
resIds
.
toString
());
$
(
"#topo_view_alarm_info"
).
trigger
(
'click'
);
// $("#topo_view_alarm_info").attr("lay-href", "/alarm/activewarning/resId=" + resIds.toString());
// $("#topo_view_alarm_info").trigger('click');
// 跳转告警管理
window
.
parent
.
postMessage
({
type
:
'custom-jump-menu-event'
,
message
:
{
'path'
:
''
,
'type'
:
"JumpToAlarmManagement"
,
params
:{
resId
:
resIds
.
toString
()
}
}
},
'*'
)
}
else
{
layer
.
msg
(
'非常健康,暂无告警信息!'
,
{
offset
:
'15px'
,
icon
:
1
,
time
:
3000
});
}
...
...
@@ -300,7 +316,12 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun
if
(
topoId
)
{
//编辑拓扑
$
(
"#gotoedittopo"
).
unbind
(
'click'
).
on
(
"click"
,
function
()
{
$
(
this
).
attr
(
"lay-href"
,
"/grapheditor-web/mxgraph/setting/id="
+
topoId
)
// $(this).attr("lay-href", "/grapheditor-web/mxgraph/setting/id=" + topoId)
var
url
=
"/grapheditor-web/jgraph/grapheditor/index.html?access_token="
+
accessToken
+
'&id='
+
topoId
;
window
.
top
.
postMessage
({
type
:
'dialog'
,
message
:
{
'params'
:{},
'title'
:
'编辑拓扑'
,
'url'
:
url
}
},
'*'
)
});
}
}
else
if
(
res
.
object
&&
res
.
object
.
xmlInfo
&&
(
new
Date
(
res
.
object
.
createTime
)
>
new
Date
(
'2021-03-23 17:28'
)))
{
...
...
@@ -319,7 +340,7 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun
var
url
=
"/grapheditor-web/jgraph/grapheditor/index.html?access_token="
+
accessToken
+
'&id='
+
topoId
;
// window.open(url);
window
.
parent
.
postMessage
({
window
.
top
.
postMessage
({
type
:
'dialog'
,
message
:
{
'params'
:{},
'title'
:
'编辑拓扑'
,
'url'
:
url
}
},
'*'
)
...
...
@@ -343,9 +364,8 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun
// $(this).attr("lay-href","/mxgraph/setting/id="+topoId);
//新版本
var
url
=
"/grapheditor-web/jgraph/grapheditor/index.html?access_token="
+
accessToken
+
'&id='
+
topoId
;
//window.open(url);
debugger
window
.
parent
.
postMessage
({
window
.
top
.
postMessage
({
type
:
'dialog'
,
message
:
{
'params'
:{},
'title'
:
'编辑拓扑'
,
'url'
:
url
}
},
'*'
)
...
...
Please
register
or
login
to post a comment