Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ops
/
monitor-ui
·
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
skinny.wu
9 years ago
Commit
8b53591a3a9ddcccb233c979743836bece0c4158
1 parent
dbe45e40
修改zktree样式
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
monitor-ui-web/src/main/webapp/script/yoho.type.zktree.js
monitor-ui-web/src/main/webapp/script/yoho.type.zktree.js
View file @
8b53591
/**
* Created by frw on 2016/6/17.
*/
var
selectedNodeId
=
null
;
var
treeData
=
[];
var
nodeId2id
=
function
(
nodeid
)
{
if
(
nodeid
==
"#"
)
{
...
...
@@ -141,9 +144,23 @@ $("#btn4type").click(function () {
/**
* 根据选中的节点获取信息
*/
function
searchType
(
ip
){
function
searchType
(
ip
,
children
,
nodeId
){
//非叶子节点不处理
if
(
children
.
length
!=
0
)
{
return
;
}
//将原来选中的节点的背景颜色去掉
if
(
selectedNodeId
!=
null
)
{
document
.
getElementById
(
selectedNodeId
).
style
.
backgroundColor
=
"transparent"
;
}
//给选中的节点添加背景颜色
document
.
getElementById
(
nodeId
).
style
.
backgroundColor
=
"#CCCCCC"
;
selectedNodeId
=
nodeId
;
$
(
"#detailTable"
).
hide
();
// $("#rootTable").table("load",{});
$
(
"#rootTable"
).
table
({
url
:
contextPath
+
"/zkTree/getRoot?ip="
+
ip
,
striped
:
true
,
...
...
@@ -185,7 +202,6 @@ function searchType(ip){
}
}],
});
}
...
...
@@ -280,7 +296,7 @@ var refreshTypeTree = function () {
$
(
'#jstree'
).
jstree
({
"plugins"
:
[
"themes"
,
"c
heckbox"
,
"c
ontextmenu"
,
"ui"
,
"types"
,
"crrm"
,
"core"
,
"status"
],
"plugins"
:
[
"themes"
,
"contextmenu"
,
"ui"
,
"types"
,
"crrm"
,
"core"
,
"status"
],
'core'
:
{
"themes"
:
{
name
:
'proton'
,
...
...
@@ -292,8 +308,8 @@ $('#jstree').jstree({
}
}).
bind
(
"changed.jstree"
,
function
(
e
,
data
)
{
console
.
log
(
data
);
console
.
log
(
data
);
console
.
log
(
"Checked: "
+
data
.
node
.
text
);
searchType
(
data
.
node
.
text
);
searchType
(
data
.
node
.
text
,
data
.
node
.
children
,
data
.
node
.
a_attr
.
id
);
});
refreshTypeTree
();
...
...
Please
register
or
login
to post a comment