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
FengRuwei
9 years ago
Commit
d6981c598bdcf11bf9473041ff37b76979dd60be
1 parent
48474f7d
初始化默认值
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
monitor-ui-web/src/main/webapp/script/yoho.type.tree.js
monitor-ui-web/src/main/webapp/script/yoho.type.tree.js
View file @
d6981c5
...
...
@@ -52,6 +52,8 @@ var addType = function (node) {
$
(
'#modal_type_del'
).
hide
();
$
(
'#modal_type_add'
).
show
();
$
(
'#myModalLabel'
).
html
(
"添加类型"
);
$
(
'#cb_new_type_isleaf'
).
prop
(
"checked"
,
true
);
// 默认为子节点
$
(
'#tx_new_type_name'
).
val
(
""
);
$
(
'#tx_type_id'
).
val
(
nodeId2id
(
node
.
id
));
$
(
'#tx_type_action'
).
val
(
"add"
);
$
(
'#tx_new_type_isleaf'
).
val
(
1
);
...
...
@@ -78,6 +80,7 @@ var updateType = function (id, oldName) {
$
(
'#tx_type_action'
).
val
(
"update"
);
$
(
'#tx_type_id'
).
val
(
nodeId2id
(
id
));
$
(
'#tx_update_type_name_old'
).
val
(
oldName
);
$
(
'#tx_update_type_name_new'
).
val
();
$
(
'#modal_type_update'
).
show
();
$
(
'#modal_type_add'
).
hide
();
$
(
'#modal_type_del'
).
hide
();
...
...
@@ -118,8 +121,9 @@ var doAddType = function () {
'id'
:
"node_"
+
newNode
.
typeId
,
'text'
:
newNode
.
typeName
,
'parent'
:
"#node_"
+
newNode
.
typeParentId
,
'data'
:
newNode
.
typeIsLeaf
'data'
:
newNode
.
typeIsLeaf
},
'last'
);
$
(
'#jstree'
).
jstree
().
get_node
(
"node_"
+
newNode
.
typeId
).
data
=
newNode
.
typeIsLeaf
;
}
else
$
.
toaster
(
'添加失败'
+
repjson
.
code
,
'提示'
,
'warning'
);
}
...
...
@@ -250,7 +254,8 @@ $(function () {
"action"
:
function
(
obj
)
{
var
inst
=
jQuery
.
jstree
.
reference
(
obj
.
reference
);
var
clickedNode
=
inst
.
get_node
(
obj
.
reference
);
console
.
log
(
"add operation--clickedNode's id is:"
+
clickedNode
.
id
+
" "
+
clickedNode
);
console
.
log
(
clickedNode
);
console
.
log
(
"add operation--clickedNode's id is:"
+
clickedNode
.
id
);
if
(
clickedNode
.
data
!=
0
)
{
$
.
toaster
(
'叶子节点无法添加子类型'
,
'提示'
,
'info'
);
return
;
...
...
Please
register
or
login
to post a comment