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
Email Patches
Plain Diff
Browse Files
Authored by
wangtao
2 years ago
Commit
dd48302abd37b239c72ab720eb8470975dcc4cd6
1 parent
4aea21ce
fix: 优化拓扑管理
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
30 deletions
hg-monitor-web-base/src/main/resources/static/src/controller/mxgraphAdd.js
hg-monitor-web-base/src/main/resources/static/src/controller/mxgraphList.js
hg-monitor-web-base/src/main/resources/static/src/views/template/user/userTransfer.html
hg-monitor-web-base/src/main/resources/static/start/layui/css/layui.css
hg-monitor-web-base/src/main/resources/static/src/controller/mxgraphAdd.js
View file @
dd48302
...
...
@@ -277,9 +277,10 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli
}
//回填拓扑类型
if
(
topoInfo
.
topoType
)
{
setTimeout
(()
=>
{
common
.
ddicSelect
(
'jgraph-topo_type'
,
'JTOPO_TOPOTYPE'
,
function
(
datalist
)
{
$
(
"#jgraph-topo_type"
).
val
(
topoInfo
.
topoType
);
},
2000
)
form
.
render
(
'select'
);
});
var
type
=
topoInfo
.
topoType
;
var
topoInfoTargetId
=
topoInfo
.
targetId
;
busTypeDom
.
hide
();
...
...
hg-monitor-web-base/src/main/resources/static/src/controller/mxgraphList.js
View file @
dd48302
...
...
@@ -399,21 +399,21 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'transfer
users
.
push
({
userId
:
value
.
value
,
nickName
:
value
.
title
})
userIds
.
push
(
value
.
value
);
});
if
(
jtopoIds
.
length
==
1
)
{
// 如果只选了一个,根据回显判断要添加和删除的
let
intersection
=
$
.
grep
(
userIds
,
function
(
i
)
{
return
!
common
.
hasPermission
(
i
,
oldUserIds
)
!=
-
1
;
});
var
inserts
=
$
.
grep
(
users
,
function
(
i
)
{
return
!
common
.
hasPermission
(
i
.
userId
,
intersection
)
==
-
1
;
});
var
deletes
=
$
.
grep
(
oldUserIds
,
function
(
i
)
{
return
!
common
.
hasPermission
(
i
,
intersection
)
==
-
1
;
});
}
else
{
// 多选则直接全部添加
inserts
=
users
}
// if (jtopoIds.length == 1) {
// // 如果只选了一个,根据回显判断要添加和删除的
// let intersection = $.grep(userIds, function (i) {
// return !$.inArray(i, oldUserIds) == -1;//!common.hasPermission(i, oldUserIds) != -1;
// });
// var inserts = $.grep(users, function (i) {
// return !$.inArray(i.userId, intersection) == -1;// common.hasPermission(i.userId, intersection) == -1;
// });
// var deletes = $.grep(oldUserIds, function (i) {
// return $.inArray(i, intersection) == -1;//!common.hasPermission(i, intersection) == -1;
// });
// } else {
// // 多选则直接全部添加
// inserts = users
// }
// //获得当前用户
var
userNow
=
localStorage
.
getItem
(
"lgn"
);
var
flag
=
0
;
...
...
@@ -434,8 +434,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'transfer
,
url
:
domainName
+
'/api-web/mxgraph/configUserAuth?accessToken='
+
accessToken
,
data
:
JSON
.
stringify
({
jtopoIds
:
jtopoIds
,
inserts
:
inserts
,
deletes
:
deletes
inserts
:
users
,
deletes
:
[]
})
,
dataType
:
'json'
,
contentType
:
"application/json;charset=UTF-8"
...
...
@@ -590,7 +590,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'transfer
,
parseData
:
function
(
res
)
{
// 如果原来有权限,回显
if
(
oldUserIds
.
length
>
0
)
{
$
.
each
(
res
.
data
,
function
(
index
,
value
)
{
$
.
each
(
res
.
data
.
rows
,
function
(
index
,
value
)
{
if
(
oldUserIds
.
indexOf
(
value
.
id
)
!=
-
1
)
{
value
[
"LAY_CHECKED"
]
=
true
}
...
...
@@ -598,7 +598,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'transfer
}
return
{
"code"
:
0
,
"data"
:
res
.
data
"data"
:
res
.
data
.
rows
};
}
,
where
:
{
...
...
hg-monitor-web-base/src/main/resources/static/src/views/template/user/userTransfer.html
View file @
dd48302
...
...
@@ -4,7 +4,7 @@
<div
class=
"main"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body collector-table"
>
<div
id=
"transfer-user"
style=
"padding-left: 25px;
display: flex;flex-wrap: nowrap;
"
></div>
<div
id=
"transfer-user"
style=
"padding-left: 25px;"
></div>
</div>
</div>
</div>
...
...
@@ -22,10 +22,3 @@
}
});
</script>
<style
type=
"text/css"
>
.layui-transfer-active
{
display
:
flex
;
align-content
:
center
;
flex-wrap
:
wrap
;
}
</style>
...
...
hg-monitor-web-base/src/main/resources/static/start/layui/css/layui.css
View file @
dd48302
...
...
@@ -5259,4 +5259,16 @@ body .layui-util-face .layui-layer-content {
height
:
6px
;
left
:
0
;
top
:
-6px
;
}
\ No newline at end of file
}
.layui-transfer
{
display
:
flex
!important
;
flex-wrap
:
nowrap
!important
;
}
.layui-transfer-active
{
display
:
flex
!important
;
align-content
:
center
!important
;
flex-wrap
:
wrap
!important
;
}
...
...
Please
register
or
login
to post a comment