Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
GitCode
1024程序员开源挑战赛(10.23-11.14)
提交
9523be07
1
1024程序员开源挑战赛(10.23-11.14)
项目概览
GitCode
/
1024程序员开源挑战赛(10.23-11.14)
通知
180912
Star
1063
Fork
1042
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
86
列表
看板
标记
里程碑
合并请求
8
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
1
1024程序员开源挑战赛(10.23-11.14)
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
86
Issue
86
列表
看板
标记
里程碑
合并请求
8
合并请求
8
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
9523be07
编写于
8月 22, 2018
作者:
Z
ztree
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* [修改] 替换 scrollIntoViewIfNeeded 方法 Thanks @jocki84
* [修改] 部分 API 文字错误
上级
3935f38e
变更
25
显示空白变更内容
内联
并排
Showing
25 changed file
with
8021 addition
and
8001 deletion
+8021
-8001
README.md
README.md
+1
-1
api/API_cn.html
api/API_cn.html
+1
-1
api/API_en.html
api/API_en.html
+1
-1
api/apiCss/jquery.ztree.core.js
api/apiCss/jquery.ztree.core.js
+65
-66
api/cn/zTreeObj.checkAllNodes.html
api/cn/zTreeObj.checkAllNodes.html
+1
-1
api/cn/zTreeObj.checkNode.html
api/cn/zTreeObj.checkNode.html
+2
-2
api/cn/zTreeObj.getCheckedNodes.html
api/cn/zTreeObj.getCheckedNodes.html
+1
-1
api/cn/zTreeObj.setChkDisabled.html
api/cn/zTreeObj.setChkDisabled.html
+1
-1
api/cn/zTreeObj.updateNode.html
api/cn/zTreeObj.updateNode.html
+1
-1
api/en/zTreeObj.checkAllNodes.html
api/en/zTreeObj.checkAllNodes.html
+1
-1
api/en/zTreeObj.checkNode.html
api/en/zTreeObj.checkNode.html
+2
-2
api/en/zTreeObj.getCheckedNodes.html
api/en/zTreeObj.getCheckedNodes.html
+1
-1
api/en/zTreeObj.setChkDisabled.html
api/en/zTreeObj.setChkDisabled.html
+1
-1
api/en/zTreeObj.updateNode.html
api/en/zTreeObj.updateNode.html
+1
-1
js/jquery.ztree.all.js
js/jquery.ztree.all.js
+3744
-3735
js/jquery.ztree.all.min.js
js/jquery.ztree.all.min.js
+69
-70
js/jquery.ztree.core.js
js/jquery.ztree.core.js
+1906
-1908
js/jquery.ztree.core.min.js
js/jquery.ztree.core.min.js
+65
-66
js/jquery.ztree.excheck.js
js/jquery.ztree.excheck.js
+601
-597
js/jquery.ztree.excheck.min.js
js/jquery.ztree.excheck.min.js
+2
-2
js/jquery.ztree.exedit.js
js/jquery.ztree.exedit.js
+1191
-1184
js/jquery.ztree.exedit.min.js
js/jquery.ztree.exedit.min.js
+2
-2
js/jquery.ztree.exhide.js
js/jquery.ztree.exhide.js
+353
-352
js/jquery.ztree.exhide.min.js
js/jquery.ztree.exhide.min.js
+2
-2
log v3.x.txt
log v3.x.txt
+6
-2
未找到文件。
README.md
浏览文件 @
9523be07
jQuery Tree Plugin ---- zTree
============
last verson : 3.5.3
6
last verson : 3.5.3
7
**Donate to zTree**
: http://www.treejs.cn/v3/donate.php
...
...
api/API_cn.html
浏览文件 @
9523be07
...
...
@@ -35,7 +35,7 @@
<div
class=
"ieSuggest"
>
浏览本网站建议您使用 Chrome、FireFox、Opera、IE9 等浏览器(只要不是 IE6 7 8 就行), 速度会更快,画面会更炫!
</div>
<div
class=
"google_plus"
><g:plusone></g:plusone></div>
<div
class=
"header-text"
>
<h1><em>
zTree v3.5.3
6
API 文档
</em></h1><p></p>
<h1><em>
zTree v3.5.3
7
API 文档
</em></h1><p></p>
<p>
all.js = core + excheck + exedit ( 不包括 exhide ); 发现错误请及时通知,谢谢。
</p>
</div>
<ul
class=
"shortcuts language"
style=
"top:0;"
>
...
...
api/API_en.html
浏览文件 @
9523be07
...
...
@@ -34,7 +34,7 @@
<div
class=
"ieSuggest"
>
If you use the Chrome / FireFox / Opera / IE9 browser will be even more dazzling effect!
</div>
<div
class=
"google_plus"
><g:plusone></g:plusone></div>
<div
class=
"header-text"
>
<h1><em>
zTree v3.5.3
6
API Document
</em></h1><p></p>
<h1><em>
zTree v3.5.3
7
API Document
</em></h1><p></p>
<p>
all.js = core + excheck + exedit ( without exhide ); if you found some mistakes please contact me.
</p>
</div>
<ul
class=
"shortcuts language"
style=
"top:0;"
>
...
...
api/apiCss/jquery.ztree.core.js
浏览文件 @
9523be07
/*
* JQuery zTree core v3.5.3
6
* JQuery zTree core v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -8,69 +8,68 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
q
){
var
H
,
I
,
J
,
K
,
L
,
M
,
u
,
s
=
{},
v
=
{},
w
=
{},
N
=
{
treeId
:
""
,
treeObj
:
null
,
view
:{
addDiyDom
:
null
,
autoCancelSelected
:
!
0
,
dblClickExpand
:
!
0
,
expandSpeed
:
"
fast
"
,
fontCss
:{},
nameIsHTML
:
!
1
,
selectedMulti
:
!
0
,
showIcon
:
!
0
,
showLine
:
!
0
,
showTitle
:
!
0
,
txtSelectedEnable
:
!
1
},
data
:{
key
:{
isParent
:
"
isParent
"
,
children
:
"
children
"
,
name
:
"
name
"
,
title
:
""
,
url
:
"
url
"
,
icon
:
"
icon
"
},
simpleData
:{
enable
:
!
1
,
idKey
:
"
id
"
,
pIdKey
:
"
pId
"
,
rootPId
:
null
},
keep
:{
parent
:
!
1
,
leaf
:
!
1
}},
async
:{
enable
:
!
1
,
contentType
:
"
application/x-www-form-urlencoded
"
,
type
:
"
post
"
,
dataType
:
"
text
"
,
headers
:{},
xhrFields
:{},
url
:
""
,
autoParam
:[],
otherParam
:[],
dataFilter
:
null
},
callback
:{
beforeAsync
:
null
,
beforeClick
:
null
,
beforeDblClick
:
null
,
beforeRightClick
:
null
,
beforeMouseDown
:
null
,
beforeMouseUp
:
null
,
beforeExpand
:
null
,
beforeCollapse
:
null
,
beforeRemove
:
null
,
onAsyncError
:
null
,
onAsyncSuccess
:
null
,
onNodeCreated
:
null
,
onClick
:
null
,
onDblClick
:
null
,
onRightClick
:
null
,
onMouseDown
:
null
,
onMouseUp
:
null
,
onExpand
:
null
,
onCollapse
:
null
,
onRemove
:
null
}},
x
=
[
function
(
a
){
var
b
=
a
.
treeObj
,
c
=
f
.
event
;
b
.
bind
(
c
.
NODECREATED
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onNodeCreated
,[
b
,
c
,
h
])});
b
.
bind
(
c
.
CLICK
,
function
(
b
,
c
,
h
,
e
,
m
){
j
.
apply
(
a
.
callback
.
onClick
,[
c
,
h
,
e
,
m
])});
b
.
bind
(
c
.
EXPAND
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onExpand
,[
b
,
c
,
h
])});
b
.
bind
(
c
.
COLLAPSE
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onCollapse
,[
b
,
c
,
h
])});
b
.
bind
(
c
.
ASYNC_SUCCESS
,
function
(
b
,
c
,
h
,
e
){
j
.
apply
(
a
.
callback
.
onAsyncSuccess
,[
b
,
c
,
h
,
e
])});
b
.
bind
(
c
.
ASYNC_ERROR
,
function
(
b
,
c
,
h
,
e
,
m
,
f
){
j
.
apply
(
a
.
callback
.
onAsyncError
,[
b
,
c
,
h
,
e
,
m
,
f
])});
b
.
bind
(
c
.
REMOVE
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onRemove
,
[
b
,
c
,
h
])});
b
.
bind
(
c
.
SELECTED
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onSelected
,[
c
,
h
])});
b
.
bind
(
c
.
UNSELECTED
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onUnSelected
,[
c
,
h
])})}],
y
=
[
function
(
a
){
var
b
=
f
.
event
;
a
.
treeObj
.
unbind
(
b
.
NODECREATED
).
unbind
(
b
.
CLICK
).
unbind
(
b
.
EXPAND
).
unbind
(
b
.
COLLAPSE
).
unbind
(
b
.
ASYNC_SUCCESS
).
unbind
(
b
.
ASYNC_ERROR
).
unbind
(
b
.
REMOVE
).
unbind
(
b
.
SELECTED
).
unbind
(
b
.
UNSELECTED
)}],
z
=
[
function
(
a
){
var
b
=
e
.
getCache
(
a
);
b
||
(
b
=
{},
e
.
setCache
(
a
,
b
));
b
.
nodes
=
[];
b
.
doms
=
[]}],
A
=
[
function
(
a
,
b
,
c
,
d
,
g
,
h
){
if
(
c
){
var
k
=
e
.
getRoot
(
a
),
m
=
e
.
nodeChildren
(
a
,
c
);
c
.
level
=
b
;
c
.
tId
=
a
.
treeId
+
"
_
"
+
++
k
.
zId
;
c
.
parentTId
=
d
?
d
.
tId
:
null
;
c
.
open
=
typeof
c
.
open
==
"
string
"
?
j
.
eqs
(
c
.
open
,
"
true
"
):
!!
c
.
open
;
b
=
e
.
nodeIsParent
(
a
,
c
);
j
.
isArray
(
m
)
&&!
(
b
===!
1
||
typeof
b
==
"
string
"
&&
j
.
eqs
(
b
,
"
false
"
))?(
e
.
nodeIsParent
(
a
,
c
,
!
0
),
c
.
zAsync
=!
0
):(
b
=
e
.
nodeIsParent
(
a
,
c
,
b
),
c
.
open
=
b
&&!
a
.
async
.
enable
?
c
.
open
:
!
1
,
c
.
zAsync
=!
b
);
c
.
isFirstNode
=
g
;
c
.
isLastNode
=
h
;
c
.
getParentNode
=
function
(){
return
e
.
getNodeCache
(
a
,
c
.
parentTId
)};
c
.
getPreNode
=
function
(){
return
e
.
getPreNode
(
a
,
c
)};
c
.
getNextNode
=
function
(){
return
e
.
getNextNode
(
a
,
c
)};
c
.
getIndex
=
function
(){
return
e
.
getNodeIndex
(
a
,
c
)};
c
.
getPath
=
function
(){
return
e
.
getNodePath
(
a
,
c
)};
c
.
isAjaxing
=!
1
;
e
.
fixPIdKeyValue
(
a
,
c
)}}],
t
=
[
function
(
a
){
var
b
=
a
.
target
,
c
=
e
.
getSetting
(
a
.
data
.
treeId
),
d
=
""
,
g
=
null
,
h
=
""
,
k
=
""
,
m
=
null
,
i
=
null
,
o
=
null
;
if
(
j
.
eqs
(
a
.
type
,
"
mousedown
"
))
k
=
"
mousedown
"
;
else
if
(
j
.
eqs
(
a
.
type
,
"
mouseup
"
))
k
=
"
mouseup
"
;
else
if
(
j
.
eqs
(
a
.
type
,
"
contextmenu
"
))
k
=
"
contextmenu
"
;
else
if
(
j
.
eqs
(
a
.
type
,
"
click
"
))
if
(
j
.
eqs
(
b
.
tagName
,
"
span
"
)
&&
b
.
getAttribute
(
"
treeNode
"
+
f
.
id
.
SWITCH
)
!==
null
)
d
=
j
.
getNodeMainDom
(
b
).
id
,
h
=
"
switchNode
"
;
else
{
if
(
o
=
j
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
f
.
id
.
A
}]))
d
=
j
.
getNodeMainDom
(
o
).
id
,
h
=
"
clickNode
"
}
else
if
(
j
.
eqs
(
a
.
type
,
"
dblclick
"
)
&&
(
k
=
"
dblclick
"
,
o
=
j
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
f
.
id
.
A
}])))
d
=
j
.
getNodeMainDom
(
o
).
id
,
h
=
"
switchNode
"
;
if
(
k
.
length
>
0
&&
d
.
length
==
0
&&
(
o
=
j
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
f
.
id
.
A
}])))
d
=
j
.
getNodeMainDom
(
o
).
id
;
if
(
d
.
length
>
0
)
switch
(
g
=
e
.
getNodeCache
(
c
,
d
),
h
){
case
"
switchNode
"
:
e
.
nodeIsParent
(
c
,
g
)?
j
.
eqs
(
a
.
type
,
"
click
"
)
||
j
.
eqs
(
a
.
type
,
"
dblclick
"
)
&&
j
.
apply
(
c
.
view
.
dblClickExpand
,[
c
.
treeId
,
g
],
c
.
view
.
dblClickExpand
)?
m
=
H
:
h
=
""
:
h
=
""
;
break
;
case
"
clickNode
"
:
m
=
I
}
switch
(
k
){
case
"
mousedown
"
:
i
=
J
;
break
;
case
"
mouseup
"
:
i
=
K
;
break
;
case
"
dblclick
"
:
i
=
L
;
break
;
case
"
contextmenu
"
:
i
=
M
}
return
{
stop
:
!
1
,
node
:
g
,
nodeEventType
:
h
,
nodeEventCallback
:
m
,
treeEventType
:
k
,
treeEventCallback
:
i
}}],
B
=
[
function
(
a
){
var
b
=
e
.
getRoot
(
a
);
b
||
(
b
=
{},
e
.
setRoot
(
a
,
b
));
e
.
nodeChildren
(
a
,
b
,[]);
b
.
expandTriggerFlag
=!
1
;
b
.
curSelectedList
=
[];
b
.
noSelection
=
!
0
;
b
.
createdNodes
=
[];
b
.
zId
=
0
;
b
.
_ver
=
(
new
Date
).
getTime
()}],
C
=
[],
D
=
[],
E
=
[],
F
=
[],
G
=
[],
e
=
{
addNodeCache
:
function
(
a
,
b
){
e
.
getCache
(
a
).
nodes
[
e
.
getNodeCacheId
(
b
.
tId
)]
=
b
},
getNodeCacheId
:
function
(
a
){
return
a
.
substring
(
a
.
lastIndexOf
(
"
_
"
)
+
1
)},
addAfterA
:
function
(
a
){
D
.
push
(
a
)},
addBeforeA
:
function
(
a
){
C
.
push
(
a
)},
addInnerAfterA
:
function
(
a
){
F
.
push
(
a
)},
addInnerBeforeA
:
function
(
a
){
E
.
push
(
a
)},
addInitBind
:
function
(
a
){
x
.
push
(
a
)},
addInitUnBind
:
function
(
a
){
y
.
push
(
a
)},
addInitCache
:
function
(
a
){
z
.
push
(
a
)},
addInitNode
:
function
(
a
){
A
.
push
(
a
)},
addInitProxy
:
function
(
a
,
b
){
b
?
t
.
splice
(
0
,
0
,
a
):
t
.
push
(
a
)},
addInitRoot
:
function
(
a
){
B
.
push
(
a
)},
addNodesData
:
function
(
a
,
b
,
c
,
d
){
var
g
=
e
.
nodeChildren
(
a
,
b
);
g
?
c
>=
g
.
length
&&
(
c
=-
1
):(
g
=
e
.
nodeChildren
(
a
,
b
,[]),
c
=-
1
);
if
(
g
.
length
>
0
&&
c
===
0
)
g
[
0
].
isFirstNode
=!
1
,
i
.
setNodeLineIcos
(
a
,
g
[
0
]);
else
if
(
g
.
length
>
0
&&
c
<
0
)
g
[
g
.
length
-
1
].
isLastNode
=!
1
,
i
.
setNodeLineIcos
(
a
,
g
[
g
.
length
-
1
]);
e
.
nodeIsParent
(
a
,
b
,
!
0
);
c
<
0
?
e
.
nodeChildren
(
a
,
b
,
g
.
concat
(
d
)):(
a
=
[
c
,
0
].
concat
(
d
),
g
.
splice
.
apply
(
g
,
a
))},
addSelectedNode
:
function
(
a
,
b
){
var
c
=
e
.
getRoot
(
a
);
e
.
isSelectedNode
(
a
,
b
)
||
c
.
curSelectedList
.
push
(
b
)},
addCreatedNode
:
function
(
a
,
b
){(
a
.
callback
.
onNodeCreated
||
a
.
view
.
addDiyDom
)
&&
e
.
getRoot
(
a
).
createdNodes
.
push
(
b
)},
addZTreeTools
:
function
(
a
){
G
.
push
(
a
)},
exSetting
:
function
(
a
){
q
.
extend
(
!
0
,
N
,
a
)},
fixPIdKeyValue
:
function
(
a
,
b
){
a
.
data
.
simpleData
.
enable
&&
(
b
[
a
.
data
.
simpleData
.
pIdKey
]
=
b
.
parentTId
?
b
.
getParentNode
()[
a
.
data
.
simpleData
.
idKey
]:
a
.
data
.
simpleData
.
rootPId
)},
getAfterA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
D
.
length
;
d
<
e
;
d
++
)
D
[
d
].
apply
(
this
,
arguments
)},
getBeforeA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
C
.
length
;
d
<
e
;
d
++
)
C
[
d
].
apply
(
this
,
arguments
)},
getInnerAfterA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
F
.
length
;
d
<
e
;
d
++
)
F
[
d
].
apply
(
this
,
arguments
)},
getInnerBeforeA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
E
.
length
;
d
<
e
;
d
++
)
E
[
d
].
apply
(
this
,
arguments
)},
getCache
:
function
(
a
){
return
w
[
a
.
treeId
]},
getNodeIndex
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
g
=
c
.
length
-
1
;
d
<=
g
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
;
return
-
1
},
getNextNode
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
g
=
c
.
length
-
1
;
d
<=
g
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
==
g
?
null
:
c
[
d
+
1
];
return
null
},
getNodeByParam
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
null
;
for
(
var
g
=
0
,
h
=
b
.
length
;
g
<
h
;
g
++
){
var
k
=
b
[
g
];
if
(
k
[
c
]
==
d
)
return
b
[
g
];
k
=
e
.
nodeChildren
(
a
,
k
);
if
(
k
=
e
.
getNodeByParam
(
a
,
k
,
c
,
d
))
return
k
}
return
null
},
getNodeCache
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
var
c
=
w
[
a
.
treeId
].
nodes
[
e
.
getNodeCacheId
(
b
)];
return
c
?
c
:
null
},
getNodePath
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
var
c
;
(
c
=
b
.
parentTId
?
b
.
getParentNode
().
getPath
():[])
&&
c
.
push
(
b
);
return
c
},
getNodes
:
function
(
a
){
return
e
.
nodeChildren
(
a
,
e
.
getRoot
(
a
))},
getNodesByParam
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
[];
for
(
var
g
=
[],
h
=
0
,
k
=
b
.
length
;
h
<
k
;
h
++
){
var
m
=
b
[
h
];
m
[
c
]
==
d
&&
g
.
push
(
m
);
m
=
e
.
nodeChildren
(
a
,
m
);
g
=
g
.
concat
(
e
.
getNodesByParam
(
a
,
m
,
c
,
d
))}
return
g
},
getNodesByParamFuzzy
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
[];
for
(
var
g
=
[],
d
=
d
.
toLowerCase
(),
h
=
0
,
k
=
b
.
length
;
h
<
k
;
h
++
){
var
m
=
b
[
h
];
typeof
m
[
c
]
==
"
string
"
&&
b
[
h
][
c
].
toLowerCase
().
indexOf
(
d
)
>-
1
&&
g
.
push
(
m
);
m
=
e
.
nodeChildren
(
a
,
m
);
g
=
g
.
concat
(
e
.
getNodesByParamFuzzy
(
a
,
m
,
c
,
d
))}
return
g
},
getNodesByFilter
:
function
(
a
,
b
,
c
,
d
,
g
){
if
(
!
b
)
return
d
?
null
:[];
for
(
var
h
=
d
?
null
:[],
k
=
0
,
m
=
b
.
length
;
k
<
m
;
k
++
){
var
f
=
b
[
k
];
if
(
j
.
apply
(
c
,[
f
,
g
],
!
1
)){
if
(
d
)
return
f
;
h
.
push
(
f
)}
f
=
e
.
nodeChildren
(
a
,
f
);
f
=
e
.
getNodesByFilter
(
a
,
f
,
c
,
d
,
g
);
if
(
d
&&
f
)
return
f
;
h
=
d
?
f
:
h
.
concat
(
f
)}
return
h
},
getPreNode
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
g
=
c
.
length
;
d
<
g
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
==
0
?
null
:
c
[
d
-
1
];
return
null
},
getRoot
:
function
(
a
){
return
a
?
v
[
a
.
treeId
]:
null
},
getRoots
:
function
(){
return
v
},
getSetting
:
function
(
a
){
return
s
[
a
]},
getSettings
:
function
(){
return
s
},
getZTreeTools
:
function
(
a
){
return
(
a
=
this
.
getRoot
(
this
.
getSetting
(
a
)))?
a
.
treeTools
:
null
},
initCache
:
function
(
a
){
for
(
var
b
=
0
,
c
=
z
.
length
;
b
<
c
;
b
++
)
z
[
b
].
apply
(
this
,
arguments
)},
initNode
:
function
(
a
,
b
,
c
,
d
,
e
,
h
){
for
(
var
k
=
0
,
f
=
A
.
length
;
k
<
f
;
k
++
)
A
[
k
].
apply
(
this
,
arguments
)},
initRoot
:
function
(
a
){
for
(
var
b
=
0
,
c
=
B
.
length
;
b
<
c
;
b
++
)
B
[
b
].
apply
(
this
,
arguments
)},
isSelectedNode
:
function
(
a
,
b
){
for
(
var
c
=
e
.
getRoot
(
a
),
d
=
0
,
g
=
c
.
curSelectedList
.
length
;
d
<
g
;
d
++
)
if
(
b
===
c
.
curSelectedList
[
d
])
return
!
0
;
return
!
1
},
nodeChildren
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
null
;
a
=
a
.
data
.
key
.
children
;
typeof
c
!==
"
undefined
"
&&
(
b
[
a
]
=
c
);
return
b
[
a
]},
nodeIsParent
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
!
1
;
a
=
a
.
data
.
key
.
isParent
;
typeof
c
!==
"
undefined
"
&&
(
typeof
c
===
"
string
"
&&
(
c
=
j
.
eqs
(
c
,
"
true
"
)),
b
[
a
]
=!!
c
);
return
b
[
a
]},
nodeName
:
function
(
a
,
b
,
c
){
a
=
a
.
data
.
key
.
name
;
typeof
c
!==
"
undefined
"
&&
(
b
[
a
]
=
c
);
return
""
+
b
[
a
]},
nodeTitle
:
function
(
a
,
b
){
return
""
+
b
[
a
.
data
.
key
.
title
===
""
?
a
.
data
.
key
.
name
:
a
.
data
.
key
.
title
]},
removeNodeCache
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
)
for
(
var
d
=
0
,
g
=
c
.
length
;
d
<
g
;
d
++
)
e
.
removeNodeCache
(
a
,
c
[
d
]);
e
.
getCache
(
a
).
nodes
[
e
.
getNodeCacheId
(
b
.
tId
)]
=
null
},
removeSelectedNode
:
function
(
a
,
b
){
for
(
var
c
=
e
.
getRoot
(
a
),
d
=
0
,
g
=
c
.
curSelectedList
.
length
;
d
<
g
;
d
++
)
if
(
b
===
c
.
curSelectedList
[
d
]
||!
e
.
getNodeCache
(
a
,
c
.
curSelectedList
[
d
].
tId
))
c
.
curSelectedList
.
splice
(
d
,
1
),
a
.
treeObj
.
trigger
(
f
.
event
.
UNSELECTED
,[
a
.
treeId
,
b
]),
d
--
,
g
--
},
setCache
:
function
(
a
,
b
){
w
[
a
.
treeId
]
=
b
},
setRoot
:
function
(
a
,
b
){
v
[
a
.
treeId
]
=
b
},
setZTreeTools
:
function
(
a
,
b
){
for
(
var
c
=
0
,
d
=
G
.
length
;
c
<
d
;
c
++
)
G
[
c
].
apply
(
this
,
arguments
)},
transformToArrayFormat
:
function
(
a
,
b
){
function
c
(
b
){
d
.
push
(
b
);(
b
=
e
.
nodeChildren
(
a
,
b
))
&&
(
d
=
d
.
concat
(
e
.
transformToArrayFormat
(
a
,
b
)))}
if
(
!
b
)
return
[];
var
d
=
[];
if
(
j
.
isArray
(
b
))
for
(
var
g
=
0
,
h
=
b
.
length
;
g
<
h
;
g
++
)
c
(
b
[
g
]);
else
c
(
b
);
return
d
},
transformTozTreeFormat
:
function
(
a
,
b
){
var
c
,
d
,
g
=
a
.
data
.
simpleData
.
idKey
,
h
=
a
.
data
.
simpleData
.
pIdKey
;
if
(
!
g
||
g
==
""
||!
b
)
return
[];
if
(
j
.
isArray
(
b
)){
var
k
=
[],
f
=
{};
for
(
c
=
0
,
d
=
b
.
length
;
c
<
d
;
c
++
)
f
[
b
[
c
][
g
]]
=
b
[
c
];
for
(
c
=
0
,
d
=
b
.
length
;
c
<
d
;
c
++
){
var
i
=
f
[
b
[
c
][
h
]];
if
(
i
&&
b
[
c
][
g
]
!=
b
[
c
][
h
]){
var
o
=
e
.
nodeChildren
(
a
,
i
);
o
||
(
o
=
e
.
nodeChildren
(
a
,
i
,[]));
o
.
push
(
b
[
c
])}
else
k
.
push
(
b
[
c
])}
return
k
}
else
return
[
b
]}},
n
=
{
bindEvent
:
function
(
a
){
for
(
var
b
=
0
,
c
=
x
.
length
;
b
<
c
;
b
++
)
x
[
b
].
apply
(
this
,
arguments
)},
unbindEvent
:
function
(
a
){
for
(
var
b
=
0
,
c
=
y
.
length
;
b
<
c
;
b
++
)
y
[
b
].
apply
(
this
,
arguments
)},
bindTree
:
function
(
a
){
var
b
=
{
treeId
:
a
.
treeId
},
c
=
a
.
treeObj
;
a
.
view
.
txtSelectedEnable
||
c
.
bind
(
"
selectstart
"
,
u
).
css
({
"
-moz-user-select
"
:
"
-moz-none
"
});
c
.
bind
(
"
click
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
dblclick
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseover
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseout
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mousedown
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseup
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
contextmenu
"
,
b
,
n
.
proxy
)},
unbindTree
:
function
(
a
){
a
.
treeObj
.
unbind
(
"
selectstart
"
,
u
).
unbind
(
"
click
"
,
n
.
proxy
).
unbind
(
"
dblclick
"
,
n
.
proxy
).
unbind
(
"
mouseover
"
,
n
.
proxy
).
unbind
(
"
mouseout
"
,
n
.
proxy
).
unbind
(
"
mousedown
"
,
n
.
proxy
).
unbind
(
"
mouseup
"
,
n
.
proxy
).
unbind
(
"
contextmenu
"
,
n
.
proxy
)},
doProxy
:
function
(
a
){
for
(
var
b
=
[],
c
=
0
,
d
=
t
.
length
;
c
<
d
;
c
++
){
var
e
=
t
[
c
].
apply
(
this
,
arguments
);
b
.
push
(
e
);
if
(
e
.
stop
)
break
}
return
b
},
proxy
:
function
(
a
){
var
b
=
e
.
getSetting
(
a
.
data
.
treeId
);
if
(
!
j
.
uCanDo
(
b
,
a
))
return
!
0
;
for
(
var
b
=
n
.
doProxy
(
a
),
c
=!
0
,
d
=
0
,
g
=
b
.
length
;
d
<
g
;
d
++
){
var
h
=
b
[
d
];
h
.
nodeEventCallback
&&
(
c
=
h
.
nodeEventCallback
.
apply
(
h
,[
a
,
h
.
node
])
&&
c
);
h
.
treeEventCallback
&&
(
c
=
h
.
treeEventCallback
.
apply
(
h
,[
a
,
h
.
node
])
&&
c
)}
return
c
}};
H
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
if
(
b
.
open
){
if
(
j
.
apply
(
c
.
callback
.
beforeCollapse
,[
c
.
treeId
,
b
],
!
0
)
==
!
1
)
return
!
0
}
else
if
(
j
.
apply
(
c
.
callback
.
beforeExpand
,[
c
.
treeId
,
b
],
!
0
)
==!
1
)
return
!
0
;
e
.
getRoot
(
c
).
expandTriggerFlag
=!
0
;
i
.
switchNode
(
c
,
b
);
return
!
0
};
I
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
),
d
=
c
.
view
.
autoCancelSelected
&&
(
a
.
ctrlKey
||
a
.
metaKey
)
&&
e
.
isSelectedNode
(
c
,
b
)?
0
:
c
.
view
.
autoCancelSelected
&&
(
a
.
ctrlKey
||
a
.
metaKey
)
&&
c
.
view
.
selectedMulti
?
2
:
1
;
if
(
j
.
apply
(
c
.
callback
.
beforeClick
,[
c
.
treeId
,
b
,
d
],
!
0
)
==!
1
)
return
!
0
;
d
===
0
?
i
.
cancelPreSelectedNode
(
c
,
b
):
i
.
selectNode
(
c
,
b
,
d
===
2
);
c
.
treeObj
.
trigger
(
f
.
event
.
CLICK
,
[
a
,
c
.
treeId
,
b
,
d
]);
return
!
0
};
J
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
j
.
apply
(
c
.
callback
.
beforeMouseDown
,[
c
.
treeId
,
b
],
!
0
)
&&
j
.
apply
(
c
.
callback
.
onMouseDown
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
K
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
j
.
apply
(
c
.
callback
.
beforeMouseUp
,[
c
.
treeId
,
b
],
!
0
)
&&
j
.
apply
(
c
.
callback
.
onMouseUp
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
L
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
j
.
apply
(
c
.
callback
.
beforeDblClick
,[
c
.
treeId
,
b
],
!
0
)
&&
j
.
apply
(
c
.
callback
.
onDblClick
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
M
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
j
.
apply
(
c
.
callback
.
beforeRightClick
,[
c
.
treeId
,
b
],
!
0
)
&&
j
.
apply
(
c
.
callback
.
onRightClick
,[
a
,
c
.
treeId
,
b
]);
return
typeof
c
.
callback
.
onRightClick
!=
"
function
"
};
u
=
function
(
a
){
a
=
a
.
originalEvent
.
srcElement
.
nodeName
.
toLowerCase
();
return
a
===
"
input
"
||
a
===
"
textarea
"
};
var
j
=
{
apply
:
function
(
a
,
b
,
c
){
return
typeof
a
==
"
function
"
?
a
.
apply
(
O
,
b
?
b
:[]):
c
},
canAsync
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
),
d
=
e
.
nodeIsParent
(
a
,
b
);
return
a
.
async
.
enable
&&
b
&&
d
&&!
(
b
.
zAsync
||
c
&&
c
.
length
>
0
)},
clone
:
function
(
a
){
if
(
a
===
null
)
return
null
;
var
b
=
j
.
isArray
(
a
)?[]:{},
c
;
for
(
c
in
a
)
b
[
c
]
=
a
[
c
]
instanceof
Date
?
new
Date
(
a
[
c
].
getTime
()):
typeof
a
[
c
]
===
"
object
"
?
j
.
clone
(
a
[
c
]):
a
[
c
];
return
b
},
eqs
:
function
(
a
,
b
){
return
a
.
toLowerCase
()
===
b
.
toLowerCase
()},
isArray
:
function
(
a
){
return
Object
.
prototype
.
toString
.
apply
(
a
)
===
"
[object Array]
"
},
isElement
:
function
(
a
){
return
typeof
HTMLElement
===
"
object
"
?
a
instanceof
HTMLElement
:
a
&&
typeof
a
===
"
object
"
&&
a
!==
null
&&
a
.
nodeType
===
1
&&
typeof
a
.
nodeName
===
"
string
"
},
$
:
function
(
a
,
b
,
c
){
b
&&
typeof
b
!=
"
string
"
&&
(
c
=
b
,
b
=
""
);
return
typeof
a
==
"
string
"
?
q
(
a
,
c
?
c
.
treeObj
.
get
(
0
).
ownerDocument
:
null
):
q
(
"
#
"
+
a
.
tId
+
b
,
c
?
c
.
treeObj
:
null
)},
getMDom
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
null
;
for
(;
b
&&
b
.
id
!==
a
.
treeId
;){
for
(
var
d
=
0
,
e
=
c
.
length
;
b
.
tagName
&&
d
<
e
;
d
++
)
if
(
j
.
eqs
(
b
.
tagName
,
c
[
d
].
tagName
)
&&
b
.
getAttribute
(
c
[
d
].
attrName
)
!==
null
)
return
b
;
b
=
b
.
parentNode
}
return
null
},
getNodeMainDom
:
function
(
a
){
return
q
(
a
).
parent
(
"
li
"
).
get
(
0
)
||
q
(
a
).
parentsUntil
(
"
li
"
).
parent
().
get
(
0
)},
isChildOrSelf
:
function
(
a
,
b
){
return
q
(
a
).
closest
(
"
#
"
+
b
).
length
>
0
},
uCanDo
:
function
(){
return
!
0
}},
i
=
{
addNodes
:
function
(
a
,
b
,
c
,
d
,
g
){
var
h
=
e
.
nodeIsParent
(
a
,
b
);
if
(
!
a
.
data
.
keep
.
leaf
||!
b
||
h
)
if
(
j
.
isArray
(
d
)
||
(
d
=
[
d
]),
a
.
data
.
simpleData
.
enable
&&
(
d
=
e
.
transformTozTreeFormat
(
a
,
d
)),
b
){
var
h
=
l
(
b
,
f
.
id
.
SWITCH
,
a
),
k
=
l
(
b
,
f
.
id
.
ICON
,
a
),
m
=
l
(
b
,
f
.
id
.
UL
,
a
);
if
(
!
b
.
open
)
i
.
replaceSwitchClass
(
b
,
h
,
f
.
folder
.
CLOSE
),
i
.
replaceIcoClass
(
b
,
k
,
f
.
folder
.
CLOSE
),
b
.
open
=!
1
,
m
.
css
({
display
:
"
none
"
});
e
.
addNodesData
(
a
,
b
,
c
,
d
);
i
.
createNodes
(
a
,
b
.
level
+
1
,
d
,
b
,
c
);
g
||
i
.
expandCollapseParentNode
(
a
,
b
,
!
0
)}
else
e
.
addNodesData
(
a
,
e
.
getRoot
(
a
),
c
,
d
),
i
.
createNodes
(
a
,
0
,
d
,
null
,
c
)},
appendNodes
:
function
(
a
,
b
,
c
,
d
,
g
,
h
,
k
){
if
(
!
c
)
return
[];
var
f
=
[],
j
=
d
?
d
:
e
.
getRoot
(
a
),
j
=
e
.
nodeChildren
(
a
,
j
),
o
,
l
;
if
(
!
j
||
g
>=
j
.
length
-
c
.
length
)
g
=-
1
;
for
(
var
n
=
0
,
Q
=
c
.
length
;
n
<
Q
;
n
++
){
var
p
=
c
[
n
];
h
&&
(
o
=
(
g
===
0
||
j
.
length
==
c
.
length
)
&&
n
==
0
,
l
=
g
<
0
&&
n
==
c
.
length
-
1
,
e
.
initNode
(
a
,
b
,
p
,
d
,
o
,
l
,
k
),
e
.
addNodeCache
(
a
,
p
));
o
=
e
.
nodeIsParent
(
a
,
p
);
l
=
[];
var
q
=
e
.
nodeChildren
(
a
,
p
);
q
&&
q
.
length
>
0
&&
(
l
=
i
.
appendNodes
(
a
,
b
+
1
,
q
,
p
,
-
1
,
h
,
k
&&
p
.
open
));
k
&&
(
i
.
makeDOMNodeMainBefore
(
f
,
a
,
p
),
i
.
makeDOMNodeLine
(
f
,
a
,
p
),
e
.
getBeforeA
(
a
,
p
,
f
),
i
.
makeDOMNodeNameBefore
(
f
,
a
,
p
),
e
.
getInnerBeforeA
(
a
,
p
,
f
),
i
.
makeDOMNodeIcon
(
f
,
a
,
p
),
e
.
getInnerAfterA
(
a
,
p
,
f
),
i
.
makeDOMNodeNameAfter
(
f
,
a
,
p
),
e
.
getAfterA
(
a
,
p
,
f
),
o
&&
p
.
open
&&
i
.
makeUlHtml
(
a
,
p
,
f
,
l
.
join
(
""
)),
i
.
makeDOMNodeMainAfter
(
f
,
a
,
p
),
e
.
addCreatedNode
(
a
,
p
))}
return
f
},
appendParentULDom
:
function
(
a
,
b
){
var
c
=
[],
d
=
l
(
b
,
a
);
!
d
.
get
(
0
)
&&
b
.
parentTId
&&
(
i
.
appendParentULDom
(
a
,
b
.
getParentNode
()),
d
=
l
(
b
,
a
));
var
g
=
l
(
b
,
f
.
id
.
UL
,
a
);
g
.
get
(
0
)
&&
g
.
remove
();
g
=
e
.
nodeChildren
(
a
,
b
);
g
=
i
.
appendNodes
(
a
,
b
.
level
+
1
,
g
,
b
,
-
1
,
!
1
,
!
0
);
i
.
makeUlHtml
(
a
,
b
,
c
,
g
.
join
(
""
));
d
.
append
(
c
.
join
(
""
))},
asyncNode
:
function
(
a
,
b
,
c
,
d
){
var
g
,
h
;
g
=
e
.
nodeIsParent
(
a
,
b
);
if
(
b
&&!
g
)
return
j
.
apply
(
d
),
!
1
;
else
if
(
b
&&
b
.
isAjaxing
)
return
!
1
;
else
if
(
j
.
apply
(
a
.
callback
.
beforeAsync
,[
a
.
treeId
,
b
],
!
0
)
==!
1
)
return
j
.
apply
(
d
),
!
1
;
if
(
b
)
b
.
isAjaxing
=!
0
,
l
(
b
,
f
.
id
.
ICON
,
a
).
attr
({
style
:
""
,
"
class
"
:
f
.
className
.
BUTTON
+
"
"
+
f
.
className
.
ICO_LOADING
});
var
k
=
{},
m
=
j
.
apply
(
a
.
async
.
autoParam
,[
a
.
treeId
,
b
],
a
.
async
.
autoParam
);
for
(
g
=
0
,
h
=
m
.
length
;
b
&&
g
<
h
;
g
++
){
var
r
=
m
[
g
].
split
(
"
=
"
),
o
=
r
;
r
.
length
>
1
&&
(
o
=
r
[
1
],
r
=
r
[
0
]);
k
[
o
]
=
b
[
r
]}
m
=
j
.
apply
(
a
.
async
.
otherParam
,[
a
.
treeId
,
b
],
a
.
async
.
otherParam
);
if
(
j
.
isArray
(
m
))
for
(
g
=
0
,
h
=
m
.
length
;
g
<
h
;
g
+=
2
)
k
[
m
[
g
]]
=
m
[
g
+
1
];
else
for
(
var
n
in
m
)
k
[
n
]
=
m
[
n
];
var
P
=
e
.
getRoot
(
a
).
_ver
;
q
.
ajax
({
contentType
:
a
.
async
.
contentType
,
cache
:
!
1
,
type
:
a
.
async
.
type
,
url
:
j
.
apply
(
a
.
async
.
url
,[
a
.
treeId
,
b
],
a
.
async
.
url
),
data
:
a
.
async
.
contentType
.
indexOf
(
"
application/json
"
)
>-
1
?
JSON
.
stringify
(
k
):
k
,
dataType
:
a
.
async
.
dataType
,
headers
:
a
.
async
.
headers
,
xhrFields
:
a
.
async
.
xhrFields
,
success
:
function
(
h
){
if
(
P
==
e
.
getRoot
(
a
).
_ver
){
var
k
=
[];
try
{
k
=!
h
||
h
.
length
==
0
?[]:
typeof
h
==
"
string
"
?
eval
(
"
(
"
+
h
+
"
)
"
):
h
}
catch
(
g
){
k
=
h
}
if
(
b
)
b
.
isAjaxing
=
null
,
b
.
zAsync
=!
0
;
i
.
setNodeLineIcos
(
a
,
b
);
k
&&
k
!==
""
?(
k
=
j
.
apply
(
a
.
async
.
dataFilter
,[
a
.
treeId
,
b
,
k
],
k
),
i
.
addNodes
(
a
,
b
,
-
1
,
k
?
j
.
clone
(
k
):[],
!!
c
)):
i
.
addNodes
(
a
,
b
,
-
1
,[],
!!
c
);
a
.
treeObj
.
trigger
(
f
.
event
.
ASYNC_SUCCESS
,[
a
.
treeId
,
b
,
h
]);
j
.
apply
(
d
)}},
error
:
function
(
c
,
d
,
h
){
if
(
P
==
e
.
getRoot
(
a
).
_ver
){
if
(
b
)
b
.
isAjaxing
=
null
;
i
.
setNodeLineIcos
(
a
,
b
);
a
.
treeObj
.
trigger
(
f
.
event
.
ASYNC_ERROR
,[
a
.
treeId
,
b
,
c
,
d
,
h
])}}});
return
!
0
},
cancelPreSelectedNode
:
function
(
a
,
b
,
c
){
var
d
=
e
.
getRoot
(
a
).
curSelectedList
,
g
,
h
;
for
(
g
=
d
.
length
-
1
;
g
>=
0
;
g
--
)
if
(
h
=
d
[
g
],
b
===
h
||!
b
&&
(
!
c
||
c
!==
h
))
if
(
l
(
h
,
f
.
id
.
A
,
a
).
removeClass
(
f
.
node
.
CURSELECTED
),
b
){
e
.
removeSelectedNode
(
a
,
b
);
break
}
else
d
.
splice
(
g
,
1
),
a
.
treeObj
.
trigger
(
f
.
event
.
UNSELECTED
,[
a
.
treeId
,
h
])},
createNodeCallback
:
function
(
a
){
if
(
a
.
callback
.
onNodeCreated
||
a
.
view
.
addDiyDom
)
for
(
var
b
=
e
.
getRoot
(
a
);
b
.
createdNodes
.
length
>
0
;){
var
c
=
b
.
createdNodes
.
shift
();
j
.
apply
(
a
.
view
.
addDiyDom
,[
a
.
treeId
,
c
]);
a
.
callback
.
onNodeCreated
&&
a
.
treeObj
.
trigger
(
f
.
event
.
NODECREATED
,[
a
.
treeId
,
c
])}},
createNodes
:
function
(
a
,
b
,
c
,
d
,
g
){
if
(
c
&&
c
.
length
!=
0
){
var
h
=
e
.
getRoot
(
a
),
k
=!
d
||
d
.
open
||!!
l
(
e
.
nodeChildren
(
a
,
d
)[
0
],
a
).
get
(
0
);
h
.
createdNodes
=
[];
var
b
=
i
.
appendNodes
(
a
,
b
,
c
,
d
,
g
,
!
0
,
k
),
m
,
j
;
d
?(
d
=
l
(
d
,
f
.
id
.
UL
,
a
),
d
.
get
(
0
)
&&
(
m
=
d
)):
m
=
a
.
treeObj
;
m
&&
(
g
>=
0
&&
(
j
=
m
.
children
()[
g
]),
g
>=
0
&&
j
?
q
(
j
).
before
(
b
.
join
(
""
)):
m
.
append
(
b
.
join
(
""
)));
i
.
createNodeCallback
(
a
)}},
destroy
:
function
(
a
){
a
&&
(
e
.
initCache
(
a
),
e
.
initRoot
(
a
),
n
.
unbindTree
(
a
),
n
.
unbindEvent
(
a
),
a
.
treeObj
.
empty
(),
delete
s
[
a
.
treeId
])},
expandCollapseNode
:
function
(
a
,
b
,
c
,
d
,
g
){
var
h
=
e
.
getRoot
(
a
),
k
;
if
(
b
){
var
m
=
e
.
nodeChildren
(
a
,
b
),
r
=
e
.
nodeIsParent
(
a
,
b
);
if
(
h
.
expandTriggerFlag
)
k
=
g
,
g
=
function
(){
k
&&
k
();
b
.
open
?
a
.
treeObj
.
trigger
(
f
.
event
.
EXPAND
,[
a
.
treeId
,
b
]):
a
.
treeObj
.
trigger
(
f
.
event
.
COLLAPSE
,[
a
.
treeId
,
b
])},
h
.
expandTriggerFlag
=!
1
;
if
(
!
b
.
open
&&
r
&&
(
!
l
(
b
,
f
.
id
.
UL
,
a
).
get
(
0
)
||
m
&&
m
.
length
>
0
&&!
l
(
m
[
0
],
a
).
get
(
0
)))
i
.
appendParentULDom
(
a
,
b
),
i
.
createNodeCallback
(
a
);
if
(
b
.
open
==
c
)
j
.
apply
(
g
,[]);
else
{
var
c
=
l
(
b
,
f
.
id
.
UL
,
a
),
h
=
l
(
b
,
f
.
id
.
SWITCH
,
a
),
o
=
l
(
b
,
f
.
id
.
ICON
,
a
);
r
?(
b
.
open
=!
b
.
open
,
b
.
iconOpen
&&
b
.
iconClose
&&
o
.
attr
(
"
style
"
,
i
.
makeNodeIcoStyle
(
a
,
b
)),
b
.
open
?(
i
.
replaceSwitchClass
(
b
,
h
,
f
.
folder
.
OPEN
),
i
.
replaceIcoClass
(
b
,
o
,
f
.
folder
.
OPEN
),
d
==!
1
||
a
.
view
.
expandSpeed
==
""
?(
c
.
show
(),
j
.
apply
(
g
,[])):
m
&&
m
.
length
>
0
?
c
.
slideDown
(
a
.
view
.
expandSpeed
,
g
):(
c
.
show
(),
j
.
apply
(
g
,[]))):(
i
.
replaceSwitchClass
(
b
,
h
,
f
.
folder
.
CLOSE
),
i
.
replaceIcoClass
(
b
,
o
,
f
.
folder
.
CLOSE
),
d
==!
1
||
a
.
view
.
expandSpeed
==
""
||!
(
m
&&
m
.
length
>
0
)?(
c
.
hide
(),
j
.
apply
(
g
,[])):
c
.
slideUp
(
a
.
view
.
expandSpeed
,
g
))):
j
.
apply
(
g
,[])}}
else
j
.
apply
(
g
,
[])},
expandCollapseParentNode
:
function
(
a
,
b
,
c
,
d
,
e
){
b
&&
(
b
.
parentTId
?(
i
.
expandCollapseNode
(
a
,
b
,
c
,
d
),
b
.
parentTId
&&
i
.
expandCollapseParentNode
(
a
,
b
.
getParentNode
(),
c
,
d
,
e
)):
i
.
expandCollapseNode
(
a
,
b
,
c
,
d
,
e
))},
expandCollapseSonNode
:
function
(
a
,
b
,
c
,
d
,
g
){
var
h
=
e
.
getRoot
(
a
),
h
=
b
?
e
.
nodeChildren
(
a
,
b
):
e
.
nodeChildren
(
a
,
h
),
k
=
b
?
!
1
:
d
,
f
=
e
.
getRoot
(
a
).
expandTriggerFlag
;
e
.
getRoot
(
a
).
expandTriggerFlag
=!
1
;
if
(
h
)
for
(
var
j
=
0
,
l
=
h
.
length
;
j
<
l
;
j
++
)
h
[
j
]
&&
i
.
expandCollapseSonNode
(
a
,
h
[
j
],
c
,
k
);
e
.
getRoot
(
a
).
expandTriggerFlag
=
f
;
i
.
expandCollapseNode
(
a
,
b
,
c
,
d
,
g
)},
isSelectedNode
:
function
(
a
,
b
){
if
(
!
b
)
return
!
1
;
var
c
=
e
.
getRoot
(
a
).
curSelectedList
,
d
;
for
(
d
=
c
.
length
-
1
;
d
>=
0
;
d
--
)
if
(
b
===
c
[
d
])
return
!
0
;
return
!
1
},
makeDOMNodeIcon
:
function
(
a
,
b
,
c
){
var
d
=
e
.
nodeName
(
b
,
c
),
d
=
b
.
view
.
nameIsHTML
?
d
:
d
.
replace
(
/&/g
,
"
&
"
).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
);
a
.
push
(
"
<span id='
"
,
c
.
tId
,
f
.
id
.
ICON
,
"
' title='' treeNode
"
,
f
.
id
.
ICON
,
"
class='
"
,
i
.
makeNodeIcoClass
(
b
,
c
),
"
' style='
"
,
i
.
makeNodeIcoStyle
(
b
,
c
),
"
'></span><span id='
"
,
c
.
tId
,
f
.
id
.
SPAN
,
"
' class='
"
,
f
.
className
.
NAME
,
"
'>
"
,
d
,
"
</span>
"
)},
makeDOMNodeLine
:
function
(
a
,
b
,
c
){
a
.
push
(
"
<span id='
"
,
c
.
tId
,
f
.
id
.
SWITCH
,
"
' title='' class='
"
,
i
.
makeNodeLineClass
(
b
,
c
),
"
' treeNode
"
,
f
.
id
.
SWITCH
,
"
></span>
"
)},
makeDOMNodeMainAfter
:
function
(
a
){
a
.
push
(
"
</li>
"
)},
makeDOMNodeMainBefore
:
function
(
a
,
b
,
c
){
a
.
push
(
"
<li id='
"
,
c
.
tId
,
"
' class='
"
,
f
.
className
.
LEVEL
,
c
.
level
,
"
' tabindex='0' hidefocus='true' treenode>
"
)},
makeDOMNodeNameAfter
:
function
(
a
){
a
.
push
(
"
</a>
"
)},
makeDOMNodeNameBefore
:
function
(
a
,
b
,
c
){
var
d
=
e
.
nodeTitle
(
b
,
c
),
g
=
i
.
makeNodeUrl
(
b
,
c
),
h
=
i
.
makeNodeFontCss
(
b
,
c
),
k
=
[],
m
;
for
(
m
in
h
)
k
.
push
(
m
,
"
:
"
,
h
[
m
],
"
;
"
);
a
.
push
(
"
<a id='
"
,
c
.
tId
,
f
.
id
.
A
,
"
' class='
"
,
f
.
className
.
LEVEL
,
c
.
level
,
"
' treeNode
"
,
f
.
id
.
A
,
'
onclick="
'
,
c
.
click
||
""
,
'
"
'
,
g
!=
null
&&
g
.
length
>
0
?
"
href='
"
+
g
+
"
'
"
:
""
,
"
target='
"
,
i
.
makeNodeTarget
(
c
),
"
' style='
"
,
k
.
join
(
""
),
"
'
"
);
j
.
apply
(
b
.
view
.
showTitle
,[
b
.
treeId
,
c
],
b
.
view
.
showTitle
)
&&
d
&&
a
.
push
(
"
title='
"
,
d
.
replace
(
/'/g
,
"
'
"
).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
),
"
'
"
);
a
.
push
(
"
>
"
)},
makeNodeFontCss
:
function
(
a
,
b
){
var
c
=
j
.
apply
(
a
.
view
.
fontCss
,[
a
.
treeId
,
b
],
a
.
view
.
fontCss
);
return
c
&&
typeof
c
!=
"
function
"
?
c
:{}},
makeNodeIcoClass
:
function
(
a
,
b
){
var
c
=
[
"
ico
"
];
if
(
!
b
.
isAjaxing
){
var
d
=
e
.
nodeIsParent
(
a
,
b
);
c
[
0
]
=
(
b
.
iconSkin
?
b
.
iconSkin
+
"
_
"
:
""
)
+
c
[
0
];
d
?
c
.
push
(
b
.
open
?
f
.
folder
.
OPEN
:
f
.
folder
.
CLOSE
):
c
.
push
(
f
.
folder
.
DOCU
)}
return
f
.
className
.
BUTTON
+
"
"
+
c
.
join
(
"
_
"
)},
makeNodeIcoStyle
:
function
(
a
,
b
){
var
c
=
[];
if
(
!
b
.
isAjaxing
){
var
d
=
e
.
nodeIsParent
(
a
,
b
)
&&
b
.
iconOpen
&&
b
.
iconClose
?
b
.
open
?
b
.
iconOpen
:
b
.
iconClose
:
b
[
a
.
data
.
key
.
icon
];
d
&&
c
.
push
(
"
background:url(
"
,
d
,
"
) 0 0 no-repeat;
"
);(
a
.
view
.
showIcon
==
!
1
||!
j
.
apply
(
a
.
view
.
showIcon
,[
a
.
treeId
,
b
],
!
0
))
&&
c
.
push
(
"
width:0px;height:0px;
"
)}
return
c
.
join
(
""
)},
makeNodeLineClass
:
function
(
a
,
b
){
var
c
=
[];
a
.
view
.
showLine
?
b
.
level
==
0
&&
b
.
isFirstNode
&&
b
.
isLastNode
?
c
.
push
(
f
.
line
.
ROOT
):
b
.
level
==
0
&&
b
.
isFirstNode
?
c
.
push
(
f
.
line
.
ROOTS
):
b
.
isLastNode
?
c
.
push
(
f
.
line
.
BOTTOM
):
c
.
push
(
f
.
line
.
CENTER
):
c
.
push
(
f
.
line
.
NOLINE
);
e
.
nodeIsParent
(
a
,
b
)?
c
.
push
(
b
.
open
?
f
.
folder
.
OPEN
:
f
.
folder
.
CLOSE
):
c
.
push
(
f
.
folder
.
DOCU
);
return
i
.
makeNodeLineClassEx
(
b
)
+
c
.
join
(
"
_
"
)},
makeNodeLineClassEx
:
function
(
a
){
return
f
.
className
.
BUTTON
+
"
"
+
f
.
className
.
LEVEL
+
a
.
level
+
"
"
+
f
.
className
.
SWITCH
+
"
"
},
makeNodeTarget
:
function
(
a
){
return
a
.
target
||
"
_blank
"
},
makeNodeUrl
:
function
(
a
,
b
){
var
c
=
a
.
data
.
key
.
url
;
return
b
[
c
]?
b
[
c
]:
null
},
makeUlHtml
:
function
(
a
,
b
,
c
,
d
){
c
.
push
(
"
<ul id='
"
,
b
.
tId
,
f
.
id
.
UL
,
"
' class='
"
,
f
.
className
.
LEVEL
,
b
.
level
,
"
"
,
i
.
makeUlLineClass
(
a
,
b
),
"
' style='display:
"
,
b
.
open
?
"
block
"
:
"
none
"
,
"
'>
"
);
c
.
push
(
d
);
c
.
push
(
"
</ul>
"
)},
makeUlLineClass
:
function
(
a
,
b
){
return
a
.
view
.
showLine
&&!
b
.
isLastNode
?
f
.
line
.
LINE
:
""
},
removeChildNodes
:
function
(
a
,
b
){
if
(
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
){
for
(
var
d
=
0
,
g
=
c
.
length
;
d
<
g
;
d
++
)
e
.
removeNodeCache
(
a
,
c
[
d
]);
e
.
removeSelectedNode
(
a
);
delete
b
[
a
.
data
.
key
.
children
];
a
.
data
.
keep
.
parent
?
l
(
b
,
f
.
id
.
UL
,
a
).
empty
():(
e
.
nodeIsParent
(
a
,
b
,
!
1
),
b
.
open
=!
1
,
c
=
l
(
b
,
f
.
id
.
SWITCH
,
a
),
d
=
l
(
b
,
f
.
id
.
ICON
,
a
),
i
.
replaceSwitchClass
(
b
,
c
,
f
.
folder
.
DOCU
),
i
.
replaceIcoClass
(
b
,
d
,
f
.
folder
.
DOCU
),
l
(
b
,
f
.
id
.
UL
,
a
).
remove
())}}},
scrollIntoView
:
function
(
a
,
b
){
if
(
b
)
if
(
typeof
Element
===
"
undefined
"
){
var
c
=
a
.
treeObj
.
get
(
0
).
getBoundingClientRect
(),
d
=
b
.
getBoundingClientRect
();(
d
.
top
<
c
.
top
||
d
.
bottom
>
c
.
bottom
||
d
.
right
>
c
.
right
||
d
.
left
<
c
.
left
)
&&
b
.
scrollIntoView
()}
else
{
if
(
!
Element
.
prototype
.
scrollIntoViewIfNeeded
)
Element
.
prototype
.
scrollIntoViewIfNeeded
=
function
(
a
){
function
b
(
a
,
c
,
d
,
f
){
return
{
left
:
a
,
top
:
c
,
width
:
d
,
height
:
f
,
right
:
a
+
d
,
bottom
:
c
+
f
,
translate
:
function
(
e
,
g
){
return
b
(
e
+
a
,
g
+
c
,
d
,
f
)},
relativeFromTo
:
function
(
g
,
k
){
var
i
=
a
,
j
=
c
,
g
=
g
.
offsetParent
,
k
=
k
.
offsetParent
;
if
(
g
===
k
)
return
e
;
for
(;
g
;
g
=
g
.
offsetParent
)
i
+=
g
.
offsetLeft
+
g
.
clientLeft
,
j
+=
g
.
offsetTop
+
g
.
clientTop
;
for
(;
k
;
k
=
k
.
offsetParent
)
i
-=
k
.
offsetLeft
+
k
.
clientLeft
,
j
-=
k
.
offsetTop
+
k
.
clientTop
;
return
b
(
i
,
j
,
d
,
f
)}}}
for
(
var
c
,
d
=
this
,
e
=
b
(
this
.
offsetLeft
,
this
.
offsetTop
,
this
.
offsetWidth
,
this
.
offsetHeight
);
j
.
isElement
(
c
=
d
.
parentNode
);){
var
f
=
c
.
offsetLeft
+
c
.
clientLeft
,
i
=
c
.
offsetTop
+
c
.
clientTop
,
e
=
e
.
relativeFromTo
(
d
,
c
).
translate
(
-
f
,
-
i
);
c
.
scrollLeft
=!
1
===
a
||
e
.
left
<=
c
.
scrollLeft
+
c
.
clientWidth
&&
c
.
scrollLeft
<=
e
.
right
-
c
.
clientWidth
+
c
.
clientWidth
?
Math
.
min
(
e
.
left
,
Math
.
max
(
e
.
right
-
c
.
clientWidth
,
c
.
scrollLeft
)):(
e
.
right
-
c
.
clientWidth
+
e
.
left
)
/
2
;
c
.
scrollTop
=
!
1
===
a
||
e
.
top
<=
c
.
scrollTop
+
c
.
clientHeight
&&
c
.
scrollTop
<=
e
.
bottom
-
c
.
clientHeight
+
c
.
clientHeight
?
Math
.
min
(
e
.
top
,
Math
.
max
(
e
.
bottom
-
c
.
clientHeight
,
c
.
scrollTop
)):(
e
.
bottom
-
c
.
clientHeight
+
e
.
top
)
/
2
;
e
=
e
.
translate
(
f
-
c
.
scrollLeft
,
i
-
c
.
scrollTop
);
d
=
c
}};
b
.
scrollIntoViewIfNeeded
()}},
setFirstNode
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
.
length
>
0
)
c
[
0
].
isFirstNode
=!
0
},
setLastNode
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
.
length
>
0
)
c
[
c
.
length
-
1
].
isLastNode
=!
0
},
removeNode
:
function
(
a
,
b
){
var
c
=
e
.
getRoot
(
a
),
d
=
b
.
parentTId
?
b
.
getParentNode
():
c
;
b
.
isFirstNode
=!
1
;
b
.
isLastNode
=!
1
;
b
.
getPreNode
=
function
(){
return
null
};
b
.
getNextNode
=
function
(){
return
null
};
if
(
e
.
getNodeCache
(
a
,
b
.
tId
)){
l
(
b
,
a
).
remove
();
e
.
removeNodeCache
(
a
,
b
);
e
.
removeSelectedNode
(
a
,
b
);
for
(
var
g
=
e
.
nodeChildren
(
a
,
d
),
h
=
0
,
k
=
g
.
length
;
h
<
k
;
h
++
)
if
(
g
[
h
].
tId
==
b
.
tId
){
g
.
splice
(
h
,
1
);
break
}
i
.
setFirstNode
(
a
,
d
);
i
.
setLastNode
(
a
,
d
);
var
j
,
h
=
g
.
length
;
if
(
!
a
.
data
.
keep
.
parent
&&
h
==
0
)
e
.
nodeIsParent
(
a
,
d
,
!
1
),
d
.
open
=!
1
,
delete
d
[
a
.
data
.
key
.
children
],
h
=
l
(
d
,
f
.
id
.
UL
,
a
),
k
=
l
(
d
,
f
.
id
.
SWITCH
,
a
),
j
=
l
(
d
,
f
.
id
.
ICON
,
a
),
i
.
replaceSwitchClass
(
d
,
k
,
f
.
folder
.
DOCU
),
i
.
replaceIcoClass
(
d
,
j
,
f
.
folder
.
DOCU
),
h
.
css
(
"
display
"
,
"
none
"
);
else
if
(
a
.
view
.
showLine
&&
h
>
0
){
var
r
=
g
[
h
-
1
],
h
=
l
(
r
,
f
.
id
.
UL
,
a
),
k
=
l
(
r
,
f
.
id
.
SWITCH
,
a
);
j
=
l
(
r
,
f
.
id
.
ICON
,
a
);
d
==
c
?
g
.
length
==
1
?
i
.
replaceSwitchClass
(
r
,
k
,
f
.
line
.
ROOT
):(
c
=
l
(
g
[
0
],
f
.
id
.
SWITCH
,
a
),
i
.
replaceSwitchClass
(
g
[
0
],
c
,
f
.
line
.
ROOTS
),
i
.
replaceSwitchClass
(
r
,
k
,
f
.
line
.
BOTTOM
)):
i
.
replaceSwitchClass
(
r
,
k
,
f
.
line
.
BOTTOM
);
h
.
removeClass
(
f
.
line
.
LINE
)}}},
replaceIcoClass
:
function
(
a
,
b
,
c
){
if
(
b
&&!
a
.
isAjaxing
&&
(
a
=
b
.
attr
(
"
class
"
),
a
!=
void
0
)){
a
=
a
.
split
(
"
_
"
);
switch
(
c
){
case
f
.
folder
.
OPEN
:
case
f
.
folder
.
CLOSE
:
case
f
.
folder
.
DOCU
:
a
[
a
.
length
-
1
]
=
c
}
b
.
attr
(
"
class
"
,
a
.
join
(
"
_
"
))}},
replaceSwitchClass
:
function
(
a
,
b
,
c
){
if
(
b
){
var
d
=
b
.
attr
(
"
class
"
);
if
(
d
!=
void
0
){
d
=
d
.
split
(
"
_
"
);
switch
(
c
){
case
f
.
line
.
ROOT
:
case
f
.
line
.
ROOTS
:
case
f
.
line
.
CENTER
:
case
f
.
line
.
BOTTOM
:
case
f
.
line
.
NOLINE
:
d
[
0
]
=
i
.
makeNodeLineClassEx
(
a
)
+
c
;
break
;
case
f
.
folder
.
OPEN
:
case
f
.
folder
.
CLOSE
:
case
f
.
folder
.
DOCU
:
d
[
1
]
=
c
}
b
.
attr
(
"
class
"
,
d
.
join
(
"
_
"
));
c
!==
f
.
folder
.
DOCU
?
b
.
removeAttr
(
"
disabled
"
):
b
.
attr
(
"
disabled
"
,
"
disabled
"
)}}},
selectNode
:
function
(
a
,
b
,
c
){
c
||
i
.
cancelPreSelectedNode
(
a
,
null
,
b
);
l
(
b
,
f
.
id
.
A
,
a
).
addClass
(
f
.
node
.
CURSELECTED
);
e
.
addSelectedNode
(
a
,
b
);
a
.
treeObj
.
trigger
(
f
.
event
.
SELECTED
,[
a
.
treeId
,
b
])},
setNodeFontCss
:
function
(
a
,
b
){
var
c
=
l
(
b
,
f
.
id
.
A
,
a
),
d
=
i
.
makeNodeFontCss
(
a
,
b
);
d
&&
c
.
css
(
d
)},
setNodeLineIcos
:
function
(
a
,
b
){
if
(
b
){
var
c
=
l
(
b
,
f
.
id
.
SWITCH
,
a
),
d
=
l
(
b
,
f
.
id
.
UL
,
a
),
g
=
l
(
b
,
f
.
id
.
ICON
,
a
),
h
=
i
.
makeUlLineClass
(
a
,
b
);
h
.
length
==
0
?
d
.
removeClass
(
f
.
line
.
LINE
):
d
.
addClass
(
h
);
c
.
attr
(
"
class
"
,
i
.
makeNodeLineClass
(
a
,
b
));
e
.
nodeIsParent
(
a
,
b
)?
c
.
removeAttr
(
"
disabled
"
):
c
.
attr
(
"
disabled
"
,
"
disabled
"
);
g
.
removeAttr
(
"
style
"
);
g
.
attr
(
"
style
"
,
i
.
makeNodeIcoStyle
(
a
,
b
));
g
.
attr
(
"
class
"
,
i
.
makeNodeIcoClass
(
a
,
b
))}},
setNodeName
:
function
(
a
,
b
){
var
c
=
e
.
nodeTitle
(
a
,
b
),
d
=
l
(
b
,
f
.
id
.
SPAN
,
a
);
d
.
empty
();
a
.
view
.
nameIsHTML
?
d
.
html
(
e
.
nodeName
(
a
,
b
)):
d
.
text
(
e
.
nodeName
(
a
,
b
));
j
.
apply
(
a
.
view
.
showTitle
,[
a
.
treeId
,
b
],
a
.
view
.
showTitle
)
&&
l
(
b
,
f
.
id
.
A
,
a
).
attr
(
"
title
"
,
!
c
?
""
:
c
)},
setNodeTarget
:
function
(
a
,
b
){
l
(
b
,
f
.
id
.
A
,
a
).
attr
(
"
target
"
,
i
.
makeNodeTarget
(
b
))},
setNodeUrl
:
function
(
a
,
b
){
var
c
=
l
(
b
,
f
.
id
.
A
,
a
),
d
=
i
.
makeNodeUrl
(
a
,
b
);
d
==
null
||
d
.
length
==
0
?
c
.
removeAttr
(
"
href
"
):
c
.
attr
(
"
href
"
,
d
)},
switchNode
:
function
(
a
,
b
){
b
.
open
||!
j
.
canAsync
(
a
,
b
)?
i
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
):
a
.
async
.
enable
?
i
.
asyncNode
(
a
,
b
)
||
i
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
):
b
&&
i
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
)}};
q
.
fn
.
zTree
=
{
consts
:{
className
:{
BUTTON
:
"
button
"
,
LEVEL
:
"
level
"
,
ICO_LOADING
:
"
ico_loading
"
,
SWITCH
:
"
switch
"
,
NAME
:
"
node_name
"
},
event
:{
NODECREATED
:
"
ztree_nodeCreated
"
,
CLICK
:
"
ztree_click
"
,
EXPAND
:
"
ztree_expand
"
,
COLLAPSE
:
"
ztree_collapse
"
,
ASYNC_SUCCESS
:
"
ztree_async_success
"
,
ASYNC_ERROR
:
"
ztree_async_error
"
,
REMOVE
:
"
ztree_remove
"
,
SELECTED
:
"
ztree_selected
"
,
UNSELECTED
:
"
ztree_unselected
"
},
id
:{
A
:
"
_a
"
,
ICON
:
"
_ico
"
,
SPAN
:
"
_span
"
,
SWITCH
:
"
_switch
"
,
UL
:
"
_ul
"
},
line
:{
ROOT
:
"
root
"
,
ROOTS
:
"
roots
"
,
CENTER
:
"
center
"
,
BOTTOM
:
"
bottom
"
,
NOLINE
:
"
noline
"
,
LINE
:
"
line
"
},
folder
:{
OPEN
:
"
open
"
,
CLOSE
:
"
close
"
,
DOCU
:
"
docu
"
},
node
:{
CURSELECTED
:
"
curSelectedNode
"
}},
_z
:{
tools
:
j
,
view
:
i
,
event
:
n
,
data
:
e
},
getZTreeObj
:
function
(
a
){
return
(
a
=
e
.
getZTreeTools
(
a
))?
a
:
null
},
destroy
:
function
(
a
){
if
(
a
&&
a
.
length
>
0
)
i
.
destroy
(
e
.
getSetting
(
a
));
else
for
(
var
b
in
s
)
i
.
destroy
(
s
[
b
])},
init
:
function
(
a
,
b
,
c
){
var
d
=
j
.
clone
(
N
);
q
.
extend
(
!
0
,
d
,
b
);
d
.
treeId
=
a
.
attr
(
"
id
"
);
d
.
treeObj
=
a
;
d
.
treeObj
.
empty
();
s
[
d
.
treeId
]
=
d
;
if
(
typeof
document
.
body
.
style
.
maxHeight
===
"
undefined
"
)
d
.
view
.
expandSpeed
=
""
;
e
.
initRoot
(
d
);
a
=
e
.
getRoot
(
d
);
c
=
c
?
j
.
clone
(
j
.
isArray
(
c
)?
c
:[
c
]):[];
d
.
data
.
simpleData
.
enable
?
e
.
nodeChildren
(
d
,
a
,
e
.
transformTozTreeFormat
(
d
,
c
)):
e
.
nodeChildren
(
d
,
a
,
c
);
e
.
initCache
(
d
);
n
.
unbindTree
(
d
);
n
.
bindTree
(
d
);
n
.
unbindEvent
(
d
);
n
.
bindEvent
(
d
);
var
g
=
{
setting
:
d
,
addNodes
:
function
(
a
,
b
,
c
,
g
){
function
f
(){
i
.
addNodes
(
d
,
a
,
b
,
n
,
g
==!
0
)}
a
||
(
a
=
null
);
var
l
=
e
.
nodeIsParent
(
d
,
a
);
if
(
a
&&!
l
&&
d
.
data
.
keep
.
leaf
)
return
null
;
l
=
parseInt
(
b
,
10
);
isNaN
(
l
)?(
g
=!!
c
,
c
=
b
,
b
=-
1
):
b
=
l
;
if
(
!
c
)
return
null
;
var
n
=
j
.
clone
(
j
.
isArray
(
c
)?
c
:[
c
]);
j
.
canAsync
(
d
,
a
)?
i
.
asyncNode
(
d
,
a
,
g
,
f
):
f
();
return
n
},
cancelSelectedNode
:
function
(
a
){
i
.
cancelPreSelectedNode
(
d
,
a
)},
destroy
:
function
(){
i
.
destroy
(
d
)},
expandAll
:
function
(
a
){
a
=!!
a
;
i
.
expandCollapseSonNode
(
d
,
null
,
a
,
!
0
);
return
a
},
expandNode
:
function
(
a
,
b
,
c
,
g
,
f
){
function
n
(){
var
b
=
l
(
a
,
d
).
get
(
0
);
b
&&
g
!==!
1
&&
i
.
scrollIntoView
(
d
,
b
)}
if
(
!
a
||!
e
.
nodeIsParent
(
d
,
a
))
return
null
;
b
!==!
0
&&
b
!==!
1
&&
(
b
=!
a
.
open
);
if
((
f
=!!
f
)
&&
b
&&
j
.
apply
(
d
.
callback
.
beforeExpand
,[
d
.
treeId
,
a
],
!
0
)
==!
1
)
return
null
;
else
if
(
f
&&!
b
&&
j
.
apply
(
d
.
callback
.
beforeCollapse
,[
d
.
treeId
,
a
],
!
0
)
==!
1
)
return
null
;
b
&&
a
.
parentTId
&&
i
.
expandCollapseParentNode
(
d
,
a
.
getParentNode
(),
b
,
!
1
);
if
(
b
===
a
.
open
&&!
c
)
return
null
;
e
.
getRoot
(
d
).
expandTriggerFlag
=
f
;
!
j
.
canAsync
(
d
,
a
)
&&
c
?
i
.
expandCollapseSonNode
(
d
,
a
,
b
,
!
0
,
n
):(
a
.
open
=!
b
,
i
.
switchNode
(
this
.
setting
,
a
),
n
());
return
b
},
getNodes
:
function
(){
return
e
.
getNodes
(
d
)},
getNodeByParam
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodeByParam
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodeByTId
:
function
(
a
){
return
e
.
getNodeCache
(
d
,
a
)},
getNodesByParam
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodesByParam
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodesByParamFuzzy
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodesByParamFuzzy
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodesByFilter
:
function
(
a
,
b
,
c
,
f
){
b
=!!
b
;
return
!
a
||
typeof
a
!=
"
function
"
?
b
?
null
:[]:
e
.
getNodesByFilter
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
,
f
)},
getNodeIndex
:
function
(
a
){
if
(
!
a
)
return
null
;
for
(
var
b
=
a
.
parentTId
?
a
.
getParentNode
():
e
.
getRoot
(
d
),
b
=
e
.
nodeChildren
(
d
,
b
),
c
=
0
,
f
=
b
.
length
;
c
<
f
;
c
++
)
if
(
b
[
c
]
==
a
)
return
c
;
return
-
1
},
getSelectedNodes
:
function
(){
for
(
var
a
=
[],
b
=
e
.
getRoot
(
d
).
curSelectedList
,
c
=
0
,
f
=
b
.
length
;
c
<
f
;
c
++
)
a
.
push
(
b
[
c
]);
return
a
},
isSelectedNode
:
function
(
a
){
return
e
.
isSelectedNode
(
d
,
a
)},
reAsyncChildNodesPromise
:
function
(
a
,
b
,
c
){
return
new
Promise
(
function
(
d
,
e
){
try
{
g
.
reAsyncChildNodes
(
a
,
b
,
c
,
function
(){
d
(
a
)})}
catch
(
f
){
e
(
f
)}})},
reAsyncChildNodes
:
function
(
a
,
b
,
c
,
g
){
if
(
this
.
setting
.
async
.
enable
){
var
j
=!
a
;
j
&&
(
a
=
e
.
getRoot
(
d
));
if
(
b
==
"
refresh
"
){
for
(
var
b
=
e
.
nodeChildren
(
d
,
a
),
n
=
0
,
q
=
b
?
b
.
length
:
0
;
n
<
q
;
n
++
)
e
.
removeNodeCache
(
d
,
b
[
n
]);
e
.
removeSelectedNode
(
d
);
e
.
nodeChildren
(
d
,
a
,[]);
j
?
this
.
setting
.
treeObj
.
empty
():
l
(
a
,
f
.
id
.
UL
,
d
).
empty
()}
i
.
asyncNode
(
this
.
setting
,
j
?
null
:
a
,
!!
c
,
g
)}},
refresh
:
function
(){
this
.
setting
.
treeObj
.
empty
();
var
a
=
e
.
getRoot
(
d
),
b
=
e
.
nodeChildren
(
d
,
a
);
e
.
initRoot
(
d
);
e
.
nodeChildren
(
d
,
a
,
b
);
e
.
initCache
(
d
);
i
.
createNodes
(
d
,
0
,
e
.
nodeChildren
(
d
,
a
),
null
,
-
1
)},
removeChildNodes
:
function
(
a
){
if
(
!
a
)
return
null
;
var
b
=
e
.
nodeChildren
(
d
,
a
);
i
.
removeChildNodes
(
d
,
a
);
return
b
?
b
:
null
},
removeNode
:
function
(
a
,
b
){
a
&&
(
b
=!!
b
,
b
&&
j
.
apply
(
d
.
callback
.
beforeRemove
,[
d
.
treeId
,
a
],
!
0
)
==!
1
||
(
i
.
removeNode
(
d
,
a
),
b
&&
this
.
setting
.
treeObj
.
trigger
(
f
.
event
.
REMOVE
,[
d
.
treeId
,
a
])))},
selectNode
:
function
(
a
,
b
,
c
){
function
e
(){
if
(
!
c
){
var
b
=
l
(
a
,
d
).
get
(
0
);
i
.
scrollIntoView
(
d
,
b
)}}
if
(
a
&&
j
.
uCanDo
(
d
)){
b
=
d
.
view
.
selectedMulti
&&
b
;
if
(
a
.
parentTId
)
i
.
expandCollapseParentNode
(
d
,
a
.
getParentNode
(),
!
0
,
!
1
,
e
);
else
if
(
!
c
)
try
{
l
(
a
,
d
).
focus
().
blur
()}
catch
(
f
){}
i
.
selectNode
(
d
,
a
,
b
)}},
transformTozTreeNodes
:
function
(
a
){
return
e
.
transformTozTreeFormat
(
d
,
a
)},
transformToArray
:
function
(
a
){
return
e
.
transformToArrayFormat
(
d
,
a
)},
updateNode
:
function
(
a
){
a
&&
l
(
a
,
d
).
get
(
0
)
&&
j
.
uCanDo
(
d
)
&&
(
i
.
setNodeName
(
d
,
a
),
i
.
setNodeTarget
(
d
,
a
),
i
.
setNodeUrl
(
d
,
a
),
i
.
setNodeLineIcos
(
d
,
a
),
i
.
setNodeFontCss
(
d
,
a
))}};
a
.
treeTools
=
g
;
e
.
setZTreeTools
(
d
,
g
);(
c
=
e
.
nodeChildren
(
d
,
a
))
&&
c
.
length
>
0
?
i
.
createNodes
(
d
,
0
,
c
,
null
,
-
1
):
d
.
async
.
enable
&&
d
.
async
.
url
&&
d
.
async
.
url
!==
""
&&
i
.
asyncNode
(
d
);
return
g
}};
var
O
=
q
.
fn
.
zTree
,
l
=
j
.
$
,
f
=
O
.
consts
})(
jQuery
);
(
function
(
r
){
var
J
,
K
,
L
,
M
,
N
,
O
,
v
,
t
=
{},
w
=
{},
x
=
{},
P
=
{
treeId
:
""
,
treeObj
:
null
,
view
:{
addDiyDom
:
null
,
autoCancelSelected
:
!
0
,
dblClickExpand
:
!
0
,
expandSpeed
:
"
fast
"
,
fontCss
:{},
nameIsHTML
:
!
1
,
selectedMulti
:
!
0
,
showIcon
:
!
0
,
showLine
:
!
0
,
showTitle
:
!
0
,
txtSelectedEnable
:
!
1
},
data
:{
key
:{
isParent
:
"
isParent
"
,
children
:
"
children
"
,
name
:
"
name
"
,
title
:
""
,
url
:
"
url
"
,
icon
:
"
icon
"
},
simpleData
:{
enable
:
!
1
,
idKey
:
"
id
"
,
pIdKey
:
"
pId
"
,
rootPId
:
null
},
keep
:{
parent
:
!
1
,
leaf
:
!
1
}},
async
:{
enable
:
!
1
,
contentType
:
"
application/x-www-form-urlencoded
"
,
type
:
"
post
"
,
dataType
:
"
text
"
,
headers
:{},
xhrFields
:{},
url
:
""
,
autoParam
:[],
otherParam
:[],
dataFilter
:
null
},
callback
:{
beforeAsync
:
null
,
beforeClick
:
null
,
beforeDblClick
:
null
,
beforeRightClick
:
null
,
beforeMouseDown
:
null
,
beforeMouseUp
:
null
,
beforeExpand
:
null
,
beforeCollapse
:
null
,
beforeRemove
:
null
,
onAsyncError
:
null
,
onAsyncSuccess
:
null
,
onNodeCreated
:
null
,
onClick
:
null
,
onDblClick
:
null
,
onRightClick
:
null
,
onMouseDown
:
null
,
onMouseUp
:
null
,
onExpand
:
null
,
onCollapse
:
null
,
onRemove
:
null
}},
y
=
[
function
(
a
){
var
b
=
a
.
treeObj
,
c
=
g
.
event
;
b
.
bind
(
c
.
NODECREATED
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onNodeCreated
,[
b
,
c
,
i
])});
b
.
bind
(
c
.
CLICK
,
function
(
b
,
c
,
i
,
e
,
k
){
h
.
apply
(
a
.
callback
.
onClick
,[
c
,
i
,
e
,
k
])});
b
.
bind
(
c
.
EXPAND
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onExpand
,[
b
,
c
,
i
])});
b
.
bind
(
c
.
COLLAPSE
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onCollapse
,[
b
,
c
,
i
])});
b
.
bind
(
c
.
ASYNC_SUCCESS
,
function
(
b
,
c
,
i
,
e
){
h
.
apply
(
a
.
callback
.
onAsyncSuccess
,[
b
,
c
,
i
,
e
])});
b
.
bind
(
c
.
ASYNC_ERROR
,
function
(
b
,
c
,
i
,
e
,
k
,
g
){
h
.
apply
(
a
.
callback
.
onAsyncError
,[
b
,
c
,
i
,
e
,
k
,
g
])});
b
.
bind
(
c
.
REMOVE
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onRemove
,
[
b
,
c
,
i
])});
b
.
bind
(
c
.
SELECTED
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onSelected
,[
c
,
i
])});
b
.
bind
(
c
.
UNSELECTED
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onUnSelected
,[
c
,
i
])})}],
z
=
[
function
(
a
){
var
b
=
g
.
event
;
a
.
treeObj
.
unbind
(
b
.
NODECREATED
).
unbind
(
b
.
CLICK
).
unbind
(
b
.
EXPAND
).
unbind
(
b
.
COLLAPSE
).
unbind
(
b
.
ASYNC_SUCCESS
).
unbind
(
b
.
ASYNC_ERROR
).
unbind
(
b
.
REMOVE
).
unbind
(
b
.
SELECTED
).
unbind
(
b
.
UNSELECTED
)}],
A
=
[
function
(
a
){
var
b
=
e
.
getCache
(
a
);
b
||
(
b
=
{},
e
.
setCache
(
a
,
b
));
b
.
nodes
=
[];
b
.
doms
=
[]}],
B
=
[
function
(
a
,
b
,
c
,
d
,
f
,
i
){
if
(
c
){
var
m
=
e
.
getRoot
(
a
),
k
=
e
.
nodeChildren
(
a
,
c
);
c
.
level
=
b
;
c
.
tId
=
a
.
treeId
+
"
_
"
+
++
m
.
zId
;
c
.
parentTId
=
d
?
d
.
tId
:
null
;
c
.
open
=
typeof
c
.
open
==
"
string
"
?
h
.
eqs
(
c
.
open
,
"
true
"
):
!!
c
.
open
;
b
=
e
.
nodeIsParent
(
a
,
c
);
h
.
isArray
(
k
)
&&!
(
b
===!
1
||
typeof
b
==
"
string
"
&&
h
.
eqs
(
b
,
"
false
"
))?(
e
.
nodeIsParent
(
a
,
c
,
!
0
),
c
.
zAsync
=!
0
):(
b
=
e
.
nodeIsParent
(
a
,
c
,
b
),
c
.
open
=
b
&&!
a
.
async
.
enable
?
c
.
open
:
!
1
,
c
.
zAsync
=!
b
);
c
.
isFirstNode
=
f
;
c
.
isLastNode
=
i
;
c
.
getParentNode
=
function
(){
return
e
.
getNodeCache
(
a
,
c
.
parentTId
)};
c
.
getPreNode
=
function
(){
return
e
.
getPreNode
(
a
,
c
)};
c
.
getNextNode
=
function
(){
return
e
.
getNextNode
(
a
,
c
)};
c
.
getIndex
=
function
(){
return
e
.
getNodeIndex
(
a
,
c
)};
c
.
getPath
=
function
(){
return
e
.
getNodePath
(
a
,
c
)};
c
.
isAjaxing
=!
1
;
e
.
fixPIdKeyValue
(
a
,
c
)}}],
u
=
[
function
(
a
){
var
b
=
a
.
target
,
c
=
e
.
getSetting
(
a
.
data
.
treeId
),
d
=
""
,
f
=
null
,
i
=
""
,
m
=
""
,
k
=
null
,
j
=
null
,
o
=
null
;
if
(
h
.
eqs
(
a
.
type
,
"
mousedown
"
))
m
=
"
mousedown
"
;
else
if
(
h
.
eqs
(
a
.
type
,
"
mouseup
"
))
m
=
"
mouseup
"
;
else
if
(
h
.
eqs
(
a
.
type
,
"
contextmenu
"
))
m
=
"
contextmenu
"
;
else
if
(
h
.
eqs
(
a
.
type
,
"
click
"
))
if
(
h
.
eqs
(
b
.
tagName
,
"
span
"
)
&&
b
.
getAttribute
(
"
treeNode
"
+
g
.
id
.
SWITCH
)
!==
null
)
d
=
h
.
getNodeMainDom
(
b
).
id
,
i
=
"
switchNode
"
;
else
{
if
(
o
=
h
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
g
.
id
.
A
}]))
d
=
h
.
getNodeMainDom
(
o
).
id
,
i
=
"
clickNode
"
}
else
if
(
h
.
eqs
(
a
.
type
,
"
dblclick
"
)
&&
(
m
=
"
dblclick
"
,
o
=
h
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
g
.
id
.
A
}])))
d
=
h
.
getNodeMainDom
(
o
).
id
,
i
=
"
switchNode
"
;
if
(
m
.
length
>
0
&&
d
.
length
==
0
&&
(
o
=
h
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
g
.
id
.
A
}])))
d
=
h
.
getNodeMainDom
(
o
).
id
;
if
(
d
.
length
>
0
)
switch
(
f
=
e
.
getNodeCache
(
c
,
d
),
i
){
case
"
switchNode
"
:
e
.
nodeIsParent
(
c
,
f
)?
h
.
eqs
(
a
.
type
,
"
click
"
)
||
h
.
eqs
(
a
.
type
,
"
dblclick
"
)
&&
h
.
apply
(
c
.
view
.
dblClickExpand
,[
c
.
treeId
,
f
],
c
.
view
.
dblClickExpand
)?
k
=
J
:
i
=
""
:
i
=
""
;
break
;
case
"
clickNode
"
:
k
=
K
}
switch
(
m
){
case
"
mousedown
"
:
j
=
L
;
break
;
case
"
mouseup
"
:
j
=
M
;
break
;
case
"
dblclick
"
:
j
=
N
;
break
;
case
"
contextmenu
"
:
j
=
O
}
return
{
stop
:
!
1
,
node
:
f
,
nodeEventType
:
i
,
nodeEventCallback
:
k
,
treeEventType
:
m
,
treeEventCallback
:
j
}}],
C
=
[
function
(
a
){
var
b
=
e
.
getRoot
(
a
);
b
||
(
b
=
{},
e
.
setRoot
(
a
,
b
));
e
.
nodeChildren
(
a
,
b
,[]);
b
.
expandTriggerFlag
=!
1
;
b
.
curSelectedList
=
[];
b
.
noSelection
=
!
0
;
b
.
createdNodes
=
[];
b
.
zId
=
0
;
b
.
_ver
=
(
new
Date
).
getTime
()}],
D
=
[],
E
=
[],
F
=
[],
G
=
[],
H
=
[],
e
=
{
addNodeCache
:
function
(
a
,
b
){
e
.
getCache
(
a
).
nodes
[
e
.
getNodeCacheId
(
b
.
tId
)]
=
b
},
getNodeCacheId
:
function
(
a
){
return
a
.
substring
(
a
.
lastIndexOf
(
"
_
"
)
+
1
)},
addAfterA
:
function
(
a
){
E
.
push
(
a
)},
addBeforeA
:
function
(
a
){
D
.
push
(
a
)},
addInnerAfterA
:
function
(
a
){
G
.
push
(
a
)},
addInnerBeforeA
:
function
(
a
){
F
.
push
(
a
)},
addInitBind
:
function
(
a
){
y
.
push
(
a
)},
addInitUnBind
:
function
(
a
){
z
.
push
(
a
)},
addInitCache
:
function
(
a
){
A
.
push
(
a
)},
addInitNode
:
function
(
a
){
B
.
push
(
a
)},
addInitProxy
:
function
(
a
,
b
){
b
?
u
.
splice
(
0
,
0
,
a
):
u
.
push
(
a
)},
addInitRoot
:
function
(
a
){
C
.
push
(
a
)},
addNodesData
:
function
(
a
,
b
,
c
,
d
){
var
f
=
e
.
nodeChildren
(
a
,
b
);
f
?
c
>=
f
.
length
&&
(
c
=-
1
):(
f
=
e
.
nodeChildren
(
a
,
b
,[]),
c
=-
1
);
if
(
f
.
length
>
0
&&
c
===
0
)
f
[
0
].
isFirstNode
=!
1
,
j
.
setNodeLineIcos
(
a
,
f
[
0
]);
else
if
(
f
.
length
>
0
&&
c
<
0
)
f
[
f
.
length
-
1
].
isLastNode
=!
1
,
j
.
setNodeLineIcos
(
a
,
f
[
f
.
length
-
1
]);
e
.
nodeIsParent
(
a
,
b
,
!
0
);
c
<
0
?
e
.
nodeChildren
(
a
,
b
,
f
.
concat
(
d
)):(
a
=
[
c
,
0
].
concat
(
d
),
f
.
splice
.
apply
(
f
,
a
))},
addSelectedNode
:
function
(
a
,
b
){
var
c
=
e
.
getRoot
(
a
);
e
.
isSelectedNode
(
a
,
b
)
||
c
.
curSelectedList
.
push
(
b
)},
addCreatedNode
:
function
(
a
,
b
){(
a
.
callback
.
onNodeCreated
||
a
.
view
.
addDiyDom
)
&&
e
.
getRoot
(
a
).
createdNodes
.
push
(
b
)},
addZTreeTools
:
function
(
a
){
H
.
push
(
a
)},
exSetting
:
function
(
a
){
r
.
extend
(
!
0
,
P
,
a
)},
fixPIdKeyValue
:
function
(
a
,
b
){
a
.
data
.
simpleData
.
enable
&&
(
b
[
a
.
data
.
simpleData
.
pIdKey
]
=
b
.
parentTId
?
b
.
getParentNode
()[
a
.
data
.
simpleData
.
idKey
]:
a
.
data
.
simpleData
.
rootPId
)},
getAfterA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
E
.
length
;
d
<
e
;
d
++
)
E
[
d
].
apply
(
this
,
arguments
)},
getBeforeA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
D
.
length
;
d
<
e
;
d
++
)
D
[
d
].
apply
(
this
,
arguments
)},
getInnerAfterA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
G
.
length
;
d
<
e
;
d
++
)
G
[
d
].
apply
(
this
,
arguments
)},
getInnerBeforeA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
F
.
length
;
d
<
e
;
d
++
)
F
[
d
].
apply
(
this
,
arguments
)},
getCache
:
function
(
a
){
return
x
[
a
.
treeId
]},
getNodeIndex
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
f
=
c
.
length
-
1
;
d
<=
f
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
;
return
-
1
},
getNextNode
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
f
=
c
.
length
-
1
;
d
<=
f
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
==
f
?
null
:
c
[
d
+
1
];
return
null
},
getNodeByParam
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
null
;
for
(
var
f
=
0
,
i
=
b
.
length
;
f
<
i
;
f
++
){
var
m
=
b
[
f
];
if
(
m
[
c
]
==
d
)
return
b
[
f
];
m
=
e
.
nodeChildren
(
a
,
m
);
if
(
m
=
e
.
getNodeByParam
(
a
,
m
,
c
,
d
))
return
m
}
return
null
},
getNodeCache
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
var
c
=
x
[
a
.
treeId
].
nodes
[
e
.
getNodeCacheId
(
b
)];
return
c
?
c
:
null
},
getNodePath
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
var
c
;
(
c
=
b
.
parentTId
?
b
.
getParentNode
().
getPath
():[])
&&
c
.
push
(
b
);
return
c
},
getNodes
:
function
(
a
){
return
e
.
nodeChildren
(
a
,
e
.
getRoot
(
a
))},
getNodesByParam
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
[];
for
(
var
f
=
[],
i
=
0
,
m
=
b
.
length
;
i
<
m
;
i
++
){
var
k
=
b
[
i
];
k
[
c
]
==
d
&&
f
.
push
(
k
);
k
=
e
.
nodeChildren
(
a
,
k
);
f
=
f
.
concat
(
e
.
getNodesByParam
(
a
,
k
,
c
,
d
))}
return
f
},
getNodesByParamFuzzy
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
[];
for
(
var
f
=
[],
d
=
d
.
toLowerCase
(),
i
=
0
,
m
=
b
.
length
;
i
<
m
;
i
++
){
var
k
=
b
[
i
];
typeof
k
[
c
]
==
"
string
"
&&
b
[
i
][
c
].
toLowerCase
().
indexOf
(
d
)
>-
1
&&
f
.
push
(
k
);
k
=
e
.
nodeChildren
(
a
,
k
);
f
=
f
.
concat
(
e
.
getNodesByParamFuzzy
(
a
,
k
,
c
,
d
))}
return
f
},
getNodesByFilter
:
function
(
a
,
b
,
c
,
d
,
f
){
if
(
!
b
)
return
d
?
null
:[];
for
(
var
i
=
d
?
null
:[],
m
=
0
,
k
=
b
.
length
;
m
<
k
;
m
++
){
var
g
=
b
[
m
];
if
(
h
.
apply
(
c
,[
g
,
f
],
!
1
)){
if
(
d
)
return
g
;
i
.
push
(
g
)}
g
=
e
.
nodeChildren
(
a
,
g
);
g
=
e
.
getNodesByFilter
(
a
,
g
,
c
,
d
,
f
);
if
(
d
&&
g
)
return
g
;
i
=
d
?
g
:
i
.
concat
(
g
)}
return
i
},
getPreNode
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
f
=
c
.
length
;
d
<
f
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
==
0
?
null
:
c
[
d
-
1
];
return
null
},
getRoot
:
function
(
a
){
return
a
?
w
[
a
.
treeId
]:
null
},
getRoots
:
function
(){
return
w
},
getSetting
:
function
(
a
){
return
t
[
a
]},
getSettings
:
function
(){
return
t
},
getZTreeTools
:
function
(
a
){
return
(
a
=
this
.
getRoot
(
this
.
getSetting
(
a
)))?
a
.
treeTools
:
null
},
initCache
:
function
(
a
){
for
(
var
b
=
0
,
c
=
A
.
length
;
b
<
c
;
b
++
)
A
[
b
].
apply
(
this
,
arguments
)},
initNode
:
function
(
a
,
b
,
c
,
d
,
e
,
i
){
for
(
var
m
=
0
,
g
=
B
.
length
;
m
<
g
;
m
++
)
B
[
m
].
apply
(
this
,
arguments
)},
initRoot
:
function
(
a
){
for
(
var
b
=
0
,
c
=
C
.
length
;
b
<
c
;
b
++
)
C
[
b
].
apply
(
this
,
arguments
)},
isSelectedNode
:
function
(
a
,
b
){
for
(
var
c
=
e
.
getRoot
(
a
),
d
=
0
,
f
=
c
.
curSelectedList
.
length
;
d
<
f
;
d
++
)
if
(
b
===
c
.
curSelectedList
[
d
])
return
!
0
;
return
!
1
},
nodeChildren
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
null
;
a
=
a
.
data
.
key
.
children
;
typeof
c
!==
"
undefined
"
&&
(
b
[
a
]
=
c
);
return
b
[
a
]},
nodeIsParent
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
!
1
;
a
=
a
.
data
.
key
.
isParent
;
typeof
c
!==
"
undefined
"
&&
(
typeof
c
===
"
string
"
&&
(
c
=
h
.
eqs
(
c
,
"
true
"
)),
b
[
a
]
=!!
c
);
return
b
[
a
]},
nodeName
:
function
(
a
,
b
,
c
){
a
=
a
.
data
.
key
.
name
;
typeof
c
!==
"
undefined
"
&&
(
b
[
a
]
=
c
);
return
""
+
b
[
a
]},
nodeTitle
:
function
(
a
,
b
){
return
""
+
b
[
a
.
data
.
key
.
title
===
""
?
a
.
data
.
key
.
name
:
a
.
data
.
key
.
title
]},
removeNodeCache
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
)
for
(
var
d
=
0
,
f
=
c
.
length
;
d
<
f
;
d
++
)
e
.
removeNodeCache
(
a
,
c
[
d
]);
e
.
getCache
(
a
).
nodes
[
e
.
getNodeCacheId
(
b
.
tId
)]
=
null
},
removeSelectedNode
:
function
(
a
,
b
){
for
(
var
c
=
e
.
getRoot
(
a
),
d
=
0
,
f
=
c
.
curSelectedList
.
length
;
d
<
f
;
d
++
)
if
(
b
===
c
.
curSelectedList
[
d
]
||!
e
.
getNodeCache
(
a
,
c
.
curSelectedList
[
d
].
tId
))
c
.
curSelectedList
.
splice
(
d
,
1
),
a
.
treeObj
.
trigger
(
g
.
event
.
UNSELECTED
,[
a
.
treeId
,
b
]),
d
--
,
f
--
},
setCache
:
function
(
a
,
b
){
x
[
a
.
treeId
]
=
b
},
setRoot
:
function
(
a
,
b
){
w
[
a
.
treeId
]
=
b
},
setZTreeTools
:
function
(
a
,
b
){
for
(
var
c
=
0
,
d
=
H
.
length
;
c
<
d
;
c
++
)
H
[
c
].
apply
(
this
,
arguments
)},
transformToArrayFormat
:
function
(
a
,
b
){
function
c
(
b
){
d
.
push
(
b
);(
b
=
e
.
nodeChildren
(
a
,
b
))
&&
(
d
=
d
.
concat
(
e
.
transformToArrayFormat
(
a
,
b
)))}
if
(
!
b
)
return
[];
var
d
=
[];
if
(
h
.
isArray
(
b
))
for
(
var
f
=
0
,
i
=
b
.
length
;
f
<
i
;
f
++
)
c
(
b
[
f
]);
else
c
(
b
);
return
d
},
transformTozTreeFormat
:
function
(
a
,
b
){
var
c
,
d
,
f
=
a
.
data
.
simpleData
.
idKey
,
i
=
a
.
data
.
simpleData
.
pIdKey
;
if
(
!
f
||
f
==
""
||!
b
)
return
[];
if
(
h
.
isArray
(
b
)){
var
g
=
[],
k
=
{};
for
(
c
=
0
,
d
=
b
.
length
;
c
<
d
;
c
++
)
k
[
b
[
c
][
f
]]
=
b
[
c
];
for
(
c
=
0
,
d
=
b
.
length
;
c
<
d
;
c
++
){
var
j
=
k
[
b
[
c
][
i
]];
if
(
j
&&
b
[
c
][
f
]
!=
b
[
c
][
i
]){
var
o
=
e
.
nodeChildren
(
a
,
j
);
o
||
(
o
=
e
.
nodeChildren
(
a
,
j
,[]));
o
.
push
(
b
[
c
])}
else
g
.
push
(
b
[
c
])}
return
g
}
else
return
[
b
]}},
n
=
{
bindEvent
:
function
(
a
){
for
(
var
b
=
0
,
c
=
y
.
length
;
b
<
c
;
b
++
)
y
[
b
].
apply
(
this
,
arguments
)},
unbindEvent
:
function
(
a
){
for
(
var
b
=
0
,
c
=
z
.
length
;
b
<
c
;
b
++
)
z
[
b
].
apply
(
this
,
arguments
)},
bindTree
:
function
(
a
){
var
b
=
{
treeId
:
a
.
treeId
},
c
=
a
.
treeObj
;
a
.
view
.
txtSelectedEnable
||
c
.
bind
(
"
selectstart
"
,
v
).
css
({
"
-moz-user-select
"
:
"
-moz-none
"
});
c
.
bind
(
"
click
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
dblclick
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseover
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseout
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mousedown
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseup
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
contextmenu
"
,
b
,
n
.
proxy
)},
unbindTree
:
function
(
a
){
a
.
treeObj
.
unbind
(
"
selectstart
"
,
v
).
unbind
(
"
click
"
,
n
.
proxy
).
unbind
(
"
dblclick
"
,
n
.
proxy
).
unbind
(
"
mouseover
"
,
n
.
proxy
).
unbind
(
"
mouseout
"
,
n
.
proxy
).
unbind
(
"
mousedown
"
,
n
.
proxy
).
unbind
(
"
mouseup
"
,
n
.
proxy
).
unbind
(
"
contextmenu
"
,
n
.
proxy
)},
doProxy
:
function
(
a
){
for
(
var
b
=
[],
c
=
0
,
d
=
u
.
length
;
c
<
d
;
c
++
){
var
e
=
u
[
c
].
apply
(
this
,
arguments
);
b
.
push
(
e
);
if
(
e
.
stop
)
break
}
return
b
},
proxy
:
function
(
a
){
var
b
=
e
.
getSetting
(
a
.
data
.
treeId
);
if
(
!
h
.
uCanDo
(
b
,
a
))
return
!
0
;
for
(
var
b
=
n
.
doProxy
(
a
),
c
=!
0
,
d
=
0
,
f
=
b
.
length
;
d
<
f
;
d
++
){
var
i
=
b
[
d
];
i
.
nodeEventCallback
&&
(
c
=
i
.
nodeEventCallback
.
apply
(
i
,[
a
,
i
.
node
])
&&
c
);
i
.
treeEventCallback
&&
(
c
=
i
.
treeEventCallback
.
apply
(
i
,[
a
,
i
.
node
])
&&
c
)}
return
c
}};
J
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
if
(
b
.
open
){
if
(
h
.
apply
(
c
.
callback
.
beforeCollapse
,[
c
.
treeId
,
b
],
!
0
)
==
!
1
)
return
!
0
}
else
if
(
h
.
apply
(
c
.
callback
.
beforeExpand
,[
c
.
treeId
,
b
],
!
0
)
==!
1
)
return
!
0
;
e
.
getRoot
(
c
).
expandTriggerFlag
=!
0
;
j
.
switchNode
(
c
,
b
);
return
!
0
};
K
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
),
d
=
c
.
view
.
autoCancelSelected
&&
(
a
.
ctrlKey
||
a
.
metaKey
)
&&
e
.
isSelectedNode
(
c
,
b
)?
0
:
c
.
view
.
autoCancelSelected
&&
(
a
.
ctrlKey
||
a
.
metaKey
)
&&
c
.
view
.
selectedMulti
?
2
:
1
;
if
(
h
.
apply
(
c
.
callback
.
beforeClick
,[
c
.
treeId
,
b
,
d
],
!
0
)
==!
1
)
return
!
0
;
d
===
0
?
j
.
cancelPreSelectedNode
(
c
,
b
):
j
.
selectNode
(
c
,
b
,
d
===
2
);
c
.
treeObj
.
trigger
(
g
.
event
.
CLICK
,
[
a
,
c
.
treeId
,
b
,
d
]);
return
!
0
};
L
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
h
.
apply
(
c
.
callback
.
beforeMouseDown
,[
c
.
treeId
,
b
],
!
0
)
&&
h
.
apply
(
c
.
callback
.
onMouseDown
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
M
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
h
.
apply
(
c
.
callback
.
beforeMouseUp
,[
c
.
treeId
,
b
],
!
0
)
&&
h
.
apply
(
c
.
callback
.
onMouseUp
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
N
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
h
.
apply
(
c
.
callback
.
beforeDblClick
,[
c
.
treeId
,
b
],
!
0
)
&&
h
.
apply
(
c
.
callback
.
onDblClick
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
O
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
h
.
apply
(
c
.
callback
.
beforeRightClick
,[
c
.
treeId
,
b
],
!
0
)
&&
h
.
apply
(
c
.
callback
.
onRightClick
,[
a
,
c
.
treeId
,
b
]);
return
typeof
c
.
callback
.
onRightClick
!=
"
function
"
};
v
=
function
(
a
){
a
=
a
.
originalEvent
.
srcElement
.
nodeName
.
toLowerCase
();
return
a
===
"
input
"
||
a
===
"
textarea
"
};
var
h
=
{
apply
:
function
(
a
,
b
,
c
){
return
typeof
a
==
"
function
"
?
a
.
apply
(
Q
,
b
?
b
:[]):
c
},
canAsync
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
),
d
=
e
.
nodeIsParent
(
a
,
b
);
return
a
.
async
.
enable
&&
b
&&
d
&&!
(
b
.
zAsync
||
c
&&
c
.
length
>
0
)},
clone
:
function
(
a
){
if
(
a
===
null
)
return
null
;
var
b
=
h
.
isArray
(
a
)?[]:{},
c
;
for
(
c
in
a
)
b
[
c
]
=
a
[
c
]
instanceof
Date
?
new
Date
(
a
[
c
].
getTime
()):
typeof
a
[
c
]
===
"
object
"
?
h
.
clone
(
a
[
c
]):
a
[
c
];
return
b
},
eqs
:
function
(
a
,
b
){
return
a
.
toLowerCase
()
===
b
.
toLowerCase
()},
isArray
:
function
(
a
){
return
Object
.
prototype
.
toString
.
apply
(
a
)
===
"
[object Array]
"
},
isElement
:
function
(
a
){
return
typeof
HTMLElement
===
"
object
"
?
a
instanceof
HTMLElement
:
a
&&
typeof
a
===
"
object
"
&&
a
!==
null
&&
a
.
nodeType
===
1
&&
typeof
a
.
nodeName
===
"
string
"
},
$
:
function
(
a
,
b
,
c
){
b
&&
typeof
b
!=
"
string
"
&&
(
c
=
b
,
b
=
""
);
return
typeof
a
==
"
string
"
?
r
(
a
,
c
?
c
.
treeObj
.
get
(
0
).
ownerDocument
:
null
):
r
(
"
#
"
+
a
.
tId
+
b
,
c
?
c
.
treeObj
:
null
)},
getMDom
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
null
;
for
(;
b
&&
b
.
id
!==
a
.
treeId
;){
for
(
var
d
=
0
,
e
=
c
.
length
;
b
.
tagName
&&
d
<
e
;
d
++
)
if
(
h
.
eqs
(
b
.
tagName
,
c
[
d
].
tagName
)
&&
b
.
getAttribute
(
c
[
d
].
attrName
)
!==
null
)
return
b
;
b
=
b
.
parentNode
}
return
null
},
getNodeMainDom
:
function
(
a
){
return
r
(
a
).
parent
(
"
li
"
).
get
(
0
)
||
r
(
a
).
parentsUntil
(
"
li
"
).
parent
().
get
(
0
)},
isChildOrSelf
:
function
(
a
,
b
){
return
r
(
a
).
closest
(
"
#
"
+
b
).
length
>
0
},
uCanDo
:
function
(){
return
!
0
}},
j
=
{
addNodes
:
function
(
a
,
b
,
c
,
d
,
f
){
var
i
=
e
.
nodeIsParent
(
a
,
b
);
if
(
!
a
.
data
.
keep
.
leaf
||!
b
||
i
)
if
(
h
.
isArray
(
d
)
||
(
d
=
[
d
]),
a
.
data
.
simpleData
.
enable
&&
(
d
=
e
.
transformTozTreeFormat
(
a
,
d
)),
b
){
var
i
=
l
(
b
,
g
.
id
.
SWITCH
,
a
),
m
=
l
(
b
,
g
.
id
.
ICON
,
a
),
k
=
l
(
b
,
g
.
id
.
UL
,
a
);
if
(
!
b
.
open
)
j
.
replaceSwitchClass
(
b
,
i
,
g
.
folder
.
CLOSE
),
j
.
replaceIcoClass
(
b
,
m
,
g
.
folder
.
CLOSE
),
b
.
open
=!
1
,
k
.
css
({
display
:
"
none
"
});
e
.
addNodesData
(
a
,
b
,
c
,
d
);
j
.
createNodes
(
a
,
b
.
level
+
1
,
d
,
b
,
c
);
f
||
j
.
expandCollapseParentNode
(
a
,
b
,
!
0
)}
else
e
.
addNodesData
(
a
,
e
.
getRoot
(
a
),
c
,
d
),
j
.
createNodes
(
a
,
0
,
d
,
null
,
c
)},
appendNodes
:
function
(
a
,
b
,
c
,
d
,
f
,
i
,
g
){
if
(
!
c
)
return
[];
var
k
=
[],
h
=
d
?
d
:
e
.
getRoot
(
a
),
h
=
e
.
nodeChildren
(
a
,
h
),
o
,
l
;
if
(
!
h
||
f
>=
h
.
length
-
c
.
length
)
f
=-
1
;
for
(
var
s
=
0
,
n
=
c
.
length
;
s
<
n
;
s
++
){
var
p
=
c
[
s
];
i
&&
(
o
=
(
f
===
0
||
h
.
length
==
c
.
length
)
&&
s
==
0
,
l
=
f
<
0
&&
s
==
c
.
length
-
1
,
e
.
initNode
(
a
,
b
,
p
,
d
,
o
,
l
,
g
),
e
.
addNodeCache
(
a
,
p
));
o
=
e
.
nodeIsParent
(
a
,
p
);
l
=
[];
var
I
=
e
.
nodeChildren
(
a
,
p
);
I
&&
I
.
length
>
0
&&
(
l
=
j
.
appendNodes
(
a
,
b
+
1
,
I
,
p
,
-
1
,
i
,
g
&&
p
.
open
));
g
&&
(
j
.
makeDOMNodeMainBefore
(
k
,
a
,
p
),
j
.
makeDOMNodeLine
(
k
,
a
,
p
),
e
.
getBeforeA
(
a
,
p
,
k
),
j
.
makeDOMNodeNameBefore
(
k
,
a
,
p
),
e
.
getInnerBeforeA
(
a
,
p
,
k
),
j
.
makeDOMNodeIcon
(
k
,
a
,
p
),
e
.
getInnerAfterA
(
a
,
p
,
k
),
j
.
makeDOMNodeNameAfter
(
k
,
a
,
p
),
e
.
getAfterA
(
a
,
p
,
k
),
o
&&
p
.
open
&&
j
.
makeUlHtml
(
a
,
p
,
k
,
l
.
join
(
""
)),
j
.
makeDOMNodeMainAfter
(
k
,
a
,
p
),
e
.
addCreatedNode
(
a
,
p
))}
return
k
},
appendParentULDom
:
function
(
a
,
b
){
var
c
=
[],
d
=
l
(
b
,
a
);
!
d
.
get
(
0
)
&&
b
.
parentTId
&&
(
j
.
appendParentULDom
(
a
,
b
.
getParentNode
()),
d
=
l
(
b
,
a
));
var
f
=
l
(
b
,
g
.
id
.
UL
,
a
);
f
.
get
(
0
)
&&
f
.
remove
();
f
=
e
.
nodeChildren
(
a
,
b
);
f
=
j
.
appendNodes
(
a
,
b
.
level
+
1
,
f
,
b
,
-
1
,
!
1
,
!
0
);
j
.
makeUlHtml
(
a
,
b
,
c
,
f
.
join
(
""
));
d
.
append
(
c
.
join
(
""
))},
asyncNode
:
function
(
a
,
b
,
c
,
d
){
var
f
,
i
;
f
=
e
.
nodeIsParent
(
a
,
b
);
if
(
b
&&!
f
)
return
h
.
apply
(
d
),
!
1
;
else
if
(
b
&&
b
.
isAjaxing
)
return
!
1
;
else
if
(
h
.
apply
(
a
.
callback
.
beforeAsync
,[
a
.
treeId
,
b
],
!
0
)
==!
1
)
return
h
.
apply
(
d
),
!
1
;
if
(
b
)
b
.
isAjaxing
=!
0
,
l
(
b
,
g
.
id
.
ICON
,
a
).
attr
({
style
:
""
,
"
class
"
:
g
.
className
.
BUTTON
+
"
"
+
g
.
className
.
ICO_LOADING
});
var
m
=
{},
k
=
h
.
apply
(
a
.
async
.
autoParam
,[
a
.
treeId
,
b
],
a
.
async
.
autoParam
);
for
(
f
=
0
,
i
=
k
.
length
;
b
&&
f
<
i
;
f
++
){
var
q
=
k
[
f
].
split
(
"
=
"
),
o
=
q
;
q
.
length
>
1
&&
(
o
=
q
[
1
],
q
=
q
[
0
]);
m
[
o
]
=
b
[
q
]}
k
=
h
.
apply
(
a
.
async
.
otherParam
,[
a
.
treeId
,
b
],
a
.
async
.
otherParam
);
if
(
h
.
isArray
(
k
))
for
(
f
=
0
,
i
=
k
.
length
;
f
<
i
;
f
+=
2
)
m
[
k
[
f
]]
=
k
[
f
+
1
];
else
for
(
var
n
in
k
)
m
[
n
]
=
k
[
n
];
var
s
=
e
.
getRoot
(
a
).
_ver
;
r
.
ajax
({
contentType
:
a
.
async
.
contentType
,
cache
:
!
1
,
type
:
a
.
async
.
type
,
url
:
h
.
apply
(
a
.
async
.
url
,[
a
.
treeId
,
b
],
a
.
async
.
url
),
data
:
a
.
async
.
contentType
.
indexOf
(
"
application/json
"
)
>-
1
?
JSON
.
stringify
(
m
):
m
,
dataType
:
a
.
async
.
dataType
,
headers
:
a
.
async
.
headers
,
xhrFields
:
a
.
async
.
xhrFields
,
success
:
function
(
i
){
if
(
s
==
e
.
getRoot
(
a
).
_ver
){
var
f
=
[];
try
{
f
=!
i
||
i
.
length
==
0
?[]:
typeof
i
==
"
string
"
?
eval
(
"
(
"
+
i
+
"
)
"
):
i
}
catch
(
k
){
f
=
i
}
if
(
b
)
b
.
isAjaxing
=
null
,
b
.
zAsync
=!
0
;
j
.
setNodeLineIcos
(
a
,
b
);
f
&&
f
!==
""
?(
f
=
h
.
apply
(
a
.
async
.
dataFilter
,[
a
.
treeId
,
b
,
f
],
f
),
j
.
addNodes
(
a
,
b
,
-
1
,
f
?
h
.
clone
(
f
):[],
!!
c
)):
j
.
addNodes
(
a
,
b
,
-
1
,[],
!!
c
);
a
.
treeObj
.
trigger
(
g
.
event
.
ASYNC_SUCCESS
,[
a
.
treeId
,
b
,
i
]);
h
.
apply
(
d
)}},
error
:
function
(
c
,
d
,
i
){
if
(
s
==
e
.
getRoot
(
a
).
_ver
){
if
(
b
)
b
.
isAjaxing
=
null
;
j
.
setNodeLineIcos
(
a
,
b
);
a
.
treeObj
.
trigger
(
g
.
event
.
ASYNC_ERROR
,[
a
.
treeId
,
b
,
c
,
d
,
i
])}}});
return
!
0
},
cancelPreSelectedNode
:
function
(
a
,
b
,
c
){
var
d
=
e
.
getRoot
(
a
).
curSelectedList
,
f
,
i
;
for
(
f
=
d
.
length
-
1
;
f
>=
0
;
f
--
)
if
(
i
=
d
[
f
],
b
===
i
||!
b
&&
(
!
c
||
c
!==
i
))
if
(
l
(
i
,
g
.
id
.
A
,
a
).
removeClass
(
g
.
node
.
CURSELECTED
),
b
){
e
.
removeSelectedNode
(
a
,
b
);
break
}
else
d
.
splice
(
f
,
1
),
a
.
treeObj
.
trigger
(
g
.
event
.
UNSELECTED
,[
a
.
treeId
,
i
])},
createNodeCallback
:
function
(
a
){
if
(
a
.
callback
.
onNodeCreated
||
a
.
view
.
addDiyDom
)
for
(
var
b
=
e
.
getRoot
(
a
);
b
.
createdNodes
.
length
>
0
;){
var
c
=
b
.
createdNodes
.
shift
();
h
.
apply
(
a
.
view
.
addDiyDom
,[
a
.
treeId
,
c
]);
a
.
callback
.
onNodeCreated
&&
a
.
treeObj
.
trigger
(
g
.
event
.
NODECREATED
,[
a
.
treeId
,
c
])}},
createNodes
:
function
(
a
,
b
,
c
,
d
,
f
){
if
(
c
&&
c
.
length
!=
0
){
var
i
=
e
.
getRoot
(
a
),
m
=!
d
||
d
.
open
||!!
l
(
e
.
nodeChildren
(
a
,
d
)[
0
],
a
).
get
(
0
);
i
.
createdNodes
=
[];
var
b
=
j
.
appendNodes
(
a
,
b
,
c
,
d
,
f
,
!
0
,
m
),
k
,
h
;
d
?(
d
=
l
(
d
,
g
.
id
.
UL
,
a
),
d
.
get
(
0
)
&&
(
k
=
d
)):
k
=
a
.
treeObj
;
k
&&
(
f
>=
0
&&
(
h
=
k
.
children
()[
f
]),
f
>=
0
&&
h
?
r
(
h
).
before
(
b
.
join
(
""
)):
k
.
append
(
b
.
join
(
""
)));
j
.
createNodeCallback
(
a
)}},
destroy
:
function
(
a
){
a
&&
(
e
.
initCache
(
a
),
e
.
initRoot
(
a
),
n
.
unbindTree
(
a
),
n
.
unbindEvent
(
a
),
a
.
treeObj
.
empty
(),
delete
t
[
a
.
treeId
])},
expandCollapseNode
:
function
(
a
,
b
,
c
,
d
,
f
){
var
i
=
e
.
getRoot
(
a
),
m
;
if
(
b
){
var
k
=
e
.
nodeChildren
(
a
,
b
),
q
=
e
.
nodeIsParent
(
a
,
b
);
if
(
i
.
expandTriggerFlag
)
m
=
f
,
f
=
function
(){
m
&&
m
();
b
.
open
?
a
.
treeObj
.
trigger
(
g
.
event
.
EXPAND
,[
a
.
treeId
,
b
]):
a
.
treeObj
.
trigger
(
g
.
event
.
COLLAPSE
,[
a
.
treeId
,
b
])},
i
.
expandTriggerFlag
=!
1
;
if
(
!
b
.
open
&&
q
&&
(
!
l
(
b
,
g
.
id
.
UL
,
a
).
get
(
0
)
||
k
&&
k
.
length
>
0
&&!
l
(
k
[
0
],
a
).
get
(
0
)))
j
.
appendParentULDom
(
a
,
b
),
j
.
createNodeCallback
(
a
);
if
(
b
.
open
==
c
)
h
.
apply
(
f
,[]);
else
{
var
c
=
l
(
b
,
g
.
id
.
UL
,
a
),
i
=
l
(
b
,
g
.
id
.
SWITCH
,
a
),
o
=
l
(
b
,
g
.
id
.
ICON
,
a
);
q
?(
b
.
open
=!
b
.
open
,
b
.
iconOpen
&&
b
.
iconClose
&&
o
.
attr
(
"
style
"
,
j
.
makeNodeIcoStyle
(
a
,
b
)),
b
.
open
?(
j
.
replaceSwitchClass
(
b
,
i
,
g
.
folder
.
OPEN
),
j
.
replaceIcoClass
(
b
,
o
,
g
.
folder
.
OPEN
),
d
==!
1
||
a
.
view
.
expandSpeed
==
""
?(
c
.
show
(),
h
.
apply
(
f
,[])):
k
&&
k
.
length
>
0
?
c
.
slideDown
(
a
.
view
.
expandSpeed
,
f
):(
c
.
show
(),
h
.
apply
(
f
,[]))):(
j
.
replaceSwitchClass
(
b
,
i
,
g
.
folder
.
CLOSE
),
j
.
replaceIcoClass
(
b
,
o
,
g
.
folder
.
CLOSE
),
d
==!
1
||
a
.
view
.
expandSpeed
==
""
||!
(
k
&&
k
.
length
>
0
)?(
c
.
hide
(),
h
.
apply
(
f
,[])):
c
.
slideUp
(
a
.
view
.
expandSpeed
,
f
))):
h
.
apply
(
f
,[])}}
else
h
.
apply
(
f
,
[])},
expandCollapseParentNode
:
function
(
a
,
b
,
c
,
d
,
e
){
b
&&
(
b
.
parentTId
?(
j
.
expandCollapseNode
(
a
,
b
,
c
,
d
),
b
.
parentTId
&&
j
.
expandCollapseParentNode
(
a
,
b
.
getParentNode
(),
c
,
d
,
e
)):
j
.
expandCollapseNode
(
a
,
b
,
c
,
d
,
e
))},
expandCollapseSonNode
:
function
(
a
,
b
,
c
,
d
,
f
){
var
i
=
e
.
getRoot
(
a
),
i
=
b
?
e
.
nodeChildren
(
a
,
b
):
e
.
nodeChildren
(
a
,
i
),
g
=
b
?
!
1
:
d
,
k
=
e
.
getRoot
(
a
).
expandTriggerFlag
;
e
.
getRoot
(
a
).
expandTriggerFlag
=!
1
;
if
(
i
)
for
(
var
h
=
0
,
l
=
i
.
length
;
h
<
l
;
h
++
)
i
[
h
]
&&
j
.
expandCollapseSonNode
(
a
,
i
[
h
],
c
,
g
);
e
.
getRoot
(
a
).
expandTriggerFlag
=
k
;
j
.
expandCollapseNode
(
a
,
b
,
c
,
d
,
f
)},
isSelectedNode
:
function
(
a
,
b
){
if
(
!
b
)
return
!
1
;
var
c
=
e
.
getRoot
(
a
).
curSelectedList
,
d
;
for
(
d
=
c
.
length
-
1
;
d
>=
0
;
d
--
)
if
(
b
===
c
[
d
])
return
!
0
;
return
!
1
},
makeDOMNodeIcon
:
function
(
a
,
b
,
c
){
var
d
=
e
.
nodeName
(
b
,
c
),
d
=
b
.
view
.
nameIsHTML
?
d
:
d
.
replace
(
/&/g
,
"
&
"
).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
);
a
.
push
(
"
<span id='
"
,
c
.
tId
,
g
.
id
.
ICON
,
"
' title='' treeNode
"
,
g
.
id
.
ICON
,
"
class='
"
,
j
.
makeNodeIcoClass
(
b
,
c
),
"
' style='
"
,
j
.
makeNodeIcoStyle
(
b
,
c
),
"
'></span><span id='
"
,
c
.
tId
,
g
.
id
.
SPAN
,
"
' class='
"
,
g
.
className
.
NAME
,
"
'>
"
,
d
,
"
</span>
"
)},
makeDOMNodeLine
:
function
(
a
,
b
,
c
){
a
.
push
(
"
<span id='
"
,
c
.
tId
,
g
.
id
.
SWITCH
,
"
' title='' class='
"
,
j
.
makeNodeLineClass
(
b
,
c
),
"
' treeNode
"
,
g
.
id
.
SWITCH
,
"
></span>
"
)},
makeDOMNodeMainAfter
:
function
(
a
){
a
.
push
(
"
</li>
"
)},
makeDOMNodeMainBefore
:
function
(
a
,
b
,
c
){
a
.
push
(
"
<li id='
"
,
c
.
tId
,
"
' class='
"
,
g
.
className
.
LEVEL
,
c
.
level
,
"
' tabindex='0' hidefocus='true' treenode>
"
)},
makeDOMNodeNameAfter
:
function
(
a
){
a
.
push
(
"
</a>
"
)},
makeDOMNodeNameBefore
:
function
(
a
,
b
,
c
){
var
d
=
e
.
nodeTitle
(
b
,
c
),
f
=
j
.
makeNodeUrl
(
b
,
c
),
i
=
j
.
makeNodeFontCss
(
b
,
c
),
m
=
[],
k
;
for
(
k
in
i
)
m
.
push
(
k
,
"
:
"
,
i
[
k
],
"
;
"
);
a
.
push
(
"
<a id='
"
,
c
.
tId
,
g
.
id
.
A
,
"
' class='
"
,
g
.
className
.
LEVEL
,
c
.
level
,
"
' treeNode
"
,
g
.
id
.
A
,
'
onclick="
'
,
c
.
click
||
""
,
'
"
'
,
f
!=
null
&&
f
.
length
>
0
?
"
href='
"
+
f
+
"
'
"
:
""
,
"
target='
"
,
j
.
makeNodeTarget
(
c
),
"
' style='
"
,
m
.
join
(
""
),
"
'
"
);
h
.
apply
(
b
.
view
.
showTitle
,[
b
.
treeId
,
c
],
b
.
view
.
showTitle
)
&&
d
&&
a
.
push
(
"
title='
"
,
d
.
replace
(
/'/g
,
"
'
"
).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
),
"
'
"
);
a
.
push
(
"
>
"
)},
makeNodeFontCss
:
function
(
a
,
b
){
var
c
=
h
.
apply
(
a
.
view
.
fontCss
,[
a
.
treeId
,
b
],
a
.
view
.
fontCss
);
return
c
&&
typeof
c
!=
"
function
"
?
c
:{}},
makeNodeIcoClass
:
function
(
a
,
b
){
var
c
=
[
"
ico
"
];
if
(
!
b
.
isAjaxing
){
var
d
=
e
.
nodeIsParent
(
a
,
b
);
c
[
0
]
=
(
b
.
iconSkin
?
b
.
iconSkin
+
"
_
"
:
""
)
+
c
[
0
];
d
?
c
.
push
(
b
.
open
?
g
.
folder
.
OPEN
:
g
.
folder
.
CLOSE
):
c
.
push
(
g
.
folder
.
DOCU
)}
return
g
.
className
.
BUTTON
+
"
"
+
c
.
join
(
"
_
"
)},
makeNodeIcoStyle
:
function
(
a
,
b
){
var
c
=
[];
if
(
!
b
.
isAjaxing
){
var
d
=
e
.
nodeIsParent
(
a
,
b
)
&&
b
.
iconOpen
&&
b
.
iconClose
?
b
.
open
?
b
.
iconOpen
:
b
.
iconClose
:
b
[
a
.
data
.
key
.
icon
];
d
&&
c
.
push
(
"
background:url(
"
,
d
,
"
) 0 0 no-repeat;
"
);(
a
.
view
.
showIcon
==
!
1
||!
h
.
apply
(
a
.
view
.
showIcon
,[
a
.
treeId
,
b
],
!
0
))
&&
c
.
push
(
"
width:0px;height:0px;
"
)}
return
c
.
join
(
""
)},
makeNodeLineClass
:
function
(
a
,
b
){
var
c
=
[];
a
.
view
.
showLine
?
b
.
level
==
0
&&
b
.
isFirstNode
&&
b
.
isLastNode
?
c
.
push
(
g
.
line
.
ROOT
):
b
.
level
==
0
&&
b
.
isFirstNode
?
c
.
push
(
g
.
line
.
ROOTS
):
b
.
isLastNode
?
c
.
push
(
g
.
line
.
BOTTOM
):
c
.
push
(
g
.
line
.
CENTER
):
c
.
push
(
g
.
line
.
NOLINE
);
e
.
nodeIsParent
(
a
,
b
)?
c
.
push
(
b
.
open
?
g
.
folder
.
OPEN
:
g
.
folder
.
CLOSE
):
c
.
push
(
g
.
folder
.
DOCU
);
return
j
.
makeNodeLineClassEx
(
b
)
+
c
.
join
(
"
_
"
)},
makeNodeLineClassEx
:
function
(
a
){
return
g
.
className
.
BUTTON
+
"
"
+
g
.
className
.
LEVEL
+
a
.
level
+
"
"
+
g
.
className
.
SWITCH
+
"
"
},
makeNodeTarget
:
function
(
a
){
return
a
.
target
||
"
_blank
"
},
makeNodeUrl
:
function
(
a
,
b
){
var
c
=
a
.
data
.
key
.
url
;
return
b
[
c
]?
b
[
c
]:
null
},
makeUlHtml
:
function
(
a
,
b
,
c
,
d
){
c
.
push
(
"
<ul id='
"
,
b
.
tId
,
g
.
id
.
UL
,
"
' class='
"
,
g
.
className
.
LEVEL
,
b
.
level
,
"
"
,
j
.
makeUlLineClass
(
a
,
b
),
"
' style='display:
"
,
b
.
open
?
"
block
"
:
"
none
"
,
"
'>
"
);
c
.
push
(
d
);
c
.
push
(
"
</ul>
"
)},
makeUlLineClass
:
function
(
a
,
b
){
return
a
.
view
.
showLine
&&!
b
.
isLastNode
?
g
.
line
.
LINE
:
""
},
removeChildNodes
:
function
(
a
,
b
){
if
(
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
){
for
(
var
d
=
0
,
f
=
c
.
length
;
d
<
f
;
d
++
)
e
.
removeNodeCache
(
a
,
c
[
d
]);
e
.
removeSelectedNode
(
a
);
delete
b
[
a
.
data
.
key
.
children
];
a
.
data
.
keep
.
parent
?
l
(
b
,
g
.
id
.
UL
,
a
).
empty
():(
e
.
nodeIsParent
(
a
,
b
,
!
1
),
b
.
open
=!
1
,
c
=
l
(
b
,
g
.
id
.
SWITCH
,
a
),
d
=
l
(
b
,
g
.
id
.
ICON
,
a
),
j
.
replaceSwitchClass
(
b
,
c
,
g
.
folder
.
DOCU
),
j
.
replaceIcoClass
(
b
,
d
,
g
.
folder
.
DOCU
),
l
(
b
,
g
.
id
.
UL
,
a
).
remove
())}}},
scrollIntoView
:
function
(
a
,
b
){
if
(
b
)
if
(
typeof
Element
===
"
undefined
"
){
var
c
=
a
.
treeObj
.
get
(
0
).
getBoundingClientRect
(),
d
=
b
.
getBoundingClientRect
();(
d
.
top
<
c
.
top
||
d
.
bottom
>
c
.
bottom
||
d
.
right
>
c
.
right
||
d
.
left
<
c
.
left
)
&&
b
.
scrollIntoView
()}
else
{
if
(
!
Element
.
prototype
.
scrollIntoViewIfNeeded
)
Element
.
prototype
.
scrollIntoViewIfNeeded
=
function
(
a
){
function
b
(
a
,
c
){
return
{
start
:
a
,
length
:
c
,
end
:
a
+
c
}}
function
c
(
b
,
d
){
return
!
1
===
a
||
d
.
start
<
b
.
end
&&
b
.
start
<
d
.
end
?
Math
.
max
(
b
.
end
-
d
.
length
,
Math
.
min
(
d
.
start
,
b
.
start
)):(
b
.
start
+
b
.
end
-
d
.
length
)
/
2
}
function
d
(
a
,
b
){
return
{
x
:
a
,
y
:
b
,
translate
:
function
(
c
,
i
){
return
d
(
a
+
c
,
b
+
i
)}}}
function
e
(
a
,
b
){
for
(;
a
;)
b
=
b
.
translate
(
a
.
offsetLeft
,
a
.
offsetTop
),
a
=
a
.
offsetParent
;
return
b
}
for
(
var
g
=
e
(
this
,
d
(
0
,
0
)),
j
=
d
(
this
.
offsetWidth
,
this
.
offsetHeight
),
h
=
this
.
parentNode
,
l
;
h
instanceof
HTMLElement
;)
l
=
e
(
h
,
d
(
h
.
clientLeft
,
h
.
clientTop
)),
h
.
scrollLeft
=
c
(
b
(
g
.
x
-
l
.
x
,
j
.
x
),
b
(
h
.
scrollLeft
,
h
.
clientWidth
)),
h
.
scrollTop
=
c
(
b
(
g
.
y
-
l
.
y
,
j
.
y
),
b
(
h
.
scrollTop
,
h
.
clientHeight
)),
g
=
g
.
translate
(
-
h
.
scrollLeft
,
-
h
.
scrollTop
),
h
=
h
.
parentNode
};
b
.
scrollIntoViewIfNeeded
()}},
setFirstNode
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
.
length
>
0
)
c
[
0
].
isFirstNode
=!
0
},
setLastNode
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
.
length
>
0
)
c
[
c
.
length
-
1
].
isLastNode
=!
0
},
removeNode
:
function
(
a
,
b
){
var
c
=
e
.
getRoot
(
a
),
d
=
b
.
parentTId
?
b
.
getParentNode
():
c
;
b
.
isFirstNode
=!
1
;
b
.
isLastNode
=!
1
;
b
.
getPreNode
=
function
(){
return
null
};
b
.
getNextNode
=
function
(){
return
null
};
if
(
e
.
getNodeCache
(
a
,
b
.
tId
)){
l
(
b
,
a
).
remove
();
e
.
removeNodeCache
(
a
,
b
);
e
.
removeSelectedNode
(
a
,
b
);
for
(
var
f
=
e
.
nodeChildren
(
a
,
d
),
i
=
0
,
h
=
f
.
length
;
i
<
h
;
i
++
)
if
(
f
[
i
].
tId
==
b
.
tId
){
f
.
splice
(
i
,
1
);
break
}
j
.
setFirstNode
(
a
,
d
);
j
.
setLastNode
(
a
,
d
);
var
k
,
i
=
f
.
length
;
if
(
!
a
.
data
.
keep
.
parent
&&
i
==
0
)
e
.
nodeIsParent
(
a
,
d
,
!
1
),
d
.
open
=!
1
,
delete
d
[
a
.
data
.
key
.
children
],
i
=
l
(
d
,
g
.
id
.
UL
,
a
),
h
=
l
(
d
,
g
.
id
.
SWITCH
,
a
),
k
=
l
(
d
,
g
.
id
.
ICON
,
a
),
j
.
replaceSwitchClass
(
d
,
h
,
g
.
folder
.
DOCU
),
j
.
replaceIcoClass
(
d
,
k
,
g
.
folder
.
DOCU
),
i
.
css
(
"
display
"
,
"
none
"
);
else
if
(
a
.
view
.
showLine
&&
i
>
0
){
var
q
=
f
[
i
-
1
],
i
=
l
(
q
,
g
.
id
.
UL
,
a
),
h
=
l
(
q
,
g
.
id
.
SWITCH
,
a
);
k
=
l
(
q
,
g
.
id
.
ICON
,
a
);
d
==
c
?
f
.
length
==
1
?
j
.
replaceSwitchClass
(
q
,
h
,
g
.
line
.
ROOT
):(
c
=
l
(
f
[
0
],
g
.
id
.
SWITCH
,
a
),
j
.
replaceSwitchClass
(
f
[
0
],
c
,
g
.
line
.
ROOTS
),
j
.
replaceSwitchClass
(
q
,
h
,
g
.
line
.
BOTTOM
)):
j
.
replaceSwitchClass
(
q
,
h
,
g
.
line
.
BOTTOM
);
i
.
removeClass
(
g
.
line
.
LINE
)}}},
replaceIcoClass
:
function
(
a
,
b
,
c
){
if
(
b
&&!
a
.
isAjaxing
&&
(
a
=
b
.
attr
(
"
class
"
),
a
!=
void
0
)){
a
=
a
.
split
(
"
_
"
);
switch
(
c
){
case
g
.
folder
.
OPEN
:
case
g
.
folder
.
CLOSE
:
case
g
.
folder
.
DOCU
:
a
[
a
.
length
-
1
]
=
c
}
b
.
attr
(
"
class
"
,
a
.
join
(
"
_
"
))}},
replaceSwitchClass
:
function
(
a
,
b
,
c
){
if
(
b
){
var
d
=
b
.
attr
(
"
class
"
);
if
(
d
!=
void
0
){
d
=
d
.
split
(
"
_
"
);
switch
(
c
){
case
g
.
line
.
ROOT
:
case
g
.
line
.
ROOTS
:
case
g
.
line
.
CENTER
:
case
g
.
line
.
BOTTOM
:
case
g
.
line
.
NOLINE
:
d
[
0
]
=
j
.
makeNodeLineClassEx
(
a
)
+
c
;
break
;
case
g
.
folder
.
OPEN
:
case
g
.
folder
.
CLOSE
:
case
g
.
folder
.
DOCU
:
d
[
1
]
=
c
}
b
.
attr
(
"
class
"
,
d
.
join
(
"
_
"
));
c
!==
g
.
folder
.
DOCU
?
b
.
removeAttr
(
"
disabled
"
):
b
.
attr
(
"
disabled
"
,
"
disabled
"
)}}},
selectNode
:
function
(
a
,
b
,
c
){
c
||
j
.
cancelPreSelectedNode
(
a
,
null
,
b
);
l
(
b
,
g
.
id
.
A
,
a
).
addClass
(
g
.
node
.
CURSELECTED
);
e
.
addSelectedNode
(
a
,
b
);
a
.
treeObj
.
trigger
(
g
.
event
.
SELECTED
,[
a
.
treeId
,
b
])},
setNodeFontCss
:
function
(
a
,
b
){
var
c
=
l
(
b
,
g
.
id
.
A
,
a
),
d
=
j
.
makeNodeFontCss
(
a
,
b
);
d
&&
c
.
css
(
d
)},
setNodeLineIcos
:
function
(
a
,
b
){
if
(
b
){
var
c
=
l
(
b
,
g
.
id
.
SWITCH
,
a
),
d
=
l
(
b
,
g
.
id
.
UL
,
a
),
f
=
l
(
b
,
g
.
id
.
ICON
,
a
),
i
=
j
.
makeUlLineClass
(
a
,
b
);
i
.
length
==
0
?
d
.
removeClass
(
g
.
line
.
LINE
):
d
.
addClass
(
i
);
c
.
attr
(
"
class
"
,
j
.
makeNodeLineClass
(
a
,
b
));
e
.
nodeIsParent
(
a
,
b
)?
c
.
removeAttr
(
"
disabled
"
):
c
.
attr
(
"
disabled
"
,
"
disabled
"
);
f
.
removeAttr
(
"
style
"
);
f
.
attr
(
"
style
"
,
j
.
makeNodeIcoStyle
(
a
,
b
));
f
.
attr
(
"
class
"
,
j
.
makeNodeIcoClass
(
a
,
b
))}},
setNodeName
:
function
(
a
,
b
){
var
c
=
e
.
nodeTitle
(
a
,
b
),
d
=
l
(
b
,
g
.
id
.
SPAN
,
a
);
d
.
empty
();
a
.
view
.
nameIsHTML
?
d
.
html
(
e
.
nodeName
(
a
,
b
)):
d
.
text
(
e
.
nodeName
(
a
,
b
));
h
.
apply
(
a
.
view
.
showTitle
,[
a
.
treeId
,
b
],
a
.
view
.
showTitle
)
&&
l
(
b
,
g
.
id
.
A
,
a
).
attr
(
"
title
"
,
!
c
?
""
:
c
)},
setNodeTarget
:
function
(
a
,
b
){
l
(
b
,
g
.
id
.
A
,
a
).
attr
(
"
target
"
,
j
.
makeNodeTarget
(
b
))},
setNodeUrl
:
function
(
a
,
b
){
var
c
=
l
(
b
,
g
.
id
.
A
,
a
),
d
=
j
.
makeNodeUrl
(
a
,
b
);
d
==
null
||
d
.
length
==
0
?
c
.
removeAttr
(
"
href
"
):
c
.
attr
(
"
href
"
,
d
)},
switchNode
:
function
(
a
,
b
){
b
.
open
||!
h
.
canAsync
(
a
,
b
)?
j
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
):
a
.
async
.
enable
?
j
.
asyncNode
(
a
,
b
)
||
j
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
):
b
&&
j
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
)}};
r
.
fn
.
zTree
=
{
consts
:{
className
:{
BUTTON
:
"
button
"
,
LEVEL
:
"
level
"
,
ICO_LOADING
:
"
ico_loading
"
,
SWITCH
:
"
switch
"
,
NAME
:
"
node_name
"
},
event
:{
NODECREATED
:
"
ztree_nodeCreated
"
,
CLICK
:
"
ztree_click
"
,
EXPAND
:
"
ztree_expand
"
,
COLLAPSE
:
"
ztree_collapse
"
,
ASYNC_SUCCESS
:
"
ztree_async_success
"
,
ASYNC_ERROR
:
"
ztree_async_error
"
,
REMOVE
:
"
ztree_remove
"
,
SELECTED
:
"
ztree_selected
"
,
UNSELECTED
:
"
ztree_unselected
"
},
id
:{
A
:
"
_a
"
,
ICON
:
"
_ico
"
,
SPAN
:
"
_span
"
,
SWITCH
:
"
_switch
"
,
UL
:
"
_ul
"
},
line
:{
ROOT
:
"
root
"
,
ROOTS
:
"
roots
"
,
CENTER
:
"
center
"
,
BOTTOM
:
"
bottom
"
,
NOLINE
:
"
noline
"
,
LINE
:
"
line
"
},
folder
:{
OPEN
:
"
open
"
,
CLOSE
:
"
close
"
,
DOCU
:
"
docu
"
},
node
:{
CURSELECTED
:
"
curSelectedNode
"
}},
_z
:{
tools
:
h
,
view
:
j
,
event
:
n
,
data
:
e
},
getZTreeObj
:
function
(
a
){
return
(
a
=
e
.
getZTreeTools
(
a
))?
a
:
null
},
destroy
:
function
(
a
){
if
(
a
&&
a
.
length
>
0
)
j
.
destroy
(
e
.
getSetting
(
a
));
else
for
(
var
b
in
t
)
j
.
destroy
(
t
[
b
])},
init
:
function
(
a
,
b
,
c
){
var
d
=
h
.
clone
(
P
);
r
.
extend
(
!
0
,
d
,
b
);
d
.
treeId
=
a
.
attr
(
"
id
"
);
d
.
treeObj
=
a
;
d
.
treeObj
.
empty
();
t
[
d
.
treeId
]
=
d
;
if
(
typeof
document
.
body
.
style
.
maxHeight
===
"
undefined
"
)
d
.
view
.
expandSpeed
=
""
;
e
.
initRoot
(
d
);
a
=
e
.
getRoot
(
d
);
c
=
c
?
h
.
clone
(
h
.
isArray
(
c
)?
c
:[
c
]):[];
d
.
data
.
simpleData
.
enable
?
e
.
nodeChildren
(
d
,
a
,
e
.
transformTozTreeFormat
(
d
,
c
)):
e
.
nodeChildren
(
d
,
a
,
c
);
e
.
initCache
(
d
);
n
.
unbindTree
(
d
);
n
.
bindTree
(
d
);
n
.
unbindEvent
(
d
);
n
.
bindEvent
(
d
);
var
f
=
{
setting
:
d
,
addNodes
:
function
(
a
,
b
,
c
,
f
){
function
g
(){
j
.
addNodes
(
d
,
a
,
b
,
n
,
f
==!
0
)}
a
||
(
a
=
null
);
var
l
=
e
.
nodeIsParent
(
d
,
a
);
if
(
a
&&!
l
&&
d
.
data
.
keep
.
leaf
)
return
null
;
l
=
parseInt
(
b
,
10
);
isNaN
(
l
)?(
f
=!!
c
,
c
=
b
,
b
=-
1
):
b
=
l
;
if
(
!
c
)
return
null
;
var
n
=
h
.
clone
(
h
.
isArray
(
c
)?
c
:[
c
]);
h
.
canAsync
(
d
,
a
)?
j
.
asyncNode
(
d
,
a
,
f
,
g
):
g
();
return
n
},
cancelSelectedNode
:
function
(
a
){
j
.
cancelPreSelectedNode
(
d
,
a
)},
destroy
:
function
(){
j
.
destroy
(
d
)},
expandAll
:
function
(
a
){
a
=!!
a
;
j
.
expandCollapseSonNode
(
d
,
null
,
a
,
!
0
);
return
a
},
expandNode
:
function
(
a
,
b
,
c
,
f
,
g
){
function
n
(){
var
b
=
l
(
a
,
d
).
get
(
0
);
b
&&
f
!==!
1
&&
j
.
scrollIntoView
(
d
,
b
)}
if
(
!
a
||!
e
.
nodeIsParent
(
d
,
a
))
return
null
;
b
!==!
0
&&
b
!==!
1
&&
(
b
=!
a
.
open
);
if
((
g
=!!
g
)
&&
b
&&
h
.
apply
(
d
.
callback
.
beforeExpand
,[
d
.
treeId
,
a
],
!
0
)
==!
1
)
return
null
;
else
if
(
g
&&!
b
&&
h
.
apply
(
d
.
callback
.
beforeCollapse
,[
d
.
treeId
,
a
],
!
0
)
==!
1
)
return
null
;
b
&&
a
.
parentTId
&&
j
.
expandCollapseParentNode
(
d
,
a
.
getParentNode
(),
b
,
!
1
);
if
(
b
===
a
.
open
&&!
c
)
return
null
;
e
.
getRoot
(
d
).
expandTriggerFlag
=
g
;
!
h
.
canAsync
(
d
,
a
)
&&
c
?
j
.
expandCollapseSonNode
(
d
,
a
,
b
,
!
0
,
n
):(
a
.
open
=!
b
,
j
.
switchNode
(
this
.
setting
,
a
),
n
());
return
b
},
getNodes
:
function
(){
return
e
.
getNodes
(
d
)},
getNodeByParam
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodeByParam
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodeByTId
:
function
(
a
){
return
e
.
getNodeCache
(
d
,
a
)},
getNodesByParam
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodesByParam
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodesByParamFuzzy
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodesByParamFuzzy
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodesByFilter
:
function
(
a
,
b
,
c
,
f
){
b
=!!
b
;
return
!
a
||
typeof
a
!=
"
function
"
?
b
?
null
:[]:
e
.
getNodesByFilter
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
,
f
)},
getNodeIndex
:
function
(
a
){
if
(
!
a
)
return
null
;
for
(
var
b
=
a
.
parentTId
?
a
.
getParentNode
():
e
.
getRoot
(
d
),
b
=
e
.
nodeChildren
(
d
,
b
),
c
=
0
,
f
=
b
.
length
;
c
<
f
;
c
++
)
if
(
b
[
c
]
==
a
)
return
c
;
return
-
1
},
getSelectedNodes
:
function
(){
for
(
var
a
=
[],
b
=
e
.
getRoot
(
d
).
curSelectedList
,
c
=
0
,
f
=
b
.
length
;
c
<
f
;
c
++
)
a
.
push
(
b
[
c
]);
return
a
},
isSelectedNode
:
function
(
a
){
return
e
.
isSelectedNode
(
d
,
a
)},
reAsyncChildNodesPromise
:
function
(
a
,
b
,
c
){
return
new
Promise
(
function
(
d
,
e
){
try
{
f
.
reAsyncChildNodes
(
a
,
b
,
c
,
function
(){
d
(
a
)})}
catch
(
g
){
e
(
g
)}})},
reAsyncChildNodes
:
function
(
a
,
b
,
c
,
f
){
if
(
this
.
setting
.
async
.
enable
){
var
h
=!
a
;
h
&&
(
a
=
e
.
getRoot
(
d
));
if
(
b
==
"
refresh
"
){
for
(
var
b
=
e
.
nodeChildren
(
d
,
a
),
n
=
0
,
r
=
b
?
b
.
length
:
0
;
n
<
r
;
n
++
)
e
.
removeNodeCache
(
d
,
b
[
n
]);
e
.
removeSelectedNode
(
d
);
e
.
nodeChildren
(
d
,
a
,[]);
h
?
this
.
setting
.
treeObj
.
empty
():
l
(
a
,
g
.
id
.
UL
,
d
).
empty
()}
j
.
asyncNode
(
this
.
setting
,
h
?
null
:
a
,
!!
c
,
f
)}},
refresh
:
function
(){
this
.
setting
.
treeObj
.
empty
();
var
a
=
e
.
getRoot
(
d
),
b
=
e
.
nodeChildren
(
d
,
a
);
e
.
initRoot
(
d
);
e
.
nodeChildren
(
d
,
a
,
b
);
e
.
initCache
(
d
);
j
.
createNodes
(
d
,
0
,
e
.
nodeChildren
(
d
,
a
),
null
,
-
1
)},
removeChildNodes
:
function
(
a
){
if
(
!
a
)
return
null
;
var
b
=
e
.
nodeChildren
(
d
,
a
);
j
.
removeChildNodes
(
d
,
a
);
return
b
?
b
:
null
},
removeNode
:
function
(
a
,
b
){
a
&&
(
b
=!!
b
,
b
&&
h
.
apply
(
d
.
callback
.
beforeRemove
,[
d
.
treeId
,
a
],
!
0
)
==!
1
||
(
j
.
removeNode
(
d
,
a
),
b
&&
this
.
setting
.
treeObj
.
trigger
(
g
.
event
.
REMOVE
,[
d
.
treeId
,
a
])))},
selectNode
:
function
(
a
,
b
,
c
){
function
e
(){
if
(
!
c
){
var
b
=
l
(
a
,
d
).
get
(
0
);
j
.
scrollIntoView
(
d
,
b
)}}
if
(
a
&&
h
.
uCanDo
(
d
)){
b
=
d
.
view
.
selectedMulti
&&
b
;
if
(
a
.
parentTId
)
j
.
expandCollapseParentNode
(
d
,
a
.
getParentNode
(),
!
0
,
!
1
,
e
);
else
if
(
!
c
)
try
{
l
(
a
,
d
).
focus
().
blur
()}
catch
(
f
){}
j
.
selectNode
(
d
,
a
,
b
)}},
transformTozTreeNodes
:
function
(
a
){
return
e
.
transformTozTreeFormat
(
d
,
a
)},
transformToArray
:
function
(
a
){
return
e
.
transformToArrayFormat
(
d
,
a
)},
updateNode
:
function
(
a
){
a
&&
l
(
a
,
d
).
get
(
0
)
&&
h
.
uCanDo
(
d
)
&&
(
j
.
setNodeName
(
d
,
a
),
j
.
setNodeTarget
(
d
,
a
),
j
.
setNodeUrl
(
d
,
a
),
j
.
setNodeLineIcos
(
d
,
a
),
j
.
setNodeFontCss
(
d
,
a
))}};
a
.
treeTools
=
f
;
e
.
setZTreeTools
(
d
,
f
);(
c
=
e
.
nodeChildren
(
d
,
a
))
&&
c
.
length
>
0
?
j
.
createNodes
(
d
,
0
,
c
,
null
,
-
1
):
d
.
async
.
enable
&&
d
.
async
.
url
&&
d
.
async
.
url
!==
""
&&
j
.
asyncNode
(
d
);
return
f
}};
var
Q
=
r
.
fn
.
zTree
,
l
=
h
.
$
,
g
=
Q
.
consts
})(
jQuery
);
api/cn/zTreeObj.checkAllNodes.html
浏览文件 @
9523be07
...
...
@@ -15,7 +15,7 @@
<h4><b>
checked
</b><span>
Boolean
</span></h4>
<p>
checked = true 表示勾选全部节点
</p>
<p>
checked = false 表示全部节点取消勾选
</p>
<p
class=
"highlight_red"
>
不会影响 treeNode.nocheck
ed
= true 的节点。
</p>
<p
class=
"highlight_red"
>
不会影响 treeNode.nocheck = true 的节点。
</p>
<p
class=
"highlight_red"
>
不会影响未加载的节点。
</p>
<h4
class=
"topLine"
><b>
返回值
</b><span>
无
</span></h4>
<p>
目前无任何返回值
</p>
...
...
api/cn/zTreeObj.checkNode.html
浏览文件 @
9523be07
...
...
@@ -19,12 +19,12 @@
<p>
checked = true 表示勾选节点
</p>
<p>
checked = false 表示节点取消勾选
</p>
<p
class=
"highlight_red"
>
省略此参数,则根据对此节点的勾选状态进行 toggle 切换
</p>
<p
class=
"highlight_red"
>
不影响 treeNode.nocheck
ed
= true 的节点。
</p>
<p
class=
"highlight_red"
>
不影响 treeNode.nocheck = true 的节点。
</p>
<h4
class=
"topLine"
><b>
checkTypeFlag
</b><span>
Boolean
</span></h4>
<p>
checkTypeFlag = true 表示按照 setting.check.chkboxType 属性进行父子节点的勾选联动操作
</p>
<p>
checkTypeFlag = false 表示只修改此节点勾选状态,无任何勾选联动操作
</p>
<p
class=
"highlight_red"
>
checkTypeFlag = false 且 treeNode.checked = checked 时,不会触发回调函数,直接返回
</p>
<p
class=
"highlight_red"
>
不影响父子节点中 treeNode.nocheck
ed
= true 的节点。
</p>
<p
class=
"highlight_red"
>
不影响父子节点中 treeNode.nocheck = true 的节点。
</p>
<h4
class=
"topLine"
><b>
callbackFlag
</b><span>
Boolean
</span></h4>
<p>
callbackFlag = true 表示执行此方法时触发 beforeCheck
&
onCheck 事件回调函数
</p>
<p>
callbackFlag = false 表示执行此方法时不触发事件回调函数
</p>
...
...
api/cn/zTreeObj.getCheckedNodes.html
浏览文件 @
9523be07
...
...
@@ -15,7 +15,7 @@
<p>
checked = true 表示获取 被勾选 的节点集合
</p>
<p>
checked = false 表示获取 未勾选 的节点集合
</p>
<p
class=
"highlight_red"
>
省略此参数,等同于 true。
</p>
<p
class=
"highlight_red"
>
对于 treeNode.nocheck
ed
= true 的节点不进行获取。
</p>
<p
class=
"highlight_red"
>
对于 treeNode.nocheck = true 的节点不进行获取。
</p>
<h4
class=
"topLine"
><b>
返回值
</b><span>
Array(JSON)
</span></h4>
<p>
返回全部符合要求的节点集合 Array
</p>
</div>
...
...
api/cn/zTreeObj.setChkDisabled.html
浏览文件 @
9523be07
...
...
@@ -20,7 +20,7 @@
<p>
disabled = true 表示禁用 checkbox / radio
</p>
<p>
disabled = false 表示解禁 checkbox / radio
</p>
<p
class=
"highlight_red"
>
省略此参数,等同于 disabled = false
</p>
<p
class=
"highlight_red"
>
不影响 treeNode.nocheck
ed
= true 的节点。
</p>
<p
class=
"highlight_red"
>
不影响 treeNode.nocheck = true 的节点。
</p>
<h4
class=
"topLine"
><b>
inheritParent
</b><span>
Boolean
</span></h4>
<p>
inheritParent = true 表示全部父节点进行同样的操作
</p>
<p>
inheritParent = false 表示不影响父节点
</p>
...
...
api/cn/zTreeObj.updateNode.html
浏览文件 @
9523be07
...
...
@@ -20,7 +20,7 @@
<p>
checkTypeFlag = true 表示按照 setting.check.chkboxType 属性进行父子节点的勾选联动操作
</p>
<p>
checkTypeFlag = false 表示只修改此节点勾选状态,无任何勾选联动操作
</p>
<p
class=
"highlight_red"
>
当 setting.check.enable = true 且 setting.check.chkStyle = "checkbox" 时才有效
</p>
<p
class=
"highlight_red"
>
不影响父子节点中 treeNode.nocheck
ed
= true 的节点。
</p>
<p
class=
"highlight_red"
>
不影响父子节点中 treeNode.nocheck = true 的节点。
</p>
<h4
class=
"topLine"
><b>
返回值
</b><span>
无
</span></h4>
<p>
目前无任何返回值
</p>
</div>
...
...
api/en/zTreeObj.checkAllNodes.html
浏览文件 @
9523be07
...
...
@@ -15,7 +15,7 @@
<h4><b>
checked
</b><span>
Boolean
</span></h4>
<p>
checked = true means: check all nodes.
</p>
<p>
checked = false means: uncheck all nodes.
</p>
<p
class=
"highlight_red"
>
Don't affect the node which 'nocheck
ed
' attribute is true.
</p>
<p
class=
"highlight_red"
>
Don't affect the node which 'nocheck' attribute is true.
</p>
<p
class=
"highlight_red"
>
Don't affect the node is not loaded.
</p>
<h4
class=
"topLine"
><b>
Return
</b><span>
none
</span></h4>
<p>
no return value
</p>
...
...
api/en/zTreeObj.checkNode.html
浏览文件 @
9523be07
...
...
@@ -19,12 +19,12 @@
<p>
checked = true means: check node.
</p>
<p>
checked = false means: uncheck node.
</p>
<p
class=
"highlight_red"
>
If this parameter is omitted, then toggle check or uncheck depend this node's expanded state.
</p>
<p
class=
"highlight_red"
>
Don't affect the node which 'nocheck
ed
' attribute is true.
</p>
<p
class=
"highlight_red"
>
Don't affect the node which 'nocheck' attribute is true.
</p>
<h4
class=
"topLine"
><b>
checkTypeFlag
</b><span>
Boolean
</span></h4>
<p>
checkTypeFlag = true means: According to 'setting.check.chkboxType' attribute automatically check or uncheck the parent and child nodes.
</p>
<p>
checkTypeFlag = false means: only check or uncheck this node, don't affect its parent and child nodes.
</p>
<p
class=
"highlight_red"
>
When checkTypeFlag = false and treeNode.checked = checked, will not trigger callback function.
</p>
<p
class=
"highlight_red"
>
Don't affect the parent and child nodes which 'nocheck
ed
' attribute is true.
</p>
<p
class=
"highlight_red"
>
Don't affect the parent and child nodes which 'nocheck' attribute is true.
</p>
<h4
class=
"topLine"
><b>
callbackFlag
</b><span>
Boolean
</span></h4>
<p>
callbackFlag = true means: call this method, will trigger 'beforeCheck'
&
'onCheck' callback.
</p>
<p>
callbackFlag = false means: call this method, will not trigger callback.
</p>
...
...
api/en/zTreeObj.getCheckedNodes.html
浏览文件 @
9523be07
...
...
@@ -15,7 +15,7 @@
<p>
checked = true means: get the collection of nodes which be checked
</p>
<p>
checked = false means: get the collection of nodes which be unchecked
</p>
<p
class=
"highlight_red"
>
If this parameter is omitted, it is same as 'checked = true'
</p>
<p
class=
"highlight_red"
>
Don't get the nodes which 'nocheck
ed
' attribute is true.
</p>
<p
class=
"highlight_red"
>
Don't get the nodes which 'nocheck' attribute is true.
</p>
<h4
class=
"topLine"
><b>
Return
</b><span>
Array(JSON)
</span></h4>
<p>
return the collection of nodes which be checked or unchecked. (Array)
</p>
</div>
...
...
api/en/zTreeObj.setChkDisabled.html
浏览文件 @
9523be07
...
...
@@ -20,7 +20,7 @@
<p>
disabled = true means: the node's checkbox / radio is disabled.
</p>
<p>
disabled = false means: the node's checkbox / radio is removed disabled.
</p>
<p
class=
"highlight_red"
>
If this parameter is omitted, it is same as disabled = false
</p>
<p
class=
"highlight_red"
>
Don't affect the node which 'nocheck
ed
' attribute is true.
</p>
<p
class=
"highlight_red"
>
Don't affect the node which 'nocheck' attribute is true.
</p>
<h4
class=
"topLine"
><b>
inheritParent
</b><span>
Boolean
</span></h4>
<p>
inheritParent = true means: all parent nodes's disabled status will be same as this node.
</p>
<p>
inheritParent = false means: all parent nodes's disabled status will be not affected.
</p>
...
...
api/en/zTreeObj.updateNode.html
浏览文件 @
9523be07
...
...
@@ -20,7 +20,7 @@
<p>
checkTypeFlag = true means: According to 'setting.check.chkboxType' attribute automatically check or uncheck the parent and child nodes.
</p>
<p>
checkTypeFlag = false means: only check or uncheck this node, don't affect its parent and child nodes.
</p>
<p
class=
"highlight_red"
>
This parameter is valid when 'setting.check.enable = true' and 'setting.check.chkStyle = "checkbox"'
</p>
<p
class=
"highlight_red"
>
Don't affect the parent and child nodes which 'nocheck
ed
' attribute is true.
</p>
<p
class=
"highlight_red"
>
Don't affect the parent and child nodes which 'nocheck' attribute is true.
</p>
<h4
class=
"topLine"
><b>
Return
</b><span>
none
</span></h4>
<p>
no return value
</p>
</div>
...
...
js/jquery.ztree.all.js
浏览文件 @
9523be07
/*
* JQuery zTree core v3.5.3
6
* JQuery zTree core v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -9,7 +9,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
$
)
{
var
settings
=
{},
roots
=
{},
caches
=
{},
...
...
@@ -819,7 +819,7 @@
},
onClickNode
:
function
(
event
,
node
)
{
var
setting
=
data
.
getSetting
(
event
.
data
.
treeId
),
clickFlag
=
(
(
setting
.
view
.
autoCancelSelected
&&
(
event
.
ctrlKey
||
event
.
metaKey
))
&&
data
.
isSelectedNode
(
setting
,
node
))
?
0
:
(
setting
.
view
.
autoCancelSelected
&&
(
event
.
ctrlKey
||
event
.
metaKey
)
&&
setting
.
view
.
selectedMulti
)
?
2
:
1
;
clickFlag
=
(
(
setting
.
view
.
autoCancelSelected
&&
(
event
.
ctrlKey
||
event
.
metaKey
))
&&
data
.
isSelectedNode
(
setting
,
node
))
?
0
:
(
setting
.
view
.
autoCancelSelected
&&
(
event
.
ctrlKey
||
event
.
metaKey
)
&&
setting
.
view
.
selectedMulti
)
?
2
:
1
;
if
(
tools
.
apply
(
setting
.
callback
.
beforeClick
,
[
setting
.
treeId
,
node
,
clickFlag
],
true
)
==
false
)
return
true
;
if
(
clickFlag
===
0
)
{
view
.
cancelPreSelectedNode
(
setting
,
node
);
...
...
@@ -859,7 +859,7 @@
},
onSelectStart
:
function
(
e
)
{
var
n
=
e
.
originalEvent
.
srcElement
.
nodeName
.
toLowerCase
();
return
(
n
===
"
input
"
||
n
===
"
textarea
"
);
return
(
n
===
"
input
"
||
n
===
"
textarea
"
);
}
},
//method of tools for zTree
...
...
@@ -922,7 +922,7 @@
return
(
$
(
target
).
parent
(
"
li
"
).
get
(
0
)
||
$
(
target
).
parentsUntil
(
"
li
"
).
parent
().
get
(
0
));
},
isChildOrSelf
:
function
(
dom
,
parentId
)
{
return
(
$
(
dom
).
closest
(
"
#
"
+
parentId
).
length
>
0
);
return
(
$
(
dom
).
closest
(
"
#
"
+
parentId
).
length
>
0
);
},
uCanDo
:
function
(
setting
,
e
)
{
return
true
;
...
...
@@ -1438,68 +1438,66 @@
}
return
;
}
// code src: http://jsfiddle.net/08u6cxwj/
// CC-BY jocki84@googlemail.com, https://gist.github.com/jocki84/6ffafd003387179a988e
if
(
!
Element
.
prototype
.
scrollIntoViewIfNeeded
)
{
Element
.
prototype
.
scrollIntoViewIfNeeded
=
function
(
centerIfNeeded
)
{
function
withinBounds
(
value
,
min
,
max
,
extent
)
{
if
(
false
===
centerIfNeeded
||
max
<=
value
+
extent
&&
value
<=
min
+
extent
)
{
return
Math
.
min
(
max
,
Math
.
max
(
min
,
value
));
}
else
{
return
(
min
+
max
)
/
2
;
}
}
"
use strict
"
;
function
makeArea
(
left
,
top
,
width
,
height
)
{
return
{
"
left
"
:
left
,
"
top
"
:
top
,
"
width
"
:
width
,
"
height
"
:
height
,
"
right
"
:
left
+
width
,
"
bottom
"
:
top
+
height
,
"
translate
"
:
function
(
x
,
y
)
{
return
makeArea
(
x
+
left
,
y
+
top
,
width
,
height
);
function
makeRange
(
start
,
length
)
{
return
{
"
start
"
:
start
,
"
length
"
:
length
,
"
end
"
:
start
+
length
};
}
,
"
relativeFromTo
"
:
function
(
lhs
,
rhs
)
{
var
newLeft
=
left
,
newTop
=
top
;
lhs
=
lhs
.
offsetParent
;
rhs
=
rhs
.
offsetParent
;
if
(
lhs
===
rhs
)
{
return
area
;
}
for
(;
lhs
;
lhs
=
lhs
.
offsetParent
)
{
newLeft
+=
lhs
.
offsetLeft
+
lhs
.
clientLeft
;
newTop
+=
lhs
.
offsetTop
+
lhs
.
clientTop
;
function
coverRange
(
inner
,
outer
)
{
if
(
false
===
centerIfNeeded
||
(
outer
.
start
<
inner
.
end
&&
inner
.
start
<
outer
.
end
)
)
{
return
Math
.
max
(
inner
.
end
-
outer
.
length
,
Math
.
min
(
outer
.
start
,
inner
.
start
)
)
;
}
for
(;
rhs
;
rhs
=
rhs
.
offsetParent
)
{
newLeft
-=
rhs
.
offsetLeft
+
rhs
.
clientLeft
;
newTop
-=
rhs
.
offsetTop
+
rhs
.
clientTop
;
return
(
inner
.
start
+
inner
.
end
-
outer
.
length
)
/
2
;
}
return
makeArea
(
newLeft
,
newTop
,
width
,
height
);
function
makePoint
(
x
,
y
)
{
return
{
"
x
"
:
x
,
"
y
"
:
y
,
"
translate
"
:
function
translate
(
dX
,
dY
)
{
return
makePoint
(
x
+
dX
,
y
+
dY
);
}
};
}
var
parent
,
elem
=
this
,
area
=
makeArea
(
this
.
offsetLeft
,
this
.
offsetTop
,
this
.
offsetWidth
,
this
.
offsetHeight
);
while
(
tools
.
isElement
(
parent
=
elem
.
parentNode
))
{
var
clientLeft
=
parent
.
offsetLeft
+
parent
.
clientLeft
;
var
clientTop
=
parent
.
offsetTop
+
parent
.
clientTop
;
// Make area relative to parent's client area.
area
=
area
.
relativeFromTo
(
elem
,
parent
).
translate
(
-
clientLeft
,
-
clientTop
);
function
absolute
(
elem
,
pt
)
{
while
(
elem
)
{
pt
=
pt
.
translate
(
elem
.
offsetLeft
,
elem
.
offsetTop
);
elem
=
elem
.
offsetParent
;
}
return
pt
;
}
parent
.
scrollLeft
=
withinBounds
(
parent
.
scrollLeft
,
area
.
right
-
parent
.
clientWidth
,
area
.
left
,
parent
.
clientWidth
)
;
var
target
=
absolute
(
this
,
makePoint
(
0
,
0
)),
extent
=
makePoint
(
this
.
offsetWidth
,
this
.
offsetHeight
)
,
elem
=
this
.
parentNode
,
origin
;
parent
.
scrollTop
=
withinBounds
(
parent
.
scrollTop
,
area
.
bottom
-
parent
.
clientHeight
,
area
.
top
,
parent
.
clientHeight
);
while
(
elem
instanceof
HTMLElement
)
{
// Apply desired scroll amount.
origin
=
absolute
(
elem
,
makePoint
(
elem
.
clientLeft
,
elem
.
clientTop
));
elem
.
scrollLeft
=
coverRange
(
makeRange
(
target
.
x
-
origin
.
x
,
extent
.
x
),
makeRange
(
elem
.
scrollLeft
,
elem
.
clientWidth
)
);
elem
.
scrollTop
=
coverRange
(
makeRange
(
target
.
y
-
origin
.
y
,
extent
.
y
),
makeRange
(
elem
.
scrollTop
,
elem
.
clientHeight
)
);
// Determine actual scroll amount by reading back scroll properties.
area
=
area
.
translate
(
clientLeft
-
parent
.
scrollLeft
,
clientTop
-
parent
.
scrollTop
);
elem
=
parent
;
target
=
target
.
translate
(
-
elem
.
scrollLeft
,
-
elem
.
scrollTop
);
elem
=
elem
.
parentNode
;
}
};
}
...
...
@@ -1870,12 +1868,12 @@
return
data
.
isSelectedNode
(
setting
,
node
);
},
reAsyncChildNodesPromise
:
function
(
parentNode
,
reloadType
,
isSilent
)
{
var
promise
=
new
Promise
(
function
(
resolve
,
reject
)
{
var
promise
=
new
Promise
(
function
(
resolve
,
reject
)
{
try
{
zTreeTools
.
reAsyncChildNodes
(
parentNode
,
reloadType
,
isSilent
,
function
()
{
zTreeTools
.
reAsyncChildNodes
(
parentNode
,
reloadType
,
isSilent
,
function
()
{
resolve
(
parentNode
);
});
}
catch
(
e
)
{
}
catch
(
e
)
{
reject
(
e
);
}
});
...
...
@@ -1985,7 +1983,7 @@
consts
=
zt
.
consts
;
})(
jQuery
);
/*
* JQuery zTree excheck v3.5.3
6
* JQuery zTree excheck v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -1994,9 +1992,9 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
$
)
{
(
function
(
$
)
{
//default consts of excheck
var
_consts
=
{
event
:
{
...
...
@@ -2041,8 +2039,8 @@
}
},
callback
:
{
beforeCheck
:
null
,
onCheck
:
null
beforeCheck
:
null
,
onCheck
:
null
}
},
//default root of excheck
...
...
@@ -2051,9 +2049,10 @@
r
.
radioCheckedList
=
[];
},
//default cache of excheck
_initCache
=
function
(
treeId
)
{},
_initCache
=
function
(
treeId
)
{
},
//default bind event of excheck
_bindEvent
=
function
(
setting
)
{
_bindEvent
=
function
(
setting
)
{
var
o
=
setting
.
treeObj
,
c
=
consts
.
event
;
o
.
bind
(
c
.
CHECK
,
function
(
event
,
srcEvent
,
treeId
,
node
)
{
...
...
@@ -2061,13 +2060,13 @@
tools
.
apply
(
setting
.
callback
.
onCheck
,
[
event
,
treeId
,
node
]);
});
},
_unbindEvent
=
function
(
setting
)
{
_unbindEvent
=
function
(
setting
)
{
var
o
=
setting
.
treeObj
,
c
=
consts
.
event
;
o
.
unbind
(
c
.
CHECK
);
},
//default event proxy of excheck
_eventProxy
=
function
(
e
)
{
_eventProxy
=
function
(
e
)
{
var
target
=
e
.
target
,
setting
=
data
.
getSetting
(
e
.
data
.
treeId
),
tId
=
""
,
node
=
null
,
...
...
@@ -2075,22 +2074,22 @@
nodeEventCallback
=
null
,
treeEventCallback
=
null
;
if
(
tools
.
eqs
(
e
.
type
,
"
mouseover
"
))
{
if
(
setting
.
check
.
enable
&&
tools
.
eqs
(
target
.
tagName
,
"
span
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
CHECK
)
!==
null
)
{
if
(
setting
.
check
.
enable
&&
tools
.
eqs
(
target
.
tagName
,
"
span
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
CHECK
)
!==
null
)
{
tId
=
tools
.
getNodeMainDom
(
target
).
id
;
nodeEventType
=
"
mouseoverCheck
"
;
}
}
else
if
(
tools
.
eqs
(
e
.
type
,
"
mouseout
"
))
{
if
(
setting
.
check
.
enable
&&
tools
.
eqs
(
target
.
tagName
,
"
span
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
CHECK
)
!==
null
)
{
if
(
setting
.
check
.
enable
&&
tools
.
eqs
(
target
.
tagName
,
"
span
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
CHECK
)
!==
null
)
{
tId
=
tools
.
getNodeMainDom
(
target
).
id
;
nodeEventType
=
"
mouseoutCheck
"
;
}
}
else
if
(
tools
.
eqs
(
e
.
type
,
"
click
"
))
{
if
(
setting
.
check
.
enable
&&
tools
.
eqs
(
target
.
tagName
,
"
span
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
CHECK
)
!==
null
)
{
if
(
setting
.
check
.
enable
&&
tools
.
eqs
(
target
.
tagName
,
"
span
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
CHECK
)
!==
null
)
{
tId
=
tools
.
getNodeMainDom
(
target
).
id
;
nodeEventType
=
"
checkNode
"
;
}
}
if
(
tId
.
length
>
0
)
{
if
(
tId
.
length
>
0
)
{
node
=
data
.
getNodeCache
(
setting
,
tId
);
switch
(
nodeEventType
)
{
case
"
checkNode
"
:
...
...
@@ -2115,7 +2114,7 @@
return
proxyResult
},
//default init node of excheck
_initNode
=
function
(
setting
,
level
,
n
,
parentNode
,
isFirstNode
,
isLastNode
,
openFlag
)
{
_initNode
=
function
(
setting
,
level
,
n
,
parentNode
,
isFirstNode
,
isLastNode
,
openFlag
)
{
if
(
!
n
)
return
;
var
checked
=
data
.
nodeChecked
(
setting
,
n
);
checked
=
data
.
nodeChecked
(
setting
,
n
,
checked
);
...
...
@@ -2128,7 +2127,9 @@
n
.
halfCheck
=
!!
n
.
halfCheck
;
n
.
check_Child_State
=
-
1
;
n
.
check_Focus
=
false
;
n
.
getCheckStatus
=
function
()
{
return
data
.
getCheckStatus
(
setting
,
n
);};
n
.
getCheckStatus
=
function
()
{
return
data
.
getCheckStatus
(
setting
,
n
);
};
if
(
setting
.
check
.
chkStyle
==
consts
.
radio
.
STYLE
&&
setting
.
check
.
radioType
==
consts
.
radio
.
TYPE_ALL
&&
checked
)
{
var
r
=
data
.
getRoot
(
setting
);
...
...
@@ -2136,15 +2137,15 @@
}
},
//add dom for check
_beforeA
=
function
(
setting
,
node
,
html
)
{
_beforeA
=
function
(
setting
,
node
,
html
)
{
if
(
setting
.
check
.
enable
)
{
data
.
makeChkFlag
(
setting
,
node
);
html
.
push
(
"
<span ID='
"
,
node
.
tId
,
consts
.
id
.
CHECK
,
"
' class='
"
,
view
.
makeChkClass
(
setting
,
node
),
"
' treeNode
"
,
consts
.
id
.
CHECK
,
(
node
.
nocheck
===
true
?
"
style='display:none;'
"
:
""
),
"
></span>
"
);
html
.
push
(
"
<span ID='
"
,
node
.
tId
,
consts
.
id
.
CHECK
,
"
' class='
"
,
view
.
makeChkClass
(
setting
,
node
),
"
' treeNode
"
,
consts
.
id
.
CHECK
,
(
node
.
nocheck
===
true
?
"
style='display:none;'
"
:
""
),
"
></span>
"
);
}
},
//update zTreeObj, add method of check
_zTreeTools
=
function
(
setting
,
zTreeTools
)
{
zTreeTools
.
checkNode
=
function
(
node
,
checked
,
checkTypeFlag
,
callbackFlag
)
{
_zTreeTools
=
function
(
setting
,
zTreeTools
)
{
zTreeTools
.
checkNode
=
function
(
node
,
checked
,
checkTypeFlag
,
callbackFlag
)
{
var
nodeChecked
=
data
.
nodeChecked
(
setting
,
node
);
if
(
node
.
chkDisabled
===
true
)
return
;
if
(
checked
!==
true
&&
checked
!==
false
)
{
...
...
@@ -2169,22 +2170,22 @@
}
}
zTreeTools
.
checkAllNodes
=
function
(
checked
)
{
zTreeTools
.
checkAllNodes
=
function
(
checked
)
{
view
.
repairAllChk
(
this
.
setting
,
!!
checked
);
}
zTreeTools
.
getCheckedNodes
=
function
(
checked
)
{
zTreeTools
.
getCheckedNodes
=
function
(
checked
)
{
var
checked
=
(
checked
!==
false
);
var
children
=
data
.
nodeChildren
(
setting
,
data
.
getRoot
(
this
.
setting
));
return
data
.
getTreeCheckedNodes
(
this
.
setting
,
children
,
checked
);
}
zTreeTools
.
getChangeCheckedNodes
=
function
()
{
zTreeTools
.
getChangeCheckedNodes
=
function
()
{
var
children
=
data
.
nodeChildren
(
setting
,
data
.
getRoot
(
this
.
setting
));
return
data
.
getTreeChangeCheckedNodes
(
this
.
setting
,
children
);
}
zTreeTools
.
setChkDisabled
=
function
(
node
,
disabled
,
inheritParent
,
inheritChildren
)
{
zTreeTools
.
setChkDisabled
=
function
(
node
,
disabled
,
inheritParent
,
inheritChildren
)
{
disabled
=
!!
disabled
;
inheritParent
=
!!
inheritParent
;
inheritChildren
=
!!
inheritChildren
;
...
...
@@ -2193,7 +2194,7 @@
}
var
_updateNode
=
zTreeTools
.
updateNode
;
zTreeTools
.
updateNode
=
function
(
node
,
checkTypeFlag
)
{
zTreeTools
.
updateNode
=
function
(
node
,
checkTypeFlag
)
{
if
(
_updateNode
)
_updateNode
.
apply
(
zTreeTools
,
arguments
);
if
(
!
node
||
!
this
.
setting
.
check
.
enable
)
return
;
var
nObj
=
$$
(
node
,
this
.
setting
);
...
...
@@ -2207,17 +2208,18 @@
},
//method of operate data
_data
=
{
getRadioCheckedList
:
function
(
setting
)
{
getRadioCheckedList
:
function
(
setting
)
{
var
checkedList
=
data
.
getRoot
(
setting
).
radioCheckedList
;
for
(
var
i
=
0
,
j
=
checkedList
.
length
;
i
<
j
;
i
++
)
{
if
(
!
data
.
getNodeCache
(
setting
,
checkedList
[
i
].
tId
))
{
for
(
var
i
=
0
,
j
=
checkedList
.
length
;
i
<
j
;
i
++
)
{
if
(
!
data
.
getNodeCache
(
setting
,
checkedList
[
i
].
tId
))
{
checkedList
.
splice
(
i
,
1
);
i
--
;
j
--
;
i
--
;
j
--
;
}
}
return
checkedList
;
},
getCheckStatus
:
function
(
setting
,
node
)
{
getCheckStatus
:
function
(
setting
,
node
)
{
if
(
!
setting
.
check
.
enable
||
node
.
nocheck
||
node
.
chkDisabled
)
return
null
;
var
checked
=
data
.
nodeChecked
(
setting
,
node
),
r
=
{
...
...
@@ -2226,7 +2228,7 @@
};
return
r
;
},
getTreeCheckedNodes
:
function
(
setting
,
nodes
,
checked
,
results
)
{
getTreeCheckedNodes
:
function
(
setting
,
nodes
,
checked
,
results
)
{
if
(
!
nodes
)
return
[];
var
onlyOne
=
(
checked
&&
setting
.
check
.
chkStyle
==
consts
.
radio
.
STYLE
&&
setting
.
check
.
radioType
==
consts
.
radio
.
TYPE_ALL
);
results
=
!
results
?
[]
:
results
;
...
...
@@ -2236,18 +2238,18 @@
var
nodeChecked
=
data
.
nodeChecked
(
setting
,
node
);
if
(
node
.
nocheck
!==
true
&&
node
.
chkDisabled
!==
true
&&
nodeChecked
==
checked
)
{
results
.
push
(
node
);
if
(
onlyOne
)
{
if
(
onlyOne
)
{
break
;
}
}
data
.
getTreeCheckedNodes
(
setting
,
children
,
checked
,
results
);
if
(
onlyOne
&&
results
.
length
>
0
)
{
if
(
onlyOne
&&
results
.
length
>
0
)
{
break
;
}
}
return
results
;
},
getTreeChangeCheckedNodes
:
function
(
setting
,
nodes
,
results
)
{
getTreeChangeCheckedNodes
:
function
(
setting
,
nodes
,
results
)
{
if
(
!
nodes
)
return
[];
results
=
!
results
?
[]
:
results
;
for
(
var
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
...
...
@@ -2261,7 +2263,7 @@
}
return
results
;
},
makeChkFlag
:
function
(
setting
,
node
)
{
makeChkFlag
:
function
(
setting
,
node
)
{
if
(
!
node
)
return
;
var
chkFlag
=
-
1
;
var
children
=
data
.
nodeChildren
(
setting
,
node
);
...
...
@@ -2278,11 +2280,12 @@
}
else
if
(
nodeChecked
)
{
tmp
=
2
;
}
else
{
tmp
=
cNode
.
check_Child_State
>
0
?
2
:
0
;
tmp
=
cNode
.
check_Child_State
>
0
?
2
:
0
;
}
if
(
tmp
==
2
)
{
chkFlag
=
2
;
break
;
}
else
if
(
tmp
==
0
){
chkFlag
=
2
;
break
;
}
else
if
(
tmp
==
0
)
{
chkFlag
=
0
;
}
}
else
if
(
setting
.
check
.
chkStyle
==
consts
.
checkbox
.
STYLE
)
{
...
...
@@ -2296,11 +2299,14 @@
tmp
=
(
cNode
.
check_Child_State
>
0
)
?
1
:
0
;
}
if
(
tmp
===
1
)
{
chkFlag
=
1
;
break
;
chkFlag
=
1
;
break
;
}
else
if
(
tmp
===
2
&&
chkFlag
>
-
1
&&
i
>
0
&&
tmp
!==
chkFlag
)
{
chkFlag
=
1
;
break
;
chkFlag
=
1
;
break
;
}
else
if
(
chkFlag
===
2
&&
tmp
>
-
1
&&
tmp
<
2
)
{
chkFlag
=
1
;
break
;
chkFlag
=
1
;
break
;
}
else
if
(
tmp
>
-
1
)
{
chkFlag
=
tmp
;
}
...
...
@@ -2311,9 +2317,7 @@
}
},
//method of event proxy
_event
=
{
},
_event
=
{},
//method of event handler
_handler
=
{
onCheckNode
:
function
(
event
,
node
)
{
...
...
@@ -2329,7 +2333,7 @@
setting
.
treeObj
.
trigger
(
consts
.
event
.
CHECK
,
[
event
,
setting
.
treeId
,
node
]);
return
true
;
},
onMouseoverCheck
:
function
(
event
,
node
)
{
onMouseoverCheck
:
function
(
event
,
node
)
{
if
(
node
.
chkDisabled
===
true
)
return
false
;
var
setting
=
data
.
getSetting
(
event
.
data
.
treeId
),
checkObj
=
$$
(
node
,
consts
.
id
.
CHECK
,
setting
);
...
...
@@ -2337,7 +2341,7 @@
view
.
setChkClass
(
setting
,
checkObj
,
node
);
return
true
;
},
onMouseoutCheck
:
function
(
event
,
node
)
{
onMouseoutCheck
:
function
(
event
,
node
)
{
if
(
node
.
chkDisabled
===
true
)
return
false
;
var
setting
=
data
.
getSetting
(
event
.
data
.
treeId
),
checkObj
=
$$
(
node
,
consts
.
id
.
CHECK
,
setting
);
...
...
@@ -2347,12 +2351,10 @@
}
},
//method of tools for zTree
_tools
=
{
},
_tools
=
{},
//method of operate ztree dom
_view
=
{
checkNodeRelation
:
function
(
setting
,
node
)
{
checkNodeRelation
:
function
(
setting
,
node
)
{
var
pNode
,
i
,
l
,
r
=
consts
.
radio
;
var
nodeChecked
=
data
.
nodeChecked
(
setting
,
node
);
...
...
@@ -2360,7 +2362,7 @@
var
checkedList
=
data
.
getRadioCheckedList
(
setting
);
if
(
nodeChecked
)
{
if
(
setting
.
check
.
radioType
==
r
.
TYPE_ALL
)
{
for
(
i
=
checkedList
.
length
-
1
;
i
>=
0
;
i
--
)
{
for
(
i
=
checkedList
.
length
-
1
;
i
>=
0
;
i
--
)
{
pNode
=
checkedList
[
i
];
var
pNodeChecked
=
data
.
nodeChecked
(
setting
,
pNode
);
if
(
pNodeChecked
&&
pNode
!=
node
)
{
...
...
@@ -2397,10 +2399,10 @@
}
else
{
var
children
=
data
.
nodeChildren
(
setting
,
node
);
if
(
nodeChecked
&&
(
!
children
||
children
.
length
==
0
||
setting
.
check
.
chkboxType
.
Y
.
indexOf
(
"
s
"
)
>
-
1
))
{
if
(
nodeChecked
&&
(
!
children
||
children
.
length
==
0
||
setting
.
check
.
chkboxType
.
Y
.
indexOf
(
"
s
"
)
>
-
1
))
{
view
.
setSonNodeCheckBox
(
setting
,
node
,
true
);
}
if
(
!
nodeChecked
&&
(
!
children
||
children
.
length
==
0
||
setting
.
check
.
chkboxType
.
N
.
indexOf
(
"
s
"
)
>
-
1
))
{
if
(
!
nodeChecked
&&
(
!
children
||
children
.
length
==
0
||
setting
.
check
.
chkboxType
.
N
.
indexOf
(
"
s
"
)
>
-
1
))
{
view
.
setSonNodeCheckBox
(
setting
,
node
,
false
);
}
if
(
nodeChecked
&&
setting
.
check
.
chkboxType
.
Y
.
indexOf
(
"
p
"
)
>
-
1
)
{
...
...
@@ -2411,7 +2413,7 @@
}
}
},
makeChkClass
:
function
(
setting
,
node
)
{
makeChkClass
:
function
(
setting
,
node
)
{
var
c
=
consts
.
checkbox
,
r
=
consts
.
radio
,
fullStyle
=
""
;
var
nodeChecked
=
data
.
nodeChecked
(
setting
,
node
);
...
...
@@ -2420,19 +2422,19 @@
}
else
if
(
node
.
halfCheck
)
{
fullStyle
=
c
.
PART
;
}
else
if
(
setting
.
check
.
chkStyle
==
r
.
STYLE
)
{
fullStyle
=
(
node
.
check_Child_State
<
1
)?
c
.
FULL
:
c
.
PART
;
fullStyle
=
(
node
.
check_Child_State
<
1
)
?
c
.
FULL
:
c
.
PART
;
}
else
{
fullStyle
=
nodeChecked
?
((
node
.
check_Child_State
===
2
||
node
.
check_Child_State
===
-
1
)
?
c
.
FULL
:
c
.
PART
)
:
((
node
.
check_Child_State
<
1
)?
c
.
FULL
:
c
.
PART
);
fullStyle
=
nodeChecked
?
((
node
.
check_Child_State
===
2
||
node
.
check_Child_State
===
-
1
)
?
c
.
FULL
:
c
.
PART
)
:
((
node
.
check_Child_State
<
1
)
?
c
.
FULL
:
c
.
PART
);
}
var
chkName
=
setting
.
check
.
chkStyle
+
"
_
"
+
(
nodeChecked
?
c
.
TRUE
:
c
.
FALSE
)
+
"
_
"
+
fullStyle
;
chkName
=
(
node
.
check_Focus
&&
node
.
chkDisabled
!==
true
)
?
chkName
+
"
_
"
+
c
.
FOCUS
:
chkName
;
return
consts
.
className
.
BUTTON
+
"
"
+
c
.
DEFAULT
+
"
"
+
chkName
;
},
repairAllChk
:
function
(
setting
,
checked
)
{
repairAllChk
:
function
(
setting
,
checked
)
{
if
(
setting
.
check
.
enable
&&
setting
.
check
.
chkStyle
===
consts
.
checkbox
.
STYLE
)
{
var
root
=
data
.
getRoot
(
setting
);
var
children
=
data
.
nodeChildren
(
setting
,
root
);
for
(
var
i
=
0
,
l
=
children
.
length
;
i
<
l
;
i
++
)
{
for
(
var
i
=
0
,
l
=
children
.
length
;
i
<
l
;
i
++
)
{
var
node
=
children
[
i
];
if
(
node
.
nocheck
!==
true
&&
node
.
chkDisabled
!==
true
)
{
data
.
nodeChecked
(
setting
,
node
,
checked
);
...
...
@@ -2441,7 +2443,7 @@
}
}
},
repairChkClass
:
function
(
setting
,
node
)
{
repairChkClass
:
function
(
setting
,
node
)
{
if
(
!
node
)
return
;
data
.
makeChkFlag
(
setting
,
node
);
if
(
node
.
nocheck
!==
true
)
{
...
...
@@ -2449,13 +2451,13 @@
view
.
setChkClass
(
setting
,
checkObj
,
node
);
}
},
repairParentChkClass
:
function
(
setting
,
node
)
{
repairParentChkClass
:
function
(
setting
,
node
)
{
if
(
!
node
||
!
node
.
parentTId
)
return
;
var
pNode
=
node
.
getParentNode
();
view
.
repairChkClass
(
setting
,
pNode
);
view
.
repairParentChkClass
(
setting
,
pNode
);
},
repairParentChkClassWithSelf
:
function
(
setting
,
node
)
{
repairParentChkClassWithSelf
:
function
(
setting
,
node
)
{
if
(
!
node
)
return
;
var
children
=
data
.
nodeChildren
(
setting
,
node
);
if
(
children
&&
children
.
length
>
0
)
{
...
...
@@ -2464,7 +2466,7 @@
view
.
repairParentChkClass
(
setting
,
node
);
}
},
repairSonChkDisabled
:
function
(
setting
,
node
,
chkDisabled
,
inherit
)
{
repairSonChkDisabled
:
function
(
setting
,
node
,
chkDisabled
,
inherit
)
{
if
(
!
node
)
return
;
if
(
node
.
chkDisabled
!=
chkDisabled
)
{
node
.
chkDisabled
=
chkDisabled
;
...
...
@@ -2478,7 +2480,7 @@
}
}
},
repairParentChkDisabled
:
function
(
setting
,
node
,
chkDisabled
,
inherit
)
{
repairParentChkDisabled
:
function
(
setting
,
node
,
chkDisabled
,
inherit
)
{
if
(
!
node
)
return
;
if
(
node
.
chkDisabled
!=
chkDisabled
&&
inherit
)
{
node
.
chkDisabled
=
chkDisabled
;
...
...
@@ -2486,7 +2488,7 @@
view
.
repairChkClass
(
setting
,
node
);
view
.
repairParentChkDisabled
(
setting
,
node
.
getParentNode
(),
chkDisabled
,
inherit
);
},
setChkClass
:
function
(
setting
,
obj
,
node
)
{
setChkClass
:
function
(
setting
,
obj
,
node
)
{
if
(
!
obj
)
return
;
if
(
node
.
nocheck
===
true
)
{
obj
.
hide
();
...
...
@@ -2495,7 +2497,7 @@
}
obj
.
attr
(
'
class
'
,
view
.
makeChkClass
(
setting
,
node
));
},
setParentNodeCheckBox
:
function
(
setting
,
node
,
value
,
srcNode
)
{
setParentNodeCheckBox
:
function
(
setting
,
node
,
value
,
srcNode
)
{
var
checkObj
=
$$
(
node
,
consts
.
id
.
CHECK
,
setting
);
if
(
!
srcNode
)
srcNode
=
node
;
data
.
makeChkFlag
(
setting
,
node
);
...
...
@@ -2525,7 +2527,7 @@
}
}
},
setSonNodeCheckBox
:
function
(
setting
,
node
,
value
,
srcNode
)
{
setSonNodeCheckBox
:
function
(
setting
,
node
,
value
,
srcNode
)
{
if
(
!
node
)
return
;
var
checkObj
=
$$
(
node
,
consts
.
id
.
CHECK
,
setting
);
if
(
!
srcNode
)
srcNode
=
node
;
...
...
@@ -2576,7 +2578,7 @@
event
=
zt
.
_z
.
event
,
$$
=
tools
.
$
;
data
.
nodeChecked
=
function
(
setting
,
node
,
newChecked
)
{
data
.
nodeChecked
=
function
(
setting
,
node
,
newChecked
)
{
if
(
!
node
)
{
return
false
;
}
...
...
@@ -2602,13 +2604,13 @@
data
.
addZTreeTools
(
_zTreeTools
);
var
_createNodes
=
view
.
createNodes
;
view
.
createNodes
=
function
(
setting
,
level
,
nodes
,
parentNode
,
index
)
{
view
.
createNodes
=
function
(
setting
,
level
,
nodes
,
parentNode
,
index
)
{
if
(
_createNodes
)
_createNodes
.
apply
(
view
,
arguments
);
if
(
!
nodes
)
return
;
view
.
repairParentChkClassWithSelf
(
setting
,
parentNode
);
}
var
_removeNode
=
view
.
removeNode
;
view
.
removeNode
=
function
(
setting
,
node
)
{
view
.
removeNode
=
function
(
setting
,
node
)
{
var
parentNode
=
node
.
getParentNode
();
if
(
_removeNode
)
_removeNode
.
apply
(
view
,
arguments
);
if
(
!
node
||
!
parentNode
)
return
;
...
...
@@ -2617,7 +2619,7 @@
}
var
_appendNodes
=
view
.
appendNodes
;
view
.
appendNodes
=
function
(
setting
,
level
,
nodes
,
parentNode
,
index
,
initFlag
,
openFlag
)
{
view
.
appendNodes
=
function
(
setting
,
level
,
nodes
,
parentNode
,
index
,
initFlag
,
openFlag
)
{
var
html
=
""
;
if
(
_appendNodes
)
{
html
=
_appendNodes
.
apply
(
view
,
arguments
);
...
...
@@ -2629,7 +2631,7 @@
}
})(
jQuery
);
/*
* JQuery zTree exedit v3.5.3
6
* JQuery zTree exedit v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -2638,16 +2640,16 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
$
)
{
(
function
(
$
)
{
//default consts of exedit
var
_consts
=
{
event
:
{
DRAG
:
"
ztree_drag
"
,
DROP
:
"
ztree_drop
"
,
RENAME
:
"
ztree_rename
"
,
DRAGMOVE
:
"
ztree_dragmove
"
DRAGMOVE
:
"
ztree_dragmove
"
},
id
:
{
EDIT
:
"
_edit
"
,
...
...
@@ -2693,15 +2695,15 @@
removeHoverDom
:
null
},
callback
:
{
beforeDrag
:
null
,
beforeDragOpen
:
null
,
beforeDrop
:
null
,
beforeEditName
:
null
,
beforeRename
:
null
,
onDrag
:
null
,
onDragMove
:
null
,
onDrop
:
null
,
onRename
:
null
beforeDrag
:
null
,
beforeDragOpen
:
null
,
beforeDrop
:
null
,
beforeEditName
:
null
,
beforeRename
:
null
,
onDrag
:
null
,
onDragMove
:
null
,
onDrop
:
null
,
onRename
:
null
}
},
//default root of exedit
...
...
@@ -2716,9 +2718,10 @@
rs
.
showHoverDom
=
true
;
},
//default cache of exedit
_initCache
=
function
(
treeId
)
{},
_initCache
=
function
(
treeId
)
{
},
//default bind event of exedit
_bindEvent
=
function
(
setting
)
{
_bindEvent
=
function
(
setting
)
{
var
o
=
setting
.
treeObj
;
var
c
=
consts
.
event
;
o
.
bind
(
c
.
RENAME
,
function
(
event
,
treeId
,
treeNode
,
isCancel
)
{
...
...
@@ -2729,15 +2732,15 @@
tools
.
apply
(
setting
.
callback
.
onDrag
,
[
srcEvent
,
treeId
,
treeNodes
]);
});
o
.
bind
(
c
.
DRAGMOVE
,
function
(
event
,
srcEvent
,
treeId
,
treeNodes
)
{
tools
.
apply
(
setting
.
callback
.
onDragMove
,
[
srcEvent
,
treeId
,
treeNodes
]);
o
.
bind
(
c
.
DRAGMOVE
,
function
(
event
,
srcEvent
,
treeId
,
treeNodes
)
{
tools
.
apply
(
setting
.
callback
.
onDragMove
,
[
srcEvent
,
treeId
,
treeNodes
]);
});
o
.
bind
(
c
.
DROP
,
function
(
event
,
srcEvent
,
treeId
,
treeNodes
,
targetNode
,
moveType
,
isCopy
)
{
tools
.
apply
(
setting
.
callback
.
onDrop
,
[
srcEvent
,
treeId
,
treeNodes
,
targetNode
,
moveType
,
isCopy
]);
});
},
_unbindEvent
=
function
(
setting
)
{
_unbindEvent
=
function
(
setting
)
{
var
o
=
setting
.
treeObj
;
var
c
=
consts
.
event
;
o
.
unbind
(
c
.
RENAME
);
...
...
@@ -2746,7 +2749,7 @@
o
.
unbind
(
c
.
DROP
);
},
//default event proxy of exedit
_eventProxy
=
function
(
e
)
{
_eventProxy
=
function
(
e
)
{
var
target
=
e
.
target
,
setting
=
data
.
getSetting
(
e
.
data
.
treeId
),
relatedTarget
=
e
.
relatedTarget
,
...
...
@@ -2756,25 +2759,25 @@
tmp
=
null
;
if
(
tools
.
eqs
(
e
.
type
,
"
mouseover
"
))
{
tmp
=
tools
.
getMDom
(
setting
,
target
,
[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
consts
.
id
.
A
}]);
tmp
=
tools
.
getMDom
(
setting
,
target
,
[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
consts
.
id
.
A
}]);
if
(
tmp
)
{
tId
=
tools
.
getNodeMainDom
(
tmp
).
id
;
nodeEventType
=
"
hoverOverNode
"
;
}
}
else
if
(
tools
.
eqs
(
e
.
type
,
"
mouseout
"
))
{
tmp
=
tools
.
getMDom
(
setting
,
relatedTarget
,
[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
consts
.
id
.
A
}]);
tmp
=
tools
.
getMDom
(
setting
,
relatedTarget
,
[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
consts
.
id
.
A
}]);
if
(
!
tmp
)
{
tId
=
"
remove
"
;
nodeEventType
=
"
hoverOutNode
"
;
}
}
else
if
(
tools
.
eqs
(
e
.
type
,
"
mousedown
"
))
{
tmp
=
tools
.
getMDom
(
setting
,
target
,
[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
consts
.
id
.
A
}]);
tmp
=
tools
.
getMDom
(
setting
,
target
,
[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
consts
.
id
.
A
}]);
if
(
tmp
)
{
tId
=
tools
.
getNodeMainDom
(
tmp
).
id
;
nodeEventType
=
"
mousedownNode
"
;
}
}
if
(
tId
.
length
>
0
)
{
if
(
tId
.
length
>
0
)
{
node
=
data
.
getNodeCache
(
setting
,
tId
);
switch
(
nodeEventType
)
{
case
"
mousedownNode
"
:
...
...
@@ -2799,19 +2802,19 @@
return
proxyResult
},
//default init node of exedit
_initNode
=
function
(
setting
,
level
,
n
,
parentNode
,
isFirstNode
,
isLastNode
,
openFlag
)
{
_initNode
=
function
(
setting
,
level
,
n
,
parentNode
,
isFirstNode
,
isLastNode
,
openFlag
)
{
if
(
!
n
)
return
;
n
.
isHover
=
false
;
n
.
editNameFlag
=
false
;
},
//update zTreeObj, add method of edit
_zTreeTools
=
function
(
setting
,
zTreeTools
)
{
zTreeTools
.
cancelEditName
=
function
(
newName
)
{
_zTreeTools
=
function
(
setting
,
zTreeTools
)
{
zTreeTools
.
cancelEditName
=
function
(
newName
)
{
var
root
=
data
.
getRoot
(
this
.
setting
);
if
(
!
root
.
curEditNode
)
return
;
view
.
cancelCurEditNode
(
this
.
setting
,
newName
?
newName
:
null
,
true
);
view
.
cancelCurEditNode
(
this
.
setting
,
newName
?
newName
:
null
,
true
);
}
zTreeTools
.
copyNode
=
function
(
targetNode
,
node
,
moveType
,
isSilent
)
{
zTreeTools
.
copyNode
=
function
(
targetNode
,
node
,
moveType
,
isSilent
)
{
if
(
!
node
)
return
null
;
var
isParent
=
data
.
nodeIsParent
(
setting
,
targetNode
);
if
(
targetNode
&&
!
isParent
&&
this
.
setting
.
data
.
keep
.
leaf
&&
moveType
===
consts
.
move
.
TYPE_INNER
)
return
null
;
...
...
@@ -2837,12 +2840,12 @@
}
return
newNode
;
}
zTreeTools
.
editName
=
function
(
node
)
{
zTreeTools
.
editName
=
function
(
node
)
{
if
(
!
node
||
!
node
.
tId
||
node
!==
data
.
getNodeCache
(
this
.
setting
,
node
.
tId
))
return
;
if
(
node
.
parentTId
)
view
.
expandCollapseParentNode
(
this
.
setting
,
node
.
getParentNode
(),
true
);
view
.
editNode
(
this
.
setting
,
node
)
}
zTreeTools
.
moveNode
=
function
(
targetNode
,
node
,
moveType
,
isSilent
)
{
zTreeTools
.
moveNode
=
function
(
targetNode
,
node
,
moveType
,
isSilent
)
{
if
(
!
node
)
return
node
;
var
isParent
=
data
.
nodeIsParent
(
setting
,
targetNode
);
if
(
targetNode
&&
!
isParent
&&
this
.
setting
.
data
.
keep
.
leaf
&&
moveType
===
consts
.
move
.
TYPE_INNER
)
{
...
...
@@ -2853,9 +2856,11 @@
targetNode
=
null
;
}
var
_this
=
this
;
function
moveCallback
()
{
view
.
moveNode
(
_this
.
setting
,
targetNode
,
node
,
moveType
,
false
,
isSilent
);
}
if
(
tools
.
canAsync
(
this
.
setting
,
targetNode
)
&&
moveType
===
consts
.
move
.
TYPE_INNER
)
{
view
.
asyncNode
(
this
.
setting
,
targetNode
,
isSilent
,
moveCallback
);
}
else
{
...
...
@@ -2863,17 +2868,17 @@
}
return
node
;
}
zTreeTools
.
setEditable
=
function
(
editable
)
{
zTreeTools
.
setEditable
=
function
(
editable
)
{
this
.
setting
.
edit
.
enable
=
editable
;
return
this
.
refresh
();
}
},
//method of operate data
_data
=
{
setSonNodeLevel
:
function
(
setting
,
parentNode
,
node
)
{
setSonNodeLevel
:
function
(
setting
,
parentNode
,
node
)
{
if
(
!
node
)
return
;
var
children
=
data
.
nodeChildren
(
setting
,
node
);
node
.
level
=
(
parentNode
)
?
parentNode
.
level
+
1
:
0
;
node
.
level
=
(
parentNode
)
?
parentNode
.
level
+
1
:
0
;
if
(
!
children
)
return
;
for
(
var
i
=
0
,
l
=
children
.
length
;
i
<
l
;
i
++
)
{
if
(
children
[
i
])
data
.
setSonNodeLevel
(
setting
,
node
,
children
[
i
]);
...
...
@@ -2881,12 +2886,10 @@
}
},
//method of event proxy
_event
=
{
},
_event
=
{},
//method of event handler
_handler
=
{
onHoverOverNode
:
function
(
event
,
node
)
{
onHoverOverNode
:
function
(
event
,
node
)
{
var
setting
=
data
.
getSetting
(
event
.
data
.
treeId
),
root
=
data
.
getRoot
(
setting
);
if
(
root
.
curHoverNode
!=
node
)
{
...
...
@@ -2895,7 +2898,7 @@
root
.
curHoverNode
=
node
;
view
.
addHoverDom
(
setting
,
node
);
},
onHoverOutNode
:
function
(
event
,
node
)
{
onHoverOutNode
:
function
(
event
,
node
)
{
var
setting
=
data
.
getSetting
(
event
.
data
.
treeId
),
root
=
data
.
getRoot
(
setting
);
if
(
root
.
curHoverNode
&&
!
data
.
isSelectedNode
(
setting
,
root
.
curHoverNode
))
{
...
...
@@ -2903,8 +2906,8 @@
root
.
curHoverNode
=
null
;
}
},
onMousedownNode
:
function
(
eventMouseDown
,
_node
)
{
var
i
,
l
,
onMousedownNode
:
function
(
eventMouseDown
,
_node
)
{
var
i
,
l
,
setting
=
data
.
getSetting
(
eventMouseDown
.
data
.
treeId
),
root
=
data
.
getRoot
(
setting
),
roots
=
data
.
getRoots
();
//right click can't drag & drop
...
...
@@ -2917,8 +2920,8 @@
if
(
!
data
.
isSelectedNode
(
setting
,
_node
))
{
nodes
=
[
_node
];
}
else
{
for
(
i
=
0
,
l
=
_nodes
.
length
;
i
<
l
;
i
++
)
{
if
(
_nodes
[
i
].
editNameFlag
&&
tools
.
eqs
(
target
.
tagName
,
"
input
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
INPUT
)
!==
null
)
{
for
(
i
=
0
,
l
=
_nodes
.
length
;
i
<
l
;
i
++
)
{
if
(
_nodes
[
i
].
editNameFlag
&&
tools
.
eqs
(
target
.
tagName
,
"
input
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
INPUT
)
!==
null
)
{
return
true
;
}
nodes
.
push
(
_nodes
[
i
]);
...
...
@@ -2949,6 +2952,7 @@
if
(
tools
.
uCanDo
(
setting
))
{
doc
.
bind
(
"
mousemove
"
,
_docMouseMove
);
}
function
_docMouseMove
(
event
)
{
//avoid start drag after click node
if
(
root
.
dragFlag
==
0
&&
Math
.
abs
(
mouseDownX
-
event
.
clientX
)
<
setting
.
edit
.
drag
.
minMoveSize
...
...
@@ -2964,8 +2968,8 @@
return
true
;
}
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
if
(
i
==
0
)
{
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
if
(
i
==
0
)
{
root
.
dragNodeShowBefore
=
[];
}
tmpNode
=
nodes
[
i
];
...
...
@@ -2983,12 +2987,12 @@
//sort
var
isOrder
=
true
,
lastIndex
=
-
1
;
if
(
nodes
.
length
>
1
)
{
if
(
nodes
.
length
>
1
)
{
var
pNodes
=
nodes
[
0
].
parentTId
?
data
.
nodeChildren
(
setting
,
nodes
[
0
].
getParentNode
())
:
data
.
getNodes
(
setting
);
tmpNodes
=
[];
for
(
i
=
0
,
l
=
pNodes
.
length
;
i
<
l
;
i
++
)
{
for
(
i
=
0
,
l
=
pNodes
.
length
;
i
<
l
;
i
++
)
{
if
(
root
.
dragNodeShowBefore
[
pNodes
[
i
].
tId
]
!==
undefined
)
{
if
(
isOrder
&&
lastIndex
>
-
1
&&
(
lastIndex
+
1
)
!==
i
)
{
if
(
isOrder
&&
lastIndex
>
-
1
&&
(
lastIndex
+
1
)
!==
i
)
{
isOrder
=
false
;
}
tmpNodes
.
push
(
pNodes
[
i
]);
...
...
@@ -3002,28 +3006,28 @@
}
if
(
isOrder
)
{
preNode
=
nodes
[
0
].
getPreNode
();
nextNode
=
nodes
[
nodes
.
length
-
1
].
getNextNode
();
nextNode
=
nodes
[
nodes
.
length
-
1
].
getNextNode
();
}
//set node in selected
curNode
=
$$
(
"
<ul class='zTreeDragUL'></ul>
"
,
setting
);
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
tmpNode
=
nodes
[
i
];
tmpNode
.
editNameFlag
=
false
;
view
.
selectNode
(
setting
,
tmpNode
,
i
>
0
);
view
.
selectNode
(
setting
,
tmpNode
,
i
>
0
);
view
.
removeTreeDom
(
setting
,
tmpNode
);
if
(
i
>
setting
.
edit
.
drag
.
maxShowNodeNum
-
1
)
{
if
(
i
>
setting
.
edit
.
drag
.
maxShowNodeNum
-
1
)
{
continue
;
}
tmpDom
=
$$
(
"
<li id='
"
+
tmpNode
.
tId
+
"
_tmp'></li>
"
,
setting
);
tmpDom
=
$$
(
"
<li id='
"
+
tmpNode
.
tId
+
"
_tmp'></li>
"
,
setting
);
tmpDom
.
append
(
$$
(
tmpNode
,
consts
.
id
.
A
,
setting
).
clone
());
tmpDom
.
css
(
"
padding
"
,
"
0
"
);
tmpDom
.
children
(
"
#
"
+
tmpNode
.
tId
+
consts
.
id
.
A
).
removeClass
(
consts
.
node
.
CURSELECTED
);
curNode
.
append
(
tmpDom
);
if
(
i
==
setting
.
edit
.
drag
.
maxShowNodeNum
-
1
)
{
tmpDom
=
$$
(
"
<li id='
"
+
tmpNode
.
tId
+
"
_moretmp'><a> ... </a></li>
"
,
setting
);
if
(
i
==
setting
.
edit
.
drag
.
maxShowNodeNum
-
1
)
{
tmpDom
=
$$
(
"
<li id='
"
+
tmpNode
.
tId
+
"
_moretmp'><a> ... </a></li>
"
,
setting
);
curNode
.
append
(
tmpDom
);
}
}
...
...
@@ -3039,7 +3043,7 @@
}
if
(
root
.
dragFlag
==
1
)
{
if
(
tmpTarget
&&
tmpArrow
.
attr
(
"
id
"
)
==
event
.
target
.
id
&&
tmpTargetNodeId
&&
(
event
.
clientX
+
doc
.
scrollLeft
()
+
2
)
>
(
$
(
"
#
"
+
tmpTargetNodeId
+
consts
.
id
.
A
,
tmpTarget
).
offset
().
left
))
{
if
(
tmpTarget
&&
tmpArrow
.
attr
(
"
id
"
)
==
event
.
target
.
id
&&
tmpTargetNodeId
&&
(
event
.
clientX
+
doc
.
scrollLeft
()
+
2
)
>
(
$
(
"
#
"
+
tmpTargetNodeId
+
consts
.
id
.
A
,
tmpTarget
).
offset
().
left
))
{
var
xT
=
$
(
"
#
"
+
tmpTargetNodeId
+
consts
.
id
.
A
,
tmpTarget
);
event
.
target
=
(
xT
.
length
>
0
)
?
xT
.
get
(
0
)
:
event
.
target
;
}
else
if
(
tmpTarget
)
{
...
...
@@ -3056,7 +3060,7 @@
var
settings
=
data
.
getSettings
();
for
(
var
s
in
settings
)
{
if
(
settings
[
s
].
treeId
&&
settings
[
s
].
edit
.
enable
&&
settings
[
s
].
treeId
!=
setting
.
treeId
&&
(
event
.
target
.
id
==
settings
[
s
].
treeId
||
$
(
event
.
target
).
parents
(
"
#
"
+
settings
[
s
].
treeId
).
length
>
0
))
{
&&
(
event
.
target
.
id
==
settings
[
s
].
treeId
||
$
(
event
.
target
).
parents
(
"
#
"
+
settings
[
s
].
treeId
).
length
>
0
))
{
isOtherTree
=
true
;
targetSetting
=
settings
[
s
];
}
...
...
@@ -3077,9 +3081,9 @@
isRight
=
(
dRight
<
setting
.
edit
.
drag
.
borderMax
&&
dRight
>
setting
.
edit
.
drag
.
borderMin
),
isTreeInner
=
dTop
>
setting
.
edit
.
drag
.
borderMin
&&
dBottom
>
setting
.
edit
.
drag
.
borderMin
&&
dLeft
>
setting
.
edit
.
drag
.
borderMin
&&
dRight
>
setting
.
edit
.
drag
.
borderMin
,
isTreeTop
=
(
isTop
&&
targetSetting
.
treeObj
.
scrollTop
()
<=
0
),
isTreeBottom
=
(
isBottom
&&
(
targetSetting
.
treeObj
.
scrollTop
()
+
targetSetting
.
treeObj
.
height
()
+
10
)
>=
scrollHeight
),
isTreeBottom
=
(
isBottom
&&
(
targetSetting
.
treeObj
.
scrollTop
()
+
targetSetting
.
treeObj
.
height
()
+
10
)
>=
scrollHeight
),
isTreeLeft
=
(
isLeft
&&
targetSetting
.
treeObj
.
scrollLeft
()
<=
0
),
isTreeRight
=
(
isRight
&&
(
targetSetting
.
treeObj
.
scrollLeft
()
+
targetSetting
.
treeObj
.
width
()
+
10
)
>=
scrollWidth
);
isTreeRight
=
(
isRight
&&
(
targetSetting
.
treeObj
.
scrollLeft
()
+
targetSetting
.
treeObj
.
width
()
+
10
)
>=
scrollWidth
);
if
(
event
.
target
&&
tools
.
isChildOrSelf
(
event
.
target
,
targetSetting
.
treeId
))
{
//get node <li> dom
...
...
@@ -3090,7 +3094,7 @@
var
canMove
=
true
;
//don't move to self or children of self
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
tmpNode
=
nodes
[
i
];
if
(
targetObj
.
id
===
tmpNode
.
tId
)
{
canMove
=
false
;
...
...
@@ -3115,18 +3119,18 @@
}
//auto scroll top
if
(
isTop
)
{
targetSetting
.
treeObj
.
scrollTop
(
targetSetting
.
treeObj
.
scrollTop
()
-
10
);
targetSetting
.
treeObj
.
scrollTop
(
targetSetting
.
treeObj
.
scrollTop
()
-
10
);
}
else
if
(
isBottom
)
{
targetSetting
.
treeObj
.
scrollTop
(
targetSetting
.
treeObj
.
scrollTop
()
+
10
);
targetSetting
.
treeObj
.
scrollTop
(
targetSetting
.
treeObj
.
scrollTop
()
+
10
);
}
if
(
isLeft
)
{
targetSetting
.
treeObj
.
scrollLeft
(
targetSetting
.
treeObj
.
scrollLeft
()
-
10
);
targetSetting
.
treeObj
.
scrollLeft
(
targetSetting
.
treeObj
.
scrollLeft
()
-
10
);
}
else
if
(
isRight
)
{
targetSetting
.
treeObj
.
scrollLeft
(
targetSetting
.
treeObj
.
scrollLeft
()
+
10
);
targetSetting
.
treeObj
.
scrollLeft
(
targetSetting
.
treeObj
.
scrollLeft
()
+
10
);
}
//auto scroll left
if
(
tmpTarget
&&
tmpTarget
!=
targetSetting
.
treeObj
&&
tmpTarget
.
offset
().
left
<
targetSetting
.
treeObj
.
offset
().
left
)
{
targetSetting
.
treeObj
.
scrollLeft
(
targetSetting
.
treeObj
.
scrollLeft
()
+
tmpTarget
.
offset
().
left
-
targetSetting
.
treeObj
.
offset
().
left
);
targetSetting
.
treeObj
.
scrollLeft
(
targetSetting
.
treeObj
.
scrollLeft
()
+
tmpTarget
.
offset
().
left
-
targetSetting
.
treeObj
.
offset
().
left
);
}
}
...
...
@@ -3137,8 +3141,8 @@
var
dX
=
0
;
var
dY
=
0
;
if
(
tmpTarget
&&
tmpTarget
.
attr
(
"
id
"
)
!=
targetSetting
.
treeId
)
{
var
tmpTargetNode
=
tmpTargetNodeId
==
null
?
null
:
data
.
getNodeCache
(
targetSetting
,
tmpTargetNodeId
),
if
(
tmpTarget
&&
tmpTarget
.
attr
(
"
id
"
)
!=
targetSetting
.
treeId
)
{
var
tmpTargetNode
=
tmpTargetNodeId
==
null
?
null
:
data
.
getNodeCache
(
targetSetting
,
tmpTargetNodeId
),
isCopy
=
((
event
.
ctrlKey
||
event
.
metaKey
)
&&
setting
.
edit
.
drag
.
isMove
&&
setting
.
edit
.
drag
.
isCopy
)
||
(
!
setting
.
edit
.
drag
.
isMove
&&
setting
.
edit
.
drag
.
isCopy
),
isPrev
=
!!
(
preNode
&&
tmpTargetNodeId
===
preNode
.
tId
),
isNext
=
!!
(
nextNode
&&
tmpTargetNodeId
===
nextNode
.
tId
),
...
...
@@ -3152,13 +3156,14 @@
tmpTargetNodeId
=
""
;
moveType
=
consts
.
move
.
TYPE_INNER
;
tmpArrow
.
css
({
"
display
"
:
"
none
"
"
display
"
:
"
none
"
});
if
(
window
.
zTreeMoveTimer
)
{
clearTimeout
(
window
.
zTreeMoveTimer
);
window
.
zTreeMoveTargetNodeTId
=
null
}
}
if
(
!
canPrev
&&
!
canNext
&&
!
canInner
)
{
clearMove
();
}
else
{
...
...
@@ -3166,17 +3171,17 @@
tmpNextA
=
tmpTargetNode
.
isLastNode
?
null
:
$
(
"
#
"
+
tmpTargetNode
.
getNextNode
().
tId
+
consts
.
id
.
A
,
tmpTarget
.
next
()),
tmpTop
=
tmpTargetA
.
offset
().
top
,
tmpLeft
=
tmpTargetA
.
offset
().
left
,
prevPercent
=
canPrev
?
(
canInner
?
0.25
:
(
canNext
?
0.5
:
1
)
)
:
-
1
,
nextPercent
=
canNext
?
(
canInner
?
0.75
:
(
canPrev
?
0.5
:
0
)
)
:
-
1
,
dY_percent
=
(
event
.
clientY
+
docScrollTop
-
tmpTop
)
/
tmpTargetA
.
height
();
prevPercent
=
canPrev
?
(
canInner
?
0.25
:
(
canNext
?
0.5
:
1
)
)
:
-
1
,
nextPercent
=
canNext
?
(
canInner
?
0.75
:
(
canPrev
?
0.5
:
0
)
)
:
-
1
,
dY_percent
=
(
event
.
clientY
+
docScrollTop
-
tmpTop
)
/
tmpTargetA
.
height
();
if
((
prevPercent
==
1
||
dY_percent
<=
prevPercent
&&
dY_percent
>=
-
.
2
)
&&
canPrev
)
{
if
((
prevPercent
==
1
||
dY_percent
<=
prevPercent
&&
dY_percent
>=
-
.
2
)
&&
canPrev
)
{
dX
=
1
-
tmpArrow
.
width
();
dY
=
tmpTop
-
tmpArrow
.
height
()
/
2
;
dY
=
tmpTop
-
tmpArrow
.
height
()
/
2
;
moveType
=
consts
.
move
.
TYPE_PREV
;
}
else
if
((
nextPercent
==
0
||
dY_percent
>=
nextPercent
&&
dY_percent
<=
1.2
)
&&
canNext
)
{
}
else
if
((
nextPercent
==
0
||
dY_percent
>=
nextPercent
&&
dY_percent
<=
1.2
)
&&
canNext
)
{
dX
=
1
-
tmpArrow
.
width
();
dY
=
(
tmpNextA
==
null
||
(
data
.
nodeIsParent
(
setting
,
tmpTargetNode
)
&&
tmpTargetNode
.
open
))
?
(
tmpTop
+
tmpTargetA
.
height
()
-
tmpArrow
.
height
()
/
2
)
:
(
tmpNextA
.
offset
().
top
-
tmpArrow
.
height
()
/
2
);
dY
=
(
tmpNextA
==
null
||
(
data
.
nodeIsParent
(
setting
,
tmpTargetNode
)
&&
tmpTargetNode
.
open
))
?
(
tmpTop
+
tmpTargetA
.
height
()
-
tmpArrow
.
height
()
/
2
)
:
(
tmpNextA
.
offset
().
top
-
tmpArrow
.
height
()
/
2
);
moveType
=
consts
.
move
.
TYPE_NEXT
;
}
else
if
(
canInner
)
{
dX
=
5
-
tmpArrow
.
width
();
...
...
@@ -3188,7 +3193,7 @@
if
(
tmpTarget
)
{
tmpArrow
.
css
({
"
display
"
:
"
block
"
,
"
display
"
:
"
block
"
,
"
top
"
:
dY
+
"
px
"
,
"
left
"
:
(
tmpLeft
+
dX
)
+
"
px
"
});
...
...
@@ -3206,7 +3211,7 @@
startTimer
=
false
;
}
if
(
startTimer
)
{
window
.
zTreeMoveTimer
=
setTimeout
(
function
()
{
window
.
zTreeMoveTimer
=
setTimeout
(
function
()
{
if
(
moveType
!=
consts
.
move
.
TYPE_INNER
)
return
;
if
(
tmpTargetNode
&&
data
.
nodeIsParent
(
setting
,
tmpTargetNode
)
&&
!
tmpTargetNode
.
open
&&
(
new
Date
()).
getTime
()
-
startTime
>
targetSetting
.
edit
.
drag
.
autoOpenTime
&&
tools
.
apply
(
targetSetting
.
callback
.
beforeDragOpen
,
[
targetSetting
.
treeId
,
tmpTargetNode
],
true
))
{
...
...
@@ -3215,7 +3220,7 @@
targetSetting
.
treeObj
.
trigger
(
consts
.
event
.
EXPAND
,
[
targetSetting
.
treeId
,
tmpTargetNode
]);
}
}
},
targetSetting
.
edit
.
drag
.
autoOpenTime
+
50
);
},
targetSetting
.
edit
.
drag
.
autoOpenTime
+
50
);
window
.
zTreeMoveTargetNodeTId
=
tmpTargetNode
.
tId
;
}
}
...
...
@@ -3229,7 +3234,7 @@
tmpTarget
=
null
;
}
tmpArrow
.
css
({
"
display
"
:
"
none
"
"
display
"
:
"
none
"
});
if
(
window
.
zTreeMoveTimer
)
{
clearTimeout
(
window
.
zTreeMoveTimer
);
...
...
@@ -3245,6 +3250,7 @@
}
doc
.
bind
(
"
mouseup
"
,
_docMouseUp
);
function
_docMouseUp
(
event
)
{
if
(
window
.
zTreeMoveTimer
)
{
clearTimeout
(
window
.
zTreeMoveTimer
);
...
...
@@ -3268,7 +3274,7 @@
root
.
dragFlag
=
0
;
var
i
,
l
,
tmpNode
;
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
tmpNode
=
nodes
[
i
];
if
(
data
.
nodeIsParent
(
setting
,
tmpNode
)
&&
root
.
dragNodeShowBefore
[
tmpNode
.
tId
]
&&
!
tmpNode
.
open
)
{
view
.
expandCollapseNode
(
setting
,
tmpNode
,
!
tmpNode
.
open
);
...
...
@@ -3280,11 +3286,11 @@
if
(
tmpArrow
)
tmpArrow
.
remove
();
var
isCopy
=
((
event
.
ctrlKey
||
event
.
metaKey
)
&&
setting
.
edit
.
drag
.
isMove
&&
setting
.
edit
.
drag
.
isCopy
)
||
(
!
setting
.
edit
.
drag
.
isMove
&&
setting
.
edit
.
drag
.
isCopy
);
if
(
!
isCopy
&&
tmpTarget
&&
tmpTargetNodeId
&&
nodes
[
0
].
parentTId
&&
tmpTargetNodeId
==
nodes
[
0
].
parentTId
&&
moveType
==
consts
.
move
.
TYPE_INNER
)
{
if
(
!
isCopy
&&
tmpTarget
&&
tmpTargetNodeId
&&
nodes
[
0
].
parentTId
&&
tmpTargetNodeId
==
nodes
[
0
].
parentTId
&&
moveType
==
consts
.
move
.
TYPE_INNER
)
{
tmpTarget
=
null
;
}
if
(
tmpTarget
)
{
var
dragTargetNode
=
tmpTargetNodeId
==
null
?
null
:
data
.
getNodeCache
(
targetSetting
,
tmpTargetNodeId
);
var
dragTargetNode
=
tmpTargetNodeId
==
null
?
null
:
data
.
getNodeCache
(
targetSetting
,
tmpTargetNodeId
);
if
(
tools
.
apply
(
setting
.
callback
.
beforeDrop
,
[
targetSetting
.
treeId
,
nodes
,
dragTargetNode
,
moveType
,
isCopy
],
true
)
==
false
)
{
view
.
selectNodes
(
sourceSetting
,
nodes
);
return
;
...
...
@@ -3294,27 +3300,27 @@
function
dropCallback
()
{
if
(
isOtherTree
)
{
if
(
!
isCopy
)
{
for
(
var
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
for
(
var
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
view
.
removeNode
(
setting
,
nodes
[
i
]);
}
}
if
(
moveType
==
consts
.
move
.
TYPE_INNER
)
{
view
.
addNodes
(
targetSetting
,
dragTargetNode
,
-
1
,
newNodes
);
}
else
{
view
.
addNodes
(
targetSetting
,
dragTargetNode
.
getParentNode
(),
moveType
==
consts
.
move
.
TYPE_PREV
?
dragTargetNode
.
getIndex
()
:
dragTargetNode
.
getIndex
()
+
1
,
newNodes
);
view
.
addNodes
(
targetSetting
,
dragTargetNode
.
getParentNode
(),
moveType
==
consts
.
move
.
TYPE_PREV
?
dragTargetNode
.
getIndex
()
:
dragTargetNode
.
getIndex
()
+
1
,
newNodes
);
}
}
else
{
if
(
isCopy
&&
moveType
==
consts
.
move
.
TYPE_INNER
)
{
view
.
addNodes
(
targetSetting
,
dragTargetNode
,
-
1
,
newNodes
);
}
else
if
(
isCopy
)
{
view
.
addNodes
(
targetSetting
,
dragTargetNode
.
getParentNode
(),
moveType
==
consts
.
move
.
TYPE_PREV
?
dragTargetNode
.
getIndex
()
:
dragTargetNode
.
getIndex
()
+
1
,
newNodes
);
view
.
addNodes
(
targetSetting
,
dragTargetNode
.
getParentNode
(),
moveType
==
consts
.
move
.
TYPE_PREV
?
dragTargetNode
.
getIndex
()
:
dragTargetNode
.
getIndex
()
+
1
,
newNodes
);
}
else
{
if
(
moveType
!=
consts
.
move
.
TYPE_NEXT
)
{
for
(
i
=
0
,
l
=
newNodes
.
length
;
i
<
l
;
i
++
)
{
for
(
i
=
0
,
l
=
newNodes
.
length
;
i
<
l
;
i
++
)
{
view
.
moveNode
(
targetSetting
,
dragTargetNode
,
newNodes
[
i
],
moveType
,
false
);
}
}
else
{
for
(
i
=-
1
,
l
=
newNodes
.
length
-
1
;
i
<
l
;
l
--
)
{
for
(
i
=
-
1
,
l
=
newNodes
.
length
-
1
;
i
<
l
;
l
--
)
{
view
.
moveNode
(
targetSetting
,
dragTargetNode
,
newNodes
[
l
],
moveType
,
false
);
}
}
...
...
@@ -3341,6 +3347,7 @@
}
doc
.
bind
(
"
selectstart
"
,
_docSelect
);
function
_docSelect
()
{
return
false
;
}
...
...
@@ -3358,26 +3365,26 @@
_tools
=
{
getAbs
:
function
(
obj
)
{
var
oRect
=
obj
.
getBoundingClientRect
(),
scrollTop
=
document
.
body
.
scrollTop
+
document
.
documentElement
.
scrollTop
,
scrollLeft
=
document
.
body
.
scrollLeft
+
document
.
documentElement
.
scrollLeft
;
return
[
oRect
.
left
+
scrollLeft
,
oRect
.
top
+
scrollTop
];
scrollTop
=
document
.
body
.
scrollTop
+
document
.
documentElement
.
scrollTop
,
scrollLeft
=
document
.
body
.
scrollLeft
+
document
.
documentElement
.
scrollLeft
;
return
[
oRect
.
left
+
scrollLeft
,
oRect
.
top
+
scrollTop
];
},
inputFocus
:
function
(
inputObj
)
{
inputFocus
:
function
(
inputObj
)
{
if
(
inputObj
.
get
(
0
))
{
inputObj
.
focus
();
tools
.
setCursorPosition
(
inputObj
.
get
(
0
),
inputObj
.
val
().
length
);
}
},
inputSelect
:
function
(
inputObj
)
{
inputSelect
:
function
(
inputObj
)
{
if
(
inputObj
.
get
(
0
))
{
inputObj
.
focus
();
inputObj
.
select
();
}
},
setCursorPosition
:
function
(
obj
,
pos
)
{
if
(
obj
.
setSelectionRange
)
{
setCursorPosition
:
function
(
obj
,
pos
)
{
if
(
obj
.
setSelectionRange
)
{
obj
.
focus
();
obj
.
setSelectionRange
(
pos
,
pos
);
obj
.
setSelectionRange
(
pos
,
pos
);
}
else
if
(
obj
.
createTextRange
)
{
var
range
=
obj
.
createTextRange
();
range
.
collapse
(
true
);
...
...
@@ -3386,7 +3393,7 @@
range
.
select
();
}
},
showIfameMask
:
function
(
setting
,
showSign
)
{
showIfameMask
:
function
(
setting
,
showSign
)
{
var
root
=
data
.
getRoot
(
setting
);
//clear full mask
while
(
root
.
dragMaskList
.
length
>
0
)
{
...
...
@@ -3408,7 +3415,7 @@
},
//method of operate ztree dom
_view
=
{
addEditBtn
:
function
(
setting
,
node
)
{
addEditBtn
:
function
(
setting
,
node
)
{
if
(
node
.
editNameFlag
||
$$
(
node
,
consts
.
id
.
EDIT
,
setting
).
length
>
0
)
{
return
;
}
...
...
@@ -3416,18 +3423,18 @@
return
;
}
var
aObj
=
$$
(
node
,
consts
.
id
.
A
,
setting
),
editStr
=
"
<span class='
"
+
consts
.
className
.
BUTTON
+
"
edit' id='
"
+
node
.
tId
+
consts
.
id
.
EDIT
+
"
' title='
"
+
tools
.
apply
(
setting
.
edit
.
renameTitle
,
[
setting
.
treeId
,
node
],
setting
.
edit
.
renameTitle
)
+
"
' treeNode
"
+
consts
.
id
.
EDIT
+
"
style='display:none;'></span>
"
;
editStr
=
"
<span class='
"
+
consts
.
className
.
BUTTON
+
"
edit' id='
"
+
node
.
tId
+
consts
.
id
.
EDIT
+
"
' title='
"
+
tools
.
apply
(
setting
.
edit
.
renameTitle
,
[
setting
.
treeId
,
node
],
setting
.
edit
.
renameTitle
)
+
"
' treeNode
"
+
consts
.
id
.
EDIT
+
"
style='display:none;'></span>
"
;
aObj
.
append
(
editStr
);
$$
(
node
,
consts
.
id
.
EDIT
,
setting
).
bind
(
'
click
'
,
function
()
{
function
()
{
if
(
!
tools
.
uCanDo
(
setting
)
||
tools
.
apply
(
setting
.
callback
.
beforeEditName
,
[
setting
.
treeId
,
node
],
true
)
==
false
)
return
false
;
view
.
editNode
(
setting
,
node
);
return
false
;
}
).
show
();
},
addRemoveBtn
:
function
(
setting
,
node
)
{
addRemoveBtn
:
function
(
setting
,
node
)
{
if
(
node
.
editNameFlag
||
$$
(
node
,
consts
.
id
.
REMOVE
,
setting
).
length
>
0
)
{
return
;
}
...
...
@@ -3435,23 +3442,23 @@
return
;
}
var
aObj
=
$$
(
node
,
consts
.
id
.
A
,
setting
),
removeStr
=
"
<span class='
"
+
consts
.
className
.
BUTTON
+
"
remove' id='
"
+
node
.
tId
+
consts
.
id
.
REMOVE
+
"
' title='
"
+
tools
.
apply
(
setting
.
edit
.
removeTitle
,
[
setting
.
treeId
,
node
],
setting
.
edit
.
removeTitle
)
+
"
' treeNode
"
+
consts
.
id
.
REMOVE
+
"
style='display:none;'></span>
"
;
removeStr
=
"
<span class='
"
+
consts
.
className
.
BUTTON
+
"
remove' id='
"
+
node
.
tId
+
consts
.
id
.
REMOVE
+
"
' title='
"
+
tools
.
apply
(
setting
.
edit
.
removeTitle
,
[
setting
.
treeId
,
node
],
setting
.
edit
.
removeTitle
)
+
"
' treeNode
"
+
consts
.
id
.
REMOVE
+
"
style='display:none;'></span>
"
;
aObj
.
append
(
removeStr
);
$$
(
node
,
consts
.
id
.
REMOVE
,
setting
).
bind
(
'
click
'
,
function
()
{
function
()
{
if
(
!
tools
.
uCanDo
(
setting
)
||
tools
.
apply
(
setting
.
callback
.
beforeRemove
,
[
setting
.
treeId
,
node
],
true
)
==
false
)
return
false
;
view
.
removeNode
(
setting
,
node
);
setting
.
treeObj
.
trigger
(
consts
.
event
.
REMOVE
,
[
setting
.
treeId
,
node
]);
return
false
;
}
).
bind
(
'
mousedown
'
,
function
(
eventMouseDown
)
{
function
(
eventMouseDown
)
{
return
true
;
}
).
show
();
},
addHoverDom
:
function
(
setting
,
node
)
{
addHoverDom
:
function
(
setting
,
node
)
{
if
(
data
.
getRoots
().
showHoverDom
)
{
node
.
isHover
=
true
;
if
(
setting
.
edit
.
enable
)
{
...
...
@@ -3467,7 +3474,7 @@
if
(
node
)
{
var
inputObj
=
root
.
curEditInput
,
newName
=
forceName
?
forceName
:(
isCancel
?
data
.
nodeName
(
setting
,
node
)
:
inputObj
.
val
());
newName
=
forceName
?
forceName
:
(
isCancel
?
data
.
nodeName
(
setting
,
node
)
:
inputObj
.
val
());
if
(
tools
.
apply
(
setting
.
callback
.
beforeRename
,
[
setting
.
treeId
,
node
,
newName
,
isCancel
],
true
)
===
false
)
{
return
false
;
}
...
...
@@ -3485,11 +3492,13 @@
root
.
noSelection
=
true
;
return
true
;
},
editNode
:
function
(
setting
,
node
)
{
editNode
:
function
(
setting
,
node
)
{
var
root
=
data
.
getRoot
(
setting
);
view
.
editNodeBlur
=
false
;
if
(
data
.
isSelectedNode
(
setting
,
node
)
&&
root
.
curEditNode
==
node
&&
node
.
editNameFlag
)
{
setTimeout
(
function
()
{
tools
.
inputFocus
(
root
.
curEditInput
);},
0
);
setTimeout
(
function
()
{
tools
.
inputFocus
(
root
.
curEditInput
);
},
0
);
return
;
}
node
.
editNameFlag
=
true
;
...
...
@@ -3505,20 +3514,20 @@
tools
.
inputFocus
(
inputObj
);
}
inputObj
.
bind
(
'
blur
'
,
function
(
event
)
{
inputObj
.
bind
(
'
blur
'
,
function
(
event
)
{
if
(
!
view
.
editNodeBlur
)
{
view
.
cancelCurEditNode
(
setting
);
}
}).
bind
(
'
keydown
'
,
function
(
event
)
{
if
(
event
.
keyCode
==
"
13
"
)
{
}).
bind
(
'
keydown
'
,
function
(
event
)
{
if
(
event
.
keyCode
==
"
13
"
)
{
view
.
editNodeBlur
=
true
;
view
.
cancelCurEditNode
(
setting
);
}
else
if
(
event
.
keyCode
==
"
27
"
)
{
}
else
if
(
event
.
keyCode
==
"
27
"
)
{
view
.
cancelCurEditNode
(
setting
,
null
,
true
);
}
}).
bind
(
'
click
'
,
function
(
event
)
{
}).
bind
(
'
click
'
,
function
(
event
)
{
return
false
;
}).
bind
(
'
dblclick
'
,
function
(
event
)
{
}).
bind
(
'
dblclick
'
,
function
(
event
)
{
return
false
;
});
...
...
@@ -3527,11 +3536,11 @@
root
.
noSelection
=
false
;
root
.
curEditNode
=
node
;
},
moveNode
:
function
(
setting
,
targetNode
,
node
,
moveType
,
animateFlag
,
isSilent
)
{
moveNode
:
function
(
setting
,
targetNode
,
node
,
moveType
,
animateFlag
,
isSilent
)
{
var
root
=
data
.
getRoot
(
setting
);
if
(
targetNode
==
node
)
return
;
if
(
setting
.
data
.
keep
.
leaf
&&
targetNode
&&
!
data
.
nodeIsParent
(
setting
,
targetNode
)
&&
moveType
==
consts
.
move
.
TYPE_INNER
)
return
;
var
oldParentNode
=
(
node
.
parentTId
?
node
.
getParentNode
()
:
root
),
var
oldParentNode
=
(
node
.
parentTId
?
node
.
getParentNode
()
:
root
),
targetNodeIsRoot
=
(
targetNode
===
null
||
targetNode
==
root
);
if
(
targetNodeIsRoot
&&
targetNode
===
null
)
targetNode
=
root
;
if
(
targetNodeIsRoot
)
moveType
=
consts
.
move
.
TYPE_INNER
;
...
...
@@ -3590,7 +3599,7 @@
}
//repair the data after move
var
i
,
l
,
var
i
,
l
,
tmpSrcIndex
=
-
1
,
tmpTargetIndex
=
0
,
oldNeighbor
=
null
,
...
...
@@ -3601,12 +3610,12 @@
var
targetChildren
=
data
.
nodeChildren
(
setting
,
targetNode
);
if
(
node
.
isFirstNode
)
{
tmpSrcIndex
=
0
;
if
(
oldChildren
.
length
>
1
)
{
if
(
oldChildren
.
length
>
1
)
{
oldNeighbor
=
oldChildren
[
1
];
oldNeighbor
.
isFirstNode
=
true
;
}
}
else
if
(
node
.
isLastNode
)
{
tmpSrcIndex
=
oldChildren
.
length
-
1
;
tmpSrcIndex
=
oldChildren
.
length
-
1
;
oldNeighbor
=
oldChildren
[
tmpSrcIndex
-
1
];
oldNeighbor
.
isLastNode
=
true
;
}
else
{
...
...
@@ -3704,19 +3713,19 @@
view
.
expandCollapseParentNode
(
setting
,
node
.
getParentNode
(),
true
,
animateFlag
);
}
},
removeEditBtn
:
function
(
setting
,
node
)
{
removeEditBtn
:
function
(
setting
,
node
)
{
$$
(
node
,
consts
.
id
.
EDIT
,
setting
).
unbind
().
remove
();
},
removeRemoveBtn
:
function
(
setting
,
node
)
{
removeRemoveBtn
:
function
(
setting
,
node
)
{
$$
(
node
,
consts
.
id
.
REMOVE
,
setting
).
unbind
().
remove
();
},
removeTreeDom
:
function
(
setting
,
node
)
{
removeTreeDom
:
function
(
setting
,
node
)
{
node
.
isHover
=
false
;
view
.
removeEditBtn
(
setting
,
node
);
view
.
removeRemoveBtn
(
setting
,
node
);
tools
.
apply
(
setting
.
view
.
removeHoverDom
,
[
setting
.
treeId
,
node
]);
},
repairNodeLevelClass
:
function
(
setting
,
node
,
oldLevel
)
{
repairNodeLevelClass
:
function
(
setting
,
node
,
oldLevel
)
{
if
(
oldLevel
===
node
.
level
)
return
;
var
liObj
=
$$
(
node
,
setting
),
aObj
=
$$
(
node
,
consts
.
id
.
A
,
setting
),
...
...
@@ -3730,9 +3739,9 @@
ulObj
.
removeClass
(
oldClass
);
ulObj
.
addClass
(
newClass
);
},
selectNodes
:
function
(
setting
,
nodes
)
{
for
(
var
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
view
.
selectNode
(
setting
,
nodes
[
i
],
i
>
0
);
selectNodes
:
function
(
setting
,
nodes
)
{
for
(
var
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
view
.
selectNode
(
setting
,
nodes
[
i
],
i
>
0
);
}
}
},
...
...
@@ -3766,7 +3775,7 @@
var
_cancelPreSelectedNode
=
view
.
cancelPreSelectedNode
;
view
.
cancelPreSelectedNode
=
function
(
setting
,
node
)
{
var
list
=
data
.
getRoot
(
setting
).
curSelectedList
;
for
(
var
i
=
0
,
j
=
list
.
length
;
i
<
j
;
i
++
)
{
for
(
var
i
=
0
,
j
=
list
.
length
;
i
<
j
;
i
++
)
{
if
(
!
node
||
node
===
list
[
i
])
{
view
.
removeTreeDom
(
setting
,
list
[
i
]);
if
(
node
)
break
;
...
...
@@ -3776,7 +3785,7 @@
}
var
_createNodes
=
view
.
createNodes
;
view
.
createNodes
=
function
(
setting
,
level
,
nodes
,
parentNode
,
index
)
{
view
.
createNodes
=
function
(
setting
,
level
,
nodes
,
parentNode
,
index
)
{
if
(
_createNodes
)
{
_createNodes
.
apply
(
view
,
arguments
);
}
...
...
@@ -3787,12 +3796,12 @@
}
var
_makeNodeUrl
=
view
.
makeNodeUrl
;
view
.
makeNodeUrl
=
function
(
setting
,
node
)
{
view
.
makeNodeUrl
=
function
(
setting
,
node
)
{
return
setting
.
edit
.
enable
?
null
:
(
_makeNodeUrl
.
apply
(
view
,
arguments
));
}
var
_removeNode
=
view
.
removeNode
;
view
.
removeNode
=
function
(
setting
,
node
)
{
view
.
removeNode
=
function
(
setting
,
node
)
{
var
root
=
data
.
getRoot
(
setting
);
if
(
root
.
curEditNode
===
node
)
root
.
curEditNode
=
null
;
if
(
_removeNode
)
{
...
...
@@ -3801,7 +3810,7 @@
}
var
_selectNode
=
view
.
selectNode
;
view
.
selectNode
=
function
(
setting
,
node
,
addFlag
)
{
view
.
selectNode
=
function
(
setting
,
node
,
addFlag
)
{
var
root
=
data
.
getRoot
(
setting
);
if
(
data
.
isSelectedNode
(
setting
,
node
)
&&
root
.
curEditNode
==
node
&&
node
.
editNameFlag
)
{
return
false
;
...
...
@@ -3812,7 +3821,7 @@
}
var
_uCanDo
=
tools
.
uCanDo
;
tools
.
uCanDo
=
function
(
setting
,
e
)
{
tools
.
uCanDo
=
function
(
setting
,
e
)
{
var
root
=
data
.
getRoot
(
setting
);
if
(
e
&&
(
tools
.
eqs
(
e
.
type
,
"
mouseover
"
)
||
tools
.
eqs
(
e
.
type
,
"
mouseout
"
)
||
tools
.
eqs
(
e
.
type
,
"
mousedown
"
)
||
tools
.
eqs
(
e
.
type
,
"
mouseup
"
)))
{
return
true
;
...
...
js/jquery.ztree.all.min.js
浏览文件 @
9523be07
/*
* JQuery zTree core v3.5.3
6
* JQuery zTree core v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -9,75 +9,74 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
q
){
var
H
,
I
,
J
,
K
,
L
,
M
,
u
,
s
=
{},
v
=
{},
w
=
{},
N
=
{
treeId
:
""
,
treeObj
:
null
,
view
:{
addDiyDom
:
null
,
autoCancelSelected
:
!
0
,
dblClickExpand
:
!
0
,
expandSpeed
:
"
fast
"
,
fontCss
:{},
nameIsHTML
:
!
1
,
selectedMulti
:
!
0
,
showIcon
:
!
0
,
showLine
:
!
0
,
showTitle
:
!
0
,
txtSelectedEnable
:
!
1
},
data
:{
key
:{
isParent
:
"
isParent
"
,
children
:
"
children
"
,
name
:
"
name
"
,
title
:
""
,
url
:
"
url
"
,
icon
:
"
icon
"
},
simpleData
:{
enable
:
!
1
,
idKey
:
"
id
"
,
pIdKey
:
"
pId
"
,
rootPId
:
null
},
keep
:{
parent
:
!
1
,
leaf
:
!
1
}},
async
:{
enable
:
!
1
,
contentType
:
"
application/x-www-form-urlencoded
"
,
type
:
"
post
"
,
dataType
:
"
text
"
,
headers
:{},
xhrFields
:{},
url
:
""
,
autoParam
:[],
otherParam
:[],
dataFilter
:
null
},
callback
:{
beforeAsync
:
null
,
beforeClick
:
null
,
beforeDblClick
:
null
,
beforeRightClick
:
null
,
beforeMouseDown
:
null
,
beforeMouseUp
:
null
,
beforeExpand
:
null
,
beforeCollapse
:
null
,
beforeRemove
:
null
,
onAsyncError
:
null
,
onAsyncSuccess
:
null
,
onNodeCreated
:
null
,
onClick
:
null
,
onDblClick
:
null
,
onRightClick
:
null
,
onMouseDown
:
null
,
onMouseUp
:
null
,
onExpand
:
null
,
onCollapse
:
null
,
onRemove
:
null
}},
x
=
[
function
(
a
){
var
b
=
a
.
treeObj
,
c
=
f
.
event
;
b
.
bind
(
c
.
NODECREATED
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onNodeCreated
,[
b
,
c
,
h
])});
b
.
bind
(
c
.
CLICK
,
function
(
b
,
c
,
h
,
e
,
m
){
j
.
apply
(
a
.
callback
.
onClick
,[
c
,
h
,
e
,
m
])});
b
.
bind
(
c
.
EXPAND
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onExpand
,[
b
,
c
,
h
])});
b
.
bind
(
c
.
COLLAPSE
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onCollapse
,[
b
,
c
,
h
])});
b
.
bind
(
c
.
ASYNC_SUCCESS
,
function
(
b
,
c
,
h
,
e
){
j
.
apply
(
a
.
callback
.
onAsyncSuccess
,[
b
,
c
,
h
,
e
])});
b
.
bind
(
c
.
ASYNC_ERROR
,
function
(
b
,
c
,
h
,
e
,
m
,
f
){
j
.
apply
(
a
.
callback
.
onAsyncError
,[
b
,
c
,
h
,
e
,
m
,
f
])});
b
.
bind
(
c
.
REMOVE
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onRemove
,
[
b
,
c
,
h
])});
b
.
bind
(
c
.
SELECTED
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onSelected
,[
c
,
h
])});
b
.
bind
(
c
.
UNSELECTED
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onUnSelected
,[
c
,
h
])})}],
y
=
[
function
(
a
){
var
b
=
f
.
event
;
a
.
treeObj
.
unbind
(
b
.
NODECREATED
).
unbind
(
b
.
CLICK
).
unbind
(
b
.
EXPAND
).
unbind
(
b
.
COLLAPSE
).
unbind
(
b
.
ASYNC_SUCCESS
).
unbind
(
b
.
ASYNC_ERROR
).
unbind
(
b
.
REMOVE
).
unbind
(
b
.
SELECTED
).
unbind
(
b
.
UNSELECTED
)}],
z
=
[
function
(
a
){
var
b
=
e
.
getCache
(
a
);
b
||
(
b
=
{},
e
.
setCache
(
a
,
b
));
b
.
nodes
=
[];
b
.
doms
=
[]}],
A
=
[
function
(
a
,
b
,
c
,
d
,
g
,
h
){
if
(
c
){
var
k
=
e
.
getRoot
(
a
),
m
=
e
.
nodeChildren
(
a
,
c
);
c
.
level
=
b
;
c
.
tId
=
a
.
treeId
+
"
_
"
+
++
k
.
zId
;
c
.
parentTId
=
d
?
d
.
tId
:
null
;
c
.
open
=
typeof
c
.
open
==
"
string
"
?
j
.
eqs
(
c
.
open
,
"
true
"
):
!!
c
.
open
;
b
=
e
.
nodeIsParent
(
a
,
c
);
j
.
isArray
(
m
)
&&!
(
b
===!
1
||
typeof
b
==
"
string
"
&&
j
.
eqs
(
b
,
"
false
"
))?(
e
.
nodeIsParent
(
a
,
c
,
!
0
),
c
.
zAsync
=!
0
):(
b
=
e
.
nodeIsParent
(
a
,
c
,
b
),
c
.
open
=
b
&&!
a
.
async
.
enable
?
c
.
open
:
!
1
,
c
.
zAsync
=!
b
);
c
.
isFirstNode
=
g
;
c
.
isLastNode
=
h
;
c
.
getParentNode
=
function
(){
return
e
.
getNodeCache
(
a
,
c
.
parentTId
)};
c
.
getPreNode
=
function
(){
return
e
.
getPreNode
(
a
,
c
)};
c
.
getNextNode
=
function
(){
return
e
.
getNextNode
(
a
,
c
)};
c
.
getIndex
=
function
(){
return
e
.
getNodeIndex
(
a
,
c
)};
c
.
getPath
=
function
(){
return
e
.
getNodePath
(
a
,
c
)};
c
.
isAjaxing
=!
1
;
e
.
fixPIdKeyValue
(
a
,
c
)}}],
t
=
[
function
(
a
){
var
b
=
a
.
target
,
c
=
e
.
getSetting
(
a
.
data
.
treeId
),
d
=
""
,
g
=
null
,
h
=
""
,
k
=
""
,
m
=
null
,
i
=
null
,
o
=
null
;
if
(
j
.
eqs
(
a
.
type
,
"
mousedown
"
))
k
=
"
mousedown
"
;
else
if
(
j
.
eqs
(
a
.
type
,
"
mouseup
"
))
k
=
"
mouseup
"
;
else
if
(
j
.
eqs
(
a
.
type
,
"
contextmenu
"
))
k
=
"
contextmenu
"
;
else
if
(
j
.
eqs
(
a
.
type
,
"
click
"
))
if
(
j
.
eqs
(
b
.
tagName
,
"
span
"
)
&&
b
.
getAttribute
(
"
treeNode
"
+
f
.
id
.
SWITCH
)
!==
null
)
d
=
j
.
getNodeMainDom
(
b
).
id
,
h
=
"
switchNode
"
;
else
{
if
(
o
=
j
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
f
.
id
.
A
}]))
d
=
j
.
getNodeMainDom
(
o
).
id
,
h
=
"
clickNode
"
}
else
if
(
j
.
eqs
(
a
.
type
,
"
dblclick
"
)
&&
(
k
=
"
dblclick
"
,
o
=
j
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
f
.
id
.
A
}])))
d
=
j
.
getNodeMainDom
(
o
).
id
,
h
=
"
switchNode
"
;
if
(
k
.
length
>
0
&&
d
.
length
==
0
&&
(
o
=
j
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
f
.
id
.
A
}])))
d
=
j
.
getNodeMainDom
(
o
).
id
;
if
(
d
.
length
>
0
)
switch
(
g
=
e
.
getNodeCache
(
c
,
d
),
h
){
case
"
switchNode
"
:
e
.
nodeIsParent
(
c
,
g
)?
j
.
eqs
(
a
.
type
,
"
click
"
)
||
j
.
eqs
(
a
.
type
,
"
dblclick
"
)
&&
j
.
apply
(
c
.
view
.
dblClickExpand
,[
c
.
treeId
,
g
],
c
.
view
.
dblClickExpand
)?
m
=
H
:
h
=
""
:
h
=
""
;
break
;
case
"
clickNode
"
:
m
=
I
}
switch
(
k
){
case
"
mousedown
"
:
i
=
J
;
break
;
case
"
mouseup
"
:
i
=
K
;
break
;
case
"
dblclick
"
:
i
=
L
;
break
;
case
"
contextmenu
"
:
i
=
M
}
return
{
stop
:
!
1
,
node
:
g
,
nodeEventType
:
h
,
nodeEventCallback
:
m
,
treeEventType
:
k
,
treeEventCallback
:
i
}}],
B
=
[
function
(
a
){
var
b
=
e
.
getRoot
(
a
);
b
||
(
b
=
{},
e
.
setRoot
(
a
,
b
));
e
.
nodeChildren
(
a
,
b
,[]);
b
.
expandTriggerFlag
=!
1
;
b
.
curSelectedList
=
[];
b
.
noSelection
=
!
0
;
b
.
createdNodes
=
[];
b
.
zId
=
0
;
b
.
_ver
=
(
new
Date
).
getTime
()}],
C
=
[],
D
=
[],
E
=
[],
F
=
[],
G
=
[],
e
=
{
addNodeCache
:
function
(
a
,
b
){
e
.
getCache
(
a
).
nodes
[
e
.
getNodeCacheId
(
b
.
tId
)]
=
b
},
getNodeCacheId
:
function
(
a
){
return
a
.
substring
(
a
.
lastIndexOf
(
"
_
"
)
+
1
)},
addAfterA
:
function
(
a
){
D
.
push
(
a
)},
addBeforeA
:
function
(
a
){
C
.
push
(
a
)},
addInnerAfterA
:
function
(
a
){
F
.
push
(
a
)},
addInnerBeforeA
:
function
(
a
){
E
.
push
(
a
)},
addInitBind
:
function
(
a
){
x
.
push
(
a
)},
addInitUnBind
:
function
(
a
){
y
.
push
(
a
)},
addInitCache
:
function
(
a
){
z
.
push
(
a
)},
addInitNode
:
function
(
a
){
A
.
push
(
a
)},
addInitProxy
:
function
(
a
,
b
){
b
?
t
.
splice
(
0
,
0
,
a
):
t
.
push
(
a
)},
addInitRoot
:
function
(
a
){
B
.
push
(
a
)},
addNodesData
:
function
(
a
,
b
,
c
,
d
){
var
g
=
e
.
nodeChildren
(
a
,
b
);
g
?
c
>=
g
.
length
&&
(
c
=-
1
):(
g
=
e
.
nodeChildren
(
a
,
b
,[]),
c
=-
1
);
if
(
g
.
length
>
0
&&
c
===
0
)
g
[
0
].
isFirstNode
=!
1
,
i
.
setNodeLineIcos
(
a
,
g
[
0
]);
else
if
(
g
.
length
>
0
&&
c
<
0
)
g
[
g
.
length
-
1
].
isLastNode
=!
1
,
i
.
setNodeLineIcos
(
a
,
g
[
g
.
length
-
1
]);
e
.
nodeIsParent
(
a
,
b
,
!
0
);
c
<
0
?
e
.
nodeChildren
(
a
,
b
,
g
.
concat
(
d
)):(
a
=
[
c
,
0
].
concat
(
d
),
g
.
splice
.
apply
(
g
,
a
))},
addSelectedNode
:
function
(
a
,
b
){
var
c
=
e
.
getRoot
(
a
);
e
.
isSelectedNode
(
a
,
b
)
||
c
.
curSelectedList
.
push
(
b
)},
addCreatedNode
:
function
(
a
,
b
){(
a
.
callback
.
onNodeCreated
||
a
.
view
.
addDiyDom
)
&&
e
.
getRoot
(
a
).
createdNodes
.
push
(
b
)},
addZTreeTools
:
function
(
a
){
G
.
push
(
a
)},
exSetting
:
function
(
a
){
q
.
extend
(
!
0
,
N
,
a
)},
fixPIdKeyValue
:
function
(
a
,
b
){
a
.
data
.
simpleData
.
enable
&&
(
b
[
a
.
data
.
simpleData
.
pIdKey
]
=
b
.
parentTId
?
b
.
getParentNode
()[
a
.
data
.
simpleData
.
idKey
]:
a
.
data
.
simpleData
.
rootPId
)},
getAfterA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
D
.
length
;
d
<
e
;
d
++
)
D
[
d
].
apply
(
this
,
arguments
)},
getBeforeA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
C
.
length
;
d
<
e
;
d
++
)
C
[
d
].
apply
(
this
,
arguments
)},
getInnerAfterA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
F
.
length
;
d
<
e
;
d
++
)
F
[
d
].
apply
(
this
,
arguments
)},
getInnerBeforeA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
E
.
length
;
d
<
e
;
d
++
)
E
[
d
].
apply
(
this
,
arguments
)},
getCache
:
function
(
a
){
return
w
[
a
.
treeId
]},
getNodeIndex
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
g
=
c
.
length
-
1
;
d
<=
g
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
;
return
-
1
},
getNextNode
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
g
=
c
.
length
-
1
;
d
<=
g
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
==
g
?
null
:
c
[
d
+
1
];
return
null
},
getNodeByParam
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
null
;
for
(
var
g
=
0
,
h
=
b
.
length
;
g
<
h
;
g
++
){
var
k
=
b
[
g
];
if
(
k
[
c
]
==
d
)
return
b
[
g
];
k
=
e
.
nodeChildren
(
a
,
k
);
if
(
k
=
e
.
getNodeByParam
(
a
,
k
,
c
,
d
))
return
k
}
return
null
},
getNodeCache
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
var
c
=
w
[
a
.
treeId
].
nodes
[
e
.
getNodeCacheId
(
b
)];
return
c
?
c
:
null
},
getNodePath
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
var
c
;
(
c
=
b
.
parentTId
?
b
.
getParentNode
().
getPath
():[])
&&
c
.
push
(
b
);
return
c
},
getNodes
:
function
(
a
){
return
e
.
nodeChildren
(
a
,
e
.
getRoot
(
a
))},
getNodesByParam
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
[];
for
(
var
g
=
[],
h
=
0
,
k
=
b
.
length
;
h
<
k
;
h
++
){
var
m
=
b
[
h
];
m
[
c
]
==
d
&&
g
.
push
(
m
);
m
=
e
.
nodeChildren
(
a
,
m
);
g
=
g
.
concat
(
e
.
getNodesByParam
(
a
,
m
,
c
,
d
))}
return
g
},
getNodesByParamFuzzy
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
[];
for
(
var
g
=
[],
d
=
d
.
toLowerCase
(),
h
=
0
,
k
=
b
.
length
;
h
<
k
;
h
++
){
var
m
=
b
[
h
];
typeof
m
[
c
]
==
"
string
"
&&
b
[
h
][
c
].
toLowerCase
().
indexOf
(
d
)
>-
1
&&
g
.
push
(
m
);
m
=
e
.
nodeChildren
(
a
,
m
);
g
=
g
.
concat
(
e
.
getNodesByParamFuzzy
(
a
,
m
,
c
,
d
))}
return
g
},
getNodesByFilter
:
function
(
a
,
b
,
c
,
d
,
g
){
if
(
!
b
)
return
d
?
null
:[];
for
(
var
h
=
d
?
null
:[],
k
=
0
,
m
=
b
.
length
;
k
<
m
;
k
++
){
var
f
=
b
[
k
];
if
(
j
.
apply
(
c
,[
f
,
g
],
!
1
)){
if
(
d
)
return
f
;
h
.
push
(
f
)}
f
=
e
.
nodeChildren
(
a
,
f
);
f
=
e
.
getNodesByFilter
(
a
,
f
,
c
,
d
,
g
);
if
(
d
&&
f
)
return
f
;
h
=
d
?
f
:
h
.
concat
(
f
)}
return
h
},
getPreNode
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
g
=
c
.
length
;
d
<
g
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
==
0
?
null
:
c
[
d
-
1
];
return
null
},
getRoot
:
function
(
a
){
return
a
?
v
[
a
.
treeId
]:
null
},
getRoots
:
function
(){
return
v
},
getSetting
:
function
(
a
){
return
s
[
a
]},
getSettings
:
function
(){
return
s
},
getZTreeTools
:
function
(
a
){
return
(
a
=
this
.
getRoot
(
this
.
getSetting
(
a
)))?
a
.
treeTools
:
null
},
initCache
:
function
(
a
){
for
(
var
b
=
0
,
c
=
z
.
length
;
b
<
c
;
b
++
)
z
[
b
].
apply
(
this
,
arguments
)},
initNode
:
function
(
a
,
b
,
c
,
d
,
e
,
h
){
for
(
var
k
=
0
,
f
=
A
.
length
;
k
<
f
;
k
++
)
A
[
k
].
apply
(
this
,
arguments
)},
initRoot
:
function
(
a
){
for
(
var
b
=
0
,
c
=
B
.
length
;
b
<
c
;
b
++
)
B
[
b
].
apply
(
this
,
arguments
)},
isSelectedNode
:
function
(
a
,
b
){
for
(
var
c
=
e
.
getRoot
(
a
),
d
=
0
,
g
=
c
.
curSelectedList
.
length
;
d
<
g
;
d
++
)
if
(
b
===
c
.
curSelectedList
[
d
])
return
!
0
;
return
!
1
},
nodeChildren
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
null
;
a
=
a
.
data
.
key
.
children
;
typeof
c
!==
"
undefined
"
&&
(
b
[
a
]
=
c
);
return
b
[
a
]},
nodeIsParent
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
!
1
;
a
=
a
.
data
.
key
.
isParent
;
typeof
c
!==
"
undefined
"
&&
(
typeof
c
===
"
string
"
&&
(
c
=
j
.
eqs
(
c
,
"
true
"
)),
b
[
a
]
=!!
c
);
return
b
[
a
]},
nodeName
:
function
(
a
,
b
,
c
){
a
=
a
.
data
.
key
.
name
;
typeof
c
!==
"
undefined
"
&&
(
b
[
a
]
=
c
);
return
""
+
b
[
a
]},
nodeTitle
:
function
(
a
,
b
){
return
""
+
b
[
a
.
data
.
key
.
title
===
""
?
a
.
data
.
key
.
name
:
a
.
data
.
key
.
title
]},
removeNodeCache
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
)
for
(
var
d
=
0
,
g
=
c
.
length
;
d
<
g
;
d
++
)
e
.
removeNodeCache
(
a
,
c
[
d
]);
e
.
getCache
(
a
).
nodes
[
e
.
getNodeCacheId
(
b
.
tId
)]
=
null
},
removeSelectedNode
:
function
(
a
,
b
){
for
(
var
c
=
e
.
getRoot
(
a
),
d
=
0
,
g
=
c
.
curSelectedList
.
length
;
d
<
g
;
d
++
)
if
(
b
===
c
.
curSelectedList
[
d
]
||!
e
.
getNodeCache
(
a
,
c
.
curSelectedList
[
d
].
tId
))
c
.
curSelectedList
.
splice
(
d
,
1
),
a
.
treeObj
.
trigger
(
f
.
event
.
UNSELECTED
,[
a
.
treeId
,
b
]),
d
--
,
g
--
},
setCache
:
function
(
a
,
b
){
w
[
a
.
treeId
]
=
b
},
setRoot
:
function
(
a
,
b
){
v
[
a
.
treeId
]
=
b
},
setZTreeTools
:
function
(
a
,
b
){
for
(
var
c
=
0
,
d
=
G
.
length
;
c
<
d
;
c
++
)
G
[
c
].
apply
(
this
,
arguments
)},
transformToArrayFormat
:
function
(
a
,
b
){
function
c
(
b
){
d
.
push
(
b
);(
b
=
e
.
nodeChildren
(
a
,
b
))
&&
(
d
=
d
.
concat
(
e
.
transformToArrayFormat
(
a
,
b
)))}
if
(
!
b
)
return
[];
var
d
=
[];
if
(
j
.
isArray
(
b
))
for
(
var
g
=
0
,
h
=
b
.
length
;
g
<
h
;
g
++
)
c
(
b
[
g
]);
else
c
(
b
);
return
d
},
transformTozTreeFormat
:
function
(
a
,
b
){
var
c
,
d
,
g
=
a
.
data
.
simpleData
.
idKey
,
h
=
a
.
data
.
simpleData
.
pIdKey
;
if
(
!
g
||
g
==
""
||!
b
)
return
[];
if
(
j
.
isArray
(
b
)){
var
k
=
[],
f
=
{};
for
(
c
=
0
,
d
=
b
.
length
;
c
<
d
;
c
++
)
f
[
b
[
c
][
g
]]
=
b
[
c
];
for
(
c
=
0
,
d
=
b
.
length
;
c
<
d
;
c
++
){
var
i
=
f
[
b
[
c
][
h
]];
if
(
i
&&
b
[
c
][
g
]
!=
b
[
c
][
h
]){
var
o
=
e
.
nodeChildren
(
a
,
i
);
o
||
(
o
=
e
.
nodeChildren
(
a
,
i
,[]));
o
.
push
(
b
[
c
])}
else
k
.
push
(
b
[
c
])}
return
k
}
else
return
[
b
]}},
n
=
{
bindEvent
:
function
(
a
){
for
(
var
b
=
0
,
c
=
x
.
length
;
b
<
c
;
b
++
)
x
[
b
].
apply
(
this
,
arguments
)},
unbindEvent
:
function
(
a
){
for
(
var
b
=
0
,
c
=
y
.
length
;
b
<
c
;
b
++
)
y
[
b
].
apply
(
this
,
arguments
)},
bindTree
:
function
(
a
){
var
b
=
{
treeId
:
a
.
treeId
},
c
=
a
.
treeObj
;
a
.
view
.
txtSelectedEnable
||
c
.
bind
(
"
selectstart
"
,
u
).
css
({
"
-moz-user-select
"
:
"
-moz-none
"
});
c
.
bind
(
"
click
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
dblclick
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseover
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseout
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mousedown
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseup
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
contextmenu
"
,
b
,
n
.
proxy
)},
unbindTree
:
function
(
a
){
a
.
treeObj
.
unbind
(
"
selectstart
"
,
u
).
unbind
(
"
click
"
,
n
.
proxy
).
unbind
(
"
dblclick
"
,
n
.
proxy
).
unbind
(
"
mouseover
"
,
n
.
proxy
).
unbind
(
"
mouseout
"
,
n
.
proxy
).
unbind
(
"
mousedown
"
,
n
.
proxy
).
unbind
(
"
mouseup
"
,
n
.
proxy
).
unbind
(
"
contextmenu
"
,
n
.
proxy
)},
doProxy
:
function
(
a
){
for
(
var
b
=
[],
c
=
0
,
d
=
t
.
length
;
c
<
d
;
c
++
){
var
e
=
t
[
c
].
apply
(
this
,
arguments
);
b
.
push
(
e
);
if
(
e
.
stop
)
break
}
return
b
},
proxy
:
function
(
a
){
var
b
=
e
.
getSetting
(
a
.
data
.
treeId
);
if
(
!
j
.
uCanDo
(
b
,
a
))
return
!
0
;
for
(
var
b
=
n
.
doProxy
(
a
),
c
=!
0
,
d
=
0
,
g
=
b
.
length
;
d
<
g
;
d
++
){
var
h
=
b
[
d
];
h
.
nodeEventCallback
&&
(
c
=
h
.
nodeEventCallback
.
apply
(
h
,[
a
,
h
.
node
])
&&
c
);
h
.
treeEventCallback
&&
(
c
=
h
.
treeEventCallback
.
apply
(
h
,[
a
,
h
.
node
])
&&
c
)}
return
c
}};
H
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
if
(
b
.
open
){
if
(
j
.
apply
(
c
.
callback
.
beforeCollapse
,[
c
.
treeId
,
b
],
!
0
)
==
!
1
)
return
!
0
}
else
if
(
j
.
apply
(
c
.
callback
.
beforeExpand
,[
c
.
treeId
,
b
],
!
0
)
==!
1
)
return
!
0
;
e
.
getRoot
(
c
).
expandTriggerFlag
=!
0
;
i
.
switchNode
(
c
,
b
);
return
!
0
};
I
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
),
d
=
c
.
view
.
autoCancelSelected
&&
(
a
.
ctrlKey
||
a
.
metaKey
)
&&
e
.
isSelectedNode
(
c
,
b
)?
0
:
c
.
view
.
autoCancelSelected
&&
(
a
.
ctrlKey
||
a
.
metaKey
)
&&
c
.
view
.
selectedMulti
?
2
:
1
;
if
(
j
.
apply
(
c
.
callback
.
beforeClick
,[
c
.
treeId
,
b
,
d
],
!
0
)
==!
1
)
return
!
0
;
d
===
0
?
i
.
cancelPreSelectedNode
(
c
,
b
):
i
.
selectNode
(
c
,
b
,
d
===
2
);
c
.
treeObj
.
trigger
(
f
.
event
.
CLICK
,
[
a
,
c
.
treeId
,
b
,
d
]);
return
!
0
};
J
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
j
.
apply
(
c
.
callback
.
beforeMouseDown
,[
c
.
treeId
,
b
],
!
0
)
&&
j
.
apply
(
c
.
callback
.
onMouseDown
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
K
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
j
.
apply
(
c
.
callback
.
beforeMouseUp
,[
c
.
treeId
,
b
],
!
0
)
&&
j
.
apply
(
c
.
callback
.
onMouseUp
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
L
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
j
.
apply
(
c
.
callback
.
beforeDblClick
,[
c
.
treeId
,
b
],
!
0
)
&&
j
.
apply
(
c
.
callback
.
onDblClick
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
M
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
j
.
apply
(
c
.
callback
.
beforeRightClick
,[
c
.
treeId
,
b
],
!
0
)
&&
j
.
apply
(
c
.
callback
.
onRightClick
,[
a
,
c
.
treeId
,
b
]);
return
typeof
c
.
callback
.
onRightClick
!=
"
function
"
};
u
=
function
(
a
){
a
=
a
.
originalEvent
.
srcElement
.
nodeName
.
toLowerCase
();
return
a
===
"
input
"
||
a
===
"
textarea
"
};
var
j
=
{
apply
:
function
(
a
,
b
,
c
){
return
typeof
a
==
"
function
"
?
a
.
apply
(
O
,
b
?
b
:[]):
c
},
canAsync
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
),
d
=
e
.
nodeIsParent
(
a
,
b
);
return
a
.
async
.
enable
&&
b
&&
d
&&!
(
b
.
zAsync
||
c
&&
c
.
length
>
0
)},
clone
:
function
(
a
){
if
(
a
===
null
)
return
null
;
var
b
=
j
.
isArray
(
a
)?[]:{},
c
;
for
(
c
in
a
)
b
[
c
]
=
a
[
c
]
instanceof
Date
?
new
Date
(
a
[
c
].
getTime
()):
typeof
a
[
c
]
===
"
object
"
?
j
.
clone
(
a
[
c
]):
a
[
c
];
return
b
},
eqs
:
function
(
a
,
b
){
return
a
.
toLowerCase
()
===
b
.
toLowerCase
()},
isArray
:
function
(
a
){
return
Object
.
prototype
.
toString
.
apply
(
a
)
===
"
[object Array]
"
},
isElement
:
function
(
a
){
return
typeof
HTMLElement
===
"
object
"
?
a
instanceof
HTMLElement
:
a
&&
typeof
a
===
"
object
"
&&
a
!==
null
&&
a
.
nodeType
===
1
&&
typeof
a
.
nodeName
===
"
string
"
},
$
:
function
(
a
,
b
,
c
){
b
&&
typeof
b
!=
"
string
"
&&
(
c
=
b
,
b
=
""
);
return
typeof
a
==
"
string
"
?
q
(
a
,
c
?
c
.
treeObj
.
get
(
0
).
ownerDocument
:
null
):
q
(
"
#
"
+
a
.
tId
+
b
,
c
?
c
.
treeObj
:
null
)},
getMDom
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
null
;
for
(;
b
&&
b
.
id
!==
a
.
treeId
;){
for
(
var
d
=
0
,
e
=
c
.
length
;
b
.
tagName
&&
d
<
e
;
d
++
)
if
(
j
.
eqs
(
b
.
tagName
,
c
[
d
].
tagName
)
&&
b
.
getAttribute
(
c
[
d
].
attrName
)
!==
null
)
return
b
;
b
=
b
.
parentNode
}
return
null
},
getNodeMainDom
:
function
(
a
){
return
q
(
a
).
parent
(
"
li
"
).
get
(
0
)
||
q
(
a
).
parentsUntil
(
"
li
"
).
parent
().
get
(
0
)},
isChildOrSelf
:
function
(
a
,
b
){
return
q
(
a
).
closest
(
"
#
"
+
b
).
length
>
0
},
uCanDo
:
function
(){
return
!
0
}},
i
=
{
addNodes
:
function
(
a
,
b
,
c
,
d
,
g
){
var
h
=
e
.
nodeIsParent
(
a
,
b
);
if
(
!
a
.
data
.
keep
.
leaf
||!
b
||
h
)
if
(
j
.
isArray
(
d
)
||
(
d
=
[
d
]),
a
.
data
.
simpleData
.
enable
&&
(
d
=
e
.
transformTozTreeFormat
(
a
,
d
)),
b
){
var
h
=
l
(
b
,
f
.
id
.
SWITCH
,
a
),
k
=
l
(
b
,
f
.
id
.
ICON
,
a
),
m
=
l
(
b
,
f
.
id
.
UL
,
a
);
if
(
!
b
.
open
)
i
.
replaceSwitchClass
(
b
,
h
,
f
.
folder
.
CLOSE
),
i
.
replaceIcoClass
(
b
,
k
,
f
.
folder
.
CLOSE
),
b
.
open
=!
1
,
m
.
css
({
display
:
"
none
"
});
e
.
addNodesData
(
a
,
b
,
c
,
d
);
i
.
createNodes
(
a
,
b
.
level
+
1
,
d
,
b
,
c
);
g
||
i
.
expandCollapseParentNode
(
a
,
b
,
!
0
)}
else
e
.
addNodesData
(
a
,
e
.
getRoot
(
a
),
c
,
d
),
i
.
createNodes
(
a
,
0
,
d
,
null
,
c
)},
appendNodes
:
function
(
a
,
b
,
c
,
d
,
g
,
h
,
k
){
if
(
!
c
)
return
[];
var
f
=
[],
j
=
d
?
d
:
e
.
getRoot
(
a
),
j
=
e
.
nodeChildren
(
a
,
j
),
o
,
l
;
if
(
!
j
||
g
>=
j
.
length
-
c
.
length
)
g
=-
1
;
for
(
var
n
=
0
,
Q
=
c
.
length
;
n
<
Q
;
n
++
){
var
p
=
c
[
n
];
h
&&
(
o
=
(
g
===
0
||
j
.
length
==
c
.
length
)
&&
n
==
0
,
l
=
g
<
0
&&
n
==
c
.
length
-
1
,
e
.
initNode
(
a
,
b
,
p
,
d
,
o
,
l
,
k
),
e
.
addNodeCache
(
a
,
p
));
o
=
e
.
nodeIsParent
(
a
,
p
);
l
=
[];
var
q
=
e
.
nodeChildren
(
a
,
p
);
q
&&
q
.
length
>
0
&&
(
l
=
i
.
appendNodes
(
a
,
b
+
1
,
q
,
p
,
-
1
,
h
,
k
&&
p
.
open
));
k
&&
(
i
.
makeDOMNodeMainBefore
(
f
,
a
,
p
),
i
.
makeDOMNodeLine
(
f
,
a
,
p
),
e
.
getBeforeA
(
a
,
p
,
f
),
i
.
makeDOMNodeNameBefore
(
f
,
a
,
p
),
e
.
getInnerBeforeA
(
a
,
p
,
f
),
i
.
makeDOMNodeIcon
(
f
,
a
,
p
),
e
.
getInnerAfterA
(
a
,
p
,
f
),
i
.
makeDOMNodeNameAfter
(
f
,
a
,
p
),
e
.
getAfterA
(
a
,
p
,
f
),
o
&&
p
.
open
&&
i
.
makeUlHtml
(
a
,
p
,
f
,
l
.
join
(
""
)),
i
.
makeDOMNodeMainAfter
(
f
,
a
,
p
),
e
.
addCreatedNode
(
a
,
p
))}
return
f
},
appendParentULDom
:
function
(
a
,
b
){
var
c
=
[],
d
=
l
(
b
,
a
);
!
d
.
get
(
0
)
&&
b
.
parentTId
&&
(
i
.
appendParentULDom
(
a
,
b
.
getParentNode
()),
d
=
l
(
b
,
a
));
var
g
=
l
(
b
,
f
.
id
.
UL
,
a
);
g
.
get
(
0
)
&&
g
.
remove
();
g
=
e
.
nodeChildren
(
a
,
b
);
g
=
i
.
appendNodes
(
a
,
b
.
level
+
1
,
g
,
b
,
-
1
,
!
1
,
!
0
);
i
.
makeUlHtml
(
a
,
b
,
c
,
g
.
join
(
""
));
d
.
append
(
c
.
join
(
""
))},
asyncNode
:
function
(
a
,
b
,
c
,
d
){
var
g
,
h
;
g
=
e
.
nodeIsParent
(
a
,
b
);
if
(
b
&&!
g
)
return
j
.
apply
(
d
),
!
1
;
else
if
(
b
&&
b
.
isAjaxing
)
return
!
1
;
else
if
(
j
.
apply
(
a
.
callback
.
beforeAsync
,[
a
.
treeId
,
b
],
!
0
)
==!
1
)
return
j
.
apply
(
d
),
!
1
;
if
(
b
)
b
.
isAjaxing
=!
0
,
l
(
b
,
f
.
id
.
ICON
,
a
).
attr
({
style
:
""
,
"
class
"
:
f
.
className
.
BUTTON
+
"
"
+
f
.
className
.
ICO_LOADING
});
var
k
=
{},
m
=
j
.
apply
(
a
.
async
.
autoParam
,[
a
.
treeId
,
b
],
a
.
async
.
autoParam
);
for
(
g
=
0
,
h
=
m
.
length
;
b
&&
g
<
h
;
g
++
){
var
r
=
m
[
g
].
split
(
"
=
"
),
o
=
r
;
r
.
length
>
1
&&
(
o
=
r
[
1
],
r
=
r
[
0
]);
k
[
o
]
=
b
[
r
]}
m
=
j
.
apply
(
a
.
async
.
otherParam
,[
a
.
treeId
,
b
],
a
.
async
.
otherParam
);
if
(
j
.
isArray
(
m
))
for
(
g
=
0
,
h
=
m
.
length
;
g
<
h
;
g
+=
2
)
k
[
m
[
g
]]
=
m
[
g
+
1
];
else
for
(
var
n
in
m
)
k
[
n
]
=
m
[
n
];
var
P
=
e
.
getRoot
(
a
).
_ver
;
q
.
ajax
({
contentType
:
a
.
async
.
contentType
,
cache
:
!
1
,
type
:
a
.
async
.
type
,
url
:
j
.
apply
(
a
.
async
.
url
,[
a
.
treeId
,
b
],
a
.
async
.
url
),
data
:
a
.
async
.
contentType
.
indexOf
(
"
application/json
"
)
>-
1
?
JSON
.
stringify
(
k
):
k
,
dataType
:
a
.
async
.
dataType
,
headers
:
a
.
async
.
headers
,
xhrFields
:
a
.
async
.
xhrFields
,
success
:
function
(
h
){
if
(
P
==
e
.
getRoot
(
a
).
_ver
){
var
k
=
[];
try
{
k
=!
h
||
h
.
length
==
0
?[]:
typeof
h
==
"
string
"
?
eval
(
"
(
"
+
h
+
"
)
"
):
h
}
catch
(
g
){
k
=
h
}
if
(
b
)
b
.
isAjaxing
=
null
,
b
.
zAsync
=!
0
;
i
.
setNodeLineIcos
(
a
,
b
);
k
&&
k
!==
""
?(
k
=
j
.
apply
(
a
.
async
.
dataFilter
,[
a
.
treeId
,
b
,
k
],
k
),
i
.
addNodes
(
a
,
b
,
-
1
,
k
?
j
.
clone
(
k
):[],
!!
c
)):
i
.
addNodes
(
a
,
b
,
-
1
,[],
!!
c
);
a
.
treeObj
.
trigger
(
f
.
event
.
ASYNC_SUCCESS
,[
a
.
treeId
,
b
,
h
]);
j
.
apply
(
d
)}},
error
:
function
(
c
,
d
,
h
){
if
(
P
==
e
.
getRoot
(
a
).
_ver
){
if
(
b
)
b
.
isAjaxing
=
null
;
i
.
setNodeLineIcos
(
a
,
b
);
a
.
treeObj
.
trigger
(
f
.
event
.
ASYNC_ERROR
,[
a
.
treeId
,
b
,
c
,
d
,
h
])}}});
return
!
0
},
cancelPreSelectedNode
:
function
(
a
,
b
,
c
){
var
d
=
e
.
getRoot
(
a
).
curSelectedList
,
g
,
h
;
for
(
g
=
d
.
length
-
1
;
g
>=
0
;
g
--
)
if
(
h
=
d
[
g
],
b
===
h
||!
b
&&
(
!
c
||
c
!==
h
))
if
(
l
(
h
,
f
.
id
.
A
,
a
).
removeClass
(
f
.
node
.
CURSELECTED
),
b
){
e
.
removeSelectedNode
(
a
,
b
);
break
}
else
d
.
splice
(
g
,
1
),
a
.
treeObj
.
trigger
(
f
.
event
.
UNSELECTED
,[
a
.
treeId
,
h
])},
createNodeCallback
:
function
(
a
){
if
(
a
.
callback
.
onNodeCreated
||
a
.
view
.
addDiyDom
)
for
(
var
b
=
e
.
getRoot
(
a
);
b
.
createdNodes
.
length
>
0
;){
var
c
=
b
.
createdNodes
.
shift
();
j
.
apply
(
a
.
view
.
addDiyDom
,[
a
.
treeId
,
c
]);
a
.
callback
.
onNodeCreated
&&
a
.
treeObj
.
trigger
(
f
.
event
.
NODECREATED
,[
a
.
treeId
,
c
])}},
createNodes
:
function
(
a
,
b
,
c
,
d
,
g
){
if
(
c
&&
c
.
length
!=
0
){
var
h
=
e
.
getRoot
(
a
),
k
=!
d
||
d
.
open
||!!
l
(
e
.
nodeChildren
(
a
,
d
)[
0
],
a
).
get
(
0
);
h
.
createdNodes
=
[];
var
b
=
i
.
appendNodes
(
a
,
b
,
c
,
d
,
g
,
!
0
,
k
),
m
,
j
;
d
?(
d
=
l
(
d
,
f
.
id
.
UL
,
a
),
d
.
get
(
0
)
&&
(
m
=
d
)):
m
=
a
.
treeObj
;
m
&&
(
g
>=
0
&&
(
j
=
m
.
children
()[
g
]),
g
>=
0
&&
j
?
q
(
j
).
before
(
b
.
join
(
""
)):
m
.
append
(
b
.
join
(
""
)));
i
.
createNodeCallback
(
a
)}},
destroy
:
function
(
a
){
a
&&
(
e
.
initCache
(
a
),
e
.
initRoot
(
a
),
n
.
unbindTree
(
a
),
n
.
unbindEvent
(
a
),
a
.
treeObj
.
empty
(),
delete
s
[
a
.
treeId
])},
expandCollapseNode
:
function
(
a
,
b
,
c
,
d
,
g
){
var
h
=
e
.
getRoot
(
a
),
k
;
if
(
b
){
var
m
=
e
.
nodeChildren
(
a
,
b
),
r
=
e
.
nodeIsParent
(
a
,
b
);
if
(
h
.
expandTriggerFlag
)
k
=
g
,
g
=
function
(){
k
&&
k
();
b
.
open
?
a
.
treeObj
.
trigger
(
f
.
event
.
EXPAND
,[
a
.
treeId
,
b
]):
a
.
treeObj
.
trigger
(
f
.
event
.
COLLAPSE
,[
a
.
treeId
,
b
])},
h
.
expandTriggerFlag
=!
1
;
if
(
!
b
.
open
&&
r
&&
(
!
l
(
b
,
f
.
id
.
UL
,
a
).
get
(
0
)
||
m
&&
m
.
length
>
0
&&!
l
(
m
[
0
],
a
).
get
(
0
)))
i
.
appendParentULDom
(
a
,
b
),
i
.
createNodeCallback
(
a
);
if
(
b
.
open
==
c
)
j
.
apply
(
g
,[]);
else
{
var
c
=
l
(
b
,
f
.
id
.
UL
,
a
),
h
=
l
(
b
,
f
.
id
.
SWITCH
,
a
),
o
=
l
(
b
,
f
.
id
.
ICON
,
a
);
r
?(
b
.
open
=!
b
.
open
,
b
.
iconOpen
&&
b
.
iconClose
&&
o
.
attr
(
"
style
"
,
i
.
makeNodeIcoStyle
(
a
,
b
)),
b
.
open
?(
i
.
replaceSwitchClass
(
b
,
h
,
f
.
folder
.
OPEN
),
i
.
replaceIcoClass
(
b
,
o
,
f
.
folder
.
OPEN
),
d
==!
1
||
a
.
view
.
expandSpeed
==
""
?(
c
.
show
(),
j
.
apply
(
g
,[])):
m
&&
m
.
length
>
0
?
c
.
slideDown
(
a
.
view
.
expandSpeed
,
g
):(
c
.
show
(),
j
.
apply
(
g
,[]))):(
i
.
replaceSwitchClass
(
b
,
h
,
f
.
folder
.
CLOSE
),
i
.
replaceIcoClass
(
b
,
o
,
f
.
folder
.
CLOSE
),
d
==!
1
||
a
.
view
.
expandSpeed
==
""
||!
(
m
&&
m
.
length
>
0
)?(
c
.
hide
(),
j
.
apply
(
g
,[])):
c
.
slideUp
(
a
.
view
.
expandSpeed
,
g
))):
j
.
apply
(
g
,[])}}
else
j
.
apply
(
g
,
[])},
expandCollapseParentNode
:
function
(
a
,
b
,
c
,
d
,
e
){
b
&&
(
b
.
parentTId
?(
i
.
expandCollapseNode
(
a
,
b
,
c
,
d
),
b
.
parentTId
&&
i
.
expandCollapseParentNode
(
a
,
b
.
getParentNode
(),
c
,
d
,
e
)):
i
.
expandCollapseNode
(
a
,
b
,
c
,
d
,
e
))},
expandCollapseSonNode
:
function
(
a
,
b
,
c
,
d
,
g
){
var
h
=
e
.
getRoot
(
a
),
h
=
b
?
e
.
nodeChildren
(
a
,
b
):
e
.
nodeChildren
(
a
,
h
),
k
=
b
?
!
1
:
d
,
f
=
e
.
getRoot
(
a
).
expandTriggerFlag
;
e
.
getRoot
(
a
).
expandTriggerFlag
=!
1
;
if
(
h
)
for
(
var
j
=
0
,
l
=
h
.
length
;
j
<
l
;
j
++
)
h
[
j
]
&&
i
.
expandCollapseSonNode
(
a
,
h
[
j
],
c
,
k
);
e
.
getRoot
(
a
).
expandTriggerFlag
=
f
;
i
.
expandCollapseNode
(
a
,
b
,
c
,
d
,
g
)},
isSelectedNode
:
function
(
a
,
b
){
if
(
!
b
)
return
!
1
;
var
c
=
e
.
getRoot
(
a
).
curSelectedList
,
d
;
for
(
d
=
c
.
length
-
1
;
d
>=
0
;
d
--
)
if
(
b
===
c
[
d
])
return
!
0
;
return
!
1
},
makeDOMNodeIcon
:
function
(
a
,
b
,
c
){
var
d
=
e
.
nodeName
(
b
,
c
),
d
=
b
.
view
.
nameIsHTML
?
d
:
d
.
replace
(
/&/g
,
"
&
"
).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
);
a
.
push
(
"
<span id='
"
,
c
.
tId
,
f
.
id
.
ICON
,
"
' title='' treeNode
"
,
f
.
id
.
ICON
,
"
class='
"
,
i
.
makeNodeIcoClass
(
b
,
c
),
"
' style='
"
,
i
.
makeNodeIcoStyle
(
b
,
c
),
"
'></span><span id='
"
,
c
.
tId
,
f
.
id
.
SPAN
,
"
' class='
"
,
f
.
className
.
NAME
,
"
'>
"
,
d
,
"
</span>
"
)},
makeDOMNodeLine
:
function
(
a
,
b
,
c
){
a
.
push
(
"
<span id='
"
,
c
.
tId
,
f
.
id
.
SWITCH
,
"
' title='' class='
"
,
i
.
makeNodeLineClass
(
b
,
c
),
"
' treeNode
"
,
f
.
id
.
SWITCH
,
"
></span>
"
)},
makeDOMNodeMainAfter
:
function
(
a
){
a
.
push
(
"
</li>
"
)},
makeDOMNodeMainBefore
:
function
(
a
,
b
,
c
){
a
.
push
(
"
<li id='
"
,
c
.
tId
,
"
' class='
"
,
f
.
className
.
LEVEL
,
c
.
level
,
"
' tabindex='0' hidefocus='true' treenode>
"
)},
makeDOMNodeNameAfter
:
function
(
a
){
a
.
push
(
"
</a>
"
)},
makeDOMNodeNameBefore
:
function
(
a
,
b
,
c
){
var
d
=
e
.
nodeTitle
(
b
,
c
),
g
=
i
.
makeNodeUrl
(
b
,
c
),
h
=
i
.
makeNodeFontCss
(
b
,
c
),
k
=
[],
m
;
for
(
m
in
h
)
k
.
push
(
m
,
"
:
"
,
h
[
m
],
"
;
"
);
a
.
push
(
"
<a id='
"
,
c
.
tId
,
f
.
id
.
A
,
"
' class='
"
,
f
.
className
.
LEVEL
,
c
.
level
,
"
' treeNode
"
,
f
.
id
.
A
,
'
onclick="
'
,
c
.
click
||
""
,
'
"
'
,
g
!=
null
&&
g
.
length
>
0
?
"
href='
"
+
g
+
"
'
"
:
""
,
"
target='
"
,
i
.
makeNodeTarget
(
c
),
"
' style='
"
,
k
.
join
(
""
),
"
'
"
);
j
.
apply
(
b
.
view
.
showTitle
,[
b
.
treeId
,
c
],
b
.
view
.
showTitle
)
&&
d
&&
a
.
push
(
"
title='
"
,
d
.
replace
(
/'/g
,
"
'
"
).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
),
"
'
"
);
a
.
push
(
"
>
"
)},
makeNodeFontCss
:
function
(
a
,
b
){
var
c
=
j
.
apply
(
a
.
view
.
fontCss
,[
a
.
treeId
,
b
],
a
.
view
.
fontCss
);
return
c
&&
typeof
c
!=
"
function
"
?
c
:{}},
makeNodeIcoClass
:
function
(
a
,
b
){
var
c
=
[
"
ico
"
];
if
(
!
b
.
isAjaxing
){
var
d
=
e
.
nodeIsParent
(
a
,
b
);
c
[
0
]
=
(
b
.
iconSkin
?
b
.
iconSkin
+
"
_
"
:
""
)
+
c
[
0
];
d
?
c
.
push
(
b
.
open
?
f
.
folder
.
OPEN
:
f
.
folder
.
CLOSE
):
c
.
push
(
f
.
folder
.
DOCU
)}
return
f
.
className
.
BUTTON
+
"
"
+
c
.
join
(
"
_
"
)},
makeNodeIcoStyle
:
function
(
a
,
b
){
var
c
=
[];
if
(
!
b
.
isAjaxing
){
var
d
=
e
.
nodeIsParent
(
a
,
b
)
&&
b
.
iconOpen
&&
b
.
iconClose
?
b
.
open
?
b
.
iconOpen
:
b
.
iconClose
:
b
[
a
.
data
.
key
.
icon
];
d
&&
c
.
push
(
"
background:url(
"
,
d
,
"
) 0 0 no-repeat;
"
);(
a
.
view
.
showIcon
==
!
1
||!
j
.
apply
(
a
.
view
.
showIcon
,[
a
.
treeId
,
b
],
!
0
))
&&
c
.
push
(
"
width:0px;height:0px;
"
)}
return
c
.
join
(
""
)},
makeNodeLineClass
:
function
(
a
,
b
){
var
c
=
[];
a
.
view
.
showLine
?
b
.
level
==
0
&&
b
.
isFirstNode
&&
b
.
isLastNode
?
c
.
push
(
f
.
line
.
ROOT
):
b
.
level
==
0
&&
b
.
isFirstNode
?
c
.
push
(
f
.
line
.
ROOTS
):
b
.
isLastNode
?
c
.
push
(
f
.
line
.
BOTTOM
):
c
.
push
(
f
.
line
.
CENTER
):
c
.
push
(
f
.
line
.
NOLINE
);
e
.
nodeIsParent
(
a
,
b
)?
c
.
push
(
b
.
open
?
f
.
folder
.
OPEN
:
f
.
folder
.
CLOSE
):
c
.
push
(
f
.
folder
.
DOCU
);
return
i
.
makeNodeLineClassEx
(
b
)
+
c
.
join
(
"
_
"
)},
makeNodeLineClassEx
:
function
(
a
){
return
f
.
className
.
BUTTON
+
"
"
+
f
.
className
.
LEVEL
+
a
.
level
+
"
"
+
f
.
className
.
SWITCH
+
"
"
},
makeNodeTarget
:
function
(
a
){
return
a
.
target
||
"
_blank
"
},
makeNodeUrl
:
function
(
a
,
b
){
var
c
=
a
.
data
.
key
.
url
;
return
b
[
c
]?
b
[
c
]:
null
},
makeUlHtml
:
function
(
a
,
b
,
c
,
d
){
c
.
push
(
"
<ul id='
"
,
b
.
tId
,
f
.
id
.
UL
,
"
' class='
"
,
f
.
className
.
LEVEL
,
b
.
level
,
"
"
,
i
.
makeUlLineClass
(
a
,
b
),
"
' style='display:
"
,
b
.
open
?
"
block
"
:
"
none
"
,
"
'>
"
);
c
.
push
(
d
);
c
.
push
(
"
</ul>
"
)},
makeUlLineClass
:
function
(
a
,
b
){
return
a
.
view
.
showLine
&&!
b
.
isLastNode
?
f
.
line
.
LINE
:
""
},
removeChildNodes
:
function
(
a
,
b
){
if
(
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
){
for
(
var
d
=
0
,
g
=
c
.
length
;
d
<
g
;
d
++
)
e
.
removeNodeCache
(
a
,
c
[
d
]);
e
.
removeSelectedNode
(
a
);
delete
b
[
a
.
data
.
key
.
children
];
a
.
data
.
keep
.
parent
?
l
(
b
,
f
.
id
.
UL
,
a
).
empty
():(
e
.
nodeIsParent
(
a
,
b
,
!
1
),
b
.
open
=!
1
,
c
=
l
(
b
,
f
.
id
.
SWITCH
,
a
),
d
=
l
(
b
,
f
.
id
.
ICON
,
a
),
i
.
replaceSwitchClass
(
b
,
c
,
f
.
folder
.
DOCU
),
i
.
replaceIcoClass
(
b
,
d
,
f
.
folder
.
DOCU
),
l
(
b
,
f
.
id
.
UL
,
a
).
remove
())}}},
scrollIntoView
:
function
(
a
,
b
){
if
(
b
)
if
(
typeof
Element
===
"
undefined
"
){
var
c
=
a
.
treeObj
.
get
(
0
).
getBoundingClientRect
(),
d
=
b
.
getBoundingClientRect
();(
d
.
top
<
c
.
top
||
d
.
bottom
>
c
.
bottom
||
d
.
right
>
c
.
right
||
d
.
left
<
c
.
left
)
&&
b
.
scrollIntoView
()}
else
{
if
(
!
Element
.
prototype
.
scrollIntoViewIfNeeded
)
Element
.
prototype
.
scrollIntoViewIfNeeded
=
function
(
a
){
function
b
(
a
,
c
,
d
,
f
){
return
{
left
:
a
,
top
:
c
,
width
:
d
,
height
:
f
,
right
:
a
+
d
,
bottom
:
c
+
f
,
translate
:
function
(
e
,
g
){
return
b
(
e
+
a
,
g
+
c
,
d
,
f
)},
relativeFromTo
:
function
(
g
,
k
){
var
i
=
a
,
j
=
c
,
g
=
g
.
offsetParent
,
k
=
k
.
offsetParent
;
if
(
g
===
k
)
return
e
;
for
(;
g
;
g
=
g
.
offsetParent
)
i
+=
g
.
offsetLeft
+
g
.
clientLeft
,
j
+=
g
.
offsetTop
+
g
.
clientTop
;
for
(;
k
;
k
=
k
.
offsetParent
)
i
-=
k
.
offsetLeft
+
k
.
clientLeft
,
j
-=
k
.
offsetTop
+
k
.
clientTop
;
return
b
(
i
,
j
,
d
,
f
)}}}
for
(
var
c
,
d
=
this
,
e
=
b
(
this
.
offsetLeft
,
this
.
offsetTop
,
this
.
offsetWidth
,
this
.
offsetHeight
);
j
.
isElement
(
c
=
d
.
parentNode
);){
var
f
=
c
.
offsetLeft
+
c
.
clientLeft
,
i
=
c
.
offsetTop
+
c
.
clientTop
,
e
=
e
.
relativeFromTo
(
d
,
c
).
translate
(
-
f
,
-
i
);
c
.
scrollLeft
=!
1
===
a
||
e
.
left
<=
c
.
scrollLeft
+
c
.
clientWidth
&&
c
.
scrollLeft
<=
e
.
right
-
c
.
clientWidth
+
c
.
clientWidth
?
Math
.
min
(
e
.
left
,
Math
.
max
(
e
.
right
-
c
.
clientWidth
,
c
.
scrollLeft
)):(
e
.
right
-
c
.
clientWidth
+
e
.
left
)
/
2
;
c
.
scrollTop
=
!
1
===
a
||
e
.
top
<=
c
.
scrollTop
+
c
.
clientHeight
&&
c
.
scrollTop
<=
e
.
bottom
-
c
.
clientHeight
+
c
.
clientHeight
?
Math
.
min
(
e
.
top
,
Math
.
max
(
e
.
bottom
-
c
.
clientHeight
,
c
.
scrollTop
)):(
e
.
bottom
-
c
.
clientHeight
+
e
.
top
)
/
2
;
e
=
e
.
translate
(
f
-
c
.
scrollLeft
,
i
-
c
.
scrollTop
);
d
=
c
}};
b
.
scrollIntoViewIfNeeded
()}},
setFirstNode
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
.
length
>
0
)
c
[
0
].
isFirstNode
=!
0
},
setLastNode
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
.
length
>
0
)
c
[
c
.
length
-
1
].
isLastNode
=!
0
},
removeNode
:
function
(
a
,
b
){
var
c
=
e
.
getRoot
(
a
),
d
=
b
.
parentTId
?
b
.
getParentNode
():
c
;
b
.
isFirstNode
=!
1
;
b
.
isLastNode
=!
1
;
b
.
getPreNode
=
function
(){
return
null
};
b
.
getNextNode
=
function
(){
return
null
};
if
(
e
.
getNodeCache
(
a
,
b
.
tId
)){
l
(
b
,
a
).
remove
();
e
.
removeNodeCache
(
a
,
b
);
e
.
removeSelectedNode
(
a
,
b
);
for
(
var
g
=
e
.
nodeChildren
(
a
,
d
),
h
=
0
,
k
=
g
.
length
;
h
<
k
;
h
++
)
if
(
g
[
h
].
tId
==
b
.
tId
){
g
.
splice
(
h
,
1
);
break
}
i
.
setFirstNode
(
a
,
d
);
i
.
setLastNode
(
a
,
d
);
var
j
,
h
=
g
.
length
;
if
(
!
a
.
data
.
keep
.
parent
&&
h
==
0
)
e
.
nodeIsParent
(
a
,
d
,
!
1
),
d
.
open
=!
1
,
delete
d
[
a
.
data
.
key
.
children
],
h
=
l
(
d
,
f
.
id
.
UL
,
a
),
k
=
l
(
d
,
f
.
id
.
SWITCH
,
a
),
j
=
l
(
d
,
f
.
id
.
ICON
,
a
),
i
.
replaceSwitchClass
(
d
,
k
,
f
.
folder
.
DOCU
),
i
.
replaceIcoClass
(
d
,
j
,
f
.
folder
.
DOCU
),
h
.
css
(
"
display
"
,
"
none
"
);
else
if
(
a
.
view
.
showLine
&&
h
>
0
){
var
r
=
g
[
h
-
1
],
h
=
l
(
r
,
f
.
id
.
UL
,
a
),
k
=
l
(
r
,
f
.
id
.
SWITCH
,
a
);
j
=
l
(
r
,
f
.
id
.
ICON
,
a
);
d
==
c
?
g
.
length
==
1
?
i
.
replaceSwitchClass
(
r
,
k
,
f
.
line
.
ROOT
):(
c
=
l
(
g
[
0
],
f
.
id
.
SWITCH
,
a
),
i
.
replaceSwitchClass
(
g
[
0
],
c
,
f
.
line
.
ROOTS
),
i
.
replaceSwitchClass
(
r
,
k
,
f
.
line
.
BOTTOM
)):
i
.
replaceSwitchClass
(
r
,
k
,
f
.
line
.
BOTTOM
);
h
.
removeClass
(
f
.
line
.
LINE
)}}},
replaceIcoClass
:
function
(
a
,
b
,
c
){
if
(
b
&&!
a
.
isAjaxing
&&
(
a
=
b
.
attr
(
"
class
"
),
a
!=
void
0
)){
a
=
a
.
split
(
"
_
"
);
switch
(
c
){
case
f
.
folder
.
OPEN
:
case
f
.
folder
.
CLOSE
:
case
f
.
folder
.
DOCU
:
a
[
a
.
length
-
1
]
=
c
}
b
.
attr
(
"
class
"
,
a
.
join
(
"
_
"
))}},
replaceSwitchClass
:
function
(
a
,
b
,
c
){
if
(
b
){
var
d
=
b
.
attr
(
"
class
"
);
if
(
d
!=
void
0
){
d
=
d
.
split
(
"
_
"
);
switch
(
c
){
case
f
.
line
.
ROOT
:
case
f
.
line
.
ROOTS
:
case
f
.
line
.
CENTER
:
case
f
.
line
.
BOTTOM
:
case
f
.
line
.
NOLINE
:
d
[
0
]
=
i
.
makeNodeLineClassEx
(
a
)
+
c
;
break
;
case
f
.
folder
.
OPEN
:
case
f
.
folder
.
CLOSE
:
case
f
.
folder
.
DOCU
:
d
[
1
]
=
c
}
b
.
attr
(
"
class
"
,
d
.
join
(
"
_
"
));
c
!==
f
.
folder
.
DOCU
?
b
.
removeAttr
(
"
disabled
"
):
b
.
attr
(
"
disabled
"
,
"
disabled
"
)}}},
selectNode
:
function
(
a
,
b
,
c
){
c
||
i
.
cancelPreSelectedNode
(
a
,
null
,
b
);
l
(
b
,
f
.
id
.
A
,
a
).
addClass
(
f
.
node
.
CURSELECTED
);
e
.
addSelectedNode
(
a
,
b
);
a
.
treeObj
.
trigger
(
f
.
event
.
SELECTED
,[
a
.
treeId
,
b
])},
setNodeFontCss
:
function
(
a
,
b
){
var
c
=
l
(
b
,
f
.
id
.
A
,
a
),
d
=
i
.
makeNodeFontCss
(
a
,
b
);
d
&&
c
.
css
(
d
)},
setNodeLineIcos
:
function
(
a
,
b
){
if
(
b
){
var
c
=
l
(
b
,
f
.
id
.
SWITCH
,
a
),
d
=
l
(
b
,
f
.
id
.
UL
,
a
),
g
=
l
(
b
,
f
.
id
.
ICON
,
a
),
h
=
i
.
makeUlLineClass
(
a
,
b
);
h
.
length
==
0
?
d
.
removeClass
(
f
.
line
.
LINE
):
d
.
addClass
(
h
);
c
.
attr
(
"
class
"
,
i
.
makeNodeLineClass
(
a
,
b
));
e
.
nodeIsParent
(
a
,
b
)?
c
.
removeAttr
(
"
disabled
"
):
c
.
attr
(
"
disabled
"
,
"
disabled
"
);
g
.
removeAttr
(
"
style
"
);
g
.
attr
(
"
style
"
,
i
.
makeNodeIcoStyle
(
a
,
b
));
g
.
attr
(
"
class
"
,
i
.
makeNodeIcoClass
(
a
,
b
))}},
setNodeName
:
function
(
a
,
b
){
var
c
=
e
.
nodeTitle
(
a
,
b
),
d
=
l
(
b
,
f
.
id
.
SPAN
,
a
);
d
.
empty
();
a
.
view
.
nameIsHTML
?
d
.
html
(
e
.
nodeName
(
a
,
b
)):
d
.
text
(
e
.
nodeName
(
a
,
b
));
j
.
apply
(
a
.
view
.
showTitle
,[
a
.
treeId
,
b
],
a
.
view
.
showTitle
)
&&
l
(
b
,
f
.
id
.
A
,
a
).
attr
(
"
title
"
,
!
c
?
""
:
c
)},
setNodeTarget
:
function
(
a
,
b
){
l
(
b
,
f
.
id
.
A
,
a
).
attr
(
"
target
"
,
i
.
makeNodeTarget
(
b
))},
setNodeUrl
:
function
(
a
,
b
){
var
c
=
l
(
b
,
f
.
id
.
A
,
a
),
d
=
i
.
makeNodeUrl
(
a
,
b
);
d
==
null
||
d
.
length
==
0
?
c
.
removeAttr
(
"
href
"
):
c
.
attr
(
"
href
"
,
d
)},
switchNode
:
function
(
a
,
b
){
b
.
open
||!
j
.
canAsync
(
a
,
b
)?
i
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
):
a
.
async
.
enable
?
i
.
asyncNode
(
a
,
b
)
||
i
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
):
b
&&
i
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
)}};
q
.
fn
.
zTree
=
{
consts
:{
className
:{
BUTTON
:
"
button
"
,
LEVEL
:
"
level
"
,
ICO_LOADING
:
"
ico_loading
"
,
SWITCH
:
"
switch
"
,
NAME
:
"
node_name
"
},
event
:{
NODECREATED
:
"
ztree_nodeCreated
"
,
CLICK
:
"
ztree_click
"
,
EXPAND
:
"
ztree_expand
"
,
COLLAPSE
:
"
ztree_collapse
"
,
ASYNC_SUCCESS
:
"
ztree_async_success
"
,
ASYNC_ERROR
:
"
ztree_async_error
"
,
REMOVE
:
"
ztree_remove
"
,
SELECTED
:
"
ztree_selected
"
,
UNSELECTED
:
"
ztree_unselected
"
},
id
:{
A
:
"
_a
"
,
ICON
:
"
_ico
"
,
SPAN
:
"
_span
"
,
SWITCH
:
"
_switch
"
,
UL
:
"
_ul
"
},
line
:{
ROOT
:
"
root
"
,
ROOTS
:
"
roots
"
,
CENTER
:
"
center
"
,
BOTTOM
:
"
bottom
"
,
NOLINE
:
"
noline
"
,
LINE
:
"
line
"
},
folder
:{
OPEN
:
"
open
"
,
CLOSE
:
"
close
"
,
DOCU
:
"
docu
"
},
node
:{
CURSELECTED
:
"
curSelectedNode
"
}},
_z
:{
tools
:
j
,
view
:
i
,
event
:
n
,
data
:
e
},
getZTreeObj
:
function
(
a
){
return
(
a
=
e
.
getZTreeTools
(
a
))?
a
:
null
},
destroy
:
function
(
a
){
if
(
a
&&
a
.
length
>
0
)
i
.
destroy
(
e
.
getSetting
(
a
));
else
for
(
var
b
in
s
)
i
.
destroy
(
s
[
b
])},
init
:
function
(
a
,
b
,
c
){
var
d
=
j
.
clone
(
N
);
q
.
extend
(
!
0
,
d
,
b
);
d
.
treeId
=
a
.
attr
(
"
id
"
);
d
.
treeObj
=
a
;
d
.
treeObj
.
empty
();
s
[
d
.
treeId
]
=
d
;
if
(
typeof
document
.
body
.
style
.
maxHeight
===
"
undefined
"
)
d
.
view
.
expandSpeed
=
""
;
e
.
initRoot
(
d
);
a
=
e
.
getRoot
(
d
);
c
=
c
?
j
.
clone
(
j
.
isArray
(
c
)?
c
:[
c
]):[];
d
.
data
.
simpleData
.
enable
?
e
.
nodeChildren
(
d
,
a
,
e
.
transformTozTreeFormat
(
d
,
c
)):
e
.
nodeChildren
(
d
,
a
,
c
);
e
.
initCache
(
d
);
n
.
unbindTree
(
d
);
n
.
bindTree
(
d
);
n
.
unbindEvent
(
d
);
n
.
bindEvent
(
d
);
var
g
=
{
setting
:
d
,
addNodes
:
function
(
a
,
b
,
c
,
g
){
function
f
(){
i
.
addNodes
(
d
,
a
,
b
,
n
,
g
==!
0
)}
a
||
(
a
=
null
);
var
l
=
e
.
nodeIsParent
(
d
,
a
);
if
(
a
&&!
l
&&
d
.
data
.
keep
.
leaf
)
return
null
;
l
=
parseInt
(
b
,
10
);
isNaN
(
l
)?(
g
=!!
c
,
c
=
b
,
b
=-
1
):
b
=
l
;
if
(
!
c
)
return
null
;
var
n
=
j
.
clone
(
j
.
isArray
(
c
)?
c
:[
c
]);
j
.
canAsync
(
d
,
a
)?
i
.
asyncNode
(
d
,
a
,
g
,
f
):
f
();
return
n
},
cancelSelectedNode
:
function
(
a
){
i
.
cancelPreSelectedNode
(
d
,
a
)},
destroy
:
function
(){
i
.
destroy
(
d
)},
expandAll
:
function
(
a
){
a
=!!
a
;
i
.
expandCollapseSonNode
(
d
,
null
,
a
,
!
0
);
return
a
},
expandNode
:
function
(
a
,
b
,
c
,
g
,
f
){
function
n
(){
var
b
=
l
(
a
,
d
).
get
(
0
);
b
&&
g
!==!
1
&&
i
.
scrollIntoView
(
d
,
b
)}
if
(
!
a
||!
e
.
nodeIsParent
(
d
,
a
))
return
null
;
b
!==!
0
&&
b
!==!
1
&&
(
b
=!
a
.
open
);
if
((
f
=!!
f
)
&&
b
&&
j
.
apply
(
d
.
callback
.
beforeExpand
,[
d
.
treeId
,
a
],
!
0
)
==!
1
)
return
null
;
else
if
(
f
&&!
b
&&
j
.
apply
(
d
.
callback
.
beforeCollapse
,[
d
.
treeId
,
a
],
!
0
)
==!
1
)
return
null
;
b
&&
a
.
parentTId
&&
i
.
expandCollapseParentNode
(
d
,
a
.
getParentNode
(),
b
,
!
1
);
if
(
b
===
a
.
open
&&!
c
)
return
null
;
e
.
getRoot
(
d
).
expandTriggerFlag
=
f
;
!
j
.
canAsync
(
d
,
a
)
&&
c
?
i
.
expandCollapseSonNode
(
d
,
a
,
b
,
!
0
,
n
):(
a
.
open
=!
b
,
i
.
switchNode
(
this
.
setting
,
a
),
n
());
return
b
},
getNodes
:
function
(){
return
e
.
getNodes
(
d
)},
getNodeByParam
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodeByParam
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodeByTId
:
function
(
a
){
return
e
.
getNodeCache
(
d
,
a
)},
getNodesByParam
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodesByParam
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodesByParamFuzzy
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodesByParamFuzzy
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodesByFilter
:
function
(
a
,
b
,
c
,
f
){
b
=!!
b
;
return
!
a
||
typeof
a
!=
"
function
"
?
b
?
null
:[]:
e
.
getNodesByFilter
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
,
f
)},
getNodeIndex
:
function
(
a
){
if
(
!
a
)
return
null
;
for
(
var
b
=
a
.
parentTId
?
a
.
getParentNode
():
e
.
getRoot
(
d
),
b
=
e
.
nodeChildren
(
d
,
b
),
c
=
0
,
f
=
b
.
length
;
c
<
f
;
c
++
)
if
(
b
[
c
]
==
a
)
return
c
;
return
-
1
},
getSelectedNodes
:
function
(){
for
(
var
a
=
[],
b
=
e
.
getRoot
(
d
).
curSelectedList
,
c
=
0
,
f
=
b
.
length
;
c
<
f
;
c
++
)
a
.
push
(
b
[
c
]);
return
a
},
isSelectedNode
:
function
(
a
){
return
e
.
isSelectedNode
(
d
,
a
)},
reAsyncChildNodesPromise
:
function
(
a
,
b
,
c
){
return
new
Promise
(
function
(
d
,
e
){
try
{
g
.
reAsyncChildNodes
(
a
,
b
,
c
,
function
(){
d
(
a
)})}
catch
(
f
){
e
(
f
)}})},
reAsyncChildNodes
:
function
(
a
,
b
,
c
,
g
){
if
(
this
.
setting
.
async
.
enable
){
var
j
=!
a
;
j
&&
(
a
=
e
.
getRoot
(
d
));
if
(
b
==
"
refresh
"
){
for
(
var
b
=
e
.
nodeChildren
(
d
,
a
),
n
=
0
,
q
=
b
?
b
.
length
:
0
;
n
<
q
;
n
++
)
e
.
removeNodeCache
(
d
,
b
[
n
]);
e
.
removeSelectedNode
(
d
);
e
.
nodeChildren
(
d
,
a
,[]);
j
?
this
.
setting
.
treeObj
.
empty
():
l
(
a
,
f
.
id
.
UL
,
d
).
empty
()}
i
.
asyncNode
(
this
.
setting
,
j
?
null
:
a
,
!!
c
,
g
)}},
refresh
:
function
(){
this
.
setting
.
treeObj
.
empty
();
var
a
=
e
.
getRoot
(
d
),
b
=
e
.
nodeChildren
(
d
,
a
);
e
.
initRoot
(
d
);
e
.
nodeChildren
(
d
,
a
,
b
);
e
.
initCache
(
d
);
i
.
createNodes
(
d
,
0
,
e
.
nodeChildren
(
d
,
a
),
null
,
-
1
)},
removeChildNodes
:
function
(
a
){
if
(
!
a
)
return
null
;
var
b
=
e
.
nodeChildren
(
d
,
a
);
i
.
removeChildNodes
(
d
,
a
);
return
b
?
b
:
null
},
removeNode
:
function
(
a
,
b
){
a
&&
(
b
=!!
b
,
b
&&
j
.
apply
(
d
.
callback
.
beforeRemove
,[
d
.
treeId
,
a
],
!
0
)
==!
1
||
(
i
.
removeNode
(
d
,
a
),
b
&&
this
.
setting
.
treeObj
.
trigger
(
f
.
event
.
REMOVE
,[
d
.
treeId
,
a
])))},
selectNode
:
function
(
a
,
b
,
c
){
function
e
(){
if
(
!
c
){
var
b
=
l
(
a
,
d
).
get
(
0
);
i
.
scrollIntoView
(
d
,
b
)}}
if
(
a
&&
j
.
uCanDo
(
d
)){
b
=
d
.
view
.
selectedMulti
&&
b
;
if
(
a
.
parentTId
)
i
.
expandCollapseParentNode
(
d
,
a
.
getParentNode
(),
!
0
,
!
1
,
e
);
else
if
(
!
c
)
try
{
l
(
a
,
d
).
focus
().
blur
()}
catch
(
f
){}
i
.
selectNode
(
d
,
a
,
b
)}},
transformTozTreeNodes
:
function
(
a
){
return
e
.
transformTozTreeFormat
(
d
,
a
)},
transformToArray
:
function
(
a
){
return
e
.
transformToArrayFormat
(
d
,
a
)},
updateNode
:
function
(
a
){
a
&&
l
(
a
,
d
).
get
(
0
)
&&
j
.
uCanDo
(
d
)
&&
(
i
.
setNodeName
(
d
,
a
),
i
.
setNodeTarget
(
d
,
a
),
i
.
setNodeUrl
(
d
,
a
),
i
.
setNodeLineIcos
(
d
,
a
),
i
.
setNodeFontCss
(
d
,
a
))}};
a
.
treeTools
=
g
;
e
.
setZTreeTools
(
d
,
g
);(
c
=
e
.
nodeChildren
(
d
,
a
))
&&
c
.
length
>
0
?
i
.
createNodes
(
d
,
0
,
c
,
null
,
-
1
):
d
.
async
.
enable
&&
d
.
async
.
url
&&
d
.
async
.
url
!==
""
&&
i
.
asyncNode
(
d
);
return
g
}};
var
O
=
q
.
fn
.
zTree
,
l
=
j
.
$
,
f
=
O
.
consts
})(
jQuery
);
(
function
(
r
){
var
J
,
K
,
L
,
M
,
N
,
O
,
v
,
t
=
{},
w
=
{},
x
=
{},
P
=
{
treeId
:
""
,
treeObj
:
null
,
view
:{
addDiyDom
:
null
,
autoCancelSelected
:
!
0
,
dblClickExpand
:
!
0
,
expandSpeed
:
"
fast
"
,
fontCss
:{},
nameIsHTML
:
!
1
,
selectedMulti
:
!
0
,
showIcon
:
!
0
,
showLine
:
!
0
,
showTitle
:
!
0
,
txtSelectedEnable
:
!
1
},
data
:{
key
:{
isParent
:
"
isParent
"
,
children
:
"
children
"
,
name
:
"
name
"
,
title
:
""
,
url
:
"
url
"
,
icon
:
"
icon
"
},
simpleData
:{
enable
:
!
1
,
idKey
:
"
id
"
,
pIdKey
:
"
pId
"
,
rootPId
:
null
},
keep
:{
parent
:
!
1
,
leaf
:
!
1
}},
async
:{
enable
:
!
1
,
contentType
:
"
application/x-www-form-urlencoded
"
,
type
:
"
post
"
,
dataType
:
"
text
"
,
headers
:{},
xhrFields
:{},
url
:
""
,
autoParam
:[],
otherParam
:[],
dataFilter
:
null
},
callback
:{
beforeAsync
:
null
,
beforeClick
:
null
,
beforeDblClick
:
null
,
beforeRightClick
:
null
,
beforeMouseDown
:
null
,
beforeMouseUp
:
null
,
beforeExpand
:
null
,
beforeCollapse
:
null
,
beforeRemove
:
null
,
onAsyncError
:
null
,
onAsyncSuccess
:
null
,
onNodeCreated
:
null
,
onClick
:
null
,
onDblClick
:
null
,
onRightClick
:
null
,
onMouseDown
:
null
,
onMouseUp
:
null
,
onExpand
:
null
,
onCollapse
:
null
,
onRemove
:
null
}},
y
=
[
function
(
a
){
var
b
=
a
.
treeObj
,
c
=
g
.
event
;
b
.
bind
(
c
.
NODECREATED
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onNodeCreated
,[
b
,
c
,
i
])});
b
.
bind
(
c
.
CLICK
,
function
(
b
,
c
,
i
,
e
,
k
){
h
.
apply
(
a
.
callback
.
onClick
,[
c
,
i
,
e
,
k
])});
b
.
bind
(
c
.
EXPAND
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onExpand
,[
b
,
c
,
i
])});
b
.
bind
(
c
.
COLLAPSE
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onCollapse
,[
b
,
c
,
i
])});
b
.
bind
(
c
.
ASYNC_SUCCESS
,
function
(
b
,
c
,
i
,
e
){
h
.
apply
(
a
.
callback
.
onAsyncSuccess
,[
b
,
c
,
i
,
e
])});
b
.
bind
(
c
.
ASYNC_ERROR
,
function
(
b
,
c
,
i
,
e
,
k
,
g
){
h
.
apply
(
a
.
callback
.
onAsyncError
,[
b
,
c
,
i
,
e
,
k
,
g
])});
b
.
bind
(
c
.
REMOVE
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onRemove
,
[
b
,
c
,
i
])});
b
.
bind
(
c
.
SELECTED
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onSelected
,[
c
,
i
])});
b
.
bind
(
c
.
UNSELECTED
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onUnSelected
,[
c
,
i
])})}],
z
=
[
function
(
a
){
var
b
=
g
.
event
;
a
.
treeObj
.
unbind
(
b
.
NODECREATED
).
unbind
(
b
.
CLICK
).
unbind
(
b
.
EXPAND
).
unbind
(
b
.
COLLAPSE
).
unbind
(
b
.
ASYNC_SUCCESS
).
unbind
(
b
.
ASYNC_ERROR
).
unbind
(
b
.
REMOVE
).
unbind
(
b
.
SELECTED
).
unbind
(
b
.
UNSELECTED
)}],
A
=
[
function
(
a
){
var
b
=
e
.
getCache
(
a
);
b
||
(
b
=
{},
e
.
setCache
(
a
,
b
));
b
.
nodes
=
[];
b
.
doms
=
[]}],
B
=
[
function
(
a
,
b
,
c
,
d
,
f
,
i
){
if
(
c
){
var
m
=
e
.
getRoot
(
a
),
k
=
e
.
nodeChildren
(
a
,
c
);
c
.
level
=
b
;
c
.
tId
=
a
.
treeId
+
"
_
"
+
++
m
.
zId
;
c
.
parentTId
=
d
?
d
.
tId
:
null
;
c
.
open
=
typeof
c
.
open
==
"
string
"
?
h
.
eqs
(
c
.
open
,
"
true
"
):
!!
c
.
open
;
b
=
e
.
nodeIsParent
(
a
,
c
);
h
.
isArray
(
k
)
&&!
(
b
===!
1
||
typeof
b
==
"
string
"
&&
h
.
eqs
(
b
,
"
false
"
))?(
e
.
nodeIsParent
(
a
,
c
,
!
0
),
c
.
zAsync
=!
0
):(
b
=
e
.
nodeIsParent
(
a
,
c
,
b
),
c
.
open
=
b
&&!
a
.
async
.
enable
?
c
.
open
:
!
1
,
c
.
zAsync
=!
b
);
c
.
isFirstNode
=
f
;
c
.
isLastNode
=
i
;
c
.
getParentNode
=
function
(){
return
e
.
getNodeCache
(
a
,
c
.
parentTId
)};
c
.
getPreNode
=
function
(){
return
e
.
getPreNode
(
a
,
c
)};
c
.
getNextNode
=
function
(){
return
e
.
getNextNode
(
a
,
c
)};
c
.
getIndex
=
function
(){
return
e
.
getNodeIndex
(
a
,
c
)};
c
.
getPath
=
function
(){
return
e
.
getNodePath
(
a
,
c
)};
c
.
isAjaxing
=!
1
;
e
.
fixPIdKeyValue
(
a
,
c
)}}],
u
=
[
function
(
a
){
var
b
=
a
.
target
,
c
=
e
.
getSetting
(
a
.
data
.
treeId
),
d
=
""
,
f
=
null
,
i
=
""
,
m
=
""
,
k
=
null
,
j
=
null
,
o
=
null
;
if
(
h
.
eqs
(
a
.
type
,
"
mousedown
"
))
m
=
"
mousedown
"
;
else
if
(
h
.
eqs
(
a
.
type
,
"
mouseup
"
))
m
=
"
mouseup
"
;
else
if
(
h
.
eqs
(
a
.
type
,
"
contextmenu
"
))
m
=
"
contextmenu
"
;
else
if
(
h
.
eqs
(
a
.
type
,
"
click
"
))
if
(
h
.
eqs
(
b
.
tagName
,
"
span
"
)
&&
b
.
getAttribute
(
"
treeNode
"
+
g
.
id
.
SWITCH
)
!==
null
)
d
=
h
.
getNodeMainDom
(
b
).
id
,
i
=
"
switchNode
"
;
else
{
if
(
o
=
h
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
g
.
id
.
A
}]))
d
=
h
.
getNodeMainDom
(
o
).
id
,
i
=
"
clickNode
"
}
else
if
(
h
.
eqs
(
a
.
type
,
"
dblclick
"
)
&&
(
m
=
"
dblclick
"
,
o
=
h
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
g
.
id
.
A
}])))
d
=
h
.
getNodeMainDom
(
o
).
id
,
i
=
"
switchNode
"
;
if
(
m
.
length
>
0
&&
d
.
length
==
0
&&
(
o
=
h
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
g
.
id
.
A
}])))
d
=
h
.
getNodeMainDom
(
o
).
id
;
if
(
d
.
length
>
0
)
switch
(
f
=
e
.
getNodeCache
(
c
,
d
),
i
){
case
"
switchNode
"
:
e
.
nodeIsParent
(
c
,
f
)?
h
.
eqs
(
a
.
type
,
"
click
"
)
||
h
.
eqs
(
a
.
type
,
"
dblclick
"
)
&&
h
.
apply
(
c
.
view
.
dblClickExpand
,[
c
.
treeId
,
f
],
c
.
view
.
dblClickExpand
)?
k
=
J
:
i
=
""
:
i
=
""
;
break
;
case
"
clickNode
"
:
k
=
K
}
switch
(
m
){
case
"
mousedown
"
:
j
=
L
;
break
;
case
"
mouseup
"
:
j
=
M
;
break
;
case
"
dblclick
"
:
j
=
N
;
break
;
case
"
contextmenu
"
:
j
=
O
}
return
{
stop
:
!
1
,
node
:
f
,
nodeEventType
:
i
,
nodeEventCallback
:
k
,
treeEventType
:
m
,
treeEventCallback
:
j
}}],
C
=
[
function
(
a
){
var
b
=
e
.
getRoot
(
a
);
b
||
(
b
=
{},
e
.
setRoot
(
a
,
b
));
e
.
nodeChildren
(
a
,
b
,[]);
b
.
expandTriggerFlag
=!
1
;
b
.
curSelectedList
=
[];
b
.
noSelection
=
!
0
;
b
.
createdNodes
=
[];
b
.
zId
=
0
;
b
.
_ver
=
(
new
Date
).
getTime
()}],
D
=
[],
E
=
[],
F
=
[],
G
=
[],
H
=
[],
e
=
{
addNodeCache
:
function
(
a
,
b
){
e
.
getCache
(
a
).
nodes
[
e
.
getNodeCacheId
(
b
.
tId
)]
=
b
},
getNodeCacheId
:
function
(
a
){
return
a
.
substring
(
a
.
lastIndexOf
(
"
_
"
)
+
1
)},
addAfterA
:
function
(
a
){
E
.
push
(
a
)},
addBeforeA
:
function
(
a
){
D
.
push
(
a
)},
addInnerAfterA
:
function
(
a
){
G
.
push
(
a
)},
addInnerBeforeA
:
function
(
a
){
F
.
push
(
a
)},
addInitBind
:
function
(
a
){
y
.
push
(
a
)},
addInitUnBind
:
function
(
a
){
z
.
push
(
a
)},
addInitCache
:
function
(
a
){
A
.
push
(
a
)},
addInitNode
:
function
(
a
){
B
.
push
(
a
)},
addInitProxy
:
function
(
a
,
b
){
b
?
u
.
splice
(
0
,
0
,
a
):
u
.
push
(
a
)},
addInitRoot
:
function
(
a
){
C
.
push
(
a
)},
addNodesData
:
function
(
a
,
b
,
c
,
d
){
var
f
=
e
.
nodeChildren
(
a
,
b
);
f
?
c
>=
f
.
length
&&
(
c
=-
1
):(
f
=
e
.
nodeChildren
(
a
,
b
,[]),
c
=-
1
);
if
(
f
.
length
>
0
&&
c
===
0
)
f
[
0
].
isFirstNode
=!
1
,
j
.
setNodeLineIcos
(
a
,
f
[
0
]);
else
if
(
f
.
length
>
0
&&
c
<
0
)
f
[
f
.
length
-
1
].
isLastNode
=!
1
,
j
.
setNodeLineIcos
(
a
,
f
[
f
.
length
-
1
]);
e
.
nodeIsParent
(
a
,
b
,
!
0
);
c
<
0
?
e
.
nodeChildren
(
a
,
b
,
f
.
concat
(
d
)):(
a
=
[
c
,
0
].
concat
(
d
),
f
.
splice
.
apply
(
f
,
a
))},
addSelectedNode
:
function
(
a
,
b
){
var
c
=
e
.
getRoot
(
a
);
e
.
isSelectedNode
(
a
,
b
)
||
c
.
curSelectedList
.
push
(
b
)},
addCreatedNode
:
function
(
a
,
b
){(
a
.
callback
.
onNodeCreated
||
a
.
view
.
addDiyDom
)
&&
e
.
getRoot
(
a
).
createdNodes
.
push
(
b
)},
addZTreeTools
:
function
(
a
){
H
.
push
(
a
)},
exSetting
:
function
(
a
){
r
.
extend
(
!
0
,
P
,
a
)},
fixPIdKeyValue
:
function
(
a
,
b
){
a
.
data
.
simpleData
.
enable
&&
(
b
[
a
.
data
.
simpleData
.
pIdKey
]
=
b
.
parentTId
?
b
.
getParentNode
()[
a
.
data
.
simpleData
.
idKey
]:
a
.
data
.
simpleData
.
rootPId
)},
getAfterA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
E
.
length
;
d
<
e
;
d
++
)
E
[
d
].
apply
(
this
,
arguments
)},
getBeforeA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
D
.
length
;
d
<
e
;
d
++
)
D
[
d
].
apply
(
this
,
arguments
)},
getInnerAfterA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
G
.
length
;
d
<
e
;
d
++
)
G
[
d
].
apply
(
this
,
arguments
)},
getInnerBeforeA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
F
.
length
;
d
<
e
;
d
++
)
F
[
d
].
apply
(
this
,
arguments
)},
getCache
:
function
(
a
){
return
x
[
a
.
treeId
]},
getNodeIndex
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
f
=
c
.
length
-
1
;
d
<=
f
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
;
return
-
1
},
getNextNode
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
f
=
c
.
length
-
1
;
d
<=
f
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
==
f
?
null
:
c
[
d
+
1
];
return
null
},
getNodeByParam
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
null
;
for
(
var
f
=
0
,
i
=
b
.
length
;
f
<
i
;
f
++
){
var
m
=
b
[
f
];
if
(
m
[
c
]
==
d
)
return
b
[
f
];
m
=
e
.
nodeChildren
(
a
,
m
);
if
(
m
=
e
.
getNodeByParam
(
a
,
m
,
c
,
d
))
return
m
}
return
null
},
getNodeCache
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
var
c
=
x
[
a
.
treeId
].
nodes
[
e
.
getNodeCacheId
(
b
)];
return
c
?
c
:
null
},
getNodePath
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
var
c
;
(
c
=
b
.
parentTId
?
b
.
getParentNode
().
getPath
():[])
&&
c
.
push
(
b
);
return
c
},
getNodes
:
function
(
a
){
return
e
.
nodeChildren
(
a
,
e
.
getRoot
(
a
))},
getNodesByParam
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
[];
for
(
var
f
=
[],
i
=
0
,
m
=
b
.
length
;
i
<
m
;
i
++
){
var
k
=
b
[
i
];
k
[
c
]
==
d
&&
f
.
push
(
k
);
k
=
e
.
nodeChildren
(
a
,
k
);
f
=
f
.
concat
(
e
.
getNodesByParam
(
a
,
k
,
c
,
d
))}
return
f
},
getNodesByParamFuzzy
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
[];
for
(
var
f
=
[],
d
=
d
.
toLowerCase
(),
i
=
0
,
m
=
b
.
length
;
i
<
m
;
i
++
){
var
k
=
b
[
i
];
typeof
k
[
c
]
==
"
string
"
&&
b
[
i
][
c
].
toLowerCase
().
indexOf
(
d
)
>-
1
&&
f
.
push
(
k
);
k
=
e
.
nodeChildren
(
a
,
k
);
f
=
f
.
concat
(
e
.
getNodesByParamFuzzy
(
a
,
k
,
c
,
d
))}
return
f
},
getNodesByFilter
:
function
(
a
,
b
,
c
,
d
,
f
){
if
(
!
b
)
return
d
?
null
:[];
for
(
var
i
=
d
?
null
:[],
m
=
0
,
k
=
b
.
length
;
m
<
k
;
m
++
){
var
g
=
b
[
m
];
if
(
h
.
apply
(
c
,[
g
,
f
],
!
1
)){
if
(
d
)
return
g
;
i
.
push
(
g
)}
g
=
e
.
nodeChildren
(
a
,
g
);
g
=
e
.
getNodesByFilter
(
a
,
g
,
c
,
d
,
f
);
if
(
d
&&
g
)
return
g
;
i
=
d
?
g
:
i
.
concat
(
g
)}
return
i
},
getPreNode
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
f
=
c
.
length
;
d
<
f
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
==
0
?
null
:
c
[
d
-
1
];
return
null
},
getRoot
:
function
(
a
){
return
a
?
w
[
a
.
treeId
]:
null
},
getRoots
:
function
(){
return
w
},
getSetting
:
function
(
a
){
return
t
[
a
]},
getSettings
:
function
(){
return
t
},
getZTreeTools
:
function
(
a
){
return
(
a
=
this
.
getRoot
(
this
.
getSetting
(
a
)))?
a
.
treeTools
:
null
},
initCache
:
function
(
a
){
for
(
var
b
=
0
,
c
=
A
.
length
;
b
<
c
;
b
++
)
A
[
b
].
apply
(
this
,
arguments
)},
initNode
:
function
(
a
,
b
,
c
,
d
,
e
,
i
){
for
(
var
m
=
0
,
g
=
B
.
length
;
m
<
g
;
m
++
)
B
[
m
].
apply
(
this
,
arguments
)},
initRoot
:
function
(
a
){
for
(
var
b
=
0
,
c
=
C
.
length
;
b
<
c
;
b
++
)
C
[
b
].
apply
(
this
,
arguments
)},
isSelectedNode
:
function
(
a
,
b
){
for
(
var
c
=
e
.
getRoot
(
a
),
d
=
0
,
f
=
c
.
curSelectedList
.
length
;
d
<
f
;
d
++
)
if
(
b
===
c
.
curSelectedList
[
d
])
return
!
0
;
return
!
1
},
nodeChildren
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
null
;
a
=
a
.
data
.
key
.
children
;
typeof
c
!==
"
undefined
"
&&
(
b
[
a
]
=
c
);
return
b
[
a
]},
nodeIsParent
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
!
1
;
a
=
a
.
data
.
key
.
isParent
;
typeof
c
!==
"
undefined
"
&&
(
typeof
c
===
"
string
"
&&
(
c
=
h
.
eqs
(
c
,
"
true
"
)),
b
[
a
]
=!!
c
);
return
b
[
a
]},
nodeName
:
function
(
a
,
b
,
c
){
a
=
a
.
data
.
key
.
name
;
typeof
c
!==
"
undefined
"
&&
(
b
[
a
]
=
c
);
return
""
+
b
[
a
]},
nodeTitle
:
function
(
a
,
b
){
return
""
+
b
[
a
.
data
.
key
.
title
===
""
?
a
.
data
.
key
.
name
:
a
.
data
.
key
.
title
]},
removeNodeCache
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
)
for
(
var
d
=
0
,
f
=
c
.
length
;
d
<
f
;
d
++
)
e
.
removeNodeCache
(
a
,
c
[
d
]);
e
.
getCache
(
a
).
nodes
[
e
.
getNodeCacheId
(
b
.
tId
)]
=
null
},
removeSelectedNode
:
function
(
a
,
b
){
for
(
var
c
=
e
.
getRoot
(
a
),
d
=
0
,
f
=
c
.
curSelectedList
.
length
;
d
<
f
;
d
++
)
if
(
b
===
c
.
curSelectedList
[
d
]
||!
e
.
getNodeCache
(
a
,
c
.
curSelectedList
[
d
].
tId
))
c
.
curSelectedList
.
splice
(
d
,
1
),
a
.
treeObj
.
trigger
(
g
.
event
.
UNSELECTED
,[
a
.
treeId
,
b
]),
d
--
,
f
--
},
setCache
:
function
(
a
,
b
){
x
[
a
.
treeId
]
=
b
},
setRoot
:
function
(
a
,
b
){
w
[
a
.
treeId
]
=
b
},
setZTreeTools
:
function
(
a
,
b
){
for
(
var
c
=
0
,
d
=
H
.
length
;
c
<
d
;
c
++
)
H
[
c
].
apply
(
this
,
arguments
)},
transformToArrayFormat
:
function
(
a
,
b
){
function
c
(
b
){
d
.
push
(
b
);(
b
=
e
.
nodeChildren
(
a
,
b
))
&&
(
d
=
d
.
concat
(
e
.
transformToArrayFormat
(
a
,
b
)))}
if
(
!
b
)
return
[];
var
d
=
[];
if
(
h
.
isArray
(
b
))
for
(
var
f
=
0
,
i
=
b
.
length
;
f
<
i
;
f
++
)
c
(
b
[
f
]);
else
c
(
b
);
return
d
},
transformTozTreeFormat
:
function
(
a
,
b
){
var
c
,
d
,
f
=
a
.
data
.
simpleData
.
idKey
,
i
=
a
.
data
.
simpleData
.
pIdKey
;
if
(
!
f
||
f
==
""
||!
b
)
return
[];
if
(
h
.
isArray
(
b
)){
var
g
=
[],
k
=
{};
for
(
c
=
0
,
d
=
b
.
length
;
c
<
d
;
c
++
)
k
[
b
[
c
][
f
]]
=
b
[
c
];
for
(
c
=
0
,
d
=
b
.
length
;
c
<
d
;
c
++
){
var
j
=
k
[
b
[
c
][
i
]];
if
(
j
&&
b
[
c
][
f
]
!=
b
[
c
][
i
]){
var
o
=
e
.
nodeChildren
(
a
,
j
);
o
||
(
o
=
e
.
nodeChildren
(
a
,
j
,[]));
o
.
push
(
b
[
c
])}
else
g
.
push
(
b
[
c
])}
return
g
}
else
return
[
b
]}},
n
=
{
bindEvent
:
function
(
a
){
for
(
var
b
=
0
,
c
=
y
.
length
;
b
<
c
;
b
++
)
y
[
b
].
apply
(
this
,
arguments
)},
unbindEvent
:
function
(
a
){
for
(
var
b
=
0
,
c
=
z
.
length
;
b
<
c
;
b
++
)
z
[
b
].
apply
(
this
,
arguments
)},
bindTree
:
function
(
a
){
var
b
=
{
treeId
:
a
.
treeId
},
c
=
a
.
treeObj
;
a
.
view
.
txtSelectedEnable
||
c
.
bind
(
"
selectstart
"
,
v
).
css
({
"
-moz-user-select
"
:
"
-moz-none
"
});
c
.
bind
(
"
click
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
dblclick
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseover
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseout
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mousedown
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseup
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
contextmenu
"
,
b
,
n
.
proxy
)},
unbindTree
:
function
(
a
){
a
.
treeObj
.
unbind
(
"
selectstart
"
,
v
).
unbind
(
"
click
"
,
n
.
proxy
).
unbind
(
"
dblclick
"
,
n
.
proxy
).
unbind
(
"
mouseover
"
,
n
.
proxy
).
unbind
(
"
mouseout
"
,
n
.
proxy
).
unbind
(
"
mousedown
"
,
n
.
proxy
).
unbind
(
"
mouseup
"
,
n
.
proxy
).
unbind
(
"
contextmenu
"
,
n
.
proxy
)},
doProxy
:
function
(
a
){
for
(
var
b
=
[],
c
=
0
,
d
=
u
.
length
;
c
<
d
;
c
++
){
var
e
=
u
[
c
].
apply
(
this
,
arguments
);
b
.
push
(
e
);
if
(
e
.
stop
)
break
}
return
b
},
proxy
:
function
(
a
){
var
b
=
e
.
getSetting
(
a
.
data
.
treeId
);
if
(
!
h
.
uCanDo
(
b
,
a
))
return
!
0
;
for
(
var
b
=
n
.
doProxy
(
a
),
c
=!
0
,
d
=
0
,
f
=
b
.
length
;
d
<
f
;
d
++
){
var
i
=
b
[
d
];
i
.
nodeEventCallback
&&
(
c
=
i
.
nodeEventCallback
.
apply
(
i
,[
a
,
i
.
node
])
&&
c
);
i
.
treeEventCallback
&&
(
c
=
i
.
treeEventCallback
.
apply
(
i
,[
a
,
i
.
node
])
&&
c
)}
return
c
}};
J
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
if
(
b
.
open
){
if
(
h
.
apply
(
c
.
callback
.
beforeCollapse
,[
c
.
treeId
,
b
],
!
0
)
==
!
1
)
return
!
0
}
else
if
(
h
.
apply
(
c
.
callback
.
beforeExpand
,[
c
.
treeId
,
b
],
!
0
)
==!
1
)
return
!
0
;
e
.
getRoot
(
c
).
expandTriggerFlag
=!
0
;
j
.
switchNode
(
c
,
b
);
return
!
0
};
K
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
),
d
=
c
.
view
.
autoCancelSelected
&&
(
a
.
ctrlKey
||
a
.
metaKey
)
&&
e
.
isSelectedNode
(
c
,
b
)?
0
:
c
.
view
.
autoCancelSelected
&&
(
a
.
ctrlKey
||
a
.
metaKey
)
&&
c
.
view
.
selectedMulti
?
2
:
1
;
if
(
h
.
apply
(
c
.
callback
.
beforeClick
,[
c
.
treeId
,
b
,
d
],
!
0
)
==!
1
)
return
!
0
;
d
===
0
?
j
.
cancelPreSelectedNode
(
c
,
b
):
j
.
selectNode
(
c
,
b
,
d
===
2
);
c
.
treeObj
.
trigger
(
g
.
event
.
CLICK
,
[
a
,
c
.
treeId
,
b
,
d
]);
return
!
0
};
L
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
h
.
apply
(
c
.
callback
.
beforeMouseDown
,[
c
.
treeId
,
b
],
!
0
)
&&
h
.
apply
(
c
.
callback
.
onMouseDown
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
M
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
h
.
apply
(
c
.
callback
.
beforeMouseUp
,[
c
.
treeId
,
b
],
!
0
)
&&
h
.
apply
(
c
.
callback
.
onMouseUp
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
N
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
h
.
apply
(
c
.
callback
.
beforeDblClick
,[
c
.
treeId
,
b
],
!
0
)
&&
h
.
apply
(
c
.
callback
.
onDblClick
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
O
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
h
.
apply
(
c
.
callback
.
beforeRightClick
,[
c
.
treeId
,
b
],
!
0
)
&&
h
.
apply
(
c
.
callback
.
onRightClick
,[
a
,
c
.
treeId
,
b
]);
return
typeof
c
.
callback
.
onRightClick
!=
"
function
"
};
v
=
function
(
a
){
a
=
a
.
originalEvent
.
srcElement
.
nodeName
.
toLowerCase
();
return
a
===
"
input
"
||
a
===
"
textarea
"
};
var
h
=
{
apply
:
function
(
a
,
b
,
c
){
return
typeof
a
==
"
function
"
?
a
.
apply
(
Q
,
b
?
b
:[]):
c
},
canAsync
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
),
d
=
e
.
nodeIsParent
(
a
,
b
);
return
a
.
async
.
enable
&&
b
&&
d
&&!
(
b
.
zAsync
||
c
&&
c
.
length
>
0
)},
clone
:
function
(
a
){
if
(
a
===
null
)
return
null
;
var
b
=
h
.
isArray
(
a
)?[]:{},
c
;
for
(
c
in
a
)
b
[
c
]
=
a
[
c
]
instanceof
Date
?
new
Date
(
a
[
c
].
getTime
()):
typeof
a
[
c
]
===
"
object
"
?
h
.
clone
(
a
[
c
]):
a
[
c
];
return
b
},
eqs
:
function
(
a
,
b
){
return
a
.
toLowerCase
()
===
b
.
toLowerCase
()},
isArray
:
function
(
a
){
return
Object
.
prototype
.
toString
.
apply
(
a
)
===
"
[object Array]
"
},
isElement
:
function
(
a
){
return
typeof
HTMLElement
===
"
object
"
?
a
instanceof
HTMLElement
:
a
&&
typeof
a
===
"
object
"
&&
a
!==
null
&&
a
.
nodeType
===
1
&&
typeof
a
.
nodeName
===
"
string
"
},
$
:
function
(
a
,
b
,
c
){
b
&&
typeof
b
!=
"
string
"
&&
(
c
=
b
,
b
=
""
);
return
typeof
a
==
"
string
"
?
r
(
a
,
c
?
c
.
treeObj
.
get
(
0
).
ownerDocument
:
null
):
r
(
"
#
"
+
a
.
tId
+
b
,
c
?
c
.
treeObj
:
null
)},
getMDom
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
null
;
for
(;
b
&&
b
.
id
!==
a
.
treeId
;){
for
(
var
d
=
0
,
e
=
c
.
length
;
b
.
tagName
&&
d
<
e
;
d
++
)
if
(
h
.
eqs
(
b
.
tagName
,
c
[
d
].
tagName
)
&&
b
.
getAttribute
(
c
[
d
].
attrName
)
!==
null
)
return
b
;
b
=
b
.
parentNode
}
return
null
},
getNodeMainDom
:
function
(
a
){
return
r
(
a
).
parent
(
"
li
"
).
get
(
0
)
||
r
(
a
).
parentsUntil
(
"
li
"
).
parent
().
get
(
0
)},
isChildOrSelf
:
function
(
a
,
b
){
return
r
(
a
).
closest
(
"
#
"
+
b
).
length
>
0
},
uCanDo
:
function
(){
return
!
0
}},
j
=
{
addNodes
:
function
(
a
,
b
,
c
,
d
,
f
){
var
i
=
e
.
nodeIsParent
(
a
,
b
);
if
(
!
a
.
data
.
keep
.
leaf
||!
b
||
i
)
if
(
h
.
isArray
(
d
)
||
(
d
=
[
d
]),
a
.
data
.
simpleData
.
enable
&&
(
d
=
e
.
transformTozTreeFormat
(
a
,
d
)),
b
){
var
i
=
l
(
b
,
g
.
id
.
SWITCH
,
a
),
m
=
l
(
b
,
g
.
id
.
ICON
,
a
),
k
=
l
(
b
,
g
.
id
.
UL
,
a
);
if
(
!
b
.
open
)
j
.
replaceSwitchClass
(
b
,
i
,
g
.
folder
.
CLOSE
),
j
.
replaceIcoClass
(
b
,
m
,
g
.
folder
.
CLOSE
),
b
.
open
=!
1
,
k
.
css
({
display
:
"
none
"
});
e
.
addNodesData
(
a
,
b
,
c
,
d
);
j
.
createNodes
(
a
,
b
.
level
+
1
,
d
,
b
,
c
);
f
||
j
.
expandCollapseParentNode
(
a
,
b
,
!
0
)}
else
e
.
addNodesData
(
a
,
e
.
getRoot
(
a
),
c
,
d
),
j
.
createNodes
(
a
,
0
,
d
,
null
,
c
)},
appendNodes
:
function
(
a
,
b
,
c
,
d
,
f
,
i
,
g
){
if
(
!
c
)
return
[];
var
k
=
[],
h
=
d
?
d
:
e
.
getRoot
(
a
),
h
=
e
.
nodeChildren
(
a
,
h
),
o
,
l
;
if
(
!
h
||
f
>=
h
.
length
-
c
.
length
)
f
=-
1
;
for
(
var
s
=
0
,
n
=
c
.
length
;
s
<
n
;
s
++
){
var
p
=
c
[
s
];
i
&&
(
o
=
(
f
===
0
||
h
.
length
==
c
.
length
)
&&
s
==
0
,
l
=
f
<
0
&&
s
==
c
.
length
-
1
,
e
.
initNode
(
a
,
b
,
p
,
d
,
o
,
l
,
g
),
e
.
addNodeCache
(
a
,
p
));
o
=
e
.
nodeIsParent
(
a
,
p
);
l
=
[];
var
I
=
e
.
nodeChildren
(
a
,
p
);
I
&&
I
.
length
>
0
&&
(
l
=
j
.
appendNodes
(
a
,
b
+
1
,
I
,
p
,
-
1
,
i
,
g
&&
p
.
open
));
g
&&
(
j
.
makeDOMNodeMainBefore
(
k
,
a
,
p
),
j
.
makeDOMNodeLine
(
k
,
a
,
p
),
e
.
getBeforeA
(
a
,
p
,
k
),
j
.
makeDOMNodeNameBefore
(
k
,
a
,
p
),
e
.
getInnerBeforeA
(
a
,
p
,
k
),
j
.
makeDOMNodeIcon
(
k
,
a
,
p
),
e
.
getInnerAfterA
(
a
,
p
,
k
),
j
.
makeDOMNodeNameAfter
(
k
,
a
,
p
),
e
.
getAfterA
(
a
,
p
,
k
),
o
&&
p
.
open
&&
j
.
makeUlHtml
(
a
,
p
,
k
,
l
.
join
(
""
)),
j
.
makeDOMNodeMainAfter
(
k
,
a
,
p
),
e
.
addCreatedNode
(
a
,
p
))}
return
k
},
appendParentULDom
:
function
(
a
,
b
){
var
c
=
[],
d
=
l
(
b
,
a
);
!
d
.
get
(
0
)
&&
b
.
parentTId
&&
(
j
.
appendParentULDom
(
a
,
b
.
getParentNode
()),
d
=
l
(
b
,
a
));
var
f
=
l
(
b
,
g
.
id
.
UL
,
a
);
f
.
get
(
0
)
&&
f
.
remove
();
f
=
e
.
nodeChildren
(
a
,
b
);
f
=
j
.
appendNodes
(
a
,
b
.
level
+
1
,
f
,
b
,
-
1
,
!
1
,
!
0
);
j
.
makeUlHtml
(
a
,
b
,
c
,
f
.
join
(
""
));
d
.
append
(
c
.
join
(
""
))},
asyncNode
:
function
(
a
,
b
,
c
,
d
){
var
f
,
i
;
f
=
e
.
nodeIsParent
(
a
,
b
);
if
(
b
&&!
f
)
return
h
.
apply
(
d
),
!
1
;
else
if
(
b
&&
b
.
isAjaxing
)
return
!
1
;
else
if
(
h
.
apply
(
a
.
callback
.
beforeAsync
,[
a
.
treeId
,
b
],
!
0
)
==!
1
)
return
h
.
apply
(
d
),
!
1
;
if
(
b
)
b
.
isAjaxing
=!
0
,
l
(
b
,
g
.
id
.
ICON
,
a
).
attr
({
style
:
""
,
"
class
"
:
g
.
className
.
BUTTON
+
"
"
+
g
.
className
.
ICO_LOADING
});
var
m
=
{},
k
=
h
.
apply
(
a
.
async
.
autoParam
,[
a
.
treeId
,
b
],
a
.
async
.
autoParam
);
for
(
f
=
0
,
i
=
k
.
length
;
b
&&
f
<
i
;
f
++
){
var
q
=
k
[
f
].
split
(
"
=
"
),
o
=
q
;
q
.
length
>
1
&&
(
o
=
q
[
1
],
q
=
q
[
0
]);
m
[
o
]
=
b
[
q
]}
k
=
h
.
apply
(
a
.
async
.
otherParam
,[
a
.
treeId
,
b
],
a
.
async
.
otherParam
);
if
(
h
.
isArray
(
k
))
for
(
f
=
0
,
i
=
k
.
length
;
f
<
i
;
f
+=
2
)
m
[
k
[
f
]]
=
k
[
f
+
1
];
else
for
(
var
n
in
k
)
m
[
n
]
=
k
[
n
];
var
s
=
e
.
getRoot
(
a
).
_ver
;
r
.
ajax
({
contentType
:
a
.
async
.
contentType
,
cache
:
!
1
,
type
:
a
.
async
.
type
,
url
:
h
.
apply
(
a
.
async
.
url
,[
a
.
treeId
,
b
],
a
.
async
.
url
),
data
:
a
.
async
.
contentType
.
indexOf
(
"
application/json
"
)
>-
1
?
JSON
.
stringify
(
m
):
m
,
dataType
:
a
.
async
.
dataType
,
headers
:
a
.
async
.
headers
,
xhrFields
:
a
.
async
.
xhrFields
,
success
:
function
(
i
){
if
(
s
==
e
.
getRoot
(
a
).
_ver
){
var
f
=
[];
try
{
f
=!
i
||
i
.
length
==
0
?[]:
typeof
i
==
"
string
"
?
eval
(
"
(
"
+
i
+
"
)
"
):
i
}
catch
(
k
){
f
=
i
}
if
(
b
)
b
.
isAjaxing
=
null
,
b
.
zAsync
=!
0
;
j
.
setNodeLineIcos
(
a
,
b
);
f
&&
f
!==
""
?(
f
=
h
.
apply
(
a
.
async
.
dataFilter
,[
a
.
treeId
,
b
,
f
],
f
),
j
.
addNodes
(
a
,
b
,
-
1
,
f
?
h
.
clone
(
f
):[],
!!
c
)):
j
.
addNodes
(
a
,
b
,
-
1
,[],
!!
c
);
a
.
treeObj
.
trigger
(
g
.
event
.
ASYNC_SUCCESS
,[
a
.
treeId
,
b
,
i
]);
h
.
apply
(
d
)}},
error
:
function
(
c
,
d
,
i
){
if
(
s
==
e
.
getRoot
(
a
).
_ver
){
if
(
b
)
b
.
isAjaxing
=
null
;
j
.
setNodeLineIcos
(
a
,
b
);
a
.
treeObj
.
trigger
(
g
.
event
.
ASYNC_ERROR
,[
a
.
treeId
,
b
,
c
,
d
,
i
])}}});
return
!
0
},
cancelPreSelectedNode
:
function
(
a
,
b
,
c
){
var
d
=
e
.
getRoot
(
a
).
curSelectedList
,
f
,
i
;
for
(
f
=
d
.
length
-
1
;
f
>=
0
;
f
--
)
if
(
i
=
d
[
f
],
b
===
i
||!
b
&&
(
!
c
||
c
!==
i
))
if
(
l
(
i
,
g
.
id
.
A
,
a
).
removeClass
(
g
.
node
.
CURSELECTED
),
b
){
e
.
removeSelectedNode
(
a
,
b
);
break
}
else
d
.
splice
(
f
,
1
),
a
.
treeObj
.
trigger
(
g
.
event
.
UNSELECTED
,[
a
.
treeId
,
i
])},
createNodeCallback
:
function
(
a
){
if
(
a
.
callback
.
onNodeCreated
||
a
.
view
.
addDiyDom
)
for
(
var
b
=
e
.
getRoot
(
a
);
b
.
createdNodes
.
length
>
0
;){
var
c
=
b
.
createdNodes
.
shift
();
h
.
apply
(
a
.
view
.
addDiyDom
,[
a
.
treeId
,
c
]);
a
.
callback
.
onNodeCreated
&&
a
.
treeObj
.
trigger
(
g
.
event
.
NODECREATED
,[
a
.
treeId
,
c
])}},
createNodes
:
function
(
a
,
b
,
c
,
d
,
f
){
if
(
c
&&
c
.
length
!=
0
){
var
i
=
e
.
getRoot
(
a
),
m
=!
d
||
d
.
open
||!!
l
(
e
.
nodeChildren
(
a
,
d
)[
0
],
a
).
get
(
0
);
i
.
createdNodes
=
[];
var
b
=
j
.
appendNodes
(
a
,
b
,
c
,
d
,
f
,
!
0
,
m
),
k
,
h
;
d
?(
d
=
l
(
d
,
g
.
id
.
UL
,
a
),
d
.
get
(
0
)
&&
(
k
=
d
)):
k
=
a
.
treeObj
;
k
&&
(
f
>=
0
&&
(
h
=
k
.
children
()[
f
]),
f
>=
0
&&
h
?
r
(
h
).
before
(
b
.
join
(
""
)):
k
.
append
(
b
.
join
(
""
)));
j
.
createNodeCallback
(
a
)}},
destroy
:
function
(
a
){
a
&&
(
e
.
initCache
(
a
),
e
.
initRoot
(
a
),
n
.
unbindTree
(
a
),
n
.
unbindEvent
(
a
),
a
.
treeObj
.
empty
(),
delete
t
[
a
.
treeId
])},
expandCollapseNode
:
function
(
a
,
b
,
c
,
d
,
f
){
var
i
=
e
.
getRoot
(
a
),
m
;
if
(
b
){
var
k
=
e
.
nodeChildren
(
a
,
b
),
q
=
e
.
nodeIsParent
(
a
,
b
);
if
(
i
.
expandTriggerFlag
)
m
=
f
,
f
=
function
(){
m
&&
m
();
b
.
open
?
a
.
treeObj
.
trigger
(
g
.
event
.
EXPAND
,[
a
.
treeId
,
b
]):
a
.
treeObj
.
trigger
(
g
.
event
.
COLLAPSE
,[
a
.
treeId
,
b
])},
i
.
expandTriggerFlag
=!
1
;
if
(
!
b
.
open
&&
q
&&
(
!
l
(
b
,
g
.
id
.
UL
,
a
).
get
(
0
)
||
k
&&
k
.
length
>
0
&&!
l
(
k
[
0
],
a
).
get
(
0
)))
j
.
appendParentULDom
(
a
,
b
),
j
.
createNodeCallback
(
a
);
if
(
b
.
open
==
c
)
h
.
apply
(
f
,[]);
else
{
var
c
=
l
(
b
,
g
.
id
.
UL
,
a
),
i
=
l
(
b
,
g
.
id
.
SWITCH
,
a
),
o
=
l
(
b
,
g
.
id
.
ICON
,
a
);
q
?(
b
.
open
=!
b
.
open
,
b
.
iconOpen
&&
b
.
iconClose
&&
o
.
attr
(
"
style
"
,
j
.
makeNodeIcoStyle
(
a
,
b
)),
b
.
open
?(
j
.
replaceSwitchClass
(
b
,
i
,
g
.
folder
.
OPEN
),
j
.
replaceIcoClass
(
b
,
o
,
g
.
folder
.
OPEN
),
d
==!
1
||
a
.
view
.
expandSpeed
==
""
?(
c
.
show
(),
h
.
apply
(
f
,[])):
k
&&
k
.
length
>
0
?
c
.
slideDown
(
a
.
view
.
expandSpeed
,
f
):(
c
.
show
(),
h
.
apply
(
f
,[]))):(
j
.
replaceSwitchClass
(
b
,
i
,
g
.
folder
.
CLOSE
),
j
.
replaceIcoClass
(
b
,
o
,
g
.
folder
.
CLOSE
),
d
==!
1
||
a
.
view
.
expandSpeed
==
""
||!
(
k
&&
k
.
length
>
0
)?(
c
.
hide
(),
h
.
apply
(
f
,[])):
c
.
slideUp
(
a
.
view
.
expandSpeed
,
f
))):
h
.
apply
(
f
,[])}}
else
h
.
apply
(
f
,
[])},
expandCollapseParentNode
:
function
(
a
,
b
,
c
,
d
,
e
){
b
&&
(
b
.
parentTId
?(
j
.
expandCollapseNode
(
a
,
b
,
c
,
d
),
b
.
parentTId
&&
j
.
expandCollapseParentNode
(
a
,
b
.
getParentNode
(),
c
,
d
,
e
)):
j
.
expandCollapseNode
(
a
,
b
,
c
,
d
,
e
))},
expandCollapseSonNode
:
function
(
a
,
b
,
c
,
d
,
f
){
var
i
=
e
.
getRoot
(
a
),
i
=
b
?
e
.
nodeChildren
(
a
,
b
):
e
.
nodeChildren
(
a
,
i
),
g
=
b
?
!
1
:
d
,
k
=
e
.
getRoot
(
a
).
expandTriggerFlag
;
e
.
getRoot
(
a
).
expandTriggerFlag
=!
1
;
if
(
i
)
for
(
var
h
=
0
,
l
=
i
.
length
;
h
<
l
;
h
++
)
i
[
h
]
&&
j
.
expandCollapseSonNode
(
a
,
i
[
h
],
c
,
g
);
e
.
getRoot
(
a
).
expandTriggerFlag
=
k
;
j
.
expandCollapseNode
(
a
,
b
,
c
,
d
,
f
)},
isSelectedNode
:
function
(
a
,
b
){
if
(
!
b
)
return
!
1
;
var
c
=
e
.
getRoot
(
a
).
curSelectedList
,
d
;
for
(
d
=
c
.
length
-
1
;
d
>=
0
;
d
--
)
if
(
b
===
c
[
d
])
return
!
0
;
return
!
1
},
makeDOMNodeIcon
:
function
(
a
,
b
,
c
){
var
d
=
e
.
nodeName
(
b
,
c
),
d
=
b
.
view
.
nameIsHTML
?
d
:
d
.
replace
(
/&/g
,
"
&
"
).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
);
a
.
push
(
"
<span id='
"
,
c
.
tId
,
g
.
id
.
ICON
,
"
' title='' treeNode
"
,
g
.
id
.
ICON
,
"
class='
"
,
j
.
makeNodeIcoClass
(
b
,
c
),
"
' style='
"
,
j
.
makeNodeIcoStyle
(
b
,
c
),
"
'></span><span id='
"
,
c
.
tId
,
g
.
id
.
SPAN
,
"
' class='
"
,
g
.
className
.
NAME
,
"
'>
"
,
d
,
"
</span>
"
)},
makeDOMNodeLine
:
function
(
a
,
b
,
c
){
a
.
push
(
"
<span id='
"
,
c
.
tId
,
g
.
id
.
SWITCH
,
"
' title='' class='
"
,
j
.
makeNodeLineClass
(
b
,
c
),
"
' treeNode
"
,
g
.
id
.
SWITCH
,
"
></span>
"
)},
makeDOMNodeMainAfter
:
function
(
a
){
a
.
push
(
"
</li>
"
)},
makeDOMNodeMainBefore
:
function
(
a
,
b
,
c
){
a
.
push
(
"
<li id='
"
,
c
.
tId
,
"
' class='
"
,
g
.
className
.
LEVEL
,
c
.
level
,
"
' tabindex='0' hidefocus='true' treenode>
"
)},
makeDOMNodeNameAfter
:
function
(
a
){
a
.
push
(
"
</a>
"
)},
makeDOMNodeNameBefore
:
function
(
a
,
b
,
c
){
var
d
=
e
.
nodeTitle
(
b
,
c
),
f
=
j
.
makeNodeUrl
(
b
,
c
),
i
=
j
.
makeNodeFontCss
(
b
,
c
),
m
=
[],
k
;
for
(
k
in
i
)
m
.
push
(
k
,
"
:
"
,
i
[
k
],
"
;
"
);
a
.
push
(
"
<a id='
"
,
c
.
tId
,
g
.
id
.
A
,
"
' class='
"
,
g
.
className
.
LEVEL
,
c
.
level
,
"
' treeNode
"
,
g
.
id
.
A
,
'
onclick="
'
,
c
.
click
||
""
,
'
"
'
,
f
!=
null
&&
f
.
length
>
0
?
"
href='
"
+
f
+
"
'
"
:
""
,
"
target='
"
,
j
.
makeNodeTarget
(
c
),
"
' style='
"
,
m
.
join
(
""
),
"
'
"
);
h
.
apply
(
b
.
view
.
showTitle
,[
b
.
treeId
,
c
],
b
.
view
.
showTitle
)
&&
d
&&
a
.
push
(
"
title='
"
,
d
.
replace
(
/'/g
,
"
'
"
).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
),
"
'
"
);
a
.
push
(
"
>
"
)},
makeNodeFontCss
:
function
(
a
,
b
){
var
c
=
h
.
apply
(
a
.
view
.
fontCss
,[
a
.
treeId
,
b
],
a
.
view
.
fontCss
);
return
c
&&
typeof
c
!=
"
function
"
?
c
:{}},
makeNodeIcoClass
:
function
(
a
,
b
){
var
c
=
[
"
ico
"
];
if
(
!
b
.
isAjaxing
){
var
d
=
e
.
nodeIsParent
(
a
,
b
);
c
[
0
]
=
(
b
.
iconSkin
?
b
.
iconSkin
+
"
_
"
:
""
)
+
c
[
0
];
d
?
c
.
push
(
b
.
open
?
g
.
folder
.
OPEN
:
g
.
folder
.
CLOSE
):
c
.
push
(
g
.
folder
.
DOCU
)}
return
g
.
className
.
BUTTON
+
"
"
+
c
.
join
(
"
_
"
)},
makeNodeIcoStyle
:
function
(
a
,
b
){
var
c
=
[];
if
(
!
b
.
isAjaxing
){
var
d
=
e
.
nodeIsParent
(
a
,
b
)
&&
b
.
iconOpen
&&
b
.
iconClose
?
b
.
open
?
b
.
iconOpen
:
b
.
iconClose
:
b
[
a
.
data
.
key
.
icon
];
d
&&
c
.
push
(
"
background:url(
"
,
d
,
"
) 0 0 no-repeat;
"
);(
a
.
view
.
showIcon
==
!
1
||!
h
.
apply
(
a
.
view
.
showIcon
,[
a
.
treeId
,
b
],
!
0
))
&&
c
.
push
(
"
width:0px;height:0px;
"
)}
return
c
.
join
(
""
)},
makeNodeLineClass
:
function
(
a
,
b
){
var
c
=
[];
a
.
view
.
showLine
?
b
.
level
==
0
&&
b
.
isFirstNode
&&
b
.
isLastNode
?
c
.
push
(
g
.
line
.
ROOT
):
b
.
level
==
0
&&
b
.
isFirstNode
?
c
.
push
(
g
.
line
.
ROOTS
):
b
.
isLastNode
?
c
.
push
(
g
.
line
.
BOTTOM
):
c
.
push
(
g
.
line
.
CENTER
):
c
.
push
(
g
.
line
.
NOLINE
);
e
.
nodeIsParent
(
a
,
b
)?
c
.
push
(
b
.
open
?
g
.
folder
.
OPEN
:
g
.
folder
.
CLOSE
):
c
.
push
(
g
.
folder
.
DOCU
);
return
j
.
makeNodeLineClassEx
(
b
)
+
c
.
join
(
"
_
"
)},
makeNodeLineClassEx
:
function
(
a
){
return
g
.
className
.
BUTTON
+
"
"
+
g
.
className
.
LEVEL
+
a
.
level
+
"
"
+
g
.
className
.
SWITCH
+
"
"
},
makeNodeTarget
:
function
(
a
){
return
a
.
target
||
"
_blank
"
},
makeNodeUrl
:
function
(
a
,
b
){
var
c
=
a
.
data
.
key
.
url
;
return
b
[
c
]?
b
[
c
]:
null
},
makeUlHtml
:
function
(
a
,
b
,
c
,
d
){
c
.
push
(
"
<ul id='
"
,
b
.
tId
,
g
.
id
.
UL
,
"
' class='
"
,
g
.
className
.
LEVEL
,
b
.
level
,
"
"
,
j
.
makeUlLineClass
(
a
,
b
),
"
' style='display:
"
,
b
.
open
?
"
block
"
:
"
none
"
,
"
'>
"
);
c
.
push
(
d
);
c
.
push
(
"
</ul>
"
)},
makeUlLineClass
:
function
(
a
,
b
){
return
a
.
view
.
showLine
&&!
b
.
isLastNode
?
g
.
line
.
LINE
:
""
},
removeChildNodes
:
function
(
a
,
b
){
if
(
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
){
for
(
var
d
=
0
,
f
=
c
.
length
;
d
<
f
;
d
++
)
e
.
removeNodeCache
(
a
,
c
[
d
]);
e
.
removeSelectedNode
(
a
);
delete
b
[
a
.
data
.
key
.
children
];
a
.
data
.
keep
.
parent
?
l
(
b
,
g
.
id
.
UL
,
a
).
empty
():(
e
.
nodeIsParent
(
a
,
b
,
!
1
),
b
.
open
=!
1
,
c
=
l
(
b
,
g
.
id
.
SWITCH
,
a
),
d
=
l
(
b
,
g
.
id
.
ICON
,
a
),
j
.
replaceSwitchClass
(
b
,
c
,
g
.
folder
.
DOCU
),
j
.
replaceIcoClass
(
b
,
d
,
g
.
folder
.
DOCU
),
l
(
b
,
g
.
id
.
UL
,
a
).
remove
())}}},
scrollIntoView
:
function
(
a
,
b
){
if
(
b
)
if
(
typeof
Element
===
"
undefined
"
){
var
c
=
a
.
treeObj
.
get
(
0
).
getBoundingClientRect
(),
d
=
b
.
getBoundingClientRect
();(
d
.
top
<
c
.
top
||
d
.
bottom
>
c
.
bottom
||
d
.
right
>
c
.
right
||
d
.
left
<
c
.
left
)
&&
b
.
scrollIntoView
()}
else
{
if
(
!
Element
.
prototype
.
scrollIntoViewIfNeeded
)
Element
.
prototype
.
scrollIntoViewIfNeeded
=
function
(
a
){
function
b
(
a
,
c
){
return
{
start
:
a
,
length
:
c
,
end
:
a
+
c
}}
function
c
(
b
,
d
){
return
!
1
===
a
||
d
.
start
<
b
.
end
&&
b
.
start
<
d
.
end
?
Math
.
max
(
b
.
end
-
d
.
length
,
Math
.
min
(
d
.
start
,
b
.
start
)):(
b
.
start
+
b
.
end
-
d
.
length
)
/
2
}
function
d
(
a
,
b
){
return
{
x
:
a
,
y
:
b
,
translate
:
function
(
c
,
i
){
return
d
(
a
+
c
,
b
+
i
)}}}
function
e
(
a
,
b
){
for
(;
a
;)
b
=
b
.
translate
(
a
.
offsetLeft
,
a
.
offsetTop
),
a
=
a
.
offsetParent
;
return
b
}
for
(
var
g
=
e
(
this
,
d
(
0
,
0
)),
j
=
d
(
this
.
offsetWidth
,
this
.
offsetHeight
),
h
=
this
.
parentNode
,
l
;
h
instanceof
HTMLElement
;)
l
=
e
(
h
,
d
(
h
.
clientLeft
,
h
.
clientTop
)),
h
.
scrollLeft
=
c
(
b
(
g
.
x
-
l
.
x
,
j
.
x
),
b
(
h
.
scrollLeft
,
h
.
clientWidth
)),
h
.
scrollTop
=
c
(
b
(
g
.
y
-
l
.
y
,
j
.
y
),
b
(
h
.
scrollTop
,
h
.
clientHeight
)),
g
=
g
.
translate
(
-
h
.
scrollLeft
,
-
h
.
scrollTop
),
h
=
h
.
parentNode
};
b
.
scrollIntoViewIfNeeded
()}},
setFirstNode
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
.
length
>
0
)
c
[
0
].
isFirstNode
=!
0
},
setLastNode
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
.
length
>
0
)
c
[
c
.
length
-
1
].
isLastNode
=!
0
},
removeNode
:
function
(
a
,
b
){
var
c
=
e
.
getRoot
(
a
),
d
=
b
.
parentTId
?
b
.
getParentNode
():
c
;
b
.
isFirstNode
=!
1
;
b
.
isLastNode
=!
1
;
b
.
getPreNode
=
function
(){
return
null
};
b
.
getNextNode
=
function
(){
return
null
};
if
(
e
.
getNodeCache
(
a
,
b
.
tId
)){
l
(
b
,
a
).
remove
();
e
.
removeNodeCache
(
a
,
b
);
e
.
removeSelectedNode
(
a
,
b
);
for
(
var
f
=
e
.
nodeChildren
(
a
,
d
),
i
=
0
,
h
=
f
.
length
;
i
<
h
;
i
++
)
if
(
f
[
i
].
tId
==
b
.
tId
){
f
.
splice
(
i
,
1
);
break
}
j
.
setFirstNode
(
a
,
d
);
j
.
setLastNode
(
a
,
d
);
var
k
,
i
=
f
.
length
;
if
(
!
a
.
data
.
keep
.
parent
&&
i
==
0
)
e
.
nodeIsParent
(
a
,
d
,
!
1
),
d
.
open
=!
1
,
delete
d
[
a
.
data
.
key
.
children
],
i
=
l
(
d
,
g
.
id
.
UL
,
a
),
h
=
l
(
d
,
g
.
id
.
SWITCH
,
a
),
k
=
l
(
d
,
g
.
id
.
ICON
,
a
),
j
.
replaceSwitchClass
(
d
,
h
,
g
.
folder
.
DOCU
),
j
.
replaceIcoClass
(
d
,
k
,
g
.
folder
.
DOCU
),
i
.
css
(
"
display
"
,
"
none
"
);
else
if
(
a
.
view
.
showLine
&&
i
>
0
){
var
q
=
f
[
i
-
1
],
i
=
l
(
q
,
g
.
id
.
UL
,
a
),
h
=
l
(
q
,
g
.
id
.
SWITCH
,
a
);
k
=
l
(
q
,
g
.
id
.
ICON
,
a
);
d
==
c
?
f
.
length
==
1
?
j
.
replaceSwitchClass
(
q
,
h
,
g
.
line
.
ROOT
):(
c
=
l
(
f
[
0
],
g
.
id
.
SWITCH
,
a
),
j
.
replaceSwitchClass
(
f
[
0
],
c
,
g
.
line
.
ROOTS
),
j
.
replaceSwitchClass
(
q
,
h
,
g
.
line
.
BOTTOM
)):
j
.
replaceSwitchClass
(
q
,
h
,
g
.
line
.
BOTTOM
);
i
.
removeClass
(
g
.
line
.
LINE
)}}},
replaceIcoClass
:
function
(
a
,
b
,
c
){
if
(
b
&&!
a
.
isAjaxing
&&
(
a
=
b
.
attr
(
"
class
"
),
a
!=
void
0
)){
a
=
a
.
split
(
"
_
"
);
switch
(
c
){
case
g
.
folder
.
OPEN
:
case
g
.
folder
.
CLOSE
:
case
g
.
folder
.
DOCU
:
a
[
a
.
length
-
1
]
=
c
}
b
.
attr
(
"
class
"
,
a
.
join
(
"
_
"
))}},
replaceSwitchClass
:
function
(
a
,
b
,
c
){
if
(
b
){
var
d
=
b
.
attr
(
"
class
"
);
if
(
d
!=
void
0
){
d
=
d
.
split
(
"
_
"
);
switch
(
c
){
case
g
.
line
.
ROOT
:
case
g
.
line
.
ROOTS
:
case
g
.
line
.
CENTER
:
case
g
.
line
.
BOTTOM
:
case
g
.
line
.
NOLINE
:
d
[
0
]
=
j
.
makeNodeLineClassEx
(
a
)
+
c
;
break
;
case
g
.
folder
.
OPEN
:
case
g
.
folder
.
CLOSE
:
case
g
.
folder
.
DOCU
:
d
[
1
]
=
c
}
b
.
attr
(
"
class
"
,
d
.
join
(
"
_
"
));
c
!==
g
.
folder
.
DOCU
?
b
.
removeAttr
(
"
disabled
"
):
b
.
attr
(
"
disabled
"
,
"
disabled
"
)}}},
selectNode
:
function
(
a
,
b
,
c
){
c
||
j
.
cancelPreSelectedNode
(
a
,
null
,
b
);
l
(
b
,
g
.
id
.
A
,
a
).
addClass
(
g
.
node
.
CURSELECTED
);
e
.
addSelectedNode
(
a
,
b
);
a
.
treeObj
.
trigger
(
g
.
event
.
SELECTED
,[
a
.
treeId
,
b
])},
setNodeFontCss
:
function
(
a
,
b
){
var
c
=
l
(
b
,
g
.
id
.
A
,
a
),
d
=
j
.
makeNodeFontCss
(
a
,
b
);
d
&&
c
.
css
(
d
)},
setNodeLineIcos
:
function
(
a
,
b
){
if
(
b
){
var
c
=
l
(
b
,
g
.
id
.
SWITCH
,
a
),
d
=
l
(
b
,
g
.
id
.
UL
,
a
),
f
=
l
(
b
,
g
.
id
.
ICON
,
a
),
i
=
j
.
makeUlLineClass
(
a
,
b
);
i
.
length
==
0
?
d
.
removeClass
(
g
.
line
.
LINE
):
d
.
addClass
(
i
);
c
.
attr
(
"
class
"
,
j
.
makeNodeLineClass
(
a
,
b
));
e
.
nodeIsParent
(
a
,
b
)?
c
.
removeAttr
(
"
disabled
"
):
c
.
attr
(
"
disabled
"
,
"
disabled
"
);
f
.
removeAttr
(
"
style
"
);
f
.
attr
(
"
style
"
,
j
.
makeNodeIcoStyle
(
a
,
b
));
f
.
attr
(
"
class
"
,
j
.
makeNodeIcoClass
(
a
,
b
))}},
setNodeName
:
function
(
a
,
b
){
var
c
=
e
.
nodeTitle
(
a
,
b
),
d
=
l
(
b
,
g
.
id
.
SPAN
,
a
);
d
.
empty
();
a
.
view
.
nameIsHTML
?
d
.
html
(
e
.
nodeName
(
a
,
b
)):
d
.
text
(
e
.
nodeName
(
a
,
b
));
h
.
apply
(
a
.
view
.
showTitle
,[
a
.
treeId
,
b
],
a
.
view
.
showTitle
)
&&
l
(
b
,
g
.
id
.
A
,
a
).
attr
(
"
title
"
,
!
c
?
""
:
c
)},
setNodeTarget
:
function
(
a
,
b
){
l
(
b
,
g
.
id
.
A
,
a
).
attr
(
"
target
"
,
j
.
makeNodeTarget
(
b
))},
setNodeUrl
:
function
(
a
,
b
){
var
c
=
l
(
b
,
g
.
id
.
A
,
a
),
d
=
j
.
makeNodeUrl
(
a
,
b
);
d
==
null
||
d
.
length
==
0
?
c
.
removeAttr
(
"
href
"
):
c
.
attr
(
"
href
"
,
d
)},
switchNode
:
function
(
a
,
b
){
b
.
open
||!
h
.
canAsync
(
a
,
b
)?
j
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
):
a
.
async
.
enable
?
j
.
asyncNode
(
a
,
b
)
||
j
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
):
b
&&
j
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
)}};
r
.
fn
.
zTree
=
{
consts
:{
className
:{
BUTTON
:
"
button
"
,
LEVEL
:
"
level
"
,
ICO_LOADING
:
"
ico_loading
"
,
SWITCH
:
"
switch
"
,
NAME
:
"
node_name
"
},
event
:{
NODECREATED
:
"
ztree_nodeCreated
"
,
CLICK
:
"
ztree_click
"
,
EXPAND
:
"
ztree_expand
"
,
COLLAPSE
:
"
ztree_collapse
"
,
ASYNC_SUCCESS
:
"
ztree_async_success
"
,
ASYNC_ERROR
:
"
ztree_async_error
"
,
REMOVE
:
"
ztree_remove
"
,
SELECTED
:
"
ztree_selected
"
,
UNSELECTED
:
"
ztree_unselected
"
},
id
:{
A
:
"
_a
"
,
ICON
:
"
_ico
"
,
SPAN
:
"
_span
"
,
SWITCH
:
"
_switch
"
,
UL
:
"
_ul
"
},
line
:{
ROOT
:
"
root
"
,
ROOTS
:
"
roots
"
,
CENTER
:
"
center
"
,
BOTTOM
:
"
bottom
"
,
NOLINE
:
"
noline
"
,
LINE
:
"
line
"
},
folder
:{
OPEN
:
"
open
"
,
CLOSE
:
"
close
"
,
DOCU
:
"
docu
"
},
node
:{
CURSELECTED
:
"
curSelectedNode
"
}},
_z
:{
tools
:
h
,
view
:
j
,
event
:
n
,
data
:
e
},
getZTreeObj
:
function
(
a
){
return
(
a
=
e
.
getZTreeTools
(
a
))?
a
:
null
},
destroy
:
function
(
a
){
if
(
a
&&
a
.
length
>
0
)
j
.
destroy
(
e
.
getSetting
(
a
));
else
for
(
var
b
in
t
)
j
.
destroy
(
t
[
b
])},
init
:
function
(
a
,
b
,
c
){
var
d
=
h
.
clone
(
P
);
r
.
extend
(
!
0
,
d
,
b
);
d
.
treeId
=
a
.
attr
(
"
id
"
);
d
.
treeObj
=
a
;
d
.
treeObj
.
empty
();
t
[
d
.
treeId
]
=
d
;
if
(
typeof
document
.
body
.
style
.
maxHeight
===
"
undefined
"
)
d
.
view
.
expandSpeed
=
""
;
e
.
initRoot
(
d
);
a
=
e
.
getRoot
(
d
);
c
=
c
?
h
.
clone
(
h
.
isArray
(
c
)?
c
:[
c
]):[];
d
.
data
.
simpleData
.
enable
?
e
.
nodeChildren
(
d
,
a
,
e
.
transformTozTreeFormat
(
d
,
c
)):
e
.
nodeChildren
(
d
,
a
,
c
);
e
.
initCache
(
d
);
n
.
unbindTree
(
d
);
n
.
bindTree
(
d
);
n
.
unbindEvent
(
d
);
n
.
bindEvent
(
d
);
var
f
=
{
setting
:
d
,
addNodes
:
function
(
a
,
b
,
c
,
f
){
function
g
(){
j
.
addNodes
(
d
,
a
,
b
,
n
,
f
==!
0
)}
a
||
(
a
=
null
);
var
l
=
e
.
nodeIsParent
(
d
,
a
);
if
(
a
&&!
l
&&
d
.
data
.
keep
.
leaf
)
return
null
;
l
=
parseInt
(
b
,
10
);
isNaN
(
l
)?(
f
=!!
c
,
c
=
b
,
b
=-
1
):
b
=
l
;
if
(
!
c
)
return
null
;
var
n
=
h
.
clone
(
h
.
isArray
(
c
)?
c
:[
c
]);
h
.
canAsync
(
d
,
a
)?
j
.
asyncNode
(
d
,
a
,
f
,
g
):
g
();
return
n
},
cancelSelectedNode
:
function
(
a
){
j
.
cancelPreSelectedNode
(
d
,
a
)},
destroy
:
function
(){
j
.
destroy
(
d
)},
expandAll
:
function
(
a
){
a
=!!
a
;
j
.
expandCollapseSonNode
(
d
,
null
,
a
,
!
0
);
return
a
},
expandNode
:
function
(
a
,
b
,
c
,
f
,
g
){
function
n
(){
var
b
=
l
(
a
,
d
).
get
(
0
);
b
&&
f
!==!
1
&&
j
.
scrollIntoView
(
d
,
b
)}
if
(
!
a
||!
e
.
nodeIsParent
(
d
,
a
))
return
null
;
b
!==!
0
&&
b
!==!
1
&&
(
b
=!
a
.
open
);
if
((
g
=!!
g
)
&&
b
&&
h
.
apply
(
d
.
callback
.
beforeExpand
,[
d
.
treeId
,
a
],
!
0
)
==!
1
)
return
null
;
else
if
(
g
&&!
b
&&
h
.
apply
(
d
.
callback
.
beforeCollapse
,[
d
.
treeId
,
a
],
!
0
)
==!
1
)
return
null
;
b
&&
a
.
parentTId
&&
j
.
expandCollapseParentNode
(
d
,
a
.
getParentNode
(),
b
,
!
1
);
if
(
b
===
a
.
open
&&!
c
)
return
null
;
e
.
getRoot
(
d
).
expandTriggerFlag
=
g
;
!
h
.
canAsync
(
d
,
a
)
&&
c
?
j
.
expandCollapseSonNode
(
d
,
a
,
b
,
!
0
,
n
):(
a
.
open
=!
b
,
j
.
switchNode
(
this
.
setting
,
a
),
n
());
return
b
},
getNodes
:
function
(){
return
e
.
getNodes
(
d
)},
getNodeByParam
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodeByParam
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodeByTId
:
function
(
a
){
return
e
.
getNodeCache
(
d
,
a
)},
getNodesByParam
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodesByParam
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodesByParamFuzzy
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodesByParamFuzzy
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodesByFilter
:
function
(
a
,
b
,
c
,
f
){
b
=!!
b
;
return
!
a
||
typeof
a
!=
"
function
"
?
b
?
null
:[]:
e
.
getNodesByFilter
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
,
f
)},
getNodeIndex
:
function
(
a
){
if
(
!
a
)
return
null
;
for
(
var
b
=
a
.
parentTId
?
a
.
getParentNode
():
e
.
getRoot
(
d
),
b
=
e
.
nodeChildren
(
d
,
b
),
c
=
0
,
f
=
b
.
length
;
c
<
f
;
c
++
)
if
(
b
[
c
]
==
a
)
return
c
;
return
-
1
},
getSelectedNodes
:
function
(){
for
(
var
a
=
[],
b
=
e
.
getRoot
(
d
).
curSelectedList
,
c
=
0
,
f
=
b
.
length
;
c
<
f
;
c
++
)
a
.
push
(
b
[
c
]);
return
a
},
isSelectedNode
:
function
(
a
){
return
e
.
isSelectedNode
(
d
,
a
)},
reAsyncChildNodesPromise
:
function
(
a
,
b
,
c
){
return
new
Promise
(
function
(
d
,
e
){
try
{
f
.
reAsyncChildNodes
(
a
,
b
,
c
,
function
(){
d
(
a
)})}
catch
(
g
){
e
(
g
)}})},
reAsyncChildNodes
:
function
(
a
,
b
,
c
,
f
){
if
(
this
.
setting
.
async
.
enable
){
var
h
=!
a
;
h
&&
(
a
=
e
.
getRoot
(
d
));
if
(
b
==
"
refresh
"
){
for
(
var
b
=
e
.
nodeChildren
(
d
,
a
),
n
=
0
,
r
=
b
?
b
.
length
:
0
;
n
<
r
;
n
++
)
e
.
removeNodeCache
(
d
,
b
[
n
]);
e
.
removeSelectedNode
(
d
);
e
.
nodeChildren
(
d
,
a
,[]);
h
?
this
.
setting
.
treeObj
.
empty
():
l
(
a
,
g
.
id
.
UL
,
d
).
empty
()}
j
.
asyncNode
(
this
.
setting
,
h
?
null
:
a
,
!!
c
,
f
)}},
refresh
:
function
(){
this
.
setting
.
treeObj
.
empty
();
var
a
=
e
.
getRoot
(
d
),
b
=
e
.
nodeChildren
(
d
,
a
);
e
.
initRoot
(
d
);
e
.
nodeChildren
(
d
,
a
,
b
);
e
.
initCache
(
d
);
j
.
createNodes
(
d
,
0
,
e
.
nodeChildren
(
d
,
a
),
null
,
-
1
)},
removeChildNodes
:
function
(
a
){
if
(
!
a
)
return
null
;
var
b
=
e
.
nodeChildren
(
d
,
a
);
j
.
removeChildNodes
(
d
,
a
);
return
b
?
b
:
null
},
removeNode
:
function
(
a
,
b
){
a
&&
(
b
=!!
b
,
b
&&
h
.
apply
(
d
.
callback
.
beforeRemove
,[
d
.
treeId
,
a
],
!
0
)
==!
1
||
(
j
.
removeNode
(
d
,
a
),
b
&&
this
.
setting
.
treeObj
.
trigger
(
g
.
event
.
REMOVE
,[
d
.
treeId
,
a
])))},
selectNode
:
function
(
a
,
b
,
c
){
function
e
(){
if
(
!
c
){
var
b
=
l
(
a
,
d
).
get
(
0
);
j
.
scrollIntoView
(
d
,
b
)}}
if
(
a
&&
h
.
uCanDo
(
d
)){
b
=
d
.
view
.
selectedMulti
&&
b
;
if
(
a
.
parentTId
)
j
.
expandCollapseParentNode
(
d
,
a
.
getParentNode
(),
!
0
,
!
1
,
e
);
else
if
(
!
c
)
try
{
l
(
a
,
d
).
focus
().
blur
()}
catch
(
f
){}
j
.
selectNode
(
d
,
a
,
b
)}},
transformTozTreeNodes
:
function
(
a
){
return
e
.
transformTozTreeFormat
(
d
,
a
)},
transformToArray
:
function
(
a
){
return
e
.
transformToArrayFormat
(
d
,
a
)},
updateNode
:
function
(
a
){
a
&&
l
(
a
,
d
).
get
(
0
)
&&
h
.
uCanDo
(
d
)
&&
(
j
.
setNodeName
(
d
,
a
),
j
.
setNodeTarget
(
d
,
a
),
j
.
setNodeUrl
(
d
,
a
),
j
.
setNodeLineIcos
(
d
,
a
),
j
.
setNodeFontCss
(
d
,
a
))}};
a
.
treeTools
=
f
;
e
.
setZTreeTools
(
d
,
f
);(
c
=
e
.
nodeChildren
(
d
,
a
))
&&
c
.
length
>
0
?
j
.
createNodes
(
d
,
0
,
c
,
null
,
-
1
):
d
.
async
.
enable
&&
d
.
async
.
url
&&
d
.
async
.
url
!==
""
&&
j
.
asyncNode
(
d
);
return
f
}};
var
Q
=
r
.
fn
.
zTree
,
l
=
h
.
$
,
g
=
Q
.
consts
})(
jQuery
);
/*
* JQuery zTree excheck v3.5.3
6
* JQuery zTree excheck v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -86,7 +85,7 @@ g);(c=e.nodeChildren(d,a))&&c.length>0?i.createNodes(d,0,c,null,-1):d.async.enab
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
n
){
var
q
,
r
,
s
,
p
=
{
event
:{
CHECK
:
"
ztree_check
"
},
id
:{
CHECK
:
"
_check
"
},
checkbox
:{
STYLE
:
"
checkbox
"
,
DEFAULT
:
"
chk
"
,
DISABLED
:
"
disable
"
,
FALSE
:
"
false
"
,
TRUE
:
"
true
"
,
FULL
:
"
full
"
,
PART
:
"
part
"
,
FOCUS
:
"
focus
"
},
radio
:{
STYLE
:
"
radio
"
,
TYPE_ALL
:
"
all
"
,
TYPE_LEVEL
:
"
level
"
}},
w
=
{
check
:{
enable
:
!
1
,
autoCheckTrigger
:
!
1
,
chkStyle
:
p
.
checkbox
.
STYLE
,
nocheckInherit
:
!
1
,
chkDisabledInherit
:
!
1
,
radioType
:
p
.
radio
.
TYPE_LEVEL
,
chkboxType
:{
Y
:
"
ps
"
,
N
:
"
ps
"
}},
data
:{
key
:{
checked
:
"
checked
"
}},
callback
:{
beforeCheck
:
null
,
onCheck
:
null
}};
q
=
function
(
c
,
a
){
if
(
a
.
chkDisabled
===!
0
)
return
!
1
;
var
b
=
e
.
getSetting
(
c
.
data
.
treeId
);
if
(
i
.
apply
(
b
.
callback
.
beforeCheck
,[
b
.
treeId
,
a
],
!
0
)
==!
1
)
return
!
0
;
var
d
=
e
.
nodeChecked
(
b
,
a
);
e
.
nodeChecked
(
b
,
a
,
!
d
);
f
.
checkNodeRelation
(
b
,
a
);
d
=
m
(
a
,
h
.
id
.
CHECK
,
b
);
f
.
setChkClass
(
b
,
d
,
a
);
f
.
repairParentChkClassWithSelf
(
b
,
a
);
b
.
treeObj
.
trigger
(
h
.
event
.
CHECK
,[
c
,
b
.
treeId
,
a
]);
return
!
0
};
r
=
function
(
c
,
a
){
if
(
a
.
chkDisabled
===!
0
)
return
!
1
;
var
b
=
e
.
getSetting
(
c
.
data
.
treeId
),
d
=
m
(
a
,
h
.
id
.
CHECK
,
b
);
a
.
check_Focus
=!
0
;
f
.
setChkClass
(
b
,
d
,
a
);
return
!
0
};
s
=
function
(
c
,
...
...
@@ -112,7 +111,7 @@ h.id.CHECK,this.setting);(e==!0||this.setting.check.chkStyle===h.radio.STYLE)&&f
function
(
c
,
a
,
b
,
d
,
h
,
g
,
i
){
var
m
=
""
;
v
&&
(
m
=
v
.
apply
(
f
,
arguments
));
d
&&
e
.
makeChkFlag
(
c
,
d
);
return
m
}})(
jQuery
);
/*
* JQuery zTree exedit v3.5.3
6
* JQuery zTree exedit v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -121,7 +120,7 @@ function(c,a,b,d,h,g,i){var m="";v&&(m=v.apply(f,arguments));d&&e.makeChkFlag(c,
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
B
){
var
I
=
{
event
:{
DRAG
:
"
ztree_drag
"
,
DROP
:
"
ztree_drop
"
,
RENAME
:
"
ztree_rename
"
,
DRAGMOVE
:
"
ztree_dragmove
"
},
id
:{
EDIT
:
"
_edit
"
,
INPUT
:
"
_input
"
,
REMOVE
:
"
_remove
"
},
move
:{
TYPE_INNER
:
"
inner
"
,
TYPE_PREV
:
"
prev
"
,
TYPE_NEXT
:
"
next
"
},
node
:{
CURSELECTED_EDIT
:
"
curSelectedNode_Edit
"
,
TMPTARGET_TREE
:
"
tmpTargetzTree
"
,
TMPTARGET_NODE
:
"
tmpTargetNode
"
}},
v
=
{
onHoverOverNode
:
function
(
a
,
b
){
var
c
=
i
.
getSetting
(
a
.
data
.
treeId
),
d
=
i
.
getRoot
(
c
);
if
(
d
.
curHoverNode
!=
b
)
v
.
onHoverOutNode
(
a
);
d
.
curHoverNode
=
b
;
e
.
addHoverDom
(
c
,
b
)},
onHoverOutNode
:
function
(
a
){
var
a
=
i
.
getSetting
(
a
.
data
.
treeId
),
b
=
i
.
getRoot
(
a
);
if
(
b
.
curHoverNode
&&!
i
.
isSelectedNode
(
a
,
b
.
curHoverNode
))
e
.
removeTreeDom
(
a
,
b
.
curHoverNode
),
b
.
curHoverNode
=
null
},
onMousedownNode
:
function
(
a
,
b
){
function
c
(
a
){
if
(
m
.
dragFlag
==
0
&&
Math
.
abs
(
N
-
a
.
clientX
)
<
f
.
edit
.
drag
.
minMoveSize
&&
Math
.
abs
(
O
-
a
.
clientY
)
<
f
.
edit
.
drag
.
minMoveSize
)
return
!
0
;
var
b
,
c
,
g
,
j
;
L
.
css
(
"
cursor
"
,
"
pointer
"
);
if
(
m
.
dragFlag
==
0
){
if
(
k
.
apply
(
f
.
callback
.
beforeDrag
,[
f
.
treeId
,
n
],
!
0
)
==!
1
)
return
l
(
a
),
!
0
;
for
(
b
=
0
,
c
=
n
.
length
;
b
<
c
;
b
++
){
if
(
b
==
0
)
m
.
dragNodeShowBefore
=
[];
...
...
js/jquery.ztree.core.js
浏览文件 @
9523be07
/*
* JQuery zTree core v3.5.3
6
* JQuery zTree core v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
$
)
{
var
settings
=
{},
roots
=
{},
caches
=
{},
...
...
@@ -818,7 +818,7 @@
},
onClickNode
:
function
(
event
,
node
)
{
var
setting
=
data
.
getSetting
(
event
.
data
.
treeId
),
clickFlag
=
(
(
setting
.
view
.
autoCancelSelected
&&
(
event
.
ctrlKey
||
event
.
metaKey
))
&&
data
.
isSelectedNode
(
setting
,
node
))
?
0
:
(
setting
.
view
.
autoCancelSelected
&&
(
event
.
ctrlKey
||
event
.
metaKey
)
&&
setting
.
view
.
selectedMulti
)
?
2
:
1
;
clickFlag
=
(
(
setting
.
view
.
autoCancelSelected
&&
(
event
.
ctrlKey
||
event
.
metaKey
))
&&
data
.
isSelectedNode
(
setting
,
node
))
?
0
:
(
setting
.
view
.
autoCancelSelected
&&
(
event
.
ctrlKey
||
event
.
metaKey
)
&&
setting
.
view
.
selectedMulti
)
?
2
:
1
;
if
(
tools
.
apply
(
setting
.
callback
.
beforeClick
,
[
setting
.
treeId
,
node
,
clickFlag
],
true
)
==
false
)
return
true
;
if
(
clickFlag
===
0
)
{
view
.
cancelPreSelectedNode
(
setting
,
node
);
...
...
@@ -858,7 +858,7 @@
},
onSelectStart
:
function
(
e
)
{
var
n
=
e
.
originalEvent
.
srcElement
.
nodeName
.
toLowerCase
();
return
(
n
===
"
input
"
||
n
===
"
textarea
"
);
return
(
n
===
"
input
"
||
n
===
"
textarea
"
);
}
},
//method of tools for zTree
...
...
@@ -921,7 +921,7 @@
return
(
$
(
target
).
parent
(
"
li
"
).
get
(
0
)
||
$
(
target
).
parentsUntil
(
"
li
"
).
parent
().
get
(
0
));
},
isChildOrSelf
:
function
(
dom
,
parentId
)
{
return
(
$
(
dom
).
closest
(
"
#
"
+
parentId
).
length
>
0
);
return
(
$
(
dom
).
closest
(
"
#
"
+
parentId
).
length
>
0
);
},
uCanDo
:
function
(
setting
,
e
)
{
return
true
;
...
...
@@ -1437,68 +1437,66 @@
}
return
;
}
// code src: http://jsfiddle.net/08u6cxwj/
// CC-BY jocki84@googlemail.com, https://gist.github.com/jocki84/6ffafd003387179a988e
if
(
!
Element
.
prototype
.
scrollIntoViewIfNeeded
)
{
Element
.
prototype
.
scrollIntoViewIfNeeded
=
function
(
centerIfNeeded
)
{
function
withinBounds
(
value
,
min
,
max
,
extent
)
{
if
(
false
===
centerIfNeeded
||
max
<=
value
+
extent
&&
value
<=
min
+
extent
)
{
return
Math
.
min
(
max
,
Math
.
max
(
min
,
value
));
}
else
{
return
(
min
+
max
)
/
2
;
}
}
"
use strict
"
;
function
makeArea
(
left
,
top
,
width
,
height
)
{
return
{
"
left
"
:
left
,
"
top
"
:
top
,
"
width
"
:
width
,
"
height
"
:
height
,
"
right
"
:
left
+
width
,
"
bottom
"
:
top
+
height
,
"
translate
"
:
function
(
x
,
y
)
{
return
makeArea
(
x
+
left
,
y
+
top
,
width
,
height
);
function
makeRange
(
start
,
length
)
{
return
{
"
start
"
:
start
,
"
length
"
:
length
,
"
end
"
:
start
+
length
};
}
,
"
relativeFromTo
"
:
function
(
lhs
,
rhs
)
{
var
newLeft
=
left
,
newTop
=
top
;
lhs
=
lhs
.
offsetParent
;
rhs
=
rhs
.
offsetParent
;
if
(
lhs
===
rhs
)
{
return
area
;
}
for
(;
lhs
;
lhs
=
lhs
.
offsetParent
)
{
newLeft
+=
lhs
.
offsetLeft
+
lhs
.
clientLeft
;
newTop
+=
lhs
.
offsetTop
+
lhs
.
clientTop
;
function
coverRange
(
inner
,
outer
)
{
if
(
false
===
centerIfNeeded
||
(
outer
.
start
<
inner
.
end
&&
inner
.
start
<
outer
.
end
)
)
{
return
Math
.
max
(
inner
.
end
-
outer
.
length
,
Math
.
min
(
outer
.
start
,
inner
.
start
)
)
;
}
for
(;
rhs
;
rhs
=
rhs
.
offsetParent
)
{
newLeft
-=
rhs
.
offsetLeft
+
rhs
.
clientLeft
;
newTop
-=
rhs
.
offsetTop
+
rhs
.
clientTop
;
return
(
inner
.
start
+
inner
.
end
-
outer
.
length
)
/
2
;
}
return
makeArea
(
newLeft
,
newTop
,
width
,
height
);
function
makePoint
(
x
,
y
)
{
return
{
"
x
"
:
x
,
"
y
"
:
y
,
"
translate
"
:
function
translate
(
dX
,
dY
)
{
return
makePoint
(
x
+
dX
,
y
+
dY
);
}
};
}
var
parent
,
elem
=
this
,
area
=
makeArea
(
this
.
offsetLeft
,
this
.
offsetTop
,
this
.
offsetWidth
,
this
.
offsetHeight
);
while
(
tools
.
isElement
(
parent
=
elem
.
parentNode
))
{
var
clientLeft
=
parent
.
offsetLeft
+
parent
.
clientLeft
;
var
clientTop
=
parent
.
offsetTop
+
parent
.
clientTop
;
// Make area relative to parent's client area.
area
=
area
.
relativeFromTo
(
elem
,
parent
).
translate
(
-
clientLeft
,
-
clientTop
);
function
absolute
(
elem
,
pt
)
{
while
(
elem
)
{
pt
=
pt
.
translate
(
elem
.
offsetLeft
,
elem
.
offsetTop
);
elem
=
elem
.
offsetParent
;
}
return
pt
;
}
parent
.
scrollLeft
=
withinBounds
(
parent
.
scrollLeft
,
area
.
right
-
parent
.
clientWidth
,
area
.
left
,
parent
.
clientWidth
)
;
var
target
=
absolute
(
this
,
makePoint
(
0
,
0
)),
extent
=
makePoint
(
this
.
offsetWidth
,
this
.
offsetHeight
)
,
elem
=
this
.
parentNode
,
origin
;
parent
.
scrollTop
=
withinBounds
(
parent
.
scrollTop
,
area
.
bottom
-
parent
.
clientHeight
,
area
.
top
,
parent
.
clientHeight
);
while
(
elem
instanceof
HTMLElement
)
{
// Apply desired scroll amount.
origin
=
absolute
(
elem
,
makePoint
(
elem
.
clientLeft
,
elem
.
clientTop
));
elem
.
scrollLeft
=
coverRange
(
makeRange
(
target
.
x
-
origin
.
x
,
extent
.
x
),
makeRange
(
elem
.
scrollLeft
,
elem
.
clientWidth
)
);
elem
.
scrollTop
=
coverRange
(
makeRange
(
target
.
y
-
origin
.
y
,
extent
.
y
),
makeRange
(
elem
.
scrollTop
,
elem
.
clientHeight
)
);
// Determine actual scroll amount by reading back scroll properties.
area
=
area
.
translate
(
clientLeft
-
parent
.
scrollLeft
,
clientTop
-
parent
.
scrollTop
);
elem
=
parent
;
target
=
target
.
translate
(
-
elem
.
scrollLeft
,
-
elem
.
scrollTop
);
elem
=
elem
.
parentNode
;
}
};
}
...
...
@@ -1869,12 +1867,12 @@
return
data
.
isSelectedNode
(
setting
,
node
);
},
reAsyncChildNodesPromise
:
function
(
parentNode
,
reloadType
,
isSilent
)
{
var
promise
=
new
Promise
(
function
(
resolve
,
reject
)
{
var
promise
=
new
Promise
(
function
(
resolve
,
reject
)
{
try
{
zTreeTools
.
reAsyncChildNodes
(
parentNode
,
reloadType
,
isSilent
,
function
()
{
zTreeTools
.
reAsyncChildNodes
(
parentNode
,
reloadType
,
isSilent
,
function
()
{
resolve
(
parentNode
);
});
}
catch
(
e
)
{
}
catch
(
e
)
{
reject
(
e
);
}
});
...
...
js/jquery.ztree.core.min.js
浏览文件 @
9523be07
/*
* JQuery zTree core v3.5.3
6
* JQuery zTree core v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -8,69 +8,68 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
q
){
var
H
,
I
,
J
,
K
,
L
,
M
,
u
,
s
=
{},
v
=
{},
w
=
{},
N
=
{
treeId
:
""
,
treeObj
:
null
,
view
:{
addDiyDom
:
null
,
autoCancelSelected
:
!
0
,
dblClickExpand
:
!
0
,
expandSpeed
:
"
fast
"
,
fontCss
:{},
nameIsHTML
:
!
1
,
selectedMulti
:
!
0
,
showIcon
:
!
0
,
showLine
:
!
0
,
showTitle
:
!
0
,
txtSelectedEnable
:
!
1
},
data
:{
key
:{
isParent
:
"
isParent
"
,
children
:
"
children
"
,
name
:
"
name
"
,
title
:
""
,
url
:
"
url
"
,
icon
:
"
icon
"
},
simpleData
:{
enable
:
!
1
,
idKey
:
"
id
"
,
pIdKey
:
"
pId
"
,
rootPId
:
null
},
keep
:{
parent
:
!
1
,
leaf
:
!
1
}},
async
:{
enable
:
!
1
,
contentType
:
"
application/x-www-form-urlencoded
"
,
type
:
"
post
"
,
dataType
:
"
text
"
,
headers
:{},
xhrFields
:{},
url
:
""
,
autoParam
:[],
otherParam
:[],
dataFilter
:
null
},
callback
:{
beforeAsync
:
null
,
beforeClick
:
null
,
beforeDblClick
:
null
,
beforeRightClick
:
null
,
beforeMouseDown
:
null
,
beforeMouseUp
:
null
,
beforeExpand
:
null
,
beforeCollapse
:
null
,
beforeRemove
:
null
,
onAsyncError
:
null
,
onAsyncSuccess
:
null
,
onNodeCreated
:
null
,
onClick
:
null
,
onDblClick
:
null
,
onRightClick
:
null
,
onMouseDown
:
null
,
onMouseUp
:
null
,
onExpand
:
null
,
onCollapse
:
null
,
onRemove
:
null
}},
x
=
[
function
(
a
){
var
b
=
a
.
treeObj
,
c
=
f
.
event
;
b
.
bind
(
c
.
NODECREATED
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onNodeCreated
,[
b
,
c
,
h
])});
b
.
bind
(
c
.
CLICK
,
function
(
b
,
c
,
h
,
e
,
m
){
j
.
apply
(
a
.
callback
.
onClick
,[
c
,
h
,
e
,
m
])});
b
.
bind
(
c
.
EXPAND
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onExpand
,[
b
,
c
,
h
])});
b
.
bind
(
c
.
COLLAPSE
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onCollapse
,[
b
,
c
,
h
])});
b
.
bind
(
c
.
ASYNC_SUCCESS
,
function
(
b
,
c
,
h
,
e
){
j
.
apply
(
a
.
callback
.
onAsyncSuccess
,[
b
,
c
,
h
,
e
])});
b
.
bind
(
c
.
ASYNC_ERROR
,
function
(
b
,
c
,
h
,
e
,
m
,
f
){
j
.
apply
(
a
.
callback
.
onAsyncError
,[
b
,
c
,
h
,
e
,
m
,
f
])});
b
.
bind
(
c
.
REMOVE
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onRemove
,
[
b
,
c
,
h
])});
b
.
bind
(
c
.
SELECTED
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onSelected
,[
c
,
h
])});
b
.
bind
(
c
.
UNSELECTED
,
function
(
b
,
c
,
h
){
j
.
apply
(
a
.
callback
.
onUnSelected
,[
c
,
h
])})}],
y
=
[
function
(
a
){
var
b
=
f
.
event
;
a
.
treeObj
.
unbind
(
b
.
NODECREATED
).
unbind
(
b
.
CLICK
).
unbind
(
b
.
EXPAND
).
unbind
(
b
.
COLLAPSE
).
unbind
(
b
.
ASYNC_SUCCESS
).
unbind
(
b
.
ASYNC_ERROR
).
unbind
(
b
.
REMOVE
).
unbind
(
b
.
SELECTED
).
unbind
(
b
.
UNSELECTED
)}],
z
=
[
function
(
a
){
var
b
=
e
.
getCache
(
a
);
b
||
(
b
=
{},
e
.
setCache
(
a
,
b
));
b
.
nodes
=
[];
b
.
doms
=
[]}],
A
=
[
function
(
a
,
b
,
c
,
d
,
g
,
h
){
if
(
c
){
var
k
=
e
.
getRoot
(
a
),
m
=
e
.
nodeChildren
(
a
,
c
);
c
.
level
=
b
;
c
.
tId
=
a
.
treeId
+
"
_
"
+
++
k
.
zId
;
c
.
parentTId
=
d
?
d
.
tId
:
null
;
c
.
open
=
typeof
c
.
open
==
"
string
"
?
j
.
eqs
(
c
.
open
,
"
true
"
):
!!
c
.
open
;
b
=
e
.
nodeIsParent
(
a
,
c
);
j
.
isArray
(
m
)
&&!
(
b
===!
1
||
typeof
b
==
"
string
"
&&
j
.
eqs
(
b
,
"
false
"
))?(
e
.
nodeIsParent
(
a
,
c
,
!
0
),
c
.
zAsync
=!
0
):(
b
=
e
.
nodeIsParent
(
a
,
c
,
b
),
c
.
open
=
b
&&!
a
.
async
.
enable
?
c
.
open
:
!
1
,
c
.
zAsync
=!
b
);
c
.
isFirstNode
=
g
;
c
.
isLastNode
=
h
;
c
.
getParentNode
=
function
(){
return
e
.
getNodeCache
(
a
,
c
.
parentTId
)};
c
.
getPreNode
=
function
(){
return
e
.
getPreNode
(
a
,
c
)};
c
.
getNextNode
=
function
(){
return
e
.
getNextNode
(
a
,
c
)};
c
.
getIndex
=
function
(){
return
e
.
getNodeIndex
(
a
,
c
)};
c
.
getPath
=
function
(){
return
e
.
getNodePath
(
a
,
c
)};
c
.
isAjaxing
=!
1
;
e
.
fixPIdKeyValue
(
a
,
c
)}}],
t
=
[
function
(
a
){
var
b
=
a
.
target
,
c
=
e
.
getSetting
(
a
.
data
.
treeId
),
d
=
""
,
g
=
null
,
h
=
""
,
k
=
""
,
m
=
null
,
i
=
null
,
o
=
null
;
if
(
j
.
eqs
(
a
.
type
,
"
mousedown
"
))
k
=
"
mousedown
"
;
else
if
(
j
.
eqs
(
a
.
type
,
"
mouseup
"
))
k
=
"
mouseup
"
;
else
if
(
j
.
eqs
(
a
.
type
,
"
contextmenu
"
))
k
=
"
contextmenu
"
;
else
if
(
j
.
eqs
(
a
.
type
,
"
click
"
))
if
(
j
.
eqs
(
b
.
tagName
,
"
span
"
)
&&
b
.
getAttribute
(
"
treeNode
"
+
f
.
id
.
SWITCH
)
!==
null
)
d
=
j
.
getNodeMainDom
(
b
).
id
,
h
=
"
switchNode
"
;
else
{
if
(
o
=
j
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
f
.
id
.
A
}]))
d
=
j
.
getNodeMainDom
(
o
).
id
,
h
=
"
clickNode
"
}
else
if
(
j
.
eqs
(
a
.
type
,
"
dblclick
"
)
&&
(
k
=
"
dblclick
"
,
o
=
j
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
f
.
id
.
A
}])))
d
=
j
.
getNodeMainDom
(
o
).
id
,
h
=
"
switchNode
"
;
if
(
k
.
length
>
0
&&
d
.
length
==
0
&&
(
o
=
j
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
f
.
id
.
A
}])))
d
=
j
.
getNodeMainDom
(
o
).
id
;
if
(
d
.
length
>
0
)
switch
(
g
=
e
.
getNodeCache
(
c
,
d
),
h
){
case
"
switchNode
"
:
e
.
nodeIsParent
(
c
,
g
)?
j
.
eqs
(
a
.
type
,
"
click
"
)
||
j
.
eqs
(
a
.
type
,
"
dblclick
"
)
&&
j
.
apply
(
c
.
view
.
dblClickExpand
,[
c
.
treeId
,
g
],
c
.
view
.
dblClickExpand
)?
m
=
H
:
h
=
""
:
h
=
""
;
break
;
case
"
clickNode
"
:
m
=
I
}
switch
(
k
){
case
"
mousedown
"
:
i
=
J
;
break
;
case
"
mouseup
"
:
i
=
K
;
break
;
case
"
dblclick
"
:
i
=
L
;
break
;
case
"
contextmenu
"
:
i
=
M
}
return
{
stop
:
!
1
,
node
:
g
,
nodeEventType
:
h
,
nodeEventCallback
:
m
,
treeEventType
:
k
,
treeEventCallback
:
i
}}],
B
=
[
function
(
a
){
var
b
=
e
.
getRoot
(
a
);
b
||
(
b
=
{},
e
.
setRoot
(
a
,
b
));
e
.
nodeChildren
(
a
,
b
,[]);
b
.
expandTriggerFlag
=!
1
;
b
.
curSelectedList
=
[];
b
.
noSelection
=
!
0
;
b
.
createdNodes
=
[];
b
.
zId
=
0
;
b
.
_ver
=
(
new
Date
).
getTime
()}],
C
=
[],
D
=
[],
E
=
[],
F
=
[],
G
=
[],
e
=
{
addNodeCache
:
function
(
a
,
b
){
e
.
getCache
(
a
).
nodes
[
e
.
getNodeCacheId
(
b
.
tId
)]
=
b
},
getNodeCacheId
:
function
(
a
){
return
a
.
substring
(
a
.
lastIndexOf
(
"
_
"
)
+
1
)},
addAfterA
:
function
(
a
){
D
.
push
(
a
)},
addBeforeA
:
function
(
a
){
C
.
push
(
a
)},
addInnerAfterA
:
function
(
a
){
F
.
push
(
a
)},
addInnerBeforeA
:
function
(
a
){
E
.
push
(
a
)},
addInitBind
:
function
(
a
){
x
.
push
(
a
)},
addInitUnBind
:
function
(
a
){
y
.
push
(
a
)},
addInitCache
:
function
(
a
){
z
.
push
(
a
)},
addInitNode
:
function
(
a
){
A
.
push
(
a
)},
addInitProxy
:
function
(
a
,
b
){
b
?
t
.
splice
(
0
,
0
,
a
):
t
.
push
(
a
)},
addInitRoot
:
function
(
a
){
B
.
push
(
a
)},
addNodesData
:
function
(
a
,
b
,
c
,
d
){
var
g
=
e
.
nodeChildren
(
a
,
b
);
g
?
c
>=
g
.
length
&&
(
c
=-
1
):(
g
=
e
.
nodeChildren
(
a
,
b
,[]),
c
=-
1
);
if
(
g
.
length
>
0
&&
c
===
0
)
g
[
0
].
isFirstNode
=!
1
,
i
.
setNodeLineIcos
(
a
,
g
[
0
]);
else
if
(
g
.
length
>
0
&&
c
<
0
)
g
[
g
.
length
-
1
].
isLastNode
=!
1
,
i
.
setNodeLineIcos
(
a
,
g
[
g
.
length
-
1
]);
e
.
nodeIsParent
(
a
,
b
,
!
0
);
c
<
0
?
e
.
nodeChildren
(
a
,
b
,
g
.
concat
(
d
)):(
a
=
[
c
,
0
].
concat
(
d
),
g
.
splice
.
apply
(
g
,
a
))},
addSelectedNode
:
function
(
a
,
b
){
var
c
=
e
.
getRoot
(
a
);
e
.
isSelectedNode
(
a
,
b
)
||
c
.
curSelectedList
.
push
(
b
)},
addCreatedNode
:
function
(
a
,
b
){(
a
.
callback
.
onNodeCreated
||
a
.
view
.
addDiyDom
)
&&
e
.
getRoot
(
a
).
createdNodes
.
push
(
b
)},
addZTreeTools
:
function
(
a
){
G
.
push
(
a
)},
exSetting
:
function
(
a
){
q
.
extend
(
!
0
,
N
,
a
)},
fixPIdKeyValue
:
function
(
a
,
b
){
a
.
data
.
simpleData
.
enable
&&
(
b
[
a
.
data
.
simpleData
.
pIdKey
]
=
b
.
parentTId
?
b
.
getParentNode
()[
a
.
data
.
simpleData
.
idKey
]:
a
.
data
.
simpleData
.
rootPId
)},
getAfterA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
D
.
length
;
d
<
e
;
d
++
)
D
[
d
].
apply
(
this
,
arguments
)},
getBeforeA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
C
.
length
;
d
<
e
;
d
++
)
C
[
d
].
apply
(
this
,
arguments
)},
getInnerAfterA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
F
.
length
;
d
<
e
;
d
++
)
F
[
d
].
apply
(
this
,
arguments
)},
getInnerBeforeA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
E
.
length
;
d
<
e
;
d
++
)
E
[
d
].
apply
(
this
,
arguments
)},
getCache
:
function
(
a
){
return
w
[
a
.
treeId
]},
getNodeIndex
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
g
=
c
.
length
-
1
;
d
<=
g
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
;
return
-
1
},
getNextNode
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
g
=
c
.
length
-
1
;
d
<=
g
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
==
g
?
null
:
c
[
d
+
1
];
return
null
},
getNodeByParam
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
null
;
for
(
var
g
=
0
,
h
=
b
.
length
;
g
<
h
;
g
++
){
var
k
=
b
[
g
];
if
(
k
[
c
]
==
d
)
return
b
[
g
];
k
=
e
.
nodeChildren
(
a
,
k
);
if
(
k
=
e
.
getNodeByParam
(
a
,
k
,
c
,
d
))
return
k
}
return
null
},
getNodeCache
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
var
c
=
w
[
a
.
treeId
].
nodes
[
e
.
getNodeCacheId
(
b
)];
return
c
?
c
:
null
},
getNodePath
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
var
c
;
(
c
=
b
.
parentTId
?
b
.
getParentNode
().
getPath
():[])
&&
c
.
push
(
b
);
return
c
},
getNodes
:
function
(
a
){
return
e
.
nodeChildren
(
a
,
e
.
getRoot
(
a
))},
getNodesByParam
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
[];
for
(
var
g
=
[],
h
=
0
,
k
=
b
.
length
;
h
<
k
;
h
++
){
var
m
=
b
[
h
];
m
[
c
]
==
d
&&
g
.
push
(
m
);
m
=
e
.
nodeChildren
(
a
,
m
);
g
=
g
.
concat
(
e
.
getNodesByParam
(
a
,
m
,
c
,
d
))}
return
g
},
getNodesByParamFuzzy
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
[];
for
(
var
g
=
[],
d
=
d
.
toLowerCase
(),
h
=
0
,
k
=
b
.
length
;
h
<
k
;
h
++
){
var
m
=
b
[
h
];
typeof
m
[
c
]
==
"
string
"
&&
b
[
h
][
c
].
toLowerCase
().
indexOf
(
d
)
>-
1
&&
g
.
push
(
m
);
m
=
e
.
nodeChildren
(
a
,
m
);
g
=
g
.
concat
(
e
.
getNodesByParamFuzzy
(
a
,
m
,
c
,
d
))}
return
g
},
getNodesByFilter
:
function
(
a
,
b
,
c
,
d
,
g
){
if
(
!
b
)
return
d
?
null
:[];
for
(
var
h
=
d
?
null
:[],
k
=
0
,
m
=
b
.
length
;
k
<
m
;
k
++
){
var
f
=
b
[
k
];
if
(
j
.
apply
(
c
,[
f
,
g
],
!
1
)){
if
(
d
)
return
f
;
h
.
push
(
f
)}
f
=
e
.
nodeChildren
(
a
,
f
);
f
=
e
.
getNodesByFilter
(
a
,
f
,
c
,
d
,
g
);
if
(
d
&&
f
)
return
f
;
h
=
d
?
f
:
h
.
concat
(
f
)}
return
h
},
getPreNode
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
g
=
c
.
length
;
d
<
g
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
==
0
?
null
:
c
[
d
-
1
];
return
null
},
getRoot
:
function
(
a
){
return
a
?
v
[
a
.
treeId
]:
null
},
getRoots
:
function
(){
return
v
},
getSetting
:
function
(
a
){
return
s
[
a
]},
getSettings
:
function
(){
return
s
},
getZTreeTools
:
function
(
a
){
return
(
a
=
this
.
getRoot
(
this
.
getSetting
(
a
)))?
a
.
treeTools
:
null
},
initCache
:
function
(
a
){
for
(
var
b
=
0
,
c
=
z
.
length
;
b
<
c
;
b
++
)
z
[
b
].
apply
(
this
,
arguments
)},
initNode
:
function
(
a
,
b
,
c
,
d
,
e
,
h
){
for
(
var
k
=
0
,
f
=
A
.
length
;
k
<
f
;
k
++
)
A
[
k
].
apply
(
this
,
arguments
)},
initRoot
:
function
(
a
){
for
(
var
b
=
0
,
c
=
B
.
length
;
b
<
c
;
b
++
)
B
[
b
].
apply
(
this
,
arguments
)},
isSelectedNode
:
function
(
a
,
b
){
for
(
var
c
=
e
.
getRoot
(
a
),
d
=
0
,
g
=
c
.
curSelectedList
.
length
;
d
<
g
;
d
++
)
if
(
b
===
c
.
curSelectedList
[
d
])
return
!
0
;
return
!
1
},
nodeChildren
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
null
;
a
=
a
.
data
.
key
.
children
;
typeof
c
!==
"
undefined
"
&&
(
b
[
a
]
=
c
);
return
b
[
a
]},
nodeIsParent
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
!
1
;
a
=
a
.
data
.
key
.
isParent
;
typeof
c
!==
"
undefined
"
&&
(
typeof
c
===
"
string
"
&&
(
c
=
j
.
eqs
(
c
,
"
true
"
)),
b
[
a
]
=!!
c
);
return
b
[
a
]},
nodeName
:
function
(
a
,
b
,
c
){
a
=
a
.
data
.
key
.
name
;
typeof
c
!==
"
undefined
"
&&
(
b
[
a
]
=
c
);
return
""
+
b
[
a
]},
nodeTitle
:
function
(
a
,
b
){
return
""
+
b
[
a
.
data
.
key
.
title
===
""
?
a
.
data
.
key
.
name
:
a
.
data
.
key
.
title
]},
removeNodeCache
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
)
for
(
var
d
=
0
,
g
=
c
.
length
;
d
<
g
;
d
++
)
e
.
removeNodeCache
(
a
,
c
[
d
]);
e
.
getCache
(
a
).
nodes
[
e
.
getNodeCacheId
(
b
.
tId
)]
=
null
},
removeSelectedNode
:
function
(
a
,
b
){
for
(
var
c
=
e
.
getRoot
(
a
),
d
=
0
,
g
=
c
.
curSelectedList
.
length
;
d
<
g
;
d
++
)
if
(
b
===
c
.
curSelectedList
[
d
]
||!
e
.
getNodeCache
(
a
,
c
.
curSelectedList
[
d
].
tId
))
c
.
curSelectedList
.
splice
(
d
,
1
),
a
.
treeObj
.
trigger
(
f
.
event
.
UNSELECTED
,[
a
.
treeId
,
b
]),
d
--
,
g
--
},
setCache
:
function
(
a
,
b
){
w
[
a
.
treeId
]
=
b
},
setRoot
:
function
(
a
,
b
){
v
[
a
.
treeId
]
=
b
},
setZTreeTools
:
function
(
a
,
b
){
for
(
var
c
=
0
,
d
=
G
.
length
;
c
<
d
;
c
++
)
G
[
c
].
apply
(
this
,
arguments
)},
transformToArrayFormat
:
function
(
a
,
b
){
function
c
(
b
){
d
.
push
(
b
);(
b
=
e
.
nodeChildren
(
a
,
b
))
&&
(
d
=
d
.
concat
(
e
.
transformToArrayFormat
(
a
,
b
)))}
if
(
!
b
)
return
[];
var
d
=
[];
if
(
j
.
isArray
(
b
))
for
(
var
g
=
0
,
h
=
b
.
length
;
g
<
h
;
g
++
)
c
(
b
[
g
]);
else
c
(
b
);
return
d
},
transformTozTreeFormat
:
function
(
a
,
b
){
var
c
,
d
,
g
=
a
.
data
.
simpleData
.
idKey
,
h
=
a
.
data
.
simpleData
.
pIdKey
;
if
(
!
g
||
g
==
""
||!
b
)
return
[];
if
(
j
.
isArray
(
b
)){
var
k
=
[],
f
=
{};
for
(
c
=
0
,
d
=
b
.
length
;
c
<
d
;
c
++
)
f
[
b
[
c
][
g
]]
=
b
[
c
];
for
(
c
=
0
,
d
=
b
.
length
;
c
<
d
;
c
++
){
var
i
=
f
[
b
[
c
][
h
]];
if
(
i
&&
b
[
c
][
g
]
!=
b
[
c
][
h
]){
var
o
=
e
.
nodeChildren
(
a
,
i
);
o
||
(
o
=
e
.
nodeChildren
(
a
,
i
,[]));
o
.
push
(
b
[
c
])}
else
k
.
push
(
b
[
c
])}
return
k
}
else
return
[
b
]}},
n
=
{
bindEvent
:
function
(
a
){
for
(
var
b
=
0
,
c
=
x
.
length
;
b
<
c
;
b
++
)
x
[
b
].
apply
(
this
,
arguments
)},
unbindEvent
:
function
(
a
){
for
(
var
b
=
0
,
c
=
y
.
length
;
b
<
c
;
b
++
)
y
[
b
].
apply
(
this
,
arguments
)},
bindTree
:
function
(
a
){
var
b
=
{
treeId
:
a
.
treeId
},
c
=
a
.
treeObj
;
a
.
view
.
txtSelectedEnable
||
c
.
bind
(
"
selectstart
"
,
u
).
css
({
"
-moz-user-select
"
:
"
-moz-none
"
});
c
.
bind
(
"
click
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
dblclick
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseover
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseout
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mousedown
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseup
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
contextmenu
"
,
b
,
n
.
proxy
)},
unbindTree
:
function
(
a
){
a
.
treeObj
.
unbind
(
"
selectstart
"
,
u
).
unbind
(
"
click
"
,
n
.
proxy
).
unbind
(
"
dblclick
"
,
n
.
proxy
).
unbind
(
"
mouseover
"
,
n
.
proxy
).
unbind
(
"
mouseout
"
,
n
.
proxy
).
unbind
(
"
mousedown
"
,
n
.
proxy
).
unbind
(
"
mouseup
"
,
n
.
proxy
).
unbind
(
"
contextmenu
"
,
n
.
proxy
)},
doProxy
:
function
(
a
){
for
(
var
b
=
[],
c
=
0
,
d
=
t
.
length
;
c
<
d
;
c
++
){
var
e
=
t
[
c
].
apply
(
this
,
arguments
);
b
.
push
(
e
);
if
(
e
.
stop
)
break
}
return
b
},
proxy
:
function
(
a
){
var
b
=
e
.
getSetting
(
a
.
data
.
treeId
);
if
(
!
j
.
uCanDo
(
b
,
a
))
return
!
0
;
for
(
var
b
=
n
.
doProxy
(
a
),
c
=!
0
,
d
=
0
,
g
=
b
.
length
;
d
<
g
;
d
++
){
var
h
=
b
[
d
];
h
.
nodeEventCallback
&&
(
c
=
h
.
nodeEventCallback
.
apply
(
h
,[
a
,
h
.
node
])
&&
c
);
h
.
treeEventCallback
&&
(
c
=
h
.
treeEventCallback
.
apply
(
h
,[
a
,
h
.
node
])
&&
c
)}
return
c
}};
H
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
if
(
b
.
open
){
if
(
j
.
apply
(
c
.
callback
.
beforeCollapse
,[
c
.
treeId
,
b
],
!
0
)
==
!
1
)
return
!
0
}
else
if
(
j
.
apply
(
c
.
callback
.
beforeExpand
,[
c
.
treeId
,
b
],
!
0
)
==!
1
)
return
!
0
;
e
.
getRoot
(
c
).
expandTriggerFlag
=!
0
;
i
.
switchNode
(
c
,
b
);
return
!
0
};
I
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
),
d
=
c
.
view
.
autoCancelSelected
&&
(
a
.
ctrlKey
||
a
.
metaKey
)
&&
e
.
isSelectedNode
(
c
,
b
)?
0
:
c
.
view
.
autoCancelSelected
&&
(
a
.
ctrlKey
||
a
.
metaKey
)
&&
c
.
view
.
selectedMulti
?
2
:
1
;
if
(
j
.
apply
(
c
.
callback
.
beforeClick
,[
c
.
treeId
,
b
,
d
],
!
0
)
==!
1
)
return
!
0
;
d
===
0
?
i
.
cancelPreSelectedNode
(
c
,
b
):
i
.
selectNode
(
c
,
b
,
d
===
2
);
c
.
treeObj
.
trigger
(
f
.
event
.
CLICK
,
[
a
,
c
.
treeId
,
b
,
d
]);
return
!
0
};
J
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
j
.
apply
(
c
.
callback
.
beforeMouseDown
,[
c
.
treeId
,
b
],
!
0
)
&&
j
.
apply
(
c
.
callback
.
onMouseDown
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
K
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
j
.
apply
(
c
.
callback
.
beforeMouseUp
,[
c
.
treeId
,
b
],
!
0
)
&&
j
.
apply
(
c
.
callback
.
onMouseUp
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
L
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
j
.
apply
(
c
.
callback
.
beforeDblClick
,[
c
.
treeId
,
b
],
!
0
)
&&
j
.
apply
(
c
.
callback
.
onDblClick
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
M
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
j
.
apply
(
c
.
callback
.
beforeRightClick
,[
c
.
treeId
,
b
],
!
0
)
&&
j
.
apply
(
c
.
callback
.
onRightClick
,[
a
,
c
.
treeId
,
b
]);
return
typeof
c
.
callback
.
onRightClick
!=
"
function
"
};
u
=
function
(
a
){
a
=
a
.
originalEvent
.
srcElement
.
nodeName
.
toLowerCase
();
return
a
===
"
input
"
||
a
===
"
textarea
"
};
var
j
=
{
apply
:
function
(
a
,
b
,
c
){
return
typeof
a
==
"
function
"
?
a
.
apply
(
O
,
b
?
b
:[]):
c
},
canAsync
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
),
d
=
e
.
nodeIsParent
(
a
,
b
);
return
a
.
async
.
enable
&&
b
&&
d
&&!
(
b
.
zAsync
||
c
&&
c
.
length
>
0
)},
clone
:
function
(
a
){
if
(
a
===
null
)
return
null
;
var
b
=
j
.
isArray
(
a
)?[]:{},
c
;
for
(
c
in
a
)
b
[
c
]
=
a
[
c
]
instanceof
Date
?
new
Date
(
a
[
c
].
getTime
()):
typeof
a
[
c
]
===
"
object
"
?
j
.
clone
(
a
[
c
]):
a
[
c
];
return
b
},
eqs
:
function
(
a
,
b
){
return
a
.
toLowerCase
()
===
b
.
toLowerCase
()},
isArray
:
function
(
a
){
return
Object
.
prototype
.
toString
.
apply
(
a
)
===
"
[object Array]
"
},
isElement
:
function
(
a
){
return
typeof
HTMLElement
===
"
object
"
?
a
instanceof
HTMLElement
:
a
&&
typeof
a
===
"
object
"
&&
a
!==
null
&&
a
.
nodeType
===
1
&&
typeof
a
.
nodeName
===
"
string
"
},
$
:
function
(
a
,
b
,
c
){
b
&&
typeof
b
!=
"
string
"
&&
(
c
=
b
,
b
=
""
);
return
typeof
a
==
"
string
"
?
q
(
a
,
c
?
c
.
treeObj
.
get
(
0
).
ownerDocument
:
null
):
q
(
"
#
"
+
a
.
tId
+
b
,
c
?
c
.
treeObj
:
null
)},
getMDom
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
null
;
for
(;
b
&&
b
.
id
!==
a
.
treeId
;){
for
(
var
d
=
0
,
e
=
c
.
length
;
b
.
tagName
&&
d
<
e
;
d
++
)
if
(
j
.
eqs
(
b
.
tagName
,
c
[
d
].
tagName
)
&&
b
.
getAttribute
(
c
[
d
].
attrName
)
!==
null
)
return
b
;
b
=
b
.
parentNode
}
return
null
},
getNodeMainDom
:
function
(
a
){
return
q
(
a
).
parent
(
"
li
"
).
get
(
0
)
||
q
(
a
).
parentsUntil
(
"
li
"
).
parent
().
get
(
0
)},
isChildOrSelf
:
function
(
a
,
b
){
return
q
(
a
).
closest
(
"
#
"
+
b
).
length
>
0
},
uCanDo
:
function
(){
return
!
0
}},
i
=
{
addNodes
:
function
(
a
,
b
,
c
,
d
,
g
){
var
h
=
e
.
nodeIsParent
(
a
,
b
);
if
(
!
a
.
data
.
keep
.
leaf
||!
b
||
h
)
if
(
j
.
isArray
(
d
)
||
(
d
=
[
d
]),
a
.
data
.
simpleData
.
enable
&&
(
d
=
e
.
transformTozTreeFormat
(
a
,
d
)),
b
){
var
h
=
l
(
b
,
f
.
id
.
SWITCH
,
a
),
k
=
l
(
b
,
f
.
id
.
ICON
,
a
),
m
=
l
(
b
,
f
.
id
.
UL
,
a
);
if
(
!
b
.
open
)
i
.
replaceSwitchClass
(
b
,
h
,
f
.
folder
.
CLOSE
),
i
.
replaceIcoClass
(
b
,
k
,
f
.
folder
.
CLOSE
),
b
.
open
=!
1
,
m
.
css
({
display
:
"
none
"
});
e
.
addNodesData
(
a
,
b
,
c
,
d
);
i
.
createNodes
(
a
,
b
.
level
+
1
,
d
,
b
,
c
);
g
||
i
.
expandCollapseParentNode
(
a
,
b
,
!
0
)}
else
e
.
addNodesData
(
a
,
e
.
getRoot
(
a
),
c
,
d
),
i
.
createNodes
(
a
,
0
,
d
,
null
,
c
)},
appendNodes
:
function
(
a
,
b
,
c
,
d
,
g
,
h
,
k
){
if
(
!
c
)
return
[];
var
f
=
[],
j
=
d
?
d
:
e
.
getRoot
(
a
),
j
=
e
.
nodeChildren
(
a
,
j
),
o
,
l
;
if
(
!
j
||
g
>=
j
.
length
-
c
.
length
)
g
=-
1
;
for
(
var
n
=
0
,
Q
=
c
.
length
;
n
<
Q
;
n
++
){
var
p
=
c
[
n
];
h
&&
(
o
=
(
g
===
0
||
j
.
length
==
c
.
length
)
&&
n
==
0
,
l
=
g
<
0
&&
n
==
c
.
length
-
1
,
e
.
initNode
(
a
,
b
,
p
,
d
,
o
,
l
,
k
),
e
.
addNodeCache
(
a
,
p
));
o
=
e
.
nodeIsParent
(
a
,
p
);
l
=
[];
var
q
=
e
.
nodeChildren
(
a
,
p
);
q
&&
q
.
length
>
0
&&
(
l
=
i
.
appendNodes
(
a
,
b
+
1
,
q
,
p
,
-
1
,
h
,
k
&&
p
.
open
));
k
&&
(
i
.
makeDOMNodeMainBefore
(
f
,
a
,
p
),
i
.
makeDOMNodeLine
(
f
,
a
,
p
),
e
.
getBeforeA
(
a
,
p
,
f
),
i
.
makeDOMNodeNameBefore
(
f
,
a
,
p
),
e
.
getInnerBeforeA
(
a
,
p
,
f
),
i
.
makeDOMNodeIcon
(
f
,
a
,
p
),
e
.
getInnerAfterA
(
a
,
p
,
f
),
i
.
makeDOMNodeNameAfter
(
f
,
a
,
p
),
e
.
getAfterA
(
a
,
p
,
f
),
o
&&
p
.
open
&&
i
.
makeUlHtml
(
a
,
p
,
f
,
l
.
join
(
""
)),
i
.
makeDOMNodeMainAfter
(
f
,
a
,
p
),
e
.
addCreatedNode
(
a
,
p
))}
return
f
},
appendParentULDom
:
function
(
a
,
b
){
var
c
=
[],
d
=
l
(
b
,
a
);
!
d
.
get
(
0
)
&&
b
.
parentTId
&&
(
i
.
appendParentULDom
(
a
,
b
.
getParentNode
()),
d
=
l
(
b
,
a
));
var
g
=
l
(
b
,
f
.
id
.
UL
,
a
);
g
.
get
(
0
)
&&
g
.
remove
();
g
=
e
.
nodeChildren
(
a
,
b
);
g
=
i
.
appendNodes
(
a
,
b
.
level
+
1
,
g
,
b
,
-
1
,
!
1
,
!
0
);
i
.
makeUlHtml
(
a
,
b
,
c
,
g
.
join
(
""
));
d
.
append
(
c
.
join
(
""
))},
asyncNode
:
function
(
a
,
b
,
c
,
d
){
var
g
,
h
;
g
=
e
.
nodeIsParent
(
a
,
b
);
if
(
b
&&!
g
)
return
j
.
apply
(
d
),
!
1
;
else
if
(
b
&&
b
.
isAjaxing
)
return
!
1
;
else
if
(
j
.
apply
(
a
.
callback
.
beforeAsync
,[
a
.
treeId
,
b
],
!
0
)
==!
1
)
return
j
.
apply
(
d
),
!
1
;
if
(
b
)
b
.
isAjaxing
=!
0
,
l
(
b
,
f
.
id
.
ICON
,
a
).
attr
({
style
:
""
,
"
class
"
:
f
.
className
.
BUTTON
+
"
"
+
f
.
className
.
ICO_LOADING
});
var
k
=
{},
m
=
j
.
apply
(
a
.
async
.
autoParam
,[
a
.
treeId
,
b
],
a
.
async
.
autoParam
);
for
(
g
=
0
,
h
=
m
.
length
;
b
&&
g
<
h
;
g
++
){
var
r
=
m
[
g
].
split
(
"
=
"
),
o
=
r
;
r
.
length
>
1
&&
(
o
=
r
[
1
],
r
=
r
[
0
]);
k
[
o
]
=
b
[
r
]}
m
=
j
.
apply
(
a
.
async
.
otherParam
,[
a
.
treeId
,
b
],
a
.
async
.
otherParam
);
if
(
j
.
isArray
(
m
))
for
(
g
=
0
,
h
=
m
.
length
;
g
<
h
;
g
+=
2
)
k
[
m
[
g
]]
=
m
[
g
+
1
];
else
for
(
var
n
in
m
)
k
[
n
]
=
m
[
n
];
var
P
=
e
.
getRoot
(
a
).
_ver
;
q
.
ajax
({
contentType
:
a
.
async
.
contentType
,
cache
:
!
1
,
type
:
a
.
async
.
type
,
url
:
j
.
apply
(
a
.
async
.
url
,[
a
.
treeId
,
b
],
a
.
async
.
url
),
data
:
a
.
async
.
contentType
.
indexOf
(
"
application/json
"
)
>-
1
?
JSON
.
stringify
(
k
):
k
,
dataType
:
a
.
async
.
dataType
,
headers
:
a
.
async
.
headers
,
xhrFields
:
a
.
async
.
xhrFields
,
success
:
function
(
h
){
if
(
P
==
e
.
getRoot
(
a
).
_ver
){
var
k
=
[];
try
{
k
=!
h
||
h
.
length
==
0
?[]:
typeof
h
==
"
string
"
?
eval
(
"
(
"
+
h
+
"
)
"
):
h
}
catch
(
g
){
k
=
h
}
if
(
b
)
b
.
isAjaxing
=
null
,
b
.
zAsync
=!
0
;
i
.
setNodeLineIcos
(
a
,
b
);
k
&&
k
!==
""
?(
k
=
j
.
apply
(
a
.
async
.
dataFilter
,[
a
.
treeId
,
b
,
k
],
k
),
i
.
addNodes
(
a
,
b
,
-
1
,
k
?
j
.
clone
(
k
):[],
!!
c
)):
i
.
addNodes
(
a
,
b
,
-
1
,[],
!!
c
);
a
.
treeObj
.
trigger
(
f
.
event
.
ASYNC_SUCCESS
,[
a
.
treeId
,
b
,
h
]);
j
.
apply
(
d
)}},
error
:
function
(
c
,
d
,
h
){
if
(
P
==
e
.
getRoot
(
a
).
_ver
){
if
(
b
)
b
.
isAjaxing
=
null
;
i
.
setNodeLineIcos
(
a
,
b
);
a
.
treeObj
.
trigger
(
f
.
event
.
ASYNC_ERROR
,[
a
.
treeId
,
b
,
c
,
d
,
h
])}}});
return
!
0
},
cancelPreSelectedNode
:
function
(
a
,
b
,
c
){
var
d
=
e
.
getRoot
(
a
).
curSelectedList
,
g
,
h
;
for
(
g
=
d
.
length
-
1
;
g
>=
0
;
g
--
)
if
(
h
=
d
[
g
],
b
===
h
||!
b
&&
(
!
c
||
c
!==
h
))
if
(
l
(
h
,
f
.
id
.
A
,
a
).
removeClass
(
f
.
node
.
CURSELECTED
),
b
){
e
.
removeSelectedNode
(
a
,
b
);
break
}
else
d
.
splice
(
g
,
1
),
a
.
treeObj
.
trigger
(
f
.
event
.
UNSELECTED
,[
a
.
treeId
,
h
])},
createNodeCallback
:
function
(
a
){
if
(
a
.
callback
.
onNodeCreated
||
a
.
view
.
addDiyDom
)
for
(
var
b
=
e
.
getRoot
(
a
);
b
.
createdNodes
.
length
>
0
;){
var
c
=
b
.
createdNodes
.
shift
();
j
.
apply
(
a
.
view
.
addDiyDom
,[
a
.
treeId
,
c
]);
a
.
callback
.
onNodeCreated
&&
a
.
treeObj
.
trigger
(
f
.
event
.
NODECREATED
,[
a
.
treeId
,
c
])}},
createNodes
:
function
(
a
,
b
,
c
,
d
,
g
){
if
(
c
&&
c
.
length
!=
0
){
var
h
=
e
.
getRoot
(
a
),
k
=!
d
||
d
.
open
||!!
l
(
e
.
nodeChildren
(
a
,
d
)[
0
],
a
).
get
(
0
);
h
.
createdNodes
=
[];
var
b
=
i
.
appendNodes
(
a
,
b
,
c
,
d
,
g
,
!
0
,
k
),
m
,
j
;
d
?(
d
=
l
(
d
,
f
.
id
.
UL
,
a
),
d
.
get
(
0
)
&&
(
m
=
d
)):
m
=
a
.
treeObj
;
m
&&
(
g
>=
0
&&
(
j
=
m
.
children
()[
g
]),
g
>=
0
&&
j
?
q
(
j
).
before
(
b
.
join
(
""
)):
m
.
append
(
b
.
join
(
""
)));
i
.
createNodeCallback
(
a
)}},
destroy
:
function
(
a
){
a
&&
(
e
.
initCache
(
a
),
e
.
initRoot
(
a
),
n
.
unbindTree
(
a
),
n
.
unbindEvent
(
a
),
a
.
treeObj
.
empty
(),
delete
s
[
a
.
treeId
])},
expandCollapseNode
:
function
(
a
,
b
,
c
,
d
,
g
){
var
h
=
e
.
getRoot
(
a
),
k
;
if
(
b
){
var
m
=
e
.
nodeChildren
(
a
,
b
),
r
=
e
.
nodeIsParent
(
a
,
b
);
if
(
h
.
expandTriggerFlag
)
k
=
g
,
g
=
function
(){
k
&&
k
();
b
.
open
?
a
.
treeObj
.
trigger
(
f
.
event
.
EXPAND
,[
a
.
treeId
,
b
]):
a
.
treeObj
.
trigger
(
f
.
event
.
COLLAPSE
,[
a
.
treeId
,
b
])},
h
.
expandTriggerFlag
=!
1
;
if
(
!
b
.
open
&&
r
&&
(
!
l
(
b
,
f
.
id
.
UL
,
a
).
get
(
0
)
||
m
&&
m
.
length
>
0
&&!
l
(
m
[
0
],
a
).
get
(
0
)))
i
.
appendParentULDom
(
a
,
b
),
i
.
createNodeCallback
(
a
);
if
(
b
.
open
==
c
)
j
.
apply
(
g
,[]);
else
{
var
c
=
l
(
b
,
f
.
id
.
UL
,
a
),
h
=
l
(
b
,
f
.
id
.
SWITCH
,
a
),
o
=
l
(
b
,
f
.
id
.
ICON
,
a
);
r
?(
b
.
open
=!
b
.
open
,
b
.
iconOpen
&&
b
.
iconClose
&&
o
.
attr
(
"
style
"
,
i
.
makeNodeIcoStyle
(
a
,
b
)),
b
.
open
?(
i
.
replaceSwitchClass
(
b
,
h
,
f
.
folder
.
OPEN
),
i
.
replaceIcoClass
(
b
,
o
,
f
.
folder
.
OPEN
),
d
==!
1
||
a
.
view
.
expandSpeed
==
""
?(
c
.
show
(),
j
.
apply
(
g
,[])):
m
&&
m
.
length
>
0
?
c
.
slideDown
(
a
.
view
.
expandSpeed
,
g
):(
c
.
show
(),
j
.
apply
(
g
,[]))):(
i
.
replaceSwitchClass
(
b
,
h
,
f
.
folder
.
CLOSE
),
i
.
replaceIcoClass
(
b
,
o
,
f
.
folder
.
CLOSE
),
d
==!
1
||
a
.
view
.
expandSpeed
==
""
||!
(
m
&&
m
.
length
>
0
)?(
c
.
hide
(),
j
.
apply
(
g
,[])):
c
.
slideUp
(
a
.
view
.
expandSpeed
,
g
))):
j
.
apply
(
g
,[])}}
else
j
.
apply
(
g
,
[])},
expandCollapseParentNode
:
function
(
a
,
b
,
c
,
d
,
e
){
b
&&
(
b
.
parentTId
?(
i
.
expandCollapseNode
(
a
,
b
,
c
,
d
),
b
.
parentTId
&&
i
.
expandCollapseParentNode
(
a
,
b
.
getParentNode
(),
c
,
d
,
e
)):
i
.
expandCollapseNode
(
a
,
b
,
c
,
d
,
e
))},
expandCollapseSonNode
:
function
(
a
,
b
,
c
,
d
,
g
){
var
h
=
e
.
getRoot
(
a
),
h
=
b
?
e
.
nodeChildren
(
a
,
b
):
e
.
nodeChildren
(
a
,
h
),
k
=
b
?
!
1
:
d
,
f
=
e
.
getRoot
(
a
).
expandTriggerFlag
;
e
.
getRoot
(
a
).
expandTriggerFlag
=!
1
;
if
(
h
)
for
(
var
j
=
0
,
l
=
h
.
length
;
j
<
l
;
j
++
)
h
[
j
]
&&
i
.
expandCollapseSonNode
(
a
,
h
[
j
],
c
,
k
);
e
.
getRoot
(
a
).
expandTriggerFlag
=
f
;
i
.
expandCollapseNode
(
a
,
b
,
c
,
d
,
g
)},
isSelectedNode
:
function
(
a
,
b
){
if
(
!
b
)
return
!
1
;
var
c
=
e
.
getRoot
(
a
).
curSelectedList
,
d
;
for
(
d
=
c
.
length
-
1
;
d
>=
0
;
d
--
)
if
(
b
===
c
[
d
])
return
!
0
;
return
!
1
},
makeDOMNodeIcon
:
function
(
a
,
b
,
c
){
var
d
=
e
.
nodeName
(
b
,
c
),
d
=
b
.
view
.
nameIsHTML
?
d
:
d
.
replace
(
/&/g
,
"
&
"
).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
);
a
.
push
(
"
<span id='
"
,
c
.
tId
,
f
.
id
.
ICON
,
"
' title='' treeNode
"
,
f
.
id
.
ICON
,
"
class='
"
,
i
.
makeNodeIcoClass
(
b
,
c
),
"
' style='
"
,
i
.
makeNodeIcoStyle
(
b
,
c
),
"
'></span><span id='
"
,
c
.
tId
,
f
.
id
.
SPAN
,
"
' class='
"
,
f
.
className
.
NAME
,
"
'>
"
,
d
,
"
</span>
"
)},
makeDOMNodeLine
:
function
(
a
,
b
,
c
){
a
.
push
(
"
<span id='
"
,
c
.
tId
,
f
.
id
.
SWITCH
,
"
' title='' class='
"
,
i
.
makeNodeLineClass
(
b
,
c
),
"
' treeNode
"
,
f
.
id
.
SWITCH
,
"
></span>
"
)},
makeDOMNodeMainAfter
:
function
(
a
){
a
.
push
(
"
</li>
"
)},
makeDOMNodeMainBefore
:
function
(
a
,
b
,
c
){
a
.
push
(
"
<li id='
"
,
c
.
tId
,
"
' class='
"
,
f
.
className
.
LEVEL
,
c
.
level
,
"
' tabindex='0' hidefocus='true' treenode>
"
)},
makeDOMNodeNameAfter
:
function
(
a
){
a
.
push
(
"
</a>
"
)},
makeDOMNodeNameBefore
:
function
(
a
,
b
,
c
){
var
d
=
e
.
nodeTitle
(
b
,
c
),
g
=
i
.
makeNodeUrl
(
b
,
c
),
h
=
i
.
makeNodeFontCss
(
b
,
c
),
k
=
[],
m
;
for
(
m
in
h
)
k
.
push
(
m
,
"
:
"
,
h
[
m
],
"
;
"
);
a
.
push
(
"
<a id='
"
,
c
.
tId
,
f
.
id
.
A
,
"
' class='
"
,
f
.
className
.
LEVEL
,
c
.
level
,
"
' treeNode
"
,
f
.
id
.
A
,
'
onclick="
'
,
c
.
click
||
""
,
'
"
'
,
g
!=
null
&&
g
.
length
>
0
?
"
href='
"
+
g
+
"
'
"
:
""
,
"
target='
"
,
i
.
makeNodeTarget
(
c
),
"
' style='
"
,
k
.
join
(
""
),
"
'
"
);
j
.
apply
(
b
.
view
.
showTitle
,[
b
.
treeId
,
c
],
b
.
view
.
showTitle
)
&&
d
&&
a
.
push
(
"
title='
"
,
d
.
replace
(
/'/g
,
"
'
"
).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
),
"
'
"
);
a
.
push
(
"
>
"
)},
makeNodeFontCss
:
function
(
a
,
b
){
var
c
=
j
.
apply
(
a
.
view
.
fontCss
,[
a
.
treeId
,
b
],
a
.
view
.
fontCss
);
return
c
&&
typeof
c
!=
"
function
"
?
c
:{}},
makeNodeIcoClass
:
function
(
a
,
b
){
var
c
=
[
"
ico
"
];
if
(
!
b
.
isAjaxing
){
var
d
=
e
.
nodeIsParent
(
a
,
b
);
c
[
0
]
=
(
b
.
iconSkin
?
b
.
iconSkin
+
"
_
"
:
""
)
+
c
[
0
];
d
?
c
.
push
(
b
.
open
?
f
.
folder
.
OPEN
:
f
.
folder
.
CLOSE
):
c
.
push
(
f
.
folder
.
DOCU
)}
return
f
.
className
.
BUTTON
+
"
"
+
c
.
join
(
"
_
"
)},
makeNodeIcoStyle
:
function
(
a
,
b
){
var
c
=
[];
if
(
!
b
.
isAjaxing
){
var
d
=
e
.
nodeIsParent
(
a
,
b
)
&&
b
.
iconOpen
&&
b
.
iconClose
?
b
.
open
?
b
.
iconOpen
:
b
.
iconClose
:
b
[
a
.
data
.
key
.
icon
];
d
&&
c
.
push
(
"
background:url(
"
,
d
,
"
) 0 0 no-repeat;
"
);(
a
.
view
.
showIcon
==
!
1
||!
j
.
apply
(
a
.
view
.
showIcon
,[
a
.
treeId
,
b
],
!
0
))
&&
c
.
push
(
"
width:0px;height:0px;
"
)}
return
c
.
join
(
""
)},
makeNodeLineClass
:
function
(
a
,
b
){
var
c
=
[];
a
.
view
.
showLine
?
b
.
level
==
0
&&
b
.
isFirstNode
&&
b
.
isLastNode
?
c
.
push
(
f
.
line
.
ROOT
):
b
.
level
==
0
&&
b
.
isFirstNode
?
c
.
push
(
f
.
line
.
ROOTS
):
b
.
isLastNode
?
c
.
push
(
f
.
line
.
BOTTOM
):
c
.
push
(
f
.
line
.
CENTER
):
c
.
push
(
f
.
line
.
NOLINE
);
e
.
nodeIsParent
(
a
,
b
)?
c
.
push
(
b
.
open
?
f
.
folder
.
OPEN
:
f
.
folder
.
CLOSE
):
c
.
push
(
f
.
folder
.
DOCU
);
return
i
.
makeNodeLineClassEx
(
b
)
+
c
.
join
(
"
_
"
)},
makeNodeLineClassEx
:
function
(
a
){
return
f
.
className
.
BUTTON
+
"
"
+
f
.
className
.
LEVEL
+
a
.
level
+
"
"
+
f
.
className
.
SWITCH
+
"
"
},
makeNodeTarget
:
function
(
a
){
return
a
.
target
||
"
_blank
"
},
makeNodeUrl
:
function
(
a
,
b
){
var
c
=
a
.
data
.
key
.
url
;
return
b
[
c
]?
b
[
c
]:
null
},
makeUlHtml
:
function
(
a
,
b
,
c
,
d
){
c
.
push
(
"
<ul id='
"
,
b
.
tId
,
f
.
id
.
UL
,
"
' class='
"
,
f
.
className
.
LEVEL
,
b
.
level
,
"
"
,
i
.
makeUlLineClass
(
a
,
b
),
"
' style='display:
"
,
b
.
open
?
"
block
"
:
"
none
"
,
"
'>
"
);
c
.
push
(
d
);
c
.
push
(
"
</ul>
"
)},
makeUlLineClass
:
function
(
a
,
b
){
return
a
.
view
.
showLine
&&!
b
.
isLastNode
?
f
.
line
.
LINE
:
""
},
removeChildNodes
:
function
(
a
,
b
){
if
(
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
){
for
(
var
d
=
0
,
g
=
c
.
length
;
d
<
g
;
d
++
)
e
.
removeNodeCache
(
a
,
c
[
d
]);
e
.
removeSelectedNode
(
a
);
delete
b
[
a
.
data
.
key
.
children
];
a
.
data
.
keep
.
parent
?
l
(
b
,
f
.
id
.
UL
,
a
).
empty
():(
e
.
nodeIsParent
(
a
,
b
,
!
1
),
b
.
open
=!
1
,
c
=
l
(
b
,
f
.
id
.
SWITCH
,
a
),
d
=
l
(
b
,
f
.
id
.
ICON
,
a
),
i
.
replaceSwitchClass
(
b
,
c
,
f
.
folder
.
DOCU
),
i
.
replaceIcoClass
(
b
,
d
,
f
.
folder
.
DOCU
),
l
(
b
,
f
.
id
.
UL
,
a
).
remove
())}}},
scrollIntoView
:
function
(
a
,
b
){
if
(
b
)
if
(
typeof
Element
===
"
undefined
"
){
var
c
=
a
.
treeObj
.
get
(
0
).
getBoundingClientRect
(),
d
=
b
.
getBoundingClientRect
();(
d
.
top
<
c
.
top
||
d
.
bottom
>
c
.
bottom
||
d
.
right
>
c
.
right
||
d
.
left
<
c
.
left
)
&&
b
.
scrollIntoView
()}
else
{
if
(
!
Element
.
prototype
.
scrollIntoViewIfNeeded
)
Element
.
prototype
.
scrollIntoViewIfNeeded
=
function
(
a
){
function
b
(
a
,
c
,
d
,
f
){
return
{
left
:
a
,
top
:
c
,
width
:
d
,
height
:
f
,
right
:
a
+
d
,
bottom
:
c
+
f
,
translate
:
function
(
e
,
g
){
return
b
(
e
+
a
,
g
+
c
,
d
,
f
)},
relativeFromTo
:
function
(
g
,
k
){
var
i
=
a
,
j
=
c
,
g
=
g
.
offsetParent
,
k
=
k
.
offsetParent
;
if
(
g
===
k
)
return
e
;
for
(;
g
;
g
=
g
.
offsetParent
)
i
+=
g
.
offsetLeft
+
g
.
clientLeft
,
j
+=
g
.
offsetTop
+
g
.
clientTop
;
for
(;
k
;
k
=
k
.
offsetParent
)
i
-=
k
.
offsetLeft
+
k
.
clientLeft
,
j
-=
k
.
offsetTop
+
k
.
clientTop
;
return
b
(
i
,
j
,
d
,
f
)}}}
for
(
var
c
,
d
=
this
,
e
=
b
(
this
.
offsetLeft
,
this
.
offsetTop
,
this
.
offsetWidth
,
this
.
offsetHeight
);
j
.
isElement
(
c
=
d
.
parentNode
);){
var
f
=
c
.
offsetLeft
+
c
.
clientLeft
,
i
=
c
.
offsetTop
+
c
.
clientTop
,
e
=
e
.
relativeFromTo
(
d
,
c
).
translate
(
-
f
,
-
i
);
c
.
scrollLeft
=!
1
===
a
||
e
.
left
<=
c
.
scrollLeft
+
c
.
clientWidth
&&
c
.
scrollLeft
<=
e
.
right
-
c
.
clientWidth
+
c
.
clientWidth
?
Math
.
min
(
e
.
left
,
Math
.
max
(
e
.
right
-
c
.
clientWidth
,
c
.
scrollLeft
)):(
e
.
right
-
c
.
clientWidth
+
e
.
left
)
/
2
;
c
.
scrollTop
=
!
1
===
a
||
e
.
top
<=
c
.
scrollTop
+
c
.
clientHeight
&&
c
.
scrollTop
<=
e
.
bottom
-
c
.
clientHeight
+
c
.
clientHeight
?
Math
.
min
(
e
.
top
,
Math
.
max
(
e
.
bottom
-
c
.
clientHeight
,
c
.
scrollTop
)):(
e
.
bottom
-
c
.
clientHeight
+
e
.
top
)
/
2
;
e
=
e
.
translate
(
f
-
c
.
scrollLeft
,
i
-
c
.
scrollTop
);
d
=
c
}};
b
.
scrollIntoViewIfNeeded
()}},
setFirstNode
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
.
length
>
0
)
c
[
0
].
isFirstNode
=!
0
},
setLastNode
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
.
length
>
0
)
c
[
c
.
length
-
1
].
isLastNode
=!
0
},
removeNode
:
function
(
a
,
b
){
var
c
=
e
.
getRoot
(
a
),
d
=
b
.
parentTId
?
b
.
getParentNode
():
c
;
b
.
isFirstNode
=!
1
;
b
.
isLastNode
=!
1
;
b
.
getPreNode
=
function
(){
return
null
};
b
.
getNextNode
=
function
(){
return
null
};
if
(
e
.
getNodeCache
(
a
,
b
.
tId
)){
l
(
b
,
a
).
remove
();
e
.
removeNodeCache
(
a
,
b
);
e
.
removeSelectedNode
(
a
,
b
);
for
(
var
g
=
e
.
nodeChildren
(
a
,
d
),
h
=
0
,
k
=
g
.
length
;
h
<
k
;
h
++
)
if
(
g
[
h
].
tId
==
b
.
tId
){
g
.
splice
(
h
,
1
);
break
}
i
.
setFirstNode
(
a
,
d
);
i
.
setLastNode
(
a
,
d
);
var
j
,
h
=
g
.
length
;
if
(
!
a
.
data
.
keep
.
parent
&&
h
==
0
)
e
.
nodeIsParent
(
a
,
d
,
!
1
),
d
.
open
=!
1
,
delete
d
[
a
.
data
.
key
.
children
],
h
=
l
(
d
,
f
.
id
.
UL
,
a
),
k
=
l
(
d
,
f
.
id
.
SWITCH
,
a
),
j
=
l
(
d
,
f
.
id
.
ICON
,
a
),
i
.
replaceSwitchClass
(
d
,
k
,
f
.
folder
.
DOCU
),
i
.
replaceIcoClass
(
d
,
j
,
f
.
folder
.
DOCU
),
h
.
css
(
"
display
"
,
"
none
"
);
else
if
(
a
.
view
.
showLine
&&
h
>
0
){
var
r
=
g
[
h
-
1
],
h
=
l
(
r
,
f
.
id
.
UL
,
a
),
k
=
l
(
r
,
f
.
id
.
SWITCH
,
a
);
j
=
l
(
r
,
f
.
id
.
ICON
,
a
);
d
==
c
?
g
.
length
==
1
?
i
.
replaceSwitchClass
(
r
,
k
,
f
.
line
.
ROOT
):(
c
=
l
(
g
[
0
],
f
.
id
.
SWITCH
,
a
),
i
.
replaceSwitchClass
(
g
[
0
],
c
,
f
.
line
.
ROOTS
),
i
.
replaceSwitchClass
(
r
,
k
,
f
.
line
.
BOTTOM
)):
i
.
replaceSwitchClass
(
r
,
k
,
f
.
line
.
BOTTOM
);
h
.
removeClass
(
f
.
line
.
LINE
)}}},
replaceIcoClass
:
function
(
a
,
b
,
c
){
if
(
b
&&!
a
.
isAjaxing
&&
(
a
=
b
.
attr
(
"
class
"
),
a
!=
void
0
)){
a
=
a
.
split
(
"
_
"
);
switch
(
c
){
case
f
.
folder
.
OPEN
:
case
f
.
folder
.
CLOSE
:
case
f
.
folder
.
DOCU
:
a
[
a
.
length
-
1
]
=
c
}
b
.
attr
(
"
class
"
,
a
.
join
(
"
_
"
))}},
replaceSwitchClass
:
function
(
a
,
b
,
c
){
if
(
b
){
var
d
=
b
.
attr
(
"
class
"
);
if
(
d
!=
void
0
){
d
=
d
.
split
(
"
_
"
);
switch
(
c
){
case
f
.
line
.
ROOT
:
case
f
.
line
.
ROOTS
:
case
f
.
line
.
CENTER
:
case
f
.
line
.
BOTTOM
:
case
f
.
line
.
NOLINE
:
d
[
0
]
=
i
.
makeNodeLineClassEx
(
a
)
+
c
;
break
;
case
f
.
folder
.
OPEN
:
case
f
.
folder
.
CLOSE
:
case
f
.
folder
.
DOCU
:
d
[
1
]
=
c
}
b
.
attr
(
"
class
"
,
d
.
join
(
"
_
"
));
c
!==
f
.
folder
.
DOCU
?
b
.
removeAttr
(
"
disabled
"
):
b
.
attr
(
"
disabled
"
,
"
disabled
"
)}}},
selectNode
:
function
(
a
,
b
,
c
){
c
||
i
.
cancelPreSelectedNode
(
a
,
null
,
b
);
l
(
b
,
f
.
id
.
A
,
a
).
addClass
(
f
.
node
.
CURSELECTED
);
e
.
addSelectedNode
(
a
,
b
);
a
.
treeObj
.
trigger
(
f
.
event
.
SELECTED
,[
a
.
treeId
,
b
])},
setNodeFontCss
:
function
(
a
,
b
){
var
c
=
l
(
b
,
f
.
id
.
A
,
a
),
d
=
i
.
makeNodeFontCss
(
a
,
b
);
d
&&
c
.
css
(
d
)},
setNodeLineIcos
:
function
(
a
,
b
){
if
(
b
){
var
c
=
l
(
b
,
f
.
id
.
SWITCH
,
a
),
d
=
l
(
b
,
f
.
id
.
UL
,
a
),
g
=
l
(
b
,
f
.
id
.
ICON
,
a
),
h
=
i
.
makeUlLineClass
(
a
,
b
);
h
.
length
==
0
?
d
.
removeClass
(
f
.
line
.
LINE
):
d
.
addClass
(
h
);
c
.
attr
(
"
class
"
,
i
.
makeNodeLineClass
(
a
,
b
));
e
.
nodeIsParent
(
a
,
b
)?
c
.
removeAttr
(
"
disabled
"
):
c
.
attr
(
"
disabled
"
,
"
disabled
"
);
g
.
removeAttr
(
"
style
"
);
g
.
attr
(
"
style
"
,
i
.
makeNodeIcoStyle
(
a
,
b
));
g
.
attr
(
"
class
"
,
i
.
makeNodeIcoClass
(
a
,
b
))}},
setNodeName
:
function
(
a
,
b
){
var
c
=
e
.
nodeTitle
(
a
,
b
),
d
=
l
(
b
,
f
.
id
.
SPAN
,
a
);
d
.
empty
();
a
.
view
.
nameIsHTML
?
d
.
html
(
e
.
nodeName
(
a
,
b
)):
d
.
text
(
e
.
nodeName
(
a
,
b
));
j
.
apply
(
a
.
view
.
showTitle
,[
a
.
treeId
,
b
],
a
.
view
.
showTitle
)
&&
l
(
b
,
f
.
id
.
A
,
a
).
attr
(
"
title
"
,
!
c
?
""
:
c
)},
setNodeTarget
:
function
(
a
,
b
){
l
(
b
,
f
.
id
.
A
,
a
).
attr
(
"
target
"
,
i
.
makeNodeTarget
(
b
))},
setNodeUrl
:
function
(
a
,
b
){
var
c
=
l
(
b
,
f
.
id
.
A
,
a
),
d
=
i
.
makeNodeUrl
(
a
,
b
);
d
==
null
||
d
.
length
==
0
?
c
.
removeAttr
(
"
href
"
):
c
.
attr
(
"
href
"
,
d
)},
switchNode
:
function
(
a
,
b
){
b
.
open
||!
j
.
canAsync
(
a
,
b
)?
i
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
):
a
.
async
.
enable
?
i
.
asyncNode
(
a
,
b
)
||
i
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
):
b
&&
i
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
)}};
q
.
fn
.
zTree
=
{
consts
:{
className
:{
BUTTON
:
"
button
"
,
LEVEL
:
"
level
"
,
ICO_LOADING
:
"
ico_loading
"
,
SWITCH
:
"
switch
"
,
NAME
:
"
node_name
"
},
event
:{
NODECREATED
:
"
ztree_nodeCreated
"
,
CLICK
:
"
ztree_click
"
,
EXPAND
:
"
ztree_expand
"
,
COLLAPSE
:
"
ztree_collapse
"
,
ASYNC_SUCCESS
:
"
ztree_async_success
"
,
ASYNC_ERROR
:
"
ztree_async_error
"
,
REMOVE
:
"
ztree_remove
"
,
SELECTED
:
"
ztree_selected
"
,
UNSELECTED
:
"
ztree_unselected
"
},
id
:{
A
:
"
_a
"
,
ICON
:
"
_ico
"
,
SPAN
:
"
_span
"
,
SWITCH
:
"
_switch
"
,
UL
:
"
_ul
"
},
line
:{
ROOT
:
"
root
"
,
ROOTS
:
"
roots
"
,
CENTER
:
"
center
"
,
BOTTOM
:
"
bottom
"
,
NOLINE
:
"
noline
"
,
LINE
:
"
line
"
},
folder
:{
OPEN
:
"
open
"
,
CLOSE
:
"
close
"
,
DOCU
:
"
docu
"
},
node
:{
CURSELECTED
:
"
curSelectedNode
"
}},
_z
:{
tools
:
j
,
view
:
i
,
event
:
n
,
data
:
e
},
getZTreeObj
:
function
(
a
){
return
(
a
=
e
.
getZTreeTools
(
a
))?
a
:
null
},
destroy
:
function
(
a
){
if
(
a
&&
a
.
length
>
0
)
i
.
destroy
(
e
.
getSetting
(
a
));
else
for
(
var
b
in
s
)
i
.
destroy
(
s
[
b
])},
init
:
function
(
a
,
b
,
c
){
var
d
=
j
.
clone
(
N
);
q
.
extend
(
!
0
,
d
,
b
);
d
.
treeId
=
a
.
attr
(
"
id
"
);
d
.
treeObj
=
a
;
d
.
treeObj
.
empty
();
s
[
d
.
treeId
]
=
d
;
if
(
typeof
document
.
body
.
style
.
maxHeight
===
"
undefined
"
)
d
.
view
.
expandSpeed
=
""
;
e
.
initRoot
(
d
);
a
=
e
.
getRoot
(
d
);
c
=
c
?
j
.
clone
(
j
.
isArray
(
c
)?
c
:[
c
]):[];
d
.
data
.
simpleData
.
enable
?
e
.
nodeChildren
(
d
,
a
,
e
.
transformTozTreeFormat
(
d
,
c
)):
e
.
nodeChildren
(
d
,
a
,
c
);
e
.
initCache
(
d
);
n
.
unbindTree
(
d
);
n
.
bindTree
(
d
);
n
.
unbindEvent
(
d
);
n
.
bindEvent
(
d
);
var
g
=
{
setting
:
d
,
addNodes
:
function
(
a
,
b
,
c
,
g
){
function
f
(){
i
.
addNodes
(
d
,
a
,
b
,
n
,
g
==!
0
)}
a
||
(
a
=
null
);
var
l
=
e
.
nodeIsParent
(
d
,
a
);
if
(
a
&&!
l
&&
d
.
data
.
keep
.
leaf
)
return
null
;
l
=
parseInt
(
b
,
10
);
isNaN
(
l
)?(
g
=!!
c
,
c
=
b
,
b
=-
1
):
b
=
l
;
if
(
!
c
)
return
null
;
var
n
=
j
.
clone
(
j
.
isArray
(
c
)?
c
:[
c
]);
j
.
canAsync
(
d
,
a
)?
i
.
asyncNode
(
d
,
a
,
g
,
f
):
f
();
return
n
},
cancelSelectedNode
:
function
(
a
){
i
.
cancelPreSelectedNode
(
d
,
a
)},
destroy
:
function
(){
i
.
destroy
(
d
)},
expandAll
:
function
(
a
){
a
=!!
a
;
i
.
expandCollapseSonNode
(
d
,
null
,
a
,
!
0
);
return
a
},
expandNode
:
function
(
a
,
b
,
c
,
g
,
f
){
function
n
(){
var
b
=
l
(
a
,
d
).
get
(
0
);
b
&&
g
!==!
1
&&
i
.
scrollIntoView
(
d
,
b
)}
if
(
!
a
||!
e
.
nodeIsParent
(
d
,
a
))
return
null
;
b
!==!
0
&&
b
!==!
1
&&
(
b
=!
a
.
open
);
if
((
f
=!!
f
)
&&
b
&&
j
.
apply
(
d
.
callback
.
beforeExpand
,[
d
.
treeId
,
a
],
!
0
)
==!
1
)
return
null
;
else
if
(
f
&&!
b
&&
j
.
apply
(
d
.
callback
.
beforeCollapse
,[
d
.
treeId
,
a
],
!
0
)
==!
1
)
return
null
;
b
&&
a
.
parentTId
&&
i
.
expandCollapseParentNode
(
d
,
a
.
getParentNode
(),
b
,
!
1
);
if
(
b
===
a
.
open
&&!
c
)
return
null
;
e
.
getRoot
(
d
).
expandTriggerFlag
=
f
;
!
j
.
canAsync
(
d
,
a
)
&&
c
?
i
.
expandCollapseSonNode
(
d
,
a
,
b
,
!
0
,
n
):(
a
.
open
=!
b
,
i
.
switchNode
(
this
.
setting
,
a
),
n
());
return
b
},
getNodes
:
function
(){
return
e
.
getNodes
(
d
)},
getNodeByParam
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodeByParam
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodeByTId
:
function
(
a
){
return
e
.
getNodeCache
(
d
,
a
)},
getNodesByParam
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodesByParam
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodesByParamFuzzy
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodesByParamFuzzy
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodesByFilter
:
function
(
a
,
b
,
c
,
f
){
b
=!!
b
;
return
!
a
||
typeof
a
!=
"
function
"
?
b
?
null
:[]:
e
.
getNodesByFilter
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
,
f
)},
getNodeIndex
:
function
(
a
){
if
(
!
a
)
return
null
;
for
(
var
b
=
a
.
parentTId
?
a
.
getParentNode
():
e
.
getRoot
(
d
),
b
=
e
.
nodeChildren
(
d
,
b
),
c
=
0
,
f
=
b
.
length
;
c
<
f
;
c
++
)
if
(
b
[
c
]
==
a
)
return
c
;
return
-
1
},
getSelectedNodes
:
function
(){
for
(
var
a
=
[],
b
=
e
.
getRoot
(
d
).
curSelectedList
,
c
=
0
,
f
=
b
.
length
;
c
<
f
;
c
++
)
a
.
push
(
b
[
c
]);
return
a
},
isSelectedNode
:
function
(
a
){
return
e
.
isSelectedNode
(
d
,
a
)},
reAsyncChildNodesPromise
:
function
(
a
,
b
,
c
){
return
new
Promise
(
function
(
d
,
e
){
try
{
g
.
reAsyncChildNodes
(
a
,
b
,
c
,
function
(){
d
(
a
)})}
catch
(
f
){
e
(
f
)}})},
reAsyncChildNodes
:
function
(
a
,
b
,
c
,
g
){
if
(
this
.
setting
.
async
.
enable
){
var
j
=!
a
;
j
&&
(
a
=
e
.
getRoot
(
d
));
if
(
b
==
"
refresh
"
){
for
(
var
b
=
e
.
nodeChildren
(
d
,
a
),
n
=
0
,
q
=
b
?
b
.
length
:
0
;
n
<
q
;
n
++
)
e
.
removeNodeCache
(
d
,
b
[
n
]);
e
.
removeSelectedNode
(
d
);
e
.
nodeChildren
(
d
,
a
,[]);
j
?
this
.
setting
.
treeObj
.
empty
():
l
(
a
,
f
.
id
.
UL
,
d
).
empty
()}
i
.
asyncNode
(
this
.
setting
,
j
?
null
:
a
,
!!
c
,
g
)}},
refresh
:
function
(){
this
.
setting
.
treeObj
.
empty
();
var
a
=
e
.
getRoot
(
d
),
b
=
e
.
nodeChildren
(
d
,
a
);
e
.
initRoot
(
d
);
e
.
nodeChildren
(
d
,
a
,
b
);
e
.
initCache
(
d
);
i
.
createNodes
(
d
,
0
,
e
.
nodeChildren
(
d
,
a
),
null
,
-
1
)},
removeChildNodes
:
function
(
a
){
if
(
!
a
)
return
null
;
var
b
=
e
.
nodeChildren
(
d
,
a
);
i
.
removeChildNodes
(
d
,
a
);
return
b
?
b
:
null
},
removeNode
:
function
(
a
,
b
){
a
&&
(
b
=!!
b
,
b
&&
j
.
apply
(
d
.
callback
.
beforeRemove
,[
d
.
treeId
,
a
],
!
0
)
==!
1
||
(
i
.
removeNode
(
d
,
a
),
b
&&
this
.
setting
.
treeObj
.
trigger
(
f
.
event
.
REMOVE
,[
d
.
treeId
,
a
])))},
selectNode
:
function
(
a
,
b
,
c
){
function
e
(){
if
(
!
c
){
var
b
=
l
(
a
,
d
).
get
(
0
);
i
.
scrollIntoView
(
d
,
b
)}}
if
(
a
&&
j
.
uCanDo
(
d
)){
b
=
d
.
view
.
selectedMulti
&&
b
;
if
(
a
.
parentTId
)
i
.
expandCollapseParentNode
(
d
,
a
.
getParentNode
(),
!
0
,
!
1
,
e
);
else
if
(
!
c
)
try
{
l
(
a
,
d
).
focus
().
blur
()}
catch
(
f
){}
i
.
selectNode
(
d
,
a
,
b
)}},
transformTozTreeNodes
:
function
(
a
){
return
e
.
transformTozTreeFormat
(
d
,
a
)},
transformToArray
:
function
(
a
){
return
e
.
transformToArrayFormat
(
d
,
a
)},
updateNode
:
function
(
a
){
a
&&
l
(
a
,
d
).
get
(
0
)
&&
j
.
uCanDo
(
d
)
&&
(
i
.
setNodeName
(
d
,
a
),
i
.
setNodeTarget
(
d
,
a
),
i
.
setNodeUrl
(
d
,
a
),
i
.
setNodeLineIcos
(
d
,
a
),
i
.
setNodeFontCss
(
d
,
a
))}};
a
.
treeTools
=
g
;
e
.
setZTreeTools
(
d
,
g
);(
c
=
e
.
nodeChildren
(
d
,
a
))
&&
c
.
length
>
0
?
i
.
createNodes
(
d
,
0
,
c
,
null
,
-
1
):
d
.
async
.
enable
&&
d
.
async
.
url
&&
d
.
async
.
url
!==
""
&&
i
.
asyncNode
(
d
);
return
g
}};
var
O
=
q
.
fn
.
zTree
,
l
=
j
.
$
,
f
=
O
.
consts
})(
jQuery
);
(
function
(
r
){
var
J
,
K
,
L
,
M
,
N
,
O
,
v
,
t
=
{},
w
=
{},
x
=
{},
P
=
{
treeId
:
""
,
treeObj
:
null
,
view
:{
addDiyDom
:
null
,
autoCancelSelected
:
!
0
,
dblClickExpand
:
!
0
,
expandSpeed
:
"
fast
"
,
fontCss
:{},
nameIsHTML
:
!
1
,
selectedMulti
:
!
0
,
showIcon
:
!
0
,
showLine
:
!
0
,
showTitle
:
!
0
,
txtSelectedEnable
:
!
1
},
data
:{
key
:{
isParent
:
"
isParent
"
,
children
:
"
children
"
,
name
:
"
name
"
,
title
:
""
,
url
:
"
url
"
,
icon
:
"
icon
"
},
simpleData
:{
enable
:
!
1
,
idKey
:
"
id
"
,
pIdKey
:
"
pId
"
,
rootPId
:
null
},
keep
:{
parent
:
!
1
,
leaf
:
!
1
}},
async
:{
enable
:
!
1
,
contentType
:
"
application/x-www-form-urlencoded
"
,
type
:
"
post
"
,
dataType
:
"
text
"
,
headers
:{},
xhrFields
:{},
url
:
""
,
autoParam
:[],
otherParam
:[],
dataFilter
:
null
},
callback
:{
beforeAsync
:
null
,
beforeClick
:
null
,
beforeDblClick
:
null
,
beforeRightClick
:
null
,
beforeMouseDown
:
null
,
beforeMouseUp
:
null
,
beforeExpand
:
null
,
beforeCollapse
:
null
,
beforeRemove
:
null
,
onAsyncError
:
null
,
onAsyncSuccess
:
null
,
onNodeCreated
:
null
,
onClick
:
null
,
onDblClick
:
null
,
onRightClick
:
null
,
onMouseDown
:
null
,
onMouseUp
:
null
,
onExpand
:
null
,
onCollapse
:
null
,
onRemove
:
null
}},
y
=
[
function
(
a
){
var
b
=
a
.
treeObj
,
c
=
g
.
event
;
b
.
bind
(
c
.
NODECREATED
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onNodeCreated
,[
b
,
c
,
i
])});
b
.
bind
(
c
.
CLICK
,
function
(
b
,
c
,
i
,
e
,
k
){
h
.
apply
(
a
.
callback
.
onClick
,[
c
,
i
,
e
,
k
])});
b
.
bind
(
c
.
EXPAND
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onExpand
,[
b
,
c
,
i
])});
b
.
bind
(
c
.
COLLAPSE
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onCollapse
,[
b
,
c
,
i
])});
b
.
bind
(
c
.
ASYNC_SUCCESS
,
function
(
b
,
c
,
i
,
e
){
h
.
apply
(
a
.
callback
.
onAsyncSuccess
,[
b
,
c
,
i
,
e
])});
b
.
bind
(
c
.
ASYNC_ERROR
,
function
(
b
,
c
,
i
,
e
,
k
,
g
){
h
.
apply
(
a
.
callback
.
onAsyncError
,[
b
,
c
,
i
,
e
,
k
,
g
])});
b
.
bind
(
c
.
REMOVE
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onRemove
,
[
b
,
c
,
i
])});
b
.
bind
(
c
.
SELECTED
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onSelected
,[
c
,
i
])});
b
.
bind
(
c
.
UNSELECTED
,
function
(
b
,
c
,
i
){
h
.
apply
(
a
.
callback
.
onUnSelected
,[
c
,
i
])})}],
z
=
[
function
(
a
){
var
b
=
g
.
event
;
a
.
treeObj
.
unbind
(
b
.
NODECREATED
).
unbind
(
b
.
CLICK
).
unbind
(
b
.
EXPAND
).
unbind
(
b
.
COLLAPSE
).
unbind
(
b
.
ASYNC_SUCCESS
).
unbind
(
b
.
ASYNC_ERROR
).
unbind
(
b
.
REMOVE
).
unbind
(
b
.
SELECTED
).
unbind
(
b
.
UNSELECTED
)}],
A
=
[
function
(
a
){
var
b
=
e
.
getCache
(
a
);
b
||
(
b
=
{},
e
.
setCache
(
a
,
b
));
b
.
nodes
=
[];
b
.
doms
=
[]}],
B
=
[
function
(
a
,
b
,
c
,
d
,
f
,
i
){
if
(
c
){
var
m
=
e
.
getRoot
(
a
),
k
=
e
.
nodeChildren
(
a
,
c
);
c
.
level
=
b
;
c
.
tId
=
a
.
treeId
+
"
_
"
+
++
m
.
zId
;
c
.
parentTId
=
d
?
d
.
tId
:
null
;
c
.
open
=
typeof
c
.
open
==
"
string
"
?
h
.
eqs
(
c
.
open
,
"
true
"
):
!!
c
.
open
;
b
=
e
.
nodeIsParent
(
a
,
c
);
h
.
isArray
(
k
)
&&!
(
b
===!
1
||
typeof
b
==
"
string
"
&&
h
.
eqs
(
b
,
"
false
"
))?(
e
.
nodeIsParent
(
a
,
c
,
!
0
),
c
.
zAsync
=!
0
):(
b
=
e
.
nodeIsParent
(
a
,
c
,
b
),
c
.
open
=
b
&&!
a
.
async
.
enable
?
c
.
open
:
!
1
,
c
.
zAsync
=!
b
);
c
.
isFirstNode
=
f
;
c
.
isLastNode
=
i
;
c
.
getParentNode
=
function
(){
return
e
.
getNodeCache
(
a
,
c
.
parentTId
)};
c
.
getPreNode
=
function
(){
return
e
.
getPreNode
(
a
,
c
)};
c
.
getNextNode
=
function
(){
return
e
.
getNextNode
(
a
,
c
)};
c
.
getIndex
=
function
(){
return
e
.
getNodeIndex
(
a
,
c
)};
c
.
getPath
=
function
(){
return
e
.
getNodePath
(
a
,
c
)};
c
.
isAjaxing
=!
1
;
e
.
fixPIdKeyValue
(
a
,
c
)}}],
u
=
[
function
(
a
){
var
b
=
a
.
target
,
c
=
e
.
getSetting
(
a
.
data
.
treeId
),
d
=
""
,
f
=
null
,
i
=
""
,
m
=
""
,
k
=
null
,
j
=
null
,
o
=
null
;
if
(
h
.
eqs
(
a
.
type
,
"
mousedown
"
))
m
=
"
mousedown
"
;
else
if
(
h
.
eqs
(
a
.
type
,
"
mouseup
"
))
m
=
"
mouseup
"
;
else
if
(
h
.
eqs
(
a
.
type
,
"
contextmenu
"
))
m
=
"
contextmenu
"
;
else
if
(
h
.
eqs
(
a
.
type
,
"
click
"
))
if
(
h
.
eqs
(
b
.
tagName
,
"
span
"
)
&&
b
.
getAttribute
(
"
treeNode
"
+
g
.
id
.
SWITCH
)
!==
null
)
d
=
h
.
getNodeMainDom
(
b
).
id
,
i
=
"
switchNode
"
;
else
{
if
(
o
=
h
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
g
.
id
.
A
}]))
d
=
h
.
getNodeMainDom
(
o
).
id
,
i
=
"
clickNode
"
}
else
if
(
h
.
eqs
(
a
.
type
,
"
dblclick
"
)
&&
(
m
=
"
dblclick
"
,
o
=
h
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
g
.
id
.
A
}])))
d
=
h
.
getNodeMainDom
(
o
).
id
,
i
=
"
switchNode
"
;
if
(
m
.
length
>
0
&&
d
.
length
==
0
&&
(
o
=
h
.
getMDom
(
c
,
b
,[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
g
.
id
.
A
}])))
d
=
h
.
getNodeMainDom
(
o
).
id
;
if
(
d
.
length
>
0
)
switch
(
f
=
e
.
getNodeCache
(
c
,
d
),
i
){
case
"
switchNode
"
:
e
.
nodeIsParent
(
c
,
f
)?
h
.
eqs
(
a
.
type
,
"
click
"
)
||
h
.
eqs
(
a
.
type
,
"
dblclick
"
)
&&
h
.
apply
(
c
.
view
.
dblClickExpand
,[
c
.
treeId
,
f
],
c
.
view
.
dblClickExpand
)?
k
=
J
:
i
=
""
:
i
=
""
;
break
;
case
"
clickNode
"
:
k
=
K
}
switch
(
m
){
case
"
mousedown
"
:
j
=
L
;
break
;
case
"
mouseup
"
:
j
=
M
;
break
;
case
"
dblclick
"
:
j
=
N
;
break
;
case
"
contextmenu
"
:
j
=
O
}
return
{
stop
:
!
1
,
node
:
f
,
nodeEventType
:
i
,
nodeEventCallback
:
k
,
treeEventType
:
m
,
treeEventCallback
:
j
}}],
C
=
[
function
(
a
){
var
b
=
e
.
getRoot
(
a
);
b
||
(
b
=
{},
e
.
setRoot
(
a
,
b
));
e
.
nodeChildren
(
a
,
b
,[]);
b
.
expandTriggerFlag
=!
1
;
b
.
curSelectedList
=
[];
b
.
noSelection
=
!
0
;
b
.
createdNodes
=
[];
b
.
zId
=
0
;
b
.
_ver
=
(
new
Date
).
getTime
()}],
D
=
[],
E
=
[],
F
=
[],
G
=
[],
H
=
[],
e
=
{
addNodeCache
:
function
(
a
,
b
){
e
.
getCache
(
a
).
nodes
[
e
.
getNodeCacheId
(
b
.
tId
)]
=
b
},
getNodeCacheId
:
function
(
a
){
return
a
.
substring
(
a
.
lastIndexOf
(
"
_
"
)
+
1
)},
addAfterA
:
function
(
a
){
E
.
push
(
a
)},
addBeforeA
:
function
(
a
){
D
.
push
(
a
)},
addInnerAfterA
:
function
(
a
){
G
.
push
(
a
)},
addInnerBeforeA
:
function
(
a
){
F
.
push
(
a
)},
addInitBind
:
function
(
a
){
y
.
push
(
a
)},
addInitUnBind
:
function
(
a
){
z
.
push
(
a
)},
addInitCache
:
function
(
a
){
A
.
push
(
a
)},
addInitNode
:
function
(
a
){
B
.
push
(
a
)},
addInitProxy
:
function
(
a
,
b
){
b
?
u
.
splice
(
0
,
0
,
a
):
u
.
push
(
a
)},
addInitRoot
:
function
(
a
){
C
.
push
(
a
)},
addNodesData
:
function
(
a
,
b
,
c
,
d
){
var
f
=
e
.
nodeChildren
(
a
,
b
);
f
?
c
>=
f
.
length
&&
(
c
=-
1
):(
f
=
e
.
nodeChildren
(
a
,
b
,[]),
c
=-
1
);
if
(
f
.
length
>
0
&&
c
===
0
)
f
[
0
].
isFirstNode
=!
1
,
j
.
setNodeLineIcos
(
a
,
f
[
0
]);
else
if
(
f
.
length
>
0
&&
c
<
0
)
f
[
f
.
length
-
1
].
isLastNode
=!
1
,
j
.
setNodeLineIcos
(
a
,
f
[
f
.
length
-
1
]);
e
.
nodeIsParent
(
a
,
b
,
!
0
);
c
<
0
?
e
.
nodeChildren
(
a
,
b
,
f
.
concat
(
d
)):(
a
=
[
c
,
0
].
concat
(
d
),
f
.
splice
.
apply
(
f
,
a
))},
addSelectedNode
:
function
(
a
,
b
){
var
c
=
e
.
getRoot
(
a
);
e
.
isSelectedNode
(
a
,
b
)
||
c
.
curSelectedList
.
push
(
b
)},
addCreatedNode
:
function
(
a
,
b
){(
a
.
callback
.
onNodeCreated
||
a
.
view
.
addDiyDom
)
&&
e
.
getRoot
(
a
).
createdNodes
.
push
(
b
)},
addZTreeTools
:
function
(
a
){
H
.
push
(
a
)},
exSetting
:
function
(
a
){
r
.
extend
(
!
0
,
P
,
a
)},
fixPIdKeyValue
:
function
(
a
,
b
){
a
.
data
.
simpleData
.
enable
&&
(
b
[
a
.
data
.
simpleData
.
pIdKey
]
=
b
.
parentTId
?
b
.
getParentNode
()[
a
.
data
.
simpleData
.
idKey
]:
a
.
data
.
simpleData
.
rootPId
)},
getAfterA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
E
.
length
;
d
<
e
;
d
++
)
E
[
d
].
apply
(
this
,
arguments
)},
getBeforeA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
D
.
length
;
d
<
e
;
d
++
)
D
[
d
].
apply
(
this
,
arguments
)},
getInnerAfterA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
G
.
length
;
d
<
e
;
d
++
)
G
[
d
].
apply
(
this
,
arguments
)},
getInnerBeforeA
:
function
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
F
.
length
;
d
<
e
;
d
++
)
F
[
d
].
apply
(
this
,
arguments
)},
getCache
:
function
(
a
){
return
x
[
a
.
treeId
]},
getNodeIndex
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
f
=
c
.
length
-
1
;
d
<=
f
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
;
return
-
1
},
getNextNode
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
f
=
c
.
length
-
1
;
d
<=
f
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
==
f
?
null
:
c
[
d
+
1
];
return
null
},
getNodeByParam
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
null
;
for
(
var
f
=
0
,
i
=
b
.
length
;
f
<
i
;
f
++
){
var
m
=
b
[
f
];
if
(
m
[
c
]
==
d
)
return
b
[
f
];
m
=
e
.
nodeChildren
(
a
,
m
);
if
(
m
=
e
.
getNodeByParam
(
a
,
m
,
c
,
d
))
return
m
}
return
null
},
getNodeCache
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
var
c
=
x
[
a
.
treeId
].
nodes
[
e
.
getNodeCacheId
(
b
)];
return
c
?
c
:
null
},
getNodePath
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
var
c
;
(
c
=
b
.
parentTId
?
b
.
getParentNode
().
getPath
():[])
&&
c
.
push
(
b
);
return
c
},
getNodes
:
function
(
a
){
return
e
.
nodeChildren
(
a
,
e
.
getRoot
(
a
))},
getNodesByParam
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
[];
for
(
var
f
=
[],
i
=
0
,
m
=
b
.
length
;
i
<
m
;
i
++
){
var
k
=
b
[
i
];
k
[
c
]
==
d
&&
f
.
push
(
k
);
k
=
e
.
nodeChildren
(
a
,
k
);
f
=
f
.
concat
(
e
.
getNodesByParam
(
a
,
k
,
c
,
d
))}
return
f
},
getNodesByParamFuzzy
:
function
(
a
,
b
,
c
,
d
){
if
(
!
b
||!
c
)
return
[];
for
(
var
f
=
[],
d
=
d
.
toLowerCase
(),
i
=
0
,
m
=
b
.
length
;
i
<
m
;
i
++
){
var
k
=
b
[
i
];
typeof
k
[
c
]
==
"
string
"
&&
b
[
i
][
c
].
toLowerCase
().
indexOf
(
d
)
>-
1
&&
f
.
push
(
k
);
k
=
e
.
nodeChildren
(
a
,
k
);
f
=
f
.
concat
(
e
.
getNodesByParamFuzzy
(
a
,
k
,
c
,
d
))}
return
f
},
getNodesByFilter
:
function
(
a
,
b
,
c
,
d
,
f
){
if
(
!
b
)
return
d
?
null
:[];
for
(
var
i
=
d
?
null
:[],
m
=
0
,
k
=
b
.
length
;
m
<
k
;
m
++
){
var
g
=
b
[
m
];
if
(
h
.
apply
(
c
,[
g
,
f
],
!
1
)){
if
(
d
)
return
g
;
i
.
push
(
g
)}
g
=
e
.
nodeChildren
(
a
,
g
);
g
=
e
.
getNodesByFilter
(
a
,
g
,
c
,
d
,
f
);
if
(
d
&&
g
)
return
g
;
i
=
d
?
g
:
i
.
concat
(
g
)}
return
i
},
getPreNode
:
function
(
a
,
b
){
if
(
!
b
)
return
null
;
for
(
var
c
=
b
.
parentTId
?
b
.
getParentNode
():
e
.
getRoot
(
a
),
c
=
e
.
nodeChildren
(
a
,
c
),
d
=
0
,
f
=
c
.
length
;
d
<
f
;
d
++
)
if
(
c
[
d
]
===
b
)
return
d
==
0
?
null
:
c
[
d
-
1
];
return
null
},
getRoot
:
function
(
a
){
return
a
?
w
[
a
.
treeId
]:
null
},
getRoots
:
function
(){
return
w
},
getSetting
:
function
(
a
){
return
t
[
a
]},
getSettings
:
function
(){
return
t
},
getZTreeTools
:
function
(
a
){
return
(
a
=
this
.
getRoot
(
this
.
getSetting
(
a
)))?
a
.
treeTools
:
null
},
initCache
:
function
(
a
){
for
(
var
b
=
0
,
c
=
A
.
length
;
b
<
c
;
b
++
)
A
[
b
].
apply
(
this
,
arguments
)},
initNode
:
function
(
a
,
b
,
c
,
d
,
e
,
i
){
for
(
var
m
=
0
,
g
=
B
.
length
;
m
<
g
;
m
++
)
B
[
m
].
apply
(
this
,
arguments
)},
initRoot
:
function
(
a
){
for
(
var
b
=
0
,
c
=
C
.
length
;
b
<
c
;
b
++
)
C
[
b
].
apply
(
this
,
arguments
)},
isSelectedNode
:
function
(
a
,
b
){
for
(
var
c
=
e
.
getRoot
(
a
),
d
=
0
,
f
=
c
.
curSelectedList
.
length
;
d
<
f
;
d
++
)
if
(
b
===
c
.
curSelectedList
[
d
])
return
!
0
;
return
!
1
},
nodeChildren
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
null
;
a
=
a
.
data
.
key
.
children
;
typeof
c
!==
"
undefined
"
&&
(
b
[
a
]
=
c
);
return
b
[
a
]},
nodeIsParent
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
!
1
;
a
=
a
.
data
.
key
.
isParent
;
typeof
c
!==
"
undefined
"
&&
(
typeof
c
===
"
string
"
&&
(
c
=
h
.
eqs
(
c
,
"
true
"
)),
b
[
a
]
=!!
c
);
return
b
[
a
]},
nodeName
:
function
(
a
,
b
,
c
){
a
=
a
.
data
.
key
.
name
;
typeof
c
!==
"
undefined
"
&&
(
b
[
a
]
=
c
);
return
""
+
b
[
a
]},
nodeTitle
:
function
(
a
,
b
){
return
""
+
b
[
a
.
data
.
key
.
title
===
""
?
a
.
data
.
key
.
name
:
a
.
data
.
key
.
title
]},
removeNodeCache
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
)
for
(
var
d
=
0
,
f
=
c
.
length
;
d
<
f
;
d
++
)
e
.
removeNodeCache
(
a
,
c
[
d
]);
e
.
getCache
(
a
).
nodes
[
e
.
getNodeCacheId
(
b
.
tId
)]
=
null
},
removeSelectedNode
:
function
(
a
,
b
){
for
(
var
c
=
e
.
getRoot
(
a
),
d
=
0
,
f
=
c
.
curSelectedList
.
length
;
d
<
f
;
d
++
)
if
(
b
===
c
.
curSelectedList
[
d
]
||!
e
.
getNodeCache
(
a
,
c
.
curSelectedList
[
d
].
tId
))
c
.
curSelectedList
.
splice
(
d
,
1
),
a
.
treeObj
.
trigger
(
g
.
event
.
UNSELECTED
,[
a
.
treeId
,
b
]),
d
--
,
f
--
},
setCache
:
function
(
a
,
b
){
x
[
a
.
treeId
]
=
b
},
setRoot
:
function
(
a
,
b
){
w
[
a
.
treeId
]
=
b
},
setZTreeTools
:
function
(
a
,
b
){
for
(
var
c
=
0
,
d
=
H
.
length
;
c
<
d
;
c
++
)
H
[
c
].
apply
(
this
,
arguments
)},
transformToArrayFormat
:
function
(
a
,
b
){
function
c
(
b
){
d
.
push
(
b
);(
b
=
e
.
nodeChildren
(
a
,
b
))
&&
(
d
=
d
.
concat
(
e
.
transformToArrayFormat
(
a
,
b
)))}
if
(
!
b
)
return
[];
var
d
=
[];
if
(
h
.
isArray
(
b
))
for
(
var
f
=
0
,
i
=
b
.
length
;
f
<
i
;
f
++
)
c
(
b
[
f
]);
else
c
(
b
);
return
d
},
transformTozTreeFormat
:
function
(
a
,
b
){
var
c
,
d
,
f
=
a
.
data
.
simpleData
.
idKey
,
i
=
a
.
data
.
simpleData
.
pIdKey
;
if
(
!
f
||
f
==
""
||!
b
)
return
[];
if
(
h
.
isArray
(
b
)){
var
g
=
[],
k
=
{};
for
(
c
=
0
,
d
=
b
.
length
;
c
<
d
;
c
++
)
k
[
b
[
c
][
f
]]
=
b
[
c
];
for
(
c
=
0
,
d
=
b
.
length
;
c
<
d
;
c
++
){
var
j
=
k
[
b
[
c
][
i
]];
if
(
j
&&
b
[
c
][
f
]
!=
b
[
c
][
i
]){
var
o
=
e
.
nodeChildren
(
a
,
j
);
o
||
(
o
=
e
.
nodeChildren
(
a
,
j
,[]));
o
.
push
(
b
[
c
])}
else
g
.
push
(
b
[
c
])}
return
g
}
else
return
[
b
]}},
n
=
{
bindEvent
:
function
(
a
){
for
(
var
b
=
0
,
c
=
y
.
length
;
b
<
c
;
b
++
)
y
[
b
].
apply
(
this
,
arguments
)},
unbindEvent
:
function
(
a
){
for
(
var
b
=
0
,
c
=
z
.
length
;
b
<
c
;
b
++
)
z
[
b
].
apply
(
this
,
arguments
)},
bindTree
:
function
(
a
){
var
b
=
{
treeId
:
a
.
treeId
},
c
=
a
.
treeObj
;
a
.
view
.
txtSelectedEnable
||
c
.
bind
(
"
selectstart
"
,
v
).
css
({
"
-moz-user-select
"
:
"
-moz-none
"
});
c
.
bind
(
"
click
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
dblclick
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseover
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseout
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mousedown
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
mouseup
"
,
b
,
n
.
proxy
);
c
.
bind
(
"
contextmenu
"
,
b
,
n
.
proxy
)},
unbindTree
:
function
(
a
){
a
.
treeObj
.
unbind
(
"
selectstart
"
,
v
).
unbind
(
"
click
"
,
n
.
proxy
).
unbind
(
"
dblclick
"
,
n
.
proxy
).
unbind
(
"
mouseover
"
,
n
.
proxy
).
unbind
(
"
mouseout
"
,
n
.
proxy
).
unbind
(
"
mousedown
"
,
n
.
proxy
).
unbind
(
"
mouseup
"
,
n
.
proxy
).
unbind
(
"
contextmenu
"
,
n
.
proxy
)},
doProxy
:
function
(
a
){
for
(
var
b
=
[],
c
=
0
,
d
=
u
.
length
;
c
<
d
;
c
++
){
var
e
=
u
[
c
].
apply
(
this
,
arguments
);
b
.
push
(
e
);
if
(
e
.
stop
)
break
}
return
b
},
proxy
:
function
(
a
){
var
b
=
e
.
getSetting
(
a
.
data
.
treeId
);
if
(
!
h
.
uCanDo
(
b
,
a
))
return
!
0
;
for
(
var
b
=
n
.
doProxy
(
a
),
c
=!
0
,
d
=
0
,
f
=
b
.
length
;
d
<
f
;
d
++
){
var
i
=
b
[
d
];
i
.
nodeEventCallback
&&
(
c
=
i
.
nodeEventCallback
.
apply
(
i
,[
a
,
i
.
node
])
&&
c
);
i
.
treeEventCallback
&&
(
c
=
i
.
treeEventCallback
.
apply
(
i
,[
a
,
i
.
node
])
&&
c
)}
return
c
}};
J
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
if
(
b
.
open
){
if
(
h
.
apply
(
c
.
callback
.
beforeCollapse
,[
c
.
treeId
,
b
],
!
0
)
==
!
1
)
return
!
0
}
else
if
(
h
.
apply
(
c
.
callback
.
beforeExpand
,[
c
.
treeId
,
b
],
!
0
)
==!
1
)
return
!
0
;
e
.
getRoot
(
c
).
expandTriggerFlag
=!
0
;
j
.
switchNode
(
c
,
b
);
return
!
0
};
K
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
),
d
=
c
.
view
.
autoCancelSelected
&&
(
a
.
ctrlKey
||
a
.
metaKey
)
&&
e
.
isSelectedNode
(
c
,
b
)?
0
:
c
.
view
.
autoCancelSelected
&&
(
a
.
ctrlKey
||
a
.
metaKey
)
&&
c
.
view
.
selectedMulti
?
2
:
1
;
if
(
h
.
apply
(
c
.
callback
.
beforeClick
,[
c
.
treeId
,
b
,
d
],
!
0
)
==!
1
)
return
!
0
;
d
===
0
?
j
.
cancelPreSelectedNode
(
c
,
b
):
j
.
selectNode
(
c
,
b
,
d
===
2
);
c
.
treeObj
.
trigger
(
g
.
event
.
CLICK
,
[
a
,
c
.
treeId
,
b
,
d
]);
return
!
0
};
L
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
h
.
apply
(
c
.
callback
.
beforeMouseDown
,[
c
.
treeId
,
b
],
!
0
)
&&
h
.
apply
(
c
.
callback
.
onMouseDown
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
M
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
h
.
apply
(
c
.
callback
.
beforeMouseUp
,[
c
.
treeId
,
b
],
!
0
)
&&
h
.
apply
(
c
.
callback
.
onMouseUp
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
N
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
h
.
apply
(
c
.
callback
.
beforeDblClick
,[
c
.
treeId
,
b
],
!
0
)
&&
h
.
apply
(
c
.
callback
.
onDblClick
,[
a
,
c
.
treeId
,
b
]);
return
!
0
};
O
=
function
(
a
,
b
){
var
c
=
e
.
getSetting
(
a
.
data
.
treeId
);
h
.
apply
(
c
.
callback
.
beforeRightClick
,[
c
.
treeId
,
b
],
!
0
)
&&
h
.
apply
(
c
.
callback
.
onRightClick
,[
a
,
c
.
treeId
,
b
]);
return
typeof
c
.
callback
.
onRightClick
!=
"
function
"
};
v
=
function
(
a
){
a
=
a
.
originalEvent
.
srcElement
.
nodeName
.
toLowerCase
();
return
a
===
"
input
"
||
a
===
"
textarea
"
};
var
h
=
{
apply
:
function
(
a
,
b
,
c
){
return
typeof
a
==
"
function
"
?
a
.
apply
(
Q
,
b
?
b
:[]):
c
},
canAsync
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
),
d
=
e
.
nodeIsParent
(
a
,
b
);
return
a
.
async
.
enable
&&
b
&&
d
&&!
(
b
.
zAsync
||
c
&&
c
.
length
>
0
)},
clone
:
function
(
a
){
if
(
a
===
null
)
return
null
;
var
b
=
h
.
isArray
(
a
)?[]:{},
c
;
for
(
c
in
a
)
b
[
c
]
=
a
[
c
]
instanceof
Date
?
new
Date
(
a
[
c
].
getTime
()):
typeof
a
[
c
]
===
"
object
"
?
h
.
clone
(
a
[
c
]):
a
[
c
];
return
b
},
eqs
:
function
(
a
,
b
){
return
a
.
toLowerCase
()
===
b
.
toLowerCase
()},
isArray
:
function
(
a
){
return
Object
.
prototype
.
toString
.
apply
(
a
)
===
"
[object Array]
"
},
isElement
:
function
(
a
){
return
typeof
HTMLElement
===
"
object
"
?
a
instanceof
HTMLElement
:
a
&&
typeof
a
===
"
object
"
&&
a
!==
null
&&
a
.
nodeType
===
1
&&
typeof
a
.
nodeName
===
"
string
"
},
$
:
function
(
a
,
b
,
c
){
b
&&
typeof
b
!=
"
string
"
&&
(
c
=
b
,
b
=
""
);
return
typeof
a
==
"
string
"
?
r
(
a
,
c
?
c
.
treeObj
.
get
(
0
).
ownerDocument
:
null
):
r
(
"
#
"
+
a
.
tId
+
b
,
c
?
c
.
treeObj
:
null
)},
getMDom
:
function
(
a
,
b
,
c
){
if
(
!
b
)
return
null
;
for
(;
b
&&
b
.
id
!==
a
.
treeId
;){
for
(
var
d
=
0
,
e
=
c
.
length
;
b
.
tagName
&&
d
<
e
;
d
++
)
if
(
h
.
eqs
(
b
.
tagName
,
c
[
d
].
tagName
)
&&
b
.
getAttribute
(
c
[
d
].
attrName
)
!==
null
)
return
b
;
b
=
b
.
parentNode
}
return
null
},
getNodeMainDom
:
function
(
a
){
return
r
(
a
).
parent
(
"
li
"
).
get
(
0
)
||
r
(
a
).
parentsUntil
(
"
li
"
).
parent
().
get
(
0
)},
isChildOrSelf
:
function
(
a
,
b
){
return
r
(
a
).
closest
(
"
#
"
+
b
).
length
>
0
},
uCanDo
:
function
(){
return
!
0
}},
j
=
{
addNodes
:
function
(
a
,
b
,
c
,
d
,
f
){
var
i
=
e
.
nodeIsParent
(
a
,
b
);
if
(
!
a
.
data
.
keep
.
leaf
||!
b
||
i
)
if
(
h
.
isArray
(
d
)
||
(
d
=
[
d
]),
a
.
data
.
simpleData
.
enable
&&
(
d
=
e
.
transformTozTreeFormat
(
a
,
d
)),
b
){
var
i
=
l
(
b
,
g
.
id
.
SWITCH
,
a
),
m
=
l
(
b
,
g
.
id
.
ICON
,
a
),
k
=
l
(
b
,
g
.
id
.
UL
,
a
);
if
(
!
b
.
open
)
j
.
replaceSwitchClass
(
b
,
i
,
g
.
folder
.
CLOSE
),
j
.
replaceIcoClass
(
b
,
m
,
g
.
folder
.
CLOSE
),
b
.
open
=!
1
,
k
.
css
({
display
:
"
none
"
});
e
.
addNodesData
(
a
,
b
,
c
,
d
);
j
.
createNodes
(
a
,
b
.
level
+
1
,
d
,
b
,
c
);
f
||
j
.
expandCollapseParentNode
(
a
,
b
,
!
0
)}
else
e
.
addNodesData
(
a
,
e
.
getRoot
(
a
),
c
,
d
),
j
.
createNodes
(
a
,
0
,
d
,
null
,
c
)},
appendNodes
:
function
(
a
,
b
,
c
,
d
,
f
,
i
,
g
){
if
(
!
c
)
return
[];
var
k
=
[],
h
=
d
?
d
:
e
.
getRoot
(
a
),
h
=
e
.
nodeChildren
(
a
,
h
),
o
,
l
;
if
(
!
h
||
f
>=
h
.
length
-
c
.
length
)
f
=-
1
;
for
(
var
s
=
0
,
n
=
c
.
length
;
s
<
n
;
s
++
){
var
p
=
c
[
s
];
i
&&
(
o
=
(
f
===
0
||
h
.
length
==
c
.
length
)
&&
s
==
0
,
l
=
f
<
0
&&
s
==
c
.
length
-
1
,
e
.
initNode
(
a
,
b
,
p
,
d
,
o
,
l
,
g
),
e
.
addNodeCache
(
a
,
p
));
o
=
e
.
nodeIsParent
(
a
,
p
);
l
=
[];
var
I
=
e
.
nodeChildren
(
a
,
p
);
I
&&
I
.
length
>
0
&&
(
l
=
j
.
appendNodes
(
a
,
b
+
1
,
I
,
p
,
-
1
,
i
,
g
&&
p
.
open
));
g
&&
(
j
.
makeDOMNodeMainBefore
(
k
,
a
,
p
),
j
.
makeDOMNodeLine
(
k
,
a
,
p
),
e
.
getBeforeA
(
a
,
p
,
k
),
j
.
makeDOMNodeNameBefore
(
k
,
a
,
p
),
e
.
getInnerBeforeA
(
a
,
p
,
k
),
j
.
makeDOMNodeIcon
(
k
,
a
,
p
),
e
.
getInnerAfterA
(
a
,
p
,
k
),
j
.
makeDOMNodeNameAfter
(
k
,
a
,
p
),
e
.
getAfterA
(
a
,
p
,
k
),
o
&&
p
.
open
&&
j
.
makeUlHtml
(
a
,
p
,
k
,
l
.
join
(
""
)),
j
.
makeDOMNodeMainAfter
(
k
,
a
,
p
),
e
.
addCreatedNode
(
a
,
p
))}
return
k
},
appendParentULDom
:
function
(
a
,
b
){
var
c
=
[],
d
=
l
(
b
,
a
);
!
d
.
get
(
0
)
&&
b
.
parentTId
&&
(
j
.
appendParentULDom
(
a
,
b
.
getParentNode
()),
d
=
l
(
b
,
a
));
var
f
=
l
(
b
,
g
.
id
.
UL
,
a
);
f
.
get
(
0
)
&&
f
.
remove
();
f
=
e
.
nodeChildren
(
a
,
b
);
f
=
j
.
appendNodes
(
a
,
b
.
level
+
1
,
f
,
b
,
-
1
,
!
1
,
!
0
);
j
.
makeUlHtml
(
a
,
b
,
c
,
f
.
join
(
""
));
d
.
append
(
c
.
join
(
""
))},
asyncNode
:
function
(
a
,
b
,
c
,
d
){
var
f
,
i
;
f
=
e
.
nodeIsParent
(
a
,
b
);
if
(
b
&&!
f
)
return
h
.
apply
(
d
),
!
1
;
else
if
(
b
&&
b
.
isAjaxing
)
return
!
1
;
else
if
(
h
.
apply
(
a
.
callback
.
beforeAsync
,[
a
.
treeId
,
b
],
!
0
)
==!
1
)
return
h
.
apply
(
d
),
!
1
;
if
(
b
)
b
.
isAjaxing
=!
0
,
l
(
b
,
g
.
id
.
ICON
,
a
).
attr
({
style
:
""
,
"
class
"
:
g
.
className
.
BUTTON
+
"
"
+
g
.
className
.
ICO_LOADING
});
var
m
=
{},
k
=
h
.
apply
(
a
.
async
.
autoParam
,[
a
.
treeId
,
b
],
a
.
async
.
autoParam
);
for
(
f
=
0
,
i
=
k
.
length
;
b
&&
f
<
i
;
f
++
){
var
q
=
k
[
f
].
split
(
"
=
"
),
o
=
q
;
q
.
length
>
1
&&
(
o
=
q
[
1
],
q
=
q
[
0
]);
m
[
o
]
=
b
[
q
]}
k
=
h
.
apply
(
a
.
async
.
otherParam
,[
a
.
treeId
,
b
],
a
.
async
.
otherParam
);
if
(
h
.
isArray
(
k
))
for
(
f
=
0
,
i
=
k
.
length
;
f
<
i
;
f
+=
2
)
m
[
k
[
f
]]
=
k
[
f
+
1
];
else
for
(
var
n
in
k
)
m
[
n
]
=
k
[
n
];
var
s
=
e
.
getRoot
(
a
).
_ver
;
r
.
ajax
({
contentType
:
a
.
async
.
contentType
,
cache
:
!
1
,
type
:
a
.
async
.
type
,
url
:
h
.
apply
(
a
.
async
.
url
,[
a
.
treeId
,
b
],
a
.
async
.
url
),
data
:
a
.
async
.
contentType
.
indexOf
(
"
application/json
"
)
>-
1
?
JSON
.
stringify
(
m
):
m
,
dataType
:
a
.
async
.
dataType
,
headers
:
a
.
async
.
headers
,
xhrFields
:
a
.
async
.
xhrFields
,
success
:
function
(
i
){
if
(
s
==
e
.
getRoot
(
a
).
_ver
){
var
f
=
[];
try
{
f
=!
i
||
i
.
length
==
0
?[]:
typeof
i
==
"
string
"
?
eval
(
"
(
"
+
i
+
"
)
"
):
i
}
catch
(
k
){
f
=
i
}
if
(
b
)
b
.
isAjaxing
=
null
,
b
.
zAsync
=!
0
;
j
.
setNodeLineIcos
(
a
,
b
);
f
&&
f
!==
""
?(
f
=
h
.
apply
(
a
.
async
.
dataFilter
,[
a
.
treeId
,
b
,
f
],
f
),
j
.
addNodes
(
a
,
b
,
-
1
,
f
?
h
.
clone
(
f
):[],
!!
c
)):
j
.
addNodes
(
a
,
b
,
-
1
,[],
!!
c
);
a
.
treeObj
.
trigger
(
g
.
event
.
ASYNC_SUCCESS
,[
a
.
treeId
,
b
,
i
]);
h
.
apply
(
d
)}},
error
:
function
(
c
,
d
,
i
){
if
(
s
==
e
.
getRoot
(
a
).
_ver
){
if
(
b
)
b
.
isAjaxing
=
null
;
j
.
setNodeLineIcos
(
a
,
b
);
a
.
treeObj
.
trigger
(
g
.
event
.
ASYNC_ERROR
,[
a
.
treeId
,
b
,
c
,
d
,
i
])}}});
return
!
0
},
cancelPreSelectedNode
:
function
(
a
,
b
,
c
){
var
d
=
e
.
getRoot
(
a
).
curSelectedList
,
f
,
i
;
for
(
f
=
d
.
length
-
1
;
f
>=
0
;
f
--
)
if
(
i
=
d
[
f
],
b
===
i
||!
b
&&
(
!
c
||
c
!==
i
))
if
(
l
(
i
,
g
.
id
.
A
,
a
).
removeClass
(
g
.
node
.
CURSELECTED
),
b
){
e
.
removeSelectedNode
(
a
,
b
);
break
}
else
d
.
splice
(
f
,
1
),
a
.
treeObj
.
trigger
(
g
.
event
.
UNSELECTED
,[
a
.
treeId
,
i
])},
createNodeCallback
:
function
(
a
){
if
(
a
.
callback
.
onNodeCreated
||
a
.
view
.
addDiyDom
)
for
(
var
b
=
e
.
getRoot
(
a
);
b
.
createdNodes
.
length
>
0
;){
var
c
=
b
.
createdNodes
.
shift
();
h
.
apply
(
a
.
view
.
addDiyDom
,[
a
.
treeId
,
c
]);
a
.
callback
.
onNodeCreated
&&
a
.
treeObj
.
trigger
(
g
.
event
.
NODECREATED
,[
a
.
treeId
,
c
])}},
createNodes
:
function
(
a
,
b
,
c
,
d
,
f
){
if
(
c
&&
c
.
length
!=
0
){
var
i
=
e
.
getRoot
(
a
),
m
=!
d
||
d
.
open
||!!
l
(
e
.
nodeChildren
(
a
,
d
)[
0
],
a
).
get
(
0
);
i
.
createdNodes
=
[];
var
b
=
j
.
appendNodes
(
a
,
b
,
c
,
d
,
f
,
!
0
,
m
),
k
,
h
;
d
?(
d
=
l
(
d
,
g
.
id
.
UL
,
a
),
d
.
get
(
0
)
&&
(
k
=
d
)):
k
=
a
.
treeObj
;
k
&&
(
f
>=
0
&&
(
h
=
k
.
children
()[
f
]),
f
>=
0
&&
h
?
r
(
h
).
before
(
b
.
join
(
""
)):
k
.
append
(
b
.
join
(
""
)));
j
.
createNodeCallback
(
a
)}},
destroy
:
function
(
a
){
a
&&
(
e
.
initCache
(
a
),
e
.
initRoot
(
a
),
n
.
unbindTree
(
a
),
n
.
unbindEvent
(
a
),
a
.
treeObj
.
empty
(),
delete
t
[
a
.
treeId
])},
expandCollapseNode
:
function
(
a
,
b
,
c
,
d
,
f
){
var
i
=
e
.
getRoot
(
a
),
m
;
if
(
b
){
var
k
=
e
.
nodeChildren
(
a
,
b
),
q
=
e
.
nodeIsParent
(
a
,
b
);
if
(
i
.
expandTriggerFlag
)
m
=
f
,
f
=
function
(){
m
&&
m
();
b
.
open
?
a
.
treeObj
.
trigger
(
g
.
event
.
EXPAND
,[
a
.
treeId
,
b
]):
a
.
treeObj
.
trigger
(
g
.
event
.
COLLAPSE
,[
a
.
treeId
,
b
])},
i
.
expandTriggerFlag
=!
1
;
if
(
!
b
.
open
&&
q
&&
(
!
l
(
b
,
g
.
id
.
UL
,
a
).
get
(
0
)
||
k
&&
k
.
length
>
0
&&!
l
(
k
[
0
],
a
).
get
(
0
)))
j
.
appendParentULDom
(
a
,
b
),
j
.
createNodeCallback
(
a
);
if
(
b
.
open
==
c
)
h
.
apply
(
f
,[]);
else
{
var
c
=
l
(
b
,
g
.
id
.
UL
,
a
),
i
=
l
(
b
,
g
.
id
.
SWITCH
,
a
),
o
=
l
(
b
,
g
.
id
.
ICON
,
a
);
q
?(
b
.
open
=!
b
.
open
,
b
.
iconOpen
&&
b
.
iconClose
&&
o
.
attr
(
"
style
"
,
j
.
makeNodeIcoStyle
(
a
,
b
)),
b
.
open
?(
j
.
replaceSwitchClass
(
b
,
i
,
g
.
folder
.
OPEN
),
j
.
replaceIcoClass
(
b
,
o
,
g
.
folder
.
OPEN
),
d
==!
1
||
a
.
view
.
expandSpeed
==
""
?(
c
.
show
(),
h
.
apply
(
f
,[])):
k
&&
k
.
length
>
0
?
c
.
slideDown
(
a
.
view
.
expandSpeed
,
f
):(
c
.
show
(),
h
.
apply
(
f
,[]))):(
j
.
replaceSwitchClass
(
b
,
i
,
g
.
folder
.
CLOSE
),
j
.
replaceIcoClass
(
b
,
o
,
g
.
folder
.
CLOSE
),
d
==!
1
||
a
.
view
.
expandSpeed
==
""
||!
(
k
&&
k
.
length
>
0
)?(
c
.
hide
(),
h
.
apply
(
f
,[])):
c
.
slideUp
(
a
.
view
.
expandSpeed
,
f
))):
h
.
apply
(
f
,[])}}
else
h
.
apply
(
f
,
[])},
expandCollapseParentNode
:
function
(
a
,
b
,
c
,
d
,
e
){
b
&&
(
b
.
parentTId
?(
j
.
expandCollapseNode
(
a
,
b
,
c
,
d
),
b
.
parentTId
&&
j
.
expandCollapseParentNode
(
a
,
b
.
getParentNode
(),
c
,
d
,
e
)):
j
.
expandCollapseNode
(
a
,
b
,
c
,
d
,
e
))},
expandCollapseSonNode
:
function
(
a
,
b
,
c
,
d
,
f
){
var
i
=
e
.
getRoot
(
a
),
i
=
b
?
e
.
nodeChildren
(
a
,
b
):
e
.
nodeChildren
(
a
,
i
),
g
=
b
?
!
1
:
d
,
k
=
e
.
getRoot
(
a
).
expandTriggerFlag
;
e
.
getRoot
(
a
).
expandTriggerFlag
=!
1
;
if
(
i
)
for
(
var
h
=
0
,
l
=
i
.
length
;
h
<
l
;
h
++
)
i
[
h
]
&&
j
.
expandCollapseSonNode
(
a
,
i
[
h
],
c
,
g
);
e
.
getRoot
(
a
).
expandTriggerFlag
=
k
;
j
.
expandCollapseNode
(
a
,
b
,
c
,
d
,
f
)},
isSelectedNode
:
function
(
a
,
b
){
if
(
!
b
)
return
!
1
;
var
c
=
e
.
getRoot
(
a
).
curSelectedList
,
d
;
for
(
d
=
c
.
length
-
1
;
d
>=
0
;
d
--
)
if
(
b
===
c
[
d
])
return
!
0
;
return
!
1
},
makeDOMNodeIcon
:
function
(
a
,
b
,
c
){
var
d
=
e
.
nodeName
(
b
,
c
),
d
=
b
.
view
.
nameIsHTML
?
d
:
d
.
replace
(
/&/g
,
"
&
"
).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
);
a
.
push
(
"
<span id='
"
,
c
.
tId
,
g
.
id
.
ICON
,
"
' title='' treeNode
"
,
g
.
id
.
ICON
,
"
class='
"
,
j
.
makeNodeIcoClass
(
b
,
c
),
"
' style='
"
,
j
.
makeNodeIcoStyle
(
b
,
c
),
"
'></span><span id='
"
,
c
.
tId
,
g
.
id
.
SPAN
,
"
' class='
"
,
g
.
className
.
NAME
,
"
'>
"
,
d
,
"
</span>
"
)},
makeDOMNodeLine
:
function
(
a
,
b
,
c
){
a
.
push
(
"
<span id='
"
,
c
.
tId
,
g
.
id
.
SWITCH
,
"
' title='' class='
"
,
j
.
makeNodeLineClass
(
b
,
c
),
"
' treeNode
"
,
g
.
id
.
SWITCH
,
"
></span>
"
)},
makeDOMNodeMainAfter
:
function
(
a
){
a
.
push
(
"
</li>
"
)},
makeDOMNodeMainBefore
:
function
(
a
,
b
,
c
){
a
.
push
(
"
<li id='
"
,
c
.
tId
,
"
' class='
"
,
g
.
className
.
LEVEL
,
c
.
level
,
"
' tabindex='0' hidefocus='true' treenode>
"
)},
makeDOMNodeNameAfter
:
function
(
a
){
a
.
push
(
"
</a>
"
)},
makeDOMNodeNameBefore
:
function
(
a
,
b
,
c
){
var
d
=
e
.
nodeTitle
(
b
,
c
),
f
=
j
.
makeNodeUrl
(
b
,
c
),
i
=
j
.
makeNodeFontCss
(
b
,
c
),
m
=
[],
k
;
for
(
k
in
i
)
m
.
push
(
k
,
"
:
"
,
i
[
k
],
"
;
"
);
a
.
push
(
"
<a id='
"
,
c
.
tId
,
g
.
id
.
A
,
"
' class='
"
,
g
.
className
.
LEVEL
,
c
.
level
,
"
' treeNode
"
,
g
.
id
.
A
,
'
onclick="
'
,
c
.
click
||
""
,
'
"
'
,
f
!=
null
&&
f
.
length
>
0
?
"
href='
"
+
f
+
"
'
"
:
""
,
"
target='
"
,
j
.
makeNodeTarget
(
c
),
"
' style='
"
,
m
.
join
(
""
),
"
'
"
);
h
.
apply
(
b
.
view
.
showTitle
,[
b
.
treeId
,
c
],
b
.
view
.
showTitle
)
&&
d
&&
a
.
push
(
"
title='
"
,
d
.
replace
(
/'/g
,
"
'
"
).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
),
"
'
"
);
a
.
push
(
"
>
"
)},
makeNodeFontCss
:
function
(
a
,
b
){
var
c
=
h
.
apply
(
a
.
view
.
fontCss
,[
a
.
treeId
,
b
],
a
.
view
.
fontCss
);
return
c
&&
typeof
c
!=
"
function
"
?
c
:{}},
makeNodeIcoClass
:
function
(
a
,
b
){
var
c
=
[
"
ico
"
];
if
(
!
b
.
isAjaxing
){
var
d
=
e
.
nodeIsParent
(
a
,
b
);
c
[
0
]
=
(
b
.
iconSkin
?
b
.
iconSkin
+
"
_
"
:
""
)
+
c
[
0
];
d
?
c
.
push
(
b
.
open
?
g
.
folder
.
OPEN
:
g
.
folder
.
CLOSE
):
c
.
push
(
g
.
folder
.
DOCU
)}
return
g
.
className
.
BUTTON
+
"
"
+
c
.
join
(
"
_
"
)},
makeNodeIcoStyle
:
function
(
a
,
b
){
var
c
=
[];
if
(
!
b
.
isAjaxing
){
var
d
=
e
.
nodeIsParent
(
a
,
b
)
&&
b
.
iconOpen
&&
b
.
iconClose
?
b
.
open
?
b
.
iconOpen
:
b
.
iconClose
:
b
[
a
.
data
.
key
.
icon
];
d
&&
c
.
push
(
"
background:url(
"
,
d
,
"
) 0 0 no-repeat;
"
);(
a
.
view
.
showIcon
==
!
1
||!
h
.
apply
(
a
.
view
.
showIcon
,[
a
.
treeId
,
b
],
!
0
))
&&
c
.
push
(
"
width:0px;height:0px;
"
)}
return
c
.
join
(
""
)},
makeNodeLineClass
:
function
(
a
,
b
){
var
c
=
[];
a
.
view
.
showLine
?
b
.
level
==
0
&&
b
.
isFirstNode
&&
b
.
isLastNode
?
c
.
push
(
g
.
line
.
ROOT
):
b
.
level
==
0
&&
b
.
isFirstNode
?
c
.
push
(
g
.
line
.
ROOTS
):
b
.
isLastNode
?
c
.
push
(
g
.
line
.
BOTTOM
):
c
.
push
(
g
.
line
.
CENTER
):
c
.
push
(
g
.
line
.
NOLINE
);
e
.
nodeIsParent
(
a
,
b
)?
c
.
push
(
b
.
open
?
g
.
folder
.
OPEN
:
g
.
folder
.
CLOSE
):
c
.
push
(
g
.
folder
.
DOCU
);
return
j
.
makeNodeLineClassEx
(
b
)
+
c
.
join
(
"
_
"
)},
makeNodeLineClassEx
:
function
(
a
){
return
g
.
className
.
BUTTON
+
"
"
+
g
.
className
.
LEVEL
+
a
.
level
+
"
"
+
g
.
className
.
SWITCH
+
"
"
},
makeNodeTarget
:
function
(
a
){
return
a
.
target
||
"
_blank
"
},
makeNodeUrl
:
function
(
a
,
b
){
var
c
=
a
.
data
.
key
.
url
;
return
b
[
c
]?
b
[
c
]:
null
},
makeUlHtml
:
function
(
a
,
b
,
c
,
d
){
c
.
push
(
"
<ul id='
"
,
b
.
tId
,
g
.
id
.
UL
,
"
' class='
"
,
g
.
className
.
LEVEL
,
b
.
level
,
"
"
,
j
.
makeUlLineClass
(
a
,
b
),
"
' style='display:
"
,
b
.
open
?
"
block
"
:
"
none
"
,
"
'>
"
);
c
.
push
(
d
);
c
.
push
(
"
</ul>
"
)},
makeUlLineClass
:
function
(
a
,
b
){
return
a
.
view
.
showLine
&&!
b
.
isLastNode
?
g
.
line
.
LINE
:
""
},
removeChildNodes
:
function
(
a
,
b
){
if
(
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
){
for
(
var
d
=
0
,
f
=
c
.
length
;
d
<
f
;
d
++
)
e
.
removeNodeCache
(
a
,
c
[
d
]);
e
.
removeSelectedNode
(
a
);
delete
b
[
a
.
data
.
key
.
children
];
a
.
data
.
keep
.
parent
?
l
(
b
,
g
.
id
.
UL
,
a
).
empty
():(
e
.
nodeIsParent
(
a
,
b
,
!
1
),
b
.
open
=!
1
,
c
=
l
(
b
,
g
.
id
.
SWITCH
,
a
),
d
=
l
(
b
,
g
.
id
.
ICON
,
a
),
j
.
replaceSwitchClass
(
b
,
c
,
g
.
folder
.
DOCU
),
j
.
replaceIcoClass
(
b
,
d
,
g
.
folder
.
DOCU
),
l
(
b
,
g
.
id
.
UL
,
a
).
remove
())}}},
scrollIntoView
:
function
(
a
,
b
){
if
(
b
)
if
(
typeof
Element
===
"
undefined
"
){
var
c
=
a
.
treeObj
.
get
(
0
).
getBoundingClientRect
(),
d
=
b
.
getBoundingClientRect
();(
d
.
top
<
c
.
top
||
d
.
bottom
>
c
.
bottom
||
d
.
right
>
c
.
right
||
d
.
left
<
c
.
left
)
&&
b
.
scrollIntoView
()}
else
{
if
(
!
Element
.
prototype
.
scrollIntoViewIfNeeded
)
Element
.
prototype
.
scrollIntoViewIfNeeded
=
function
(
a
){
function
b
(
a
,
c
){
return
{
start
:
a
,
length
:
c
,
end
:
a
+
c
}}
function
c
(
b
,
d
){
return
!
1
===
a
||
d
.
start
<
b
.
end
&&
b
.
start
<
d
.
end
?
Math
.
max
(
b
.
end
-
d
.
length
,
Math
.
min
(
d
.
start
,
b
.
start
)):(
b
.
start
+
b
.
end
-
d
.
length
)
/
2
}
function
d
(
a
,
b
){
return
{
x
:
a
,
y
:
b
,
translate
:
function
(
c
,
i
){
return
d
(
a
+
c
,
b
+
i
)}}}
function
e
(
a
,
b
){
for
(;
a
;)
b
=
b
.
translate
(
a
.
offsetLeft
,
a
.
offsetTop
),
a
=
a
.
offsetParent
;
return
b
}
for
(
var
g
=
e
(
this
,
d
(
0
,
0
)),
j
=
d
(
this
.
offsetWidth
,
this
.
offsetHeight
),
h
=
this
.
parentNode
,
l
;
h
instanceof
HTMLElement
;)
l
=
e
(
h
,
d
(
h
.
clientLeft
,
h
.
clientTop
)),
h
.
scrollLeft
=
c
(
b
(
g
.
x
-
l
.
x
,
j
.
x
),
b
(
h
.
scrollLeft
,
h
.
clientWidth
)),
h
.
scrollTop
=
c
(
b
(
g
.
y
-
l
.
y
,
j
.
y
),
b
(
h
.
scrollTop
,
h
.
clientHeight
)),
g
=
g
.
translate
(
-
h
.
scrollLeft
,
-
h
.
scrollTop
),
h
=
h
.
parentNode
};
b
.
scrollIntoViewIfNeeded
()}},
setFirstNode
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
.
length
>
0
)
c
[
0
].
isFirstNode
=!
0
},
setLastNode
:
function
(
a
,
b
){
var
c
=
e
.
nodeChildren
(
a
,
b
);
if
(
c
.
length
>
0
)
c
[
c
.
length
-
1
].
isLastNode
=!
0
},
removeNode
:
function
(
a
,
b
){
var
c
=
e
.
getRoot
(
a
),
d
=
b
.
parentTId
?
b
.
getParentNode
():
c
;
b
.
isFirstNode
=!
1
;
b
.
isLastNode
=!
1
;
b
.
getPreNode
=
function
(){
return
null
};
b
.
getNextNode
=
function
(){
return
null
};
if
(
e
.
getNodeCache
(
a
,
b
.
tId
)){
l
(
b
,
a
).
remove
();
e
.
removeNodeCache
(
a
,
b
);
e
.
removeSelectedNode
(
a
,
b
);
for
(
var
f
=
e
.
nodeChildren
(
a
,
d
),
i
=
0
,
h
=
f
.
length
;
i
<
h
;
i
++
)
if
(
f
[
i
].
tId
==
b
.
tId
){
f
.
splice
(
i
,
1
);
break
}
j
.
setFirstNode
(
a
,
d
);
j
.
setLastNode
(
a
,
d
);
var
k
,
i
=
f
.
length
;
if
(
!
a
.
data
.
keep
.
parent
&&
i
==
0
)
e
.
nodeIsParent
(
a
,
d
,
!
1
),
d
.
open
=!
1
,
delete
d
[
a
.
data
.
key
.
children
],
i
=
l
(
d
,
g
.
id
.
UL
,
a
),
h
=
l
(
d
,
g
.
id
.
SWITCH
,
a
),
k
=
l
(
d
,
g
.
id
.
ICON
,
a
),
j
.
replaceSwitchClass
(
d
,
h
,
g
.
folder
.
DOCU
),
j
.
replaceIcoClass
(
d
,
k
,
g
.
folder
.
DOCU
),
i
.
css
(
"
display
"
,
"
none
"
);
else
if
(
a
.
view
.
showLine
&&
i
>
0
){
var
q
=
f
[
i
-
1
],
i
=
l
(
q
,
g
.
id
.
UL
,
a
),
h
=
l
(
q
,
g
.
id
.
SWITCH
,
a
);
k
=
l
(
q
,
g
.
id
.
ICON
,
a
);
d
==
c
?
f
.
length
==
1
?
j
.
replaceSwitchClass
(
q
,
h
,
g
.
line
.
ROOT
):(
c
=
l
(
f
[
0
],
g
.
id
.
SWITCH
,
a
),
j
.
replaceSwitchClass
(
f
[
0
],
c
,
g
.
line
.
ROOTS
),
j
.
replaceSwitchClass
(
q
,
h
,
g
.
line
.
BOTTOM
)):
j
.
replaceSwitchClass
(
q
,
h
,
g
.
line
.
BOTTOM
);
i
.
removeClass
(
g
.
line
.
LINE
)}}},
replaceIcoClass
:
function
(
a
,
b
,
c
){
if
(
b
&&!
a
.
isAjaxing
&&
(
a
=
b
.
attr
(
"
class
"
),
a
!=
void
0
)){
a
=
a
.
split
(
"
_
"
);
switch
(
c
){
case
g
.
folder
.
OPEN
:
case
g
.
folder
.
CLOSE
:
case
g
.
folder
.
DOCU
:
a
[
a
.
length
-
1
]
=
c
}
b
.
attr
(
"
class
"
,
a
.
join
(
"
_
"
))}},
replaceSwitchClass
:
function
(
a
,
b
,
c
){
if
(
b
){
var
d
=
b
.
attr
(
"
class
"
);
if
(
d
!=
void
0
){
d
=
d
.
split
(
"
_
"
);
switch
(
c
){
case
g
.
line
.
ROOT
:
case
g
.
line
.
ROOTS
:
case
g
.
line
.
CENTER
:
case
g
.
line
.
BOTTOM
:
case
g
.
line
.
NOLINE
:
d
[
0
]
=
j
.
makeNodeLineClassEx
(
a
)
+
c
;
break
;
case
g
.
folder
.
OPEN
:
case
g
.
folder
.
CLOSE
:
case
g
.
folder
.
DOCU
:
d
[
1
]
=
c
}
b
.
attr
(
"
class
"
,
d
.
join
(
"
_
"
));
c
!==
g
.
folder
.
DOCU
?
b
.
removeAttr
(
"
disabled
"
):
b
.
attr
(
"
disabled
"
,
"
disabled
"
)}}},
selectNode
:
function
(
a
,
b
,
c
){
c
||
j
.
cancelPreSelectedNode
(
a
,
null
,
b
);
l
(
b
,
g
.
id
.
A
,
a
).
addClass
(
g
.
node
.
CURSELECTED
);
e
.
addSelectedNode
(
a
,
b
);
a
.
treeObj
.
trigger
(
g
.
event
.
SELECTED
,[
a
.
treeId
,
b
])},
setNodeFontCss
:
function
(
a
,
b
){
var
c
=
l
(
b
,
g
.
id
.
A
,
a
),
d
=
j
.
makeNodeFontCss
(
a
,
b
);
d
&&
c
.
css
(
d
)},
setNodeLineIcos
:
function
(
a
,
b
){
if
(
b
){
var
c
=
l
(
b
,
g
.
id
.
SWITCH
,
a
),
d
=
l
(
b
,
g
.
id
.
UL
,
a
),
f
=
l
(
b
,
g
.
id
.
ICON
,
a
),
i
=
j
.
makeUlLineClass
(
a
,
b
);
i
.
length
==
0
?
d
.
removeClass
(
g
.
line
.
LINE
):
d
.
addClass
(
i
);
c
.
attr
(
"
class
"
,
j
.
makeNodeLineClass
(
a
,
b
));
e
.
nodeIsParent
(
a
,
b
)?
c
.
removeAttr
(
"
disabled
"
):
c
.
attr
(
"
disabled
"
,
"
disabled
"
);
f
.
removeAttr
(
"
style
"
);
f
.
attr
(
"
style
"
,
j
.
makeNodeIcoStyle
(
a
,
b
));
f
.
attr
(
"
class
"
,
j
.
makeNodeIcoClass
(
a
,
b
))}},
setNodeName
:
function
(
a
,
b
){
var
c
=
e
.
nodeTitle
(
a
,
b
),
d
=
l
(
b
,
g
.
id
.
SPAN
,
a
);
d
.
empty
();
a
.
view
.
nameIsHTML
?
d
.
html
(
e
.
nodeName
(
a
,
b
)):
d
.
text
(
e
.
nodeName
(
a
,
b
));
h
.
apply
(
a
.
view
.
showTitle
,[
a
.
treeId
,
b
],
a
.
view
.
showTitle
)
&&
l
(
b
,
g
.
id
.
A
,
a
).
attr
(
"
title
"
,
!
c
?
""
:
c
)},
setNodeTarget
:
function
(
a
,
b
){
l
(
b
,
g
.
id
.
A
,
a
).
attr
(
"
target
"
,
j
.
makeNodeTarget
(
b
))},
setNodeUrl
:
function
(
a
,
b
){
var
c
=
l
(
b
,
g
.
id
.
A
,
a
),
d
=
j
.
makeNodeUrl
(
a
,
b
);
d
==
null
||
d
.
length
==
0
?
c
.
removeAttr
(
"
href
"
):
c
.
attr
(
"
href
"
,
d
)},
switchNode
:
function
(
a
,
b
){
b
.
open
||!
h
.
canAsync
(
a
,
b
)?
j
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
):
a
.
async
.
enable
?
j
.
asyncNode
(
a
,
b
)
||
j
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
):
b
&&
j
.
expandCollapseNode
(
a
,
b
,
!
b
.
open
)}};
r
.
fn
.
zTree
=
{
consts
:{
className
:{
BUTTON
:
"
button
"
,
LEVEL
:
"
level
"
,
ICO_LOADING
:
"
ico_loading
"
,
SWITCH
:
"
switch
"
,
NAME
:
"
node_name
"
},
event
:{
NODECREATED
:
"
ztree_nodeCreated
"
,
CLICK
:
"
ztree_click
"
,
EXPAND
:
"
ztree_expand
"
,
COLLAPSE
:
"
ztree_collapse
"
,
ASYNC_SUCCESS
:
"
ztree_async_success
"
,
ASYNC_ERROR
:
"
ztree_async_error
"
,
REMOVE
:
"
ztree_remove
"
,
SELECTED
:
"
ztree_selected
"
,
UNSELECTED
:
"
ztree_unselected
"
},
id
:{
A
:
"
_a
"
,
ICON
:
"
_ico
"
,
SPAN
:
"
_span
"
,
SWITCH
:
"
_switch
"
,
UL
:
"
_ul
"
},
line
:{
ROOT
:
"
root
"
,
ROOTS
:
"
roots
"
,
CENTER
:
"
center
"
,
BOTTOM
:
"
bottom
"
,
NOLINE
:
"
noline
"
,
LINE
:
"
line
"
},
folder
:{
OPEN
:
"
open
"
,
CLOSE
:
"
close
"
,
DOCU
:
"
docu
"
},
node
:{
CURSELECTED
:
"
curSelectedNode
"
}},
_z
:{
tools
:
h
,
view
:
j
,
event
:
n
,
data
:
e
},
getZTreeObj
:
function
(
a
){
return
(
a
=
e
.
getZTreeTools
(
a
))?
a
:
null
},
destroy
:
function
(
a
){
if
(
a
&&
a
.
length
>
0
)
j
.
destroy
(
e
.
getSetting
(
a
));
else
for
(
var
b
in
t
)
j
.
destroy
(
t
[
b
])},
init
:
function
(
a
,
b
,
c
){
var
d
=
h
.
clone
(
P
);
r
.
extend
(
!
0
,
d
,
b
);
d
.
treeId
=
a
.
attr
(
"
id
"
);
d
.
treeObj
=
a
;
d
.
treeObj
.
empty
();
t
[
d
.
treeId
]
=
d
;
if
(
typeof
document
.
body
.
style
.
maxHeight
===
"
undefined
"
)
d
.
view
.
expandSpeed
=
""
;
e
.
initRoot
(
d
);
a
=
e
.
getRoot
(
d
);
c
=
c
?
h
.
clone
(
h
.
isArray
(
c
)?
c
:[
c
]):[];
d
.
data
.
simpleData
.
enable
?
e
.
nodeChildren
(
d
,
a
,
e
.
transformTozTreeFormat
(
d
,
c
)):
e
.
nodeChildren
(
d
,
a
,
c
);
e
.
initCache
(
d
);
n
.
unbindTree
(
d
);
n
.
bindTree
(
d
);
n
.
unbindEvent
(
d
);
n
.
bindEvent
(
d
);
var
f
=
{
setting
:
d
,
addNodes
:
function
(
a
,
b
,
c
,
f
){
function
g
(){
j
.
addNodes
(
d
,
a
,
b
,
n
,
f
==!
0
)}
a
||
(
a
=
null
);
var
l
=
e
.
nodeIsParent
(
d
,
a
);
if
(
a
&&!
l
&&
d
.
data
.
keep
.
leaf
)
return
null
;
l
=
parseInt
(
b
,
10
);
isNaN
(
l
)?(
f
=!!
c
,
c
=
b
,
b
=-
1
):
b
=
l
;
if
(
!
c
)
return
null
;
var
n
=
h
.
clone
(
h
.
isArray
(
c
)?
c
:[
c
]);
h
.
canAsync
(
d
,
a
)?
j
.
asyncNode
(
d
,
a
,
f
,
g
):
g
();
return
n
},
cancelSelectedNode
:
function
(
a
){
j
.
cancelPreSelectedNode
(
d
,
a
)},
destroy
:
function
(){
j
.
destroy
(
d
)},
expandAll
:
function
(
a
){
a
=!!
a
;
j
.
expandCollapseSonNode
(
d
,
null
,
a
,
!
0
);
return
a
},
expandNode
:
function
(
a
,
b
,
c
,
f
,
g
){
function
n
(){
var
b
=
l
(
a
,
d
).
get
(
0
);
b
&&
f
!==!
1
&&
j
.
scrollIntoView
(
d
,
b
)}
if
(
!
a
||!
e
.
nodeIsParent
(
d
,
a
))
return
null
;
b
!==!
0
&&
b
!==!
1
&&
(
b
=!
a
.
open
);
if
((
g
=!!
g
)
&&
b
&&
h
.
apply
(
d
.
callback
.
beforeExpand
,[
d
.
treeId
,
a
],
!
0
)
==!
1
)
return
null
;
else
if
(
g
&&!
b
&&
h
.
apply
(
d
.
callback
.
beforeCollapse
,[
d
.
treeId
,
a
],
!
0
)
==!
1
)
return
null
;
b
&&
a
.
parentTId
&&
j
.
expandCollapseParentNode
(
d
,
a
.
getParentNode
(),
b
,
!
1
);
if
(
b
===
a
.
open
&&!
c
)
return
null
;
e
.
getRoot
(
d
).
expandTriggerFlag
=
g
;
!
h
.
canAsync
(
d
,
a
)
&&
c
?
j
.
expandCollapseSonNode
(
d
,
a
,
b
,
!
0
,
n
):(
a
.
open
=!
b
,
j
.
switchNode
(
this
.
setting
,
a
),
n
());
return
b
},
getNodes
:
function
(){
return
e
.
getNodes
(
d
)},
getNodeByParam
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodeByParam
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodeByTId
:
function
(
a
){
return
e
.
getNodeCache
(
d
,
a
)},
getNodesByParam
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodesByParam
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodesByParamFuzzy
:
function
(
a
,
b
,
c
){
return
!
a
?
null
:
e
.
getNodesByParamFuzzy
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
)},
getNodesByFilter
:
function
(
a
,
b
,
c
,
f
){
b
=!!
b
;
return
!
a
||
typeof
a
!=
"
function
"
?
b
?
null
:[]:
e
.
getNodesByFilter
(
d
,
c
?
e
.
nodeChildren
(
d
,
c
):
e
.
getNodes
(
d
),
a
,
b
,
f
)},
getNodeIndex
:
function
(
a
){
if
(
!
a
)
return
null
;
for
(
var
b
=
a
.
parentTId
?
a
.
getParentNode
():
e
.
getRoot
(
d
),
b
=
e
.
nodeChildren
(
d
,
b
),
c
=
0
,
f
=
b
.
length
;
c
<
f
;
c
++
)
if
(
b
[
c
]
==
a
)
return
c
;
return
-
1
},
getSelectedNodes
:
function
(){
for
(
var
a
=
[],
b
=
e
.
getRoot
(
d
).
curSelectedList
,
c
=
0
,
f
=
b
.
length
;
c
<
f
;
c
++
)
a
.
push
(
b
[
c
]);
return
a
},
isSelectedNode
:
function
(
a
){
return
e
.
isSelectedNode
(
d
,
a
)},
reAsyncChildNodesPromise
:
function
(
a
,
b
,
c
){
return
new
Promise
(
function
(
d
,
e
){
try
{
f
.
reAsyncChildNodes
(
a
,
b
,
c
,
function
(){
d
(
a
)})}
catch
(
g
){
e
(
g
)}})},
reAsyncChildNodes
:
function
(
a
,
b
,
c
,
f
){
if
(
this
.
setting
.
async
.
enable
){
var
h
=!
a
;
h
&&
(
a
=
e
.
getRoot
(
d
));
if
(
b
==
"
refresh
"
){
for
(
var
b
=
e
.
nodeChildren
(
d
,
a
),
n
=
0
,
r
=
b
?
b
.
length
:
0
;
n
<
r
;
n
++
)
e
.
removeNodeCache
(
d
,
b
[
n
]);
e
.
removeSelectedNode
(
d
);
e
.
nodeChildren
(
d
,
a
,[]);
h
?
this
.
setting
.
treeObj
.
empty
():
l
(
a
,
g
.
id
.
UL
,
d
).
empty
()}
j
.
asyncNode
(
this
.
setting
,
h
?
null
:
a
,
!!
c
,
f
)}},
refresh
:
function
(){
this
.
setting
.
treeObj
.
empty
();
var
a
=
e
.
getRoot
(
d
),
b
=
e
.
nodeChildren
(
d
,
a
);
e
.
initRoot
(
d
);
e
.
nodeChildren
(
d
,
a
,
b
);
e
.
initCache
(
d
);
j
.
createNodes
(
d
,
0
,
e
.
nodeChildren
(
d
,
a
),
null
,
-
1
)},
removeChildNodes
:
function
(
a
){
if
(
!
a
)
return
null
;
var
b
=
e
.
nodeChildren
(
d
,
a
);
j
.
removeChildNodes
(
d
,
a
);
return
b
?
b
:
null
},
removeNode
:
function
(
a
,
b
){
a
&&
(
b
=!!
b
,
b
&&
h
.
apply
(
d
.
callback
.
beforeRemove
,[
d
.
treeId
,
a
],
!
0
)
==!
1
||
(
j
.
removeNode
(
d
,
a
),
b
&&
this
.
setting
.
treeObj
.
trigger
(
g
.
event
.
REMOVE
,[
d
.
treeId
,
a
])))},
selectNode
:
function
(
a
,
b
,
c
){
function
e
(){
if
(
!
c
){
var
b
=
l
(
a
,
d
).
get
(
0
);
j
.
scrollIntoView
(
d
,
b
)}}
if
(
a
&&
h
.
uCanDo
(
d
)){
b
=
d
.
view
.
selectedMulti
&&
b
;
if
(
a
.
parentTId
)
j
.
expandCollapseParentNode
(
d
,
a
.
getParentNode
(),
!
0
,
!
1
,
e
);
else
if
(
!
c
)
try
{
l
(
a
,
d
).
focus
().
blur
()}
catch
(
f
){}
j
.
selectNode
(
d
,
a
,
b
)}},
transformTozTreeNodes
:
function
(
a
){
return
e
.
transformTozTreeFormat
(
d
,
a
)},
transformToArray
:
function
(
a
){
return
e
.
transformToArrayFormat
(
d
,
a
)},
updateNode
:
function
(
a
){
a
&&
l
(
a
,
d
).
get
(
0
)
&&
h
.
uCanDo
(
d
)
&&
(
j
.
setNodeName
(
d
,
a
),
j
.
setNodeTarget
(
d
,
a
),
j
.
setNodeUrl
(
d
,
a
),
j
.
setNodeLineIcos
(
d
,
a
),
j
.
setNodeFontCss
(
d
,
a
))}};
a
.
treeTools
=
f
;
e
.
setZTreeTools
(
d
,
f
);(
c
=
e
.
nodeChildren
(
d
,
a
))
&&
c
.
length
>
0
?
j
.
createNodes
(
d
,
0
,
c
,
null
,
-
1
):
d
.
async
.
enable
&&
d
.
async
.
url
&&
d
.
async
.
url
!==
""
&&
j
.
asyncNode
(
d
);
return
f
}};
var
Q
=
r
.
fn
.
zTree
,
l
=
h
.
$
,
g
=
Q
.
consts
})(
jQuery
);
js/jquery.ztree.excheck.js
浏览文件 @
9523be07
/*
* JQuery zTree excheck v3.5.3
6
* JQuery zTree excheck v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -8,9 +8,9 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
$
)
{
(
function
(
$
)
{
//default consts of excheck
var
_consts
=
{
event
:
{
...
...
@@ -55,8 +55,8 @@
}
},
callback
:
{
beforeCheck
:
null
,
onCheck
:
null
beforeCheck
:
null
,
onCheck
:
null
}
},
//default root of excheck
...
...
@@ -65,9 +65,10 @@
r
.
radioCheckedList
=
[];
},
//default cache of excheck
_initCache
=
function
(
treeId
)
{},
_initCache
=
function
(
treeId
)
{
},
//default bind event of excheck
_bindEvent
=
function
(
setting
)
{
_bindEvent
=
function
(
setting
)
{
var
o
=
setting
.
treeObj
,
c
=
consts
.
event
;
o
.
bind
(
c
.
CHECK
,
function
(
event
,
srcEvent
,
treeId
,
node
)
{
...
...
@@ -75,13 +76,13 @@
tools
.
apply
(
setting
.
callback
.
onCheck
,
[
event
,
treeId
,
node
]);
});
},
_unbindEvent
=
function
(
setting
)
{
_unbindEvent
=
function
(
setting
)
{
var
o
=
setting
.
treeObj
,
c
=
consts
.
event
;
o
.
unbind
(
c
.
CHECK
);
},
//default event proxy of excheck
_eventProxy
=
function
(
e
)
{
_eventProxy
=
function
(
e
)
{
var
target
=
e
.
target
,
setting
=
data
.
getSetting
(
e
.
data
.
treeId
),
tId
=
""
,
node
=
null
,
...
...
@@ -89,22 +90,22 @@
nodeEventCallback
=
null
,
treeEventCallback
=
null
;
if
(
tools
.
eqs
(
e
.
type
,
"
mouseover
"
))
{
if
(
setting
.
check
.
enable
&&
tools
.
eqs
(
target
.
tagName
,
"
span
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
CHECK
)
!==
null
)
{
if
(
setting
.
check
.
enable
&&
tools
.
eqs
(
target
.
tagName
,
"
span
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
CHECK
)
!==
null
)
{
tId
=
tools
.
getNodeMainDom
(
target
).
id
;
nodeEventType
=
"
mouseoverCheck
"
;
}
}
else
if
(
tools
.
eqs
(
e
.
type
,
"
mouseout
"
))
{
if
(
setting
.
check
.
enable
&&
tools
.
eqs
(
target
.
tagName
,
"
span
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
CHECK
)
!==
null
)
{
if
(
setting
.
check
.
enable
&&
tools
.
eqs
(
target
.
tagName
,
"
span
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
CHECK
)
!==
null
)
{
tId
=
tools
.
getNodeMainDom
(
target
).
id
;
nodeEventType
=
"
mouseoutCheck
"
;
}
}
else
if
(
tools
.
eqs
(
e
.
type
,
"
click
"
))
{
if
(
setting
.
check
.
enable
&&
tools
.
eqs
(
target
.
tagName
,
"
span
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
CHECK
)
!==
null
)
{
if
(
setting
.
check
.
enable
&&
tools
.
eqs
(
target
.
tagName
,
"
span
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
CHECK
)
!==
null
)
{
tId
=
tools
.
getNodeMainDom
(
target
).
id
;
nodeEventType
=
"
checkNode
"
;
}
}
if
(
tId
.
length
>
0
)
{
if
(
tId
.
length
>
0
)
{
node
=
data
.
getNodeCache
(
setting
,
tId
);
switch
(
nodeEventType
)
{
case
"
checkNode
"
:
...
...
@@ -129,7 +130,7 @@
return
proxyResult
},
//default init node of excheck
_initNode
=
function
(
setting
,
level
,
n
,
parentNode
,
isFirstNode
,
isLastNode
,
openFlag
)
{
_initNode
=
function
(
setting
,
level
,
n
,
parentNode
,
isFirstNode
,
isLastNode
,
openFlag
)
{
if
(
!
n
)
return
;
var
checked
=
data
.
nodeChecked
(
setting
,
n
);
checked
=
data
.
nodeChecked
(
setting
,
n
,
checked
);
...
...
@@ -142,7 +143,9 @@
n
.
halfCheck
=
!!
n
.
halfCheck
;
n
.
check_Child_State
=
-
1
;
n
.
check_Focus
=
false
;
n
.
getCheckStatus
=
function
()
{
return
data
.
getCheckStatus
(
setting
,
n
);};
n
.
getCheckStatus
=
function
()
{
return
data
.
getCheckStatus
(
setting
,
n
);
};
if
(
setting
.
check
.
chkStyle
==
consts
.
radio
.
STYLE
&&
setting
.
check
.
radioType
==
consts
.
radio
.
TYPE_ALL
&&
checked
)
{
var
r
=
data
.
getRoot
(
setting
);
...
...
@@ -150,15 +153,15 @@
}
},
//add dom for check
_beforeA
=
function
(
setting
,
node
,
html
)
{
_beforeA
=
function
(
setting
,
node
,
html
)
{
if
(
setting
.
check
.
enable
)
{
data
.
makeChkFlag
(
setting
,
node
);
html
.
push
(
"
<span ID='
"
,
node
.
tId
,
consts
.
id
.
CHECK
,
"
' class='
"
,
view
.
makeChkClass
(
setting
,
node
),
"
' treeNode
"
,
consts
.
id
.
CHECK
,
(
node
.
nocheck
===
true
?
"
style='display:none;'
"
:
""
),
"
></span>
"
);
html
.
push
(
"
<span ID='
"
,
node
.
tId
,
consts
.
id
.
CHECK
,
"
' class='
"
,
view
.
makeChkClass
(
setting
,
node
),
"
' treeNode
"
,
consts
.
id
.
CHECK
,
(
node
.
nocheck
===
true
?
"
style='display:none;'
"
:
""
),
"
></span>
"
);
}
},
//update zTreeObj, add method of check
_zTreeTools
=
function
(
setting
,
zTreeTools
)
{
zTreeTools
.
checkNode
=
function
(
node
,
checked
,
checkTypeFlag
,
callbackFlag
)
{
_zTreeTools
=
function
(
setting
,
zTreeTools
)
{
zTreeTools
.
checkNode
=
function
(
node
,
checked
,
checkTypeFlag
,
callbackFlag
)
{
var
nodeChecked
=
data
.
nodeChecked
(
setting
,
node
);
if
(
node
.
chkDisabled
===
true
)
return
;
if
(
checked
!==
true
&&
checked
!==
false
)
{
...
...
@@ -183,22 +186,22 @@
}
}
zTreeTools
.
checkAllNodes
=
function
(
checked
)
{
zTreeTools
.
checkAllNodes
=
function
(
checked
)
{
view
.
repairAllChk
(
this
.
setting
,
!!
checked
);
}
zTreeTools
.
getCheckedNodes
=
function
(
checked
)
{
zTreeTools
.
getCheckedNodes
=
function
(
checked
)
{
var
checked
=
(
checked
!==
false
);
var
children
=
data
.
nodeChildren
(
setting
,
data
.
getRoot
(
this
.
setting
));
return
data
.
getTreeCheckedNodes
(
this
.
setting
,
children
,
checked
);
}
zTreeTools
.
getChangeCheckedNodes
=
function
()
{
zTreeTools
.
getChangeCheckedNodes
=
function
()
{
var
children
=
data
.
nodeChildren
(
setting
,
data
.
getRoot
(
this
.
setting
));
return
data
.
getTreeChangeCheckedNodes
(
this
.
setting
,
children
);
}
zTreeTools
.
setChkDisabled
=
function
(
node
,
disabled
,
inheritParent
,
inheritChildren
)
{
zTreeTools
.
setChkDisabled
=
function
(
node
,
disabled
,
inheritParent
,
inheritChildren
)
{
disabled
=
!!
disabled
;
inheritParent
=
!!
inheritParent
;
inheritChildren
=
!!
inheritChildren
;
...
...
@@ -207,7 +210,7 @@
}
var
_updateNode
=
zTreeTools
.
updateNode
;
zTreeTools
.
updateNode
=
function
(
node
,
checkTypeFlag
)
{
zTreeTools
.
updateNode
=
function
(
node
,
checkTypeFlag
)
{
if
(
_updateNode
)
_updateNode
.
apply
(
zTreeTools
,
arguments
);
if
(
!
node
||
!
this
.
setting
.
check
.
enable
)
return
;
var
nObj
=
$$
(
node
,
this
.
setting
);
...
...
@@ -221,17 +224,18 @@
},
//method of operate data
_data
=
{
getRadioCheckedList
:
function
(
setting
)
{
getRadioCheckedList
:
function
(
setting
)
{
var
checkedList
=
data
.
getRoot
(
setting
).
radioCheckedList
;
for
(
var
i
=
0
,
j
=
checkedList
.
length
;
i
<
j
;
i
++
)
{
if
(
!
data
.
getNodeCache
(
setting
,
checkedList
[
i
].
tId
))
{
for
(
var
i
=
0
,
j
=
checkedList
.
length
;
i
<
j
;
i
++
)
{
if
(
!
data
.
getNodeCache
(
setting
,
checkedList
[
i
].
tId
))
{
checkedList
.
splice
(
i
,
1
);
i
--
;
j
--
;
i
--
;
j
--
;
}
}
return
checkedList
;
},
getCheckStatus
:
function
(
setting
,
node
)
{
getCheckStatus
:
function
(
setting
,
node
)
{
if
(
!
setting
.
check
.
enable
||
node
.
nocheck
||
node
.
chkDisabled
)
return
null
;
var
checked
=
data
.
nodeChecked
(
setting
,
node
),
r
=
{
...
...
@@ -240,7 +244,7 @@
};
return
r
;
},
getTreeCheckedNodes
:
function
(
setting
,
nodes
,
checked
,
results
)
{
getTreeCheckedNodes
:
function
(
setting
,
nodes
,
checked
,
results
)
{
if
(
!
nodes
)
return
[];
var
onlyOne
=
(
checked
&&
setting
.
check
.
chkStyle
==
consts
.
radio
.
STYLE
&&
setting
.
check
.
radioType
==
consts
.
radio
.
TYPE_ALL
);
results
=
!
results
?
[]
:
results
;
...
...
@@ -250,18 +254,18 @@
var
nodeChecked
=
data
.
nodeChecked
(
setting
,
node
);
if
(
node
.
nocheck
!==
true
&&
node
.
chkDisabled
!==
true
&&
nodeChecked
==
checked
)
{
results
.
push
(
node
);
if
(
onlyOne
)
{
if
(
onlyOne
)
{
break
;
}
}
data
.
getTreeCheckedNodes
(
setting
,
children
,
checked
,
results
);
if
(
onlyOne
&&
results
.
length
>
0
)
{
if
(
onlyOne
&&
results
.
length
>
0
)
{
break
;
}
}
return
results
;
},
getTreeChangeCheckedNodes
:
function
(
setting
,
nodes
,
results
)
{
getTreeChangeCheckedNodes
:
function
(
setting
,
nodes
,
results
)
{
if
(
!
nodes
)
return
[];
results
=
!
results
?
[]
:
results
;
for
(
var
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
...
...
@@ -275,7 +279,7 @@
}
return
results
;
},
makeChkFlag
:
function
(
setting
,
node
)
{
makeChkFlag
:
function
(
setting
,
node
)
{
if
(
!
node
)
return
;
var
chkFlag
=
-
1
;
var
children
=
data
.
nodeChildren
(
setting
,
node
);
...
...
@@ -292,11 +296,12 @@
}
else
if
(
nodeChecked
)
{
tmp
=
2
;
}
else
{
tmp
=
cNode
.
check_Child_State
>
0
?
2
:
0
;
tmp
=
cNode
.
check_Child_State
>
0
?
2
:
0
;
}
if
(
tmp
==
2
)
{
chkFlag
=
2
;
break
;
}
else
if
(
tmp
==
0
){
chkFlag
=
2
;
break
;
}
else
if
(
tmp
==
0
)
{
chkFlag
=
0
;
}
}
else
if
(
setting
.
check
.
chkStyle
==
consts
.
checkbox
.
STYLE
)
{
...
...
@@ -310,11 +315,14 @@
tmp
=
(
cNode
.
check_Child_State
>
0
)
?
1
:
0
;
}
if
(
tmp
===
1
)
{
chkFlag
=
1
;
break
;
chkFlag
=
1
;
break
;
}
else
if
(
tmp
===
2
&&
chkFlag
>
-
1
&&
i
>
0
&&
tmp
!==
chkFlag
)
{
chkFlag
=
1
;
break
;
chkFlag
=
1
;
break
;
}
else
if
(
chkFlag
===
2
&&
tmp
>
-
1
&&
tmp
<
2
)
{
chkFlag
=
1
;
break
;
chkFlag
=
1
;
break
;
}
else
if
(
tmp
>
-
1
)
{
chkFlag
=
tmp
;
}
...
...
@@ -325,9 +333,7 @@
}
},
//method of event proxy
_event
=
{
},
_event
=
{},
//method of event handler
_handler
=
{
onCheckNode
:
function
(
event
,
node
)
{
...
...
@@ -343,7 +349,7 @@
setting
.
treeObj
.
trigger
(
consts
.
event
.
CHECK
,
[
event
,
setting
.
treeId
,
node
]);
return
true
;
},
onMouseoverCheck
:
function
(
event
,
node
)
{
onMouseoverCheck
:
function
(
event
,
node
)
{
if
(
node
.
chkDisabled
===
true
)
return
false
;
var
setting
=
data
.
getSetting
(
event
.
data
.
treeId
),
checkObj
=
$$
(
node
,
consts
.
id
.
CHECK
,
setting
);
...
...
@@ -351,7 +357,7 @@
view
.
setChkClass
(
setting
,
checkObj
,
node
);
return
true
;
},
onMouseoutCheck
:
function
(
event
,
node
)
{
onMouseoutCheck
:
function
(
event
,
node
)
{
if
(
node
.
chkDisabled
===
true
)
return
false
;
var
setting
=
data
.
getSetting
(
event
.
data
.
treeId
),
checkObj
=
$$
(
node
,
consts
.
id
.
CHECK
,
setting
);
...
...
@@ -361,12 +367,10 @@
}
},
//method of tools for zTree
_tools
=
{
},
_tools
=
{},
//method of operate ztree dom
_view
=
{
checkNodeRelation
:
function
(
setting
,
node
)
{
checkNodeRelation
:
function
(
setting
,
node
)
{
var
pNode
,
i
,
l
,
r
=
consts
.
radio
;
var
nodeChecked
=
data
.
nodeChecked
(
setting
,
node
);
...
...
@@ -374,7 +378,7 @@
var
checkedList
=
data
.
getRadioCheckedList
(
setting
);
if
(
nodeChecked
)
{
if
(
setting
.
check
.
radioType
==
r
.
TYPE_ALL
)
{
for
(
i
=
checkedList
.
length
-
1
;
i
>=
0
;
i
--
)
{
for
(
i
=
checkedList
.
length
-
1
;
i
>=
0
;
i
--
)
{
pNode
=
checkedList
[
i
];
var
pNodeChecked
=
data
.
nodeChecked
(
setting
,
pNode
);
if
(
pNodeChecked
&&
pNode
!=
node
)
{
...
...
@@ -411,10 +415,10 @@
}
else
{
var
children
=
data
.
nodeChildren
(
setting
,
node
);
if
(
nodeChecked
&&
(
!
children
||
children
.
length
==
0
||
setting
.
check
.
chkboxType
.
Y
.
indexOf
(
"
s
"
)
>
-
1
))
{
if
(
nodeChecked
&&
(
!
children
||
children
.
length
==
0
||
setting
.
check
.
chkboxType
.
Y
.
indexOf
(
"
s
"
)
>
-
1
))
{
view
.
setSonNodeCheckBox
(
setting
,
node
,
true
);
}
if
(
!
nodeChecked
&&
(
!
children
||
children
.
length
==
0
||
setting
.
check
.
chkboxType
.
N
.
indexOf
(
"
s
"
)
>
-
1
))
{
if
(
!
nodeChecked
&&
(
!
children
||
children
.
length
==
0
||
setting
.
check
.
chkboxType
.
N
.
indexOf
(
"
s
"
)
>
-
1
))
{
view
.
setSonNodeCheckBox
(
setting
,
node
,
false
);
}
if
(
nodeChecked
&&
setting
.
check
.
chkboxType
.
Y
.
indexOf
(
"
p
"
)
>
-
1
)
{
...
...
@@ -425,7 +429,7 @@
}
}
},
makeChkClass
:
function
(
setting
,
node
)
{
makeChkClass
:
function
(
setting
,
node
)
{
var
c
=
consts
.
checkbox
,
r
=
consts
.
radio
,
fullStyle
=
""
;
var
nodeChecked
=
data
.
nodeChecked
(
setting
,
node
);
...
...
@@ -434,19 +438,19 @@
}
else
if
(
node
.
halfCheck
)
{
fullStyle
=
c
.
PART
;
}
else
if
(
setting
.
check
.
chkStyle
==
r
.
STYLE
)
{
fullStyle
=
(
node
.
check_Child_State
<
1
)?
c
.
FULL
:
c
.
PART
;
fullStyle
=
(
node
.
check_Child_State
<
1
)
?
c
.
FULL
:
c
.
PART
;
}
else
{
fullStyle
=
nodeChecked
?
((
node
.
check_Child_State
===
2
||
node
.
check_Child_State
===
-
1
)
?
c
.
FULL
:
c
.
PART
)
:
((
node
.
check_Child_State
<
1
)?
c
.
FULL
:
c
.
PART
);
fullStyle
=
nodeChecked
?
((
node
.
check_Child_State
===
2
||
node
.
check_Child_State
===
-
1
)
?
c
.
FULL
:
c
.
PART
)
:
((
node
.
check_Child_State
<
1
)
?
c
.
FULL
:
c
.
PART
);
}
var
chkName
=
setting
.
check
.
chkStyle
+
"
_
"
+
(
nodeChecked
?
c
.
TRUE
:
c
.
FALSE
)
+
"
_
"
+
fullStyle
;
chkName
=
(
node
.
check_Focus
&&
node
.
chkDisabled
!==
true
)
?
chkName
+
"
_
"
+
c
.
FOCUS
:
chkName
;
return
consts
.
className
.
BUTTON
+
"
"
+
c
.
DEFAULT
+
"
"
+
chkName
;
},
repairAllChk
:
function
(
setting
,
checked
)
{
repairAllChk
:
function
(
setting
,
checked
)
{
if
(
setting
.
check
.
enable
&&
setting
.
check
.
chkStyle
===
consts
.
checkbox
.
STYLE
)
{
var
root
=
data
.
getRoot
(
setting
);
var
children
=
data
.
nodeChildren
(
setting
,
root
);
for
(
var
i
=
0
,
l
=
children
.
length
;
i
<
l
;
i
++
)
{
for
(
var
i
=
0
,
l
=
children
.
length
;
i
<
l
;
i
++
)
{
var
node
=
children
[
i
];
if
(
node
.
nocheck
!==
true
&&
node
.
chkDisabled
!==
true
)
{
data
.
nodeChecked
(
setting
,
node
,
checked
);
...
...
@@ -455,7 +459,7 @@
}
}
},
repairChkClass
:
function
(
setting
,
node
)
{
repairChkClass
:
function
(
setting
,
node
)
{
if
(
!
node
)
return
;
data
.
makeChkFlag
(
setting
,
node
);
if
(
node
.
nocheck
!==
true
)
{
...
...
@@ -463,13 +467,13 @@
view
.
setChkClass
(
setting
,
checkObj
,
node
);
}
},
repairParentChkClass
:
function
(
setting
,
node
)
{
repairParentChkClass
:
function
(
setting
,
node
)
{
if
(
!
node
||
!
node
.
parentTId
)
return
;
var
pNode
=
node
.
getParentNode
();
view
.
repairChkClass
(
setting
,
pNode
);
view
.
repairParentChkClass
(
setting
,
pNode
);
},
repairParentChkClassWithSelf
:
function
(
setting
,
node
)
{
repairParentChkClassWithSelf
:
function
(
setting
,
node
)
{
if
(
!
node
)
return
;
var
children
=
data
.
nodeChildren
(
setting
,
node
);
if
(
children
&&
children
.
length
>
0
)
{
...
...
@@ -478,7 +482,7 @@
view
.
repairParentChkClass
(
setting
,
node
);
}
},
repairSonChkDisabled
:
function
(
setting
,
node
,
chkDisabled
,
inherit
)
{
repairSonChkDisabled
:
function
(
setting
,
node
,
chkDisabled
,
inherit
)
{
if
(
!
node
)
return
;
if
(
node
.
chkDisabled
!=
chkDisabled
)
{
node
.
chkDisabled
=
chkDisabled
;
...
...
@@ -492,7 +496,7 @@
}
}
},
repairParentChkDisabled
:
function
(
setting
,
node
,
chkDisabled
,
inherit
)
{
repairParentChkDisabled
:
function
(
setting
,
node
,
chkDisabled
,
inherit
)
{
if
(
!
node
)
return
;
if
(
node
.
chkDisabled
!=
chkDisabled
&&
inherit
)
{
node
.
chkDisabled
=
chkDisabled
;
...
...
@@ -500,7 +504,7 @@
view
.
repairChkClass
(
setting
,
node
);
view
.
repairParentChkDisabled
(
setting
,
node
.
getParentNode
(),
chkDisabled
,
inherit
);
},
setChkClass
:
function
(
setting
,
obj
,
node
)
{
setChkClass
:
function
(
setting
,
obj
,
node
)
{
if
(
!
obj
)
return
;
if
(
node
.
nocheck
===
true
)
{
obj
.
hide
();
...
...
@@ -509,7 +513,7 @@
}
obj
.
attr
(
'
class
'
,
view
.
makeChkClass
(
setting
,
node
));
},
setParentNodeCheckBox
:
function
(
setting
,
node
,
value
,
srcNode
)
{
setParentNodeCheckBox
:
function
(
setting
,
node
,
value
,
srcNode
)
{
var
checkObj
=
$$
(
node
,
consts
.
id
.
CHECK
,
setting
);
if
(
!
srcNode
)
srcNode
=
node
;
data
.
makeChkFlag
(
setting
,
node
);
...
...
@@ -539,7 +543,7 @@
}
}
},
setSonNodeCheckBox
:
function
(
setting
,
node
,
value
,
srcNode
)
{
setSonNodeCheckBox
:
function
(
setting
,
node
,
value
,
srcNode
)
{
if
(
!
node
)
return
;
var
checkObj
=
$$
(
node
,
consts
.
id
.
CHECK
,
setting
);
if
(
!
srcNode
)
srcNode
=
node
;
...
...
@@ -590,7 +594,7 @@
event
=
zt
.
_z
.
event
,
$$
=
tools
.
$
;
data
.
nodeChecked
=
function
(
setting
,
node
,
newChecked
)
{
data
.
nodeChecked
=
function
(
setting
,
node
,
newChecked
)
{
if
(
!
node
)
{
return
false
;
}
...
...
@@ -616,13 +620,13 @@
data
.
addZTreeTools
(
_zTreeTools
);
var
_createNodes
=
view
.
createNodes
;
view
.
createNodes
=
function
(
setting
,
level
,
nodes
,
parentNode
,
index
)
{
view
.
createNodes
=
function
(
setting
,
level
,
nodes
,
parentNode
,
index
)
{
if
(
_createNodes
)
_createNodes
.
apply
(
view
,
arguments
);
if
(
!
nodes
)
return
;
view
.
repairParentChkClassWithSelf
(
setting
,
parentNode
);
}
var
_removeNode
=
view
.
removeNode
;
view
.
removeNode
=
function
(
setting
,
node
)
{
view
.
removeNode
=
function
(
setting
,
node
)
{
var
parentNode
=
node
.
getParentNode
();
if
(
_removeNode
)
_removeNode
.
apply
(
view
,
arguments
);
if
(
!
node
||
!
parentNode
)
return
;
...
...
@@ -631,7 +635,7 @@
}
var
_appendNodes
=
view
.
appendNodes
;
view
.
appendNodes
=
function
(
setting
,
level
,
nodes
,
parentNode
,
index
,
initFlag
,
openFlag
)
{
view
.
appendNodes
=
function
(
setting
,
level
,
nodes
,
parentNode
,
index
,
initFlag
,
openFlag
)
{
var
html
=
""
;
if
(
_appendNodes
)
{
html
=
_appendNodes
.
apply
(
view
,
arguments
);
...
...
js/jquery.ztree.excheck.min.js
浏览文件 @
9523be07
/*
* JQuery zTree excheck v3.5.3
6
* JQuery zTree excheck v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
n
){
var
q
,
r
,
s
,
p
=
{
event
:{
CHECK
:
"
ztree_check
"
},
id
:{
CHECK
:
"
_check
"
},
checkbox
:{
STYLE
:
"
checkbox
"
,
DEFAULT
:
"
chk
"
,
DISABLED
:
"
disable
"
,
FALSE
:
"
false
"
,
TRUE
:
"
true
"
,
FULL
:
"
full
"
,
PART
:
"
part
"
,
FOCUS
:
"
focus
"
},
radio
:{
STYLE
:
"
radio
"
,
TYPE_ALL
:
"
all
"
,
TYPE_LEVEL
:
"
level
"
}},
w
=
{
check
:{
enable
:
!
1
,
autoCheckTrigger
:
!
1
,
chkStyle
:
p
.
checkbox
.
STYLE
,
nocheckInherit
:
!
1
,
chkDisabledInherit
:
!
1
,
radioType
:
p
.
radio
.
TYPE_LEVEL
,
chkboxType
:{
Y
:
"
ps
"
,
N
:
"
ps
"
}},
data
:{
key
:{
checked
:
"
checked
"
}},
callback
:{
beforeCheck
:
null
,
onCheck
:
null
}};
q
=
function
(
c
,
a
){
if
(
a
.
chkDisabled
===!
0
)
return
!
1
;
var
b
=
e
.
getSetting
(
c
.
data
.
treeId
);
if
(
i
.
apply
(
b
.
callback
.
beforeCheck
,[
b
.
treeId
,
a
],
!
0
)
==!
1
)
return
!
0
;
var
d
=
e
.
nodeChecked
(
b
,
a
);
e
.
nodeChecked
(
b
,
a
,
!
d
);
f
.
checkNodeRelation
(
b
,
a
);
d
=
m
(
a
,
h
.
id
.
CHECK
,
b
);
f
.
setChkClass
(
b
,
d
,
a
);
f
.
repairParentChkClassWithSelf
(
b
,
a
);
b
.
treeObj
.
trigger
(
h
.
event
.
CHECK
,[
c
,
b
.
treeId
,
a
]);
return
!
0
};
r
=
function
(
c
,
a
){
if
(
a
.
chkDisabled
===!
0
)
return
!
1
;
var
b
=
e
.
getSetting
(
c
.
data
.
treeId
),
d
=
m
(
a
,
h
.
id
.
CHECK
,
b
);
a
.
check_Focus
=!
0
;
f
.
setChkClass
(
b
,
d
,
a
);
return
!
0
};
s
=
function
(
c
,
...
...
js/jquery.ztree.exedit.js
浏览文件 @
9523be07
/*
* JQuery zTree exedit v3.5.3
6
* JQuery zTree exedit v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -8,16 +8,16 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
$
)
{
(
function
(
$
)
{
//default consts of exedit
var
_consts
=
{
event
:
{
DRAG
:
"
ztree_drag
"
,
DROP
:
"
ztree_drop
"
,
RENAME
:
"
ztree_rename
"
,
DRAGMOVE
:
"
ztree_dragmove
"
DRAGMOVE
:
"
ztree_dragmove
"
},
id
:
{
EDIT
:
"
_edit
"
,
...
...
@@ -63,15 +63,15 @@
removeHoverDom
:
null
},
callback
:
{
beforeDrag
:
null
,
beforeDragOpen
:
null
,
beforeDrop
:
null
,
beforeEditName
:
null
,
beforeRename
:
null
,
onDrag
:
null
,
onDragMove
:
null
,
onDrop
:
null
,
onRename
:
null
beforeDrag
:
null
,
beforeDragOpen
:
null
,
beforeDrop
:
null
,
beforeEditName
:
null
,
beforeRename
:
null
,
onDrag
:
null
,
onDragMove
:
null
,
onDrop
:
null
,
onRename
:
null
}
},
//default root of exedit
...
...
@@ -86,9 +86,10 @@
rs
.
showHoverDom
=
true
;
},
//default cache of exedit
_initCache
=
function
(
treeId
)
{},
_initCache
=
function
(
treeId
)
{
},
//default bind event of exedit
_bindEvent
=
function
(
setting
)
{
_bindEvent
=
function
(
setting
)
{
var
o
=
setting
.
treeObj
;
var
c
=
consts
.
event
;
o
.
bind
(
c
.
RENAME
,
function
(
event
,
treeId
,
treeNode
,
isCancel
)
{
...
...
@@ -99,15 +100,15 @@
tools
.
apply
(
setting
.
callback
.
onDrag
,
[
srcEvent
,
treeId
,
treeNodes
]);
});
o
.
bind
(
c
.
DRAGMOVE
,
function
(
event
,
srcEvent
,
treeId
,
treeNodes
)
{
tools
.
apply
(
setting
.
callback
.
onDragMove
,
[
srcEvent
,
treeId
,
treeNodes
]);
o
.
bind
(
c
.
DRAGMOVE
,
function
(
event
,
srcEvent
,
treeId
,
treeNodes
)
{
tools
.
apply
(
setting
.
callback
.
onDragMove
,
[
srcEvent
,
treeId
,
treeNodes
]);
});
o
.
bind
(
c
.
DROP
,
function
(
event
,
srcEvent
,
treeId
,
treeNodes
,
targetNode
,
moveType
,
isCopy
)
{
tools
.
apply
(
setting
.
callback
.
onDrop
,
[
srcEvent
,
treeId
,
treeNodes
,
targetNode
,
moveType
,
isCopy
]);
});
},
_unbindEvent
=
function
(
setting
)
{
_unbindEvent
=
function
(
setting
)
{
var
o
=
setting
.
treeObj
;
var
c
=
consts
.
event
;
o
.
unbind
(
c
.
RENAME
);
...
...
@@ -116,7 +117,7 @@
o
.
unbind
(
c
.
DROP
);
},
//default event proxy of exedit
_eventProxy
=
function
(
e
)
{
_eventProxy
=
function
(
e
)
{
var
target
=
e
.
target
,
setting
=
data
.
getSetting
(
e
.
data
.
treeId
),
relatedTarget
=
e
.
relatedTarget
,
...
...
@@ -126,25 +127,25 @@
tmp
=
null
;
if
(
tools
.
eqs
(
e
.
type
,
"
mouseover
"
))
{
tmp
=
tools
.
getMDom
(
setting
,
target
,
[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
consts
.
id
.
A
}]);
tmp
=
tools
.
getMDom
(
setting
,
target
,
[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
consts
.
id
.
A
}]);
if
(
tmp
)
{
tId
=
tools
.
getNodeMainDom
(
tmp
).
id
;
nodeEventType
=
"
hoverOverNode
"
;
}
}
else
if
(
tools
.
eqs
(
e
.
type
,
"
mouseout
"
))
{
tmp
=
tools
.
getMDom
(
setting
,
relatedTarget
,
[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
consts
.
id
.
A
}]);
tmp
=
tools
.
getMDom
(
setting
,
relatedTarget
,
[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
consts
.
id
.
A
}]);
if
(
!
tmp
)
{
tId
=
"
remove
"
;
nodeEventType
=
"
hoverOutNode
"
;
}
}
else
if
(
tools
.
eqs
(
e
.
type
,
"
mousedown
"
))
{
tmp
=
tools
.
getMDom
(
setting
,
target
,
[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
consts
.
id
.
A
}]);
tmp
=
tools
.
getMDom
(
setting
,
target
,
[{
tagName
:
"
a
"
,
attrName
:
"
treeNode
"
+
consts
.
id
.
A
}]);
if
(
tmp
)
{
tId
=
tools
.
getNodeMainDom
(
tmp
).
id
;
nodeEventType
=
"
mousedownNode
"
;
}
}
if
(
tId
.
length
>
0
)
{
if
(
tId
.
length
>
0
)
{
node
=
data
.
getNodeCache
(
setting
,
tId
);
switch
(
nodeEventType
)
{
case
"
mousedownNode
"
:
...
...
@@ -169,19 +170,19 @@
return
proxyResult
},
//default init node of exedit
_initNode
=
function
(
setting
,
level
,
n
,
parentNode
,
isFirstNode
,
isLastNode
,
openFlag
)
{
_initNode
=
function
(
setting
,
level
,
n
,
parentNode
,
isFirstNode
,
isLastNode
,
openFlag
)
{
if
(
!
n
)
return
;
n
.
isHover
=
false
;
n
.
editNameFlag
=
false
;
},
//update zTreeObj, add method of edit
_zTreeTools
=
function
(
setting
,
zTreeTools
)
{
zTreeTools
.
cancelEditName
=
function
(
newName
)
{
_zTreeTools
=
function
(
setting
,
zTreeTools
)
{
zTreeTools
.
cancelEditName
=
function
(
newName
)
{
var
root
=
data
.
getRoot
(
this
.
setting
);
if
(
!
root
.
curEditNode
)
return
;
view
.
cancelCurEditNode
(
this
.
setting
,
newName
?
newName
:
null
,
true
);
view
.
cancelCurEditNode
(
this
.
setting
,
newName
?
newName
:
null
,
true
);
}
zTreeTools
.
copyNode
=
function
(
targetNode
,
node
,
moveType
,
isSilent
)
{
zTreeTools
.
copyNode
=
function
(
targetNode
,
node
,
moveType
,
isSilent
)
{
if
(
!
node
)
return
null
;
var
isParent
=
data
.
nodeIsParent
(
setting
,
targetNode
);
if
(
targetNode
&&
!
isParent
&&
this
.
setting
.
data
.
keep
.
leaf
&&
moveType
===
consts
.
move
.
TYPE_INNER
)
return
null
;
...
...
@@ -207,12 +208,12 @@
}
return
newNode
;
}
zTreeTools
.
editName
=
function
(
node
)
{
zTreeTools
.
editName
=
function
(
node
)
{
if
(
!
node
||
!
node
.
tId
||
node
!==
data
.
getNodeCache
(
this
.
setting
,
node
.
tId
))
return
;
if
(
node
.
parentTId
)
view
.
expandCollapseParentNode
(
this
.
setting
,
node
.
getParentNode
(),
true
);
view
.
editNode
(
this
.
setting
,
node
)
}
zTreeTools
.
moveNode
=
function
(
targetNode
,
node
,
moveType
,
isSilent
)
{
zTreeTools
.
moveNode
=
function
(
targetNode
,
node
,
moveType
,
isSilent
)
{
if
(
!
node
)
return
node
;
var
isParent
=
data
.
nodeIsParent
(
setting
,
targetNode
);
if
(
targetNode
&&
!
isParent
&&
this
.
setting
.
data
.
keep
.
leaf
&&
moveType
===
consts
.
move
.
TYPE_INNER
)
{
...
...
@@ -223,9 +224,11 @@
targetNode
=
null
;
}
var
_this
=
this
;
function
moveCallback
()
{
view
.
moveNode
(
_this
.
setting
,
targetNode
,
node
,
moveType
,
false
,
isSilent
);
}
if
(
tools
.
canAsync
(
this
.
setting
,
targetNode
)
&&
moveType
===
consts
.
move
.
TYPE_INNER
)
{
view
.
asyncNode
(
this
.
setting
,
targetNode
,
isSilent
,
moveCallback
);
}
else
{
...
...
@@ -233,17 +236,17 @@
}
return
node
;
}
zTreeTools
.
setEditable
=
function
(
editable
)
{
zTreeTools
.
setEditable
=
function
(
editable
)
{
this
.
setting
.
edit
.
enable
=
editable
;
return
this
.
refresh
();
}
},
//method of operate data
_data
=
{
setSonNodeLevel
:
function
(
setting
,
parentNode
,
node
)
{
setSonNodeLevel
:
function
(
setting
,
parentNode
,
node
)
{
if
(
!
node
)
return
;
var
children
=
data
.
nodeChildren
(
setting
,
node
);
node
.
level
=
(
parentNode
)
?
parentNode
.
level
+
1
:
0
;
node
.
level
=
(
parentNode
)
?
parentNode
.
level
+
1
:
0
;
if
(
!
children
)
return
;
for
(
var
i
=
0
,
l
=
children
.
length
;
i
<
l
;
i
++
)
{
if
(
children
[
i
])
data
.
setSonNodeLevel
(
setting
,
node
,
children
[
i
]);
...
...
@@ -251,12 +254,10 @@
}
},
//method of event proxy
_event
=
{
},
_event
=
{},
//method of event handler
_handler
=
{
onHoverOverNode
:
function
(
event
,
node
)
{
onHoverOverNode
:
function
(
event
,
node
)
{
var
setting
=
data
.
getSetting
(
event
.
data
.
treeId
),
root
=
data
.
getRoot
(
setting
);
if
(
root
.
curHoverNode
!=
node
)
{
...
...
@@ -265,7 +266,7 @@
root
.
curHoverNode
=
node
;
view
.
addHoverDom
(
setting
,
node
);
},
onHoverOutNode
:
function
(
event
,
node
)
{
onHoverOutNode
:
function
(
event
,
node
)
{
var
setting
=
data
.
getSetting
(
event
.
data
.
treeId
),
root
=
data
.
getRoot
(
setting
);
if
(
root
.
curHoverNode
&&
!
data
.
isSelectedNode
(
setting
,
root
.
curHoverNode
))
{
...
...
@@ -273,8 +274,8 @@
root
.
curHoverNode
=
null
;
}
},
onMousedownNode
:
function
(
eventMouseDown
,
_node
)
{
var
i
,
l
,
onMousedownNode
:
function
(
eventMouseDown
,
_node
)
{
var
i
,
l
,
setting
=
data
.
getSetting
(
eventMouseDown
.
data
.
treeId
),
root
=
data
.
getRoot
(
setting
),
roots
=
data
.
getRoots
();
//right click can't drag & drop
...
...
@@ -287,8 +288,8 @@
if
(
!
data
.
isSelectedNode
(
setting
,
_node
))
{
nodes
=
[
_node
];
}
else
{
for
(
i
=
0
,
l
=
_nodes
.
length
;
i
<
l
;
i
++
)
{
if
(
_nodes
[
i
].
editNameFlag
&&
tools
.
eqs
(
target
.
tagName
,
"
input
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
INPUT
)
!==
null
)
{
for
(
i
=
0
,
l
=
_nodes
.
length
;
i
<
l
;
i
++
)
{
if
(
_nodes
[
i
].
editNameFlag
&&
tools
.
eqs
(
target
.
tagName
,
"
input
"
)
&&
target
.
getAttribute
(
"
treeNode
"
+
consts
.
id
.
INPUT
)
!==
null
)
{
return
true
;
}
nodes
.
push
(
_nodes
[
i
]);
...
...
@@ -319,6 +320,7 @@
if
(
tools
.
uCanDo
(
setting
))
{
doc
.
bind
(
"
mousemove
"
,
_docMouseMove
);
}
function
_docMouseMove
(
event
)
{
//avoid start drag after click node
if
(
root
.
dragFlag
==
0
&&
Math
.
abs
(
mouseDownX
-
event
.
clientX
)
<
setting
.
edit
.
drag
.
minMoveSize
...
...
@@ -334,8 +336,8 @@
return
true
;
}
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
if
(
i
==
0
)
{
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
if
(
i
==
0
)
{
root
.
dragNodeShowBefore
=
[];
}
tmpNode
=
nodes
[
i
];
...
...
@@ -353,12 +355,12 @@
//sort
var
isOrder
=
true
,
lastIndex
=
-
1
;
if
(
nodes
.
length
>
1
)
{
if
(
nodes
.
length
>
1
)
{
var
pNodes
=
nodes
[
0
].
parentTId
?
data
.
nodeChildren
(
setting
,
nodes
[
0
].
getParentNode
())
:
data
.
getNodes
(
setting
);
tmpNodes
=
[];
for
(
i
=
0
,
l
=
pNodes
.
length
;
i
<
l
;
i
++
)
{
for
(
i
=
0
,
l
=
pNodes
.
length
;
i
<
l
;
i
++
)
{
if
(
root
.
dragNodeShowBefore
[
pNodes
[
i
].
tId
]
!==
undefined
)
{
if
(
isOrder
&&
lastIndex
>
-
1
&&
(
lastIndex
+
1
)
!==
i
)
{
if
(
isOrder
&&
lastIndex
>
-
1
&&
(
lastIndex
+
1
)
!==
i
)
{
isOrder
=
false
;
}
tmpNodes
.
push
(
pNodes
[
i
]);
...
...
@@ -372,28 +374,28 @@
}
if
(
isOrder
)
{
preNode
=
nodes
[
0
].
getPreNode
();
nextNode
=
nodes
[
nodes
.
length
-
1
].
getNextNode
();
nextNode
=
nodes
[
nodes
.
length
-
1
].
getNextNode
();
}
//set node in selected
curNode
=
$$
(
"
<ul class='zTreeDragUL'></ul>
"
,
setting
);
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
tmpNode
=
nodes
[
i
];
tmpNode
.
editNameFlag
=
false
;
view
.
selectNode
(
setting
,
tmpNode
,
i
>
0
);
view
.
selectNode
(
setting
,
tmpNode
,
i
>
0
);
view
.
removeTreeDom
(
setting
,
tmpNode
);
if
(
i
>
setting
.
edit
.
drag
.
maxShowNodeNum
-
1
)
{
if
(
i
>
setting
.
edit
.
drag
.
maxShowNodeNum
-
1
)
{
continue
;
}
tmpDom
=
$$
(
"
<li id='
"
+
tmpNode
.
tId
+
"
_tmp'></li>
"
,
setting
);
tmpDom
=
$$
(
"
<li id='
"
+
tmpNode
.
tId
+
"
_tmp'></li>
"
,
setting
);
tmpDom
.
append
(
$$
(
tmpNode
,
consts
.
id
.
A
,
setting
).
clone
());
tmpDom
.
css
(
"
padding
"
,
"
0
"
);
tmpDom
.
children
(
"
#
"
+
tmpNode
.
tId
+
consts
.
id
.
A
).
removeClass
(
consts
.
node
.
CURSELECTED
);
curNode
.
append
(
tmpDom
);
if
(
i
==
setting
.
edit
.
drag
.
maxShowNodeNum
-
1
)
{
tmpDom
=
$$
(
"
<li id='
"
+
tmpNode
.
tId
+
"
_moretmp'><a> ... </a></li>
"
,
setting
);
if
(
i
==
setting
.
edit
.
drag
.
maxShowNodeNum
-
1
)
{
tmpDom
=
$$
(
"
<li id='
"
+
tmpNode
.
tId
+
"
_moretmp'><a> ... </a></li>
"
,
setting
);
curNode
.
append
(
tmpDom
);
}
}
...
...
@@ -409,7 +411,7 @@
}
if
(
root
.
dragFlag
==
1
)
{
if
(
tmpTarget
&&
tmpArrow
.
attr
(
"
id
"
)
==
event
.
target
.
id
&&
tmpTargetNodeId
&&
(
event
.
clientX
+
doc
.
scrollLeft
()
+
2
)
>
(
$
(
"
#
"
+
tmpTargetNodeId
+
consts
.
id
.
A
,
tmpTarget
).
offset
().
left
))
{
if
(
tmpTarget
&&
tmpArrow
.
attr
(
"
id
"
)
==
event
.
target
.
id
&&
tmpTargetNodeId
&&
(
event
.
clientX
+
doc
.
scrollLeft
()
+
2
)
>
(
$
(
"
#
"
+
tmpTargetNodeId
+
consts
.
id
.
A
,
tmpTarget
).
offset
().
left
))
{
var
xT
=
$
(
"
#
"
+
tmpTargetNodeId
+
consts
.
id
.
A
,
tmpTarget
);
event
.
target
=
(
xT
.
length
>
0
)
?
xT
.
get
(
0
)
:
event
.
target
;
}
else
if
(
tmpTarget
)
{
...
...
@@ -426,7 +428,7 @@
var
settings
=
data
.
getSettings
();
for
(
var
s
in
settings
)
{
if
(
settings
[
s
].
treeId
&&
settings
[
s
].
edit
.
enable
&&
settings
[
s
].
treeId
!=
setting
.
treeId
&&
(
event
.
target
.
id
==
settings
[
s
].
treeId
||
$
(
event
.
target
).
parents
(
"
#
"
+
settings
[
s
].
treeId
).
length
>
0
))
{
&&
(
event
.
target
.
id
==
settings
[
s
].
treeId
||
$
(
event
.
target
).
parents
(
"
#
"
+
settings
[
s
].
treeId
).
length
>
0
))
{
isOtherTree
=
true
;
targetSetting
=
settings
[
s
];
}
...
...
@@ -447,9 +449,9 @@
isRight
=
(
dRight
<
setting
.
edit
.
drag
.
borderMax
&&
dRight
>
setting
.
edit
.
drag
.
borderMin
),
isTreeInner
=
dTop
>
setting
.
edit
.
drag
.
borderMin
&&
dBottom
>
setting
.
edit
.
drag
.
borderMin
&&
dLeft
>
setting
.
edit
.
drag
.
borderMin
&&
dRight
>
setting
.
edit
.
drag
.
borderMin
,
isTreeTop
=
(
isTop
&&
targetSetting
.
treeObj
.
scrollTop
()
<=
0
),
isTreeBottom
=
(
isBottom
&&
(
targetSetting
.
treeObj
.
scrollTop
()
+
targetSetting
.
treeObj
.
height
()
+
10
)
>=
scrollHeight
),
isTreeBottom
=
(
isBottom
&&
(
targetSetting
.
treeObj
.
scrollTop
()
+
targetSetting
.
treeObj
.
height
()
+
10
)
>=
scrollHeight
),
isTreeLeft
=
(
isLeft
&&
targetSetting
.
treeObj
.
scrollLeft
()
<=
0
),
isTreeRight
=
(
isRight
&&
(
targetSetting
.
treeObj
.
scrollLeft
()
+
targetSetting
.
treeObj
.
width
()
+
10
)
>=
scrollWidth
);
isTreeRight
=
(
isRight
&&
(
targetSetting
.
treeObj
.
scrollLeft
()
+
targetSetting
.
treeObj
.
width
()
+
10
)
>=
scrollWidth
);
if
(
event
.
target
&&
tools
.
isChildOrSelf
(
event
.
target
,
targetSetting
.
treeId
))
{
//get node <li> dom
...
...
@@ -460,7 +462,7 @@
var
canMove
=
true
;
//don't move to self or children of self
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
tmpNode
=
nodes
[
i
];
if
(
targetObj
.
id
===
tmpNode
.
tId
)
{
canMove
=
false
;
...
...
@@ -485,18 +487,18 @@
}
//auto scroll top
if
(
isTop
)
{
targetSetting
.
treeObj
.
scrollTop
(
targetSetting
.
treeObj
.
scrollTop
()
-
10
);
targetSetting
.
treeObj
.
scrollTop
(
targetSetting
.
treeObj
.
scrollTop
()
-
10
);
}
else
if
(
isBottom
)
{
targetSetting
.
treeObj
.
scrollTop
(
targetSetting
.
treeObj
.
scrollTop
()
+
10
);
targetSetting
.
treeObj
.
scrollTop
(
targetSetting
.
treeObj
.
scrollTop
()
+
10
);
}
if
(
isLeft
)
{
targetSetting
.
treeObj
.
scrollLeft
(
targetSetting
.
treeObj
.
scrollLeft
()
-
10
);
targetSetting
.
treeObj
.
scrollLeft
(
targetSetting
.
treeObj
.
scrollLeft
()
-
10
);
}
else
if
(
isRight
)
{
targetSetting
.
treeObj
.
scrollLeft
(
targetSetting
.
treeObj
.
scrollLeft
()
+
10
);
targetSetting
.
treeObj
.
scrollLeft
(
targetSetting
.
treeObj
.
scrollLeft
()
+
10
);
}
//auto scroll left
if
(
tmpTarget
&&
tmpTarget
!=
targetSetting
.
treeObj
&&
tmpTarget
.
offset
().
left
<
targetSetting
.
treeObj
.
offset
().
left
)
{
targetSetting
.
treeObj
.
scrollLeft
(
targetSetting
.
treeObj
.
scrollLeft
()
+
tmpTarget
.
offset
().
left
-
targetSetting
.
treeObj
.
offset
().
left
);
targetSetting
.
treeObj
.
scrollLeft
(
targetSetting
.
treeObj
.
scrollLeft
()
+
tmpTarget
.
offset
().
left
-
targetSetting
.
treeObj
.
offset
().
left
);
}
}
...
...
@@ -507,8 +509,8 @@
var
dX
=
0
;
var
dY
=
0
;
if
(
tmpTarget
&&
tmpTarget
.
attr
(
"
id
"
)
!=
targetSetting
.
treeId
)
{
var
tmpTargetNode
=
tmpTargetNodeId
==
null
?
null
:
data
.
getNodeCache
(
targetSetting
,
tmpTargetNodeId
),
if
(
tmpTarget
&&
tmpTarget
.
attr
(
"
id
"
)
!=
targetSetting
.
treeId
)
{
var
tmpTargetNode
=
tmpTargetNodeId
==
null
?
null
:
data
.
getNodeCache
(
targetSetting
,
tmpTargetNodeId
),
isCopy
=
((
event
.
ctrlKey
||
event
.
metaKey
)
&&
setting
.
edit
.
drag
.
isMove
&&
setting
.
edit
.
drag
.
isCopy
)
||
(
!
setting
.
edit
.
drag
.
isMove
&&
setting
.
edit
.
drag
.
isCopy
),
isPrev
=
!!
(
preNode
&&
tmpTargetNodeId
===
preNode
.
tId
),
isNext
=
!!
(
nextNode
&&
tmpTargetNodeId
===
nextNode
.
tId
),
...
...
@@ -522,13 +524,14 @@
tmpTargetNodeId
=
""
;
moveType
=
consts
.
move
.
TYPE_INNER
;
tmpArrow
.
css
({
"
display
"
:
"
none
"
"
display
"
:
"
none
"
});
if
(
window
.
zTreeMoveTimer
)
{
clearTimeout
(
window
.
zTreeMoveTimer
);
window
.
zTreeMoveTargetNodeTId
=
null
}
}
if
(
!
canPrev
&&
!
canNext
&&
!
canInner
)
{
clearMove
();
}
else
{
...
...
@@ -536,17 +539,17 @@
tmpNextA
=
tmpTargetNode
.
isLastNode
?
null
:
$
(
"
#
"
+
tmpTargetNode
.
getNextNode
().
tId
+
consts
.
id
.
A
,
tmpTarget
.
next
()),
tmpTop
=
tmpTargetA
.
offset
().
top
,
tmpLeft
=
tmpTargetA
.
offset
().
left
,
prevPercent
=
canPrev
?
(
canInner
?
0.25
:
(
canNext
?
0.5
:
1
)
)
:
-
1
,
nextPercent
=
canNext
?
(
canInner
?
0.75
:
(
canPrev
?
0.5
:
0
)
)
:
-
1
,
dY_percent
=
(
event
.
clientY
+
docScrollTop
-
tmpTop
)
/
tmpTargetA
.
height
();
prevPercent
=
canPrev
?
(
canInner
?
0.25
:
(
canNext
?
0.5
:
1
)
)
:
-
1
,
nextPercent
=
canNext
?
(
canInner
?
0.75
:
(
canPrev
?
0.5
:
0
)
)
:
-
1
,
dY_percent
=
(
event
.
clientY
+
docScrollTop
-
tmpTop
)
/
tmpTargetA
.
height
();
if
((
prevPercent
==
1
||
dY_percent
<=
prevPercent
&&
dY_percent
>=
-
.
2
)
&&
canPrev
)
{
if
((
prevPercent
==
1
||
dY_percent
<=
prevPercent
&&
dY_percent
>=
-
.
2
)
&&
canPrev
)
{
dX
=
1
-
tmpArrow
.
width
();
dY
=
tmpTop
-
tmpArrow
.
height
()
/
2
;
dY
=
tmpTop
-
tmpArrow
.
height
()
/
2
;
moveType
=
consts
.
move
.
TYPE_PREV
;
}
else
if
((
nextPercent
==
0
||
dY_percent
>=
nextPercent
&&
dY_percent
<=
1.2
)
&&
canNext
)
{
}
else
if
((
nextPercent
==
0
||
dY_percent
>=
nextPercent
&&
dY_percent
<=
1.2
)
&&
canNext
)
{
dX
=
1
-
tmpArrow
.
width
();
dY
=
(
tmpNextA
==
null
||
(
data
.
nodeIsParent
(
setting
,
tmpTargetNode
)
&&
tmpTargetNode
.
open
))
?
(
tmpTop
+
tmpTargetA
.
height
()
-
tmpArrow
.
height
()
/
2
)
:
(
tmpNextA
.
offset
().
top
-
tmpArrow
.
height
()
/
2
);
dY
=
(
tmpNextA
==
null
||
(
data
.
nodeIsParent
(
setting
,
tmpTargetNode
)
&&
tmpTargetNode
.
open
))
?
(
tmpTop
+
tmpTargetA
.
height
()
-
tmpArrow
.
height
()
/
2
)
:
(
tmpNextA
.
offset
().
top
-
tmpArrow
.
height
()
/
2
);
moveType
=
consts
.
move
.
TYPE_NEXT
;
}
else
if
(
canInner
)
{
dX
=
5
-
tmpArrow
.
width
();
...
...
@@ -558,7 +561,7 @@
if
(
tmpTarget
)
{
tmpArrow
.
css
({
"
display
"
:
"
block
"
,
"
display
"
:
"
block
"
,
"
top
"
:
dY
+
"
px
"
,
"
left
"
:
(
tmpLeft
+
dX
)
+
"
px
"
});
...
...
@@ -576,7 +579,7 @@
startTimer
=
false
;
}
if
(
startTimer
)
{
window
.
zTreeMoveTimer
=
setTimeout
(
function
()
{
window
.
zTreeMoveTimer
=
setTimeout
(
function
()
{
if
(
moveType
!=
consts
.
move
.
TYPE_INNER
)
return
;
if
(
tmpTargetNode
&&
data
.
nodeIsParent
(
setting
,
tmpTargetNode
)
&&
!
tmpTargetNode
.
open
&&
(
new
Date
()).
getTime
()
-
startTime
>
targetSetting
.
edit
.
drag
.
autoOpenTime
&&
tools
.
apply
(
targetSetting
.
callback
.
beforeDragOpen
,
[
targetSetting
.
treeId
,
tmpTargetNode
],
true
))
{
...
...
@@ -585,7 +588,7 @@
targetSetting
.
treeObj
.
trigger
(
consts
.
event
.
EXPAND
,
[
targetSetting
.
treeId
,
tmpTargetNode
]);
}
}
},
targetSetting
.
edit
.
drag
.
autoOpenTime
+
50
);
},
targetSetting
.
edit
.
drag
.
autoOpenTime
+
50
);
window
.
zTreeMoveTargetNodeTId
=
tmpTargetNode
.
tId
;
}
}
...
...
@@ -599,7 +602,7 @@
tmpTarget
=
null
;
}
tmpArrow
.
css
({
"
display
"
:
"
none
"
"
display
"
:
"
none
"
});
if
(
window
.
zTreeMoveTimer
)
{
clearTimeout
(
window
.
zTreeMoveTimer
);
...
...
@@ -615,6 +618,7 @@
}
doc
.
bind
(
"
mouseup
"
,
_docMouseUp
);
function
_docMouseUp
(
event
)
{
if
(
window
.
zTreeMoveTimer
)
{
clearTimeout
(
window
.
zTreeMoveTimer
);
...
...
@@ -638,7 +642,7 @@
root
.
dragFlag
=
0
;
var
i
,
l
,
tmpNode
;
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
for
(
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
tmpNode
=
nodes
[
i
];
if
(
data
.
nodeIsParent
(
setting
,
tmpNode
)
&&
root
.
dragNodeShowBefore
[
tmpNode
.
tId
]
&&
!
tmpNode
.
open
)
{
view
.
expandCollapseNode
(
setting
,
tmpNode
,
!
tmpNode
.
open
);
...
...
@@ -650,11 +654,11 @@
if
(
tmpArrow
)
tmpArrow
.
remove
();
var
isCopy
=
((
event
.
ctrlKey
||
event
.
metaKey
)
&&
setting
.
edit
.
drag
.
isMove
&&
setting
.
edit
.
drag
.
isCopy
)
||
(
!
setting
.
edit
.
drag
.
isMove
&&
setting
.
edit
.
drag
.
isCopy
);
if
(
!
isCopy
&&
tmpTarget
&&
tmpTargetNodeId
&&
nodes
[
0
].
parentTId
&&
tmpTargetNodeId
==
nodes
[
0
].
parentTId
&&
moveType
==
consts
.
move
.
TYPE_INNER
)
{
if
(
!
isCopy
&&
tmpTarget
&&
tmpTargetNodeId
&&
nodes
[
0
].
parentTId
&&
tmpTargetNodeId
==
nodes
[
0
].
parentTId
&&
moveType
==
consts
.
move
.
TYPE_INNER
)
{
tmpTarget
=
null
;
}
if
(
tmpTarget
)
{
var
dragTargetNode
=
tmpTargetNodeId
==
null
?
null
:
data
.
getNodeCache
(
targetSetting
,
tmpTargetNodeId
);
var
dragTargetNode
=
tmpTargetNodeId
==
null
?
null
:
data
.
getNodeCache
(
targetSetting
,
tmpTargetNodeId
);
if
(
tools
.
apply
(
setting
.
callback
.
beforeDrop
,
[
targetSetting
.
treeId
,
nodes
,
dragTargetNode
,
moveType
,
isCopy
],
true
)
==
false
)
{
view
.
selectNodes
(
sourceSetting
,
nodes
);
return
;
...
...
@@ -664,27 +668,27 @@
function
dropCallback
()
{
if
(
isOtherTree
)
{
if
(
!
isCopy
)
{
for
(
var
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
for
(
var
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
view
.
removeNode
(
setting
,
nodes
[
i
]);
}
}
if
(
moveType
==
consts
.
move
.
TYPE_INNER
)
{
view
.
addNodes
(
targetSetting
,
dragTargetNode
,
-
1
,
newNodes
);
}
else
{
view
.
addNodes
(
targetSetting
,
dragTargetNode
.
getParentNode
(),
moveType
==
consts
.
move
.
TYPE_PREV
?
dragTargetNode
.
getIndex
()
:
dragTargetNode
.
getIndex
()
+
1
,
newNodes
);
view
.
addNodes
(
targetSetting
,
dragTargetNode
.
getParentNode
(),
moveType
==
consts
.
move
.
TYPE_PREV
?
dragTargetNode
.
getIndex
()
:
dragTargetNode
.
getIndex
()
+
1
,
newNodes
);
}
}
else
{
if
(
isCopy
&&
moveType
==
consts
.
move
.
TYPE_INNER
)
{
view
.
addNodes
(
targetSetting
,
dragTargetNode
,
-
1
,
newNodes
);
}
else
if
(
isCopy
)
{
view
.
addNodes
(
targetSetting
,
dragTargetNode
.
getParentNode
(),
moveType
==
consts
.
move
.
TYPE_PREV
?
dragTargetNode
.
getIndex
()
:
dragTargetNode
.
getIndex
()
+
1
,
newNodes
);
view
.
addNodes
(
targetSetting
,
dragTargetNode
.
getParentNode
(),
moveType
==
consts
.
move
.
TYPE_PREV
?
dragTargetNode
.
getIndex
()
:
dragTargetNode
.
getIndex
()
+
1
,
newNodes
);
}
else
{
if
(
moveType
!=
consts
.
move
.
TYPE_NEXT
)
{
for
(
i
=
0
,
l
=
newNodes
.
length
;
i
<
l
;
i
++
)
{
for
(
i
=
0
,
l
=
newNodes
.
length
;
i
<
l
;
i
++
)
{
view
.
moveNode
(
targetSetting
,
dragTargetNode
,
newNodes
[
i
],
moveType
,
false
);
}
}
else
{
for
(
i
=-
1
,
l
=
newNodes
.
length
-
1
;
i
<
l
;
l
--
)
{
for
(
i
=
-
1
,
l
=
newNodes
.
length
-
1
;
i
<
l
;
l
--
)
{
view
.
moveNode
(
targetSetting
,
dragTargetNode
,
newNodes
[
l
],
moveType
,
false
);
}
}
...
...
@@ -711,6 +715,7 @@
}
doc
.
bind
(
"
selectstart
"
,
_docSelect
);
function
_docSelect
()
{
return
false
;
}
...
...
@@ -728,26 +733,26 @@
_tools
=
{
getAbs
:
function
(
obj
)
{
var
oRect
=
obj
.
getBoundingClientRect
(),
scrollTop
=
document
.
body
.
scrollTop
+
document
.
documentElement
.
scrollTop
,
scrollLeft
=
document
.
body
.
scrollLeft
+
document
.
documentElement
.
scrollLeft
;
return
[
oRect
.
left
+
scrollLeft
,
oRect
.
top
+
scrollTop
];
scrollTop
=
document
.
body
.
scrollTop
+
document
.
documentElement
.
scrollTop
,
scrollLeft
=
document
.
body
.
scrollLeft
+
document
.
documentElement
.
scrollLeft
;
return
[
oRect
.
left
+
scrollLeft
,
oRect
.
top
+
scrollTop
];
},
inputFocus
:
function
(
inputObj
)
{
inputFocus
:
function
(
inputObj
)
{
if
(
inputObj
.
get
(
0
))
{
inputObj
.
focus
();
tools
.
setCursorPosition
(
inputObj
.
get
(
0
),
inputObj
.
val
().
length
);
}
},
inputSelect
:
function
(
inputObj
)
{
inputSelect
:
function
(
inputObj
)
{
if
(
inputObj
.
get
(
0
))
{
inputObj
.
focus
();
inputObj
.
select
();
}
},
setCursorPosition
:
function
(
obj
,
pos
)
{
if
(
obj
.
setSelectionRange
)
{
setCursorPosition
:
function
(
obj
,
pos
)
{
if
(
obj
.
setSelectionRange
)
{
obj
.
focus
();
obj
.
setSelectionRange
(
pos
,
pos
);
obj
.
setSelectionRange
(
pos
,
pos
);
}
else
if
(
obj
.
createTextRange
)
{
var
range
=
obj
.
createTextRange
();
range
.
collapse
(
true
);
...
...
@@ -756,7 +761,7 @@
range
.
select
();
}
},
showIfameMask
:
function
(
setting
,
showSign
)
{
showIfameMask
:
function
(
setting
,
showSign
)
{
var
root
=
data
.
getRoot
(
setting
);
//clear full mask
while
(
root
.
dragMaskList
.
length
>
0
)
{
...
...
@@ -778,7 +783,7 @@
},
//method of operate ztree dom
_view
=
{
addEditBtn
:
function
(
setting
,
node
)
{
addEditBtn
:
function
(
setting
,
node
)
{
if
(
node
.
editNameFlag
||
$$
(
node
,
consts
.
id
.
EDIT
,
setting
).
length
>
0
)
{
return
;
}
...
...
@@ -786,18 +791,18 @@
return
;
}
var
aObj
=
$$
(
node
,
consts
.
id
.
A
,
setting
),
editStr
=
"
<span class='
"
+
consts
.
className
.
BUTTON
+
"
edit' id='
"
+
node
.
tId
+
consts
.
id
.
EDIT
+
"
' title='
"
+
tools
.
apply
(
setting
.
edit
.
renameTitle
,
[
setting
.
treeId
,
node
],
setting
.
edit
.
renameTitle
)
+
"
' treeNode
"
+
consts
.
id
.
EDIT
+
"
style='display:none;'></span>
"
;
editStr
=
"
<span class='
"
+
consts
.
className
.
BUTTON
+
"
edit' id='
"
+
node
.
tId
+
consts
.
id
.
EDIT
+
"
' title='
"
+
tools
.
apply
(
setting
.
edit
.
renameTitle
,
[
setting
.
treeId
,
node
],
setting
.
edit
.
renameTitle
)
+
"
' treeNode
"
+
consts
.
id
.
EDIT
+
"
style='display:none;'></span>
"
;
aObj
.
append
(
editStr
);
$$
(
node
,
consts
.
id
.
EDIT
,
setting
).
bind
(
'
click
'
,
function
()
{
function
()
{
if
(
!
tools
.
uCanDo
(
setting
)
||
tools
.
apply
(
setting
.
callback
.
beforeEditName
,
[
setting
.
treeId
,
node
],
true
)
==
false
)
return
false
;
view
.
editNode
(
setting
,
node
);
return
false
;
}
).
show
();
},
addRemoveBtn
:
function
(
setting
,
node
)
{
addRemoveBtn
:
function
(
setting
,
node
)
{
if
(
node
.
editNameFlag
||
$$
(
node
,
consts
.
id
.
REMOVE
,
setting
).
length
>
0
)
{
return
;
}
...
...
@@ -805,23 +810,23 @@
return
;
}
var
aObj
=
$$
(
node
,
consts
.
id
.
A
,
setting
),
removeStr
=
"
<span class='
"
+
consts
.
className
.
BUTTON
+
"
remove' id='
"
+
node
.
tId
+
consts
.
id
.
REMOVE
+
"
' title='
"
+
tools
.
apply
(
setting
.
edit
.
removeTitle
,
[
setting
.
treeId
,
node
],
setting
.
edit
.
removeTitle
)
+
"
' treeNode
"
+
consts
.
id
.
REMOVE
+
"
style='display:none;'></span>
"
;
removeStr
=
"
<span class='
"
+
consts
.
className
.
BUTTON
+
"
remove' id='
"
+
node
.
tId
+
consts
.
id
.
REMOVE
+
"
' title='
"
+
tools
.
apply
(
setting
.
edit
.
removeTitle
,
[
setting
.
treeId
,
node
],
setting
.
edit
.
removeTitle
)
+
"
' treeNode
"
+
consts
.
id
.
REMOVE
+
"
style='display:none;'></span>
"
;
aObj
.
append
(
removeStr
);
$$
(
node
,
consts
.
id
.
REMOVE
,
setting
).
bind
(
'
click
'
,
function
()
{
function
()
{
if
(
!
tools
.
uCanDo
(
setting
)
||
tools
.
apply
(
setting
.
callback
.
beforeRemove
,
[
setting
.
treeId
,
node
],
true
)
==
false
)
return
false
;
view
.
removeNode
(
setting
,
node
);
setting
.
treeObj
.
trigger
(
consts
.
event
.
REMOVE
,
[
setting
.
treeId
,
node
]);
return
false
;
}
).
bind
(
'
mousedown
'
,
function
(
eventMouseDown
)
{
function
(
eventMouseDown
)
{
return
true
;
}
).
show
();
},
addHoverDom
:
function
(
setting
,
node
)
{
addHoverDom
:
function
(
setting
,
node
)
{
if
(
data
.
getRoots
().
showHoverDom
)
{
node
.
isHover
=
true
;
if
(
setting
.
edit
.
enable
)
{
...
...
@@ -837,7 +842,7 @@
if
(
node
)
{
var
inputObj
=
root
.
curEditInput
,
newName
=
forceName
?
forceName
:(
isCancel
?
data
.
nodeName
(
setting
,
node
)
:
inputObj
.
val
());
newName
=
forceName
?
forceName
:
(
isCancel
?
data
.
nodeName
(
setting
,
node
)
:
inputObj
.
val
());
if
(
tools
.
apply
(
setting
.
callback
.
beforeRename
,
[
setting
.
treeId
,
node
,
newName
,
isCancel
],
true
)
===
false
)
{
return
false
;
}
...
...
@@ -855,11 +860,13 @@
root
.
noSelection
=
true
;
return
true
;
},
editNode
:
function
(
setting
,
node
)
{
editNode
:
function
(
setting
,
node
)
{
var
root
=
data
.
getRoot
(
setting
);
view
.
editNodeBlur
=
false
;
if
(
data
.
isSelectedNode
(
setting
,
node
)
&&
root
.
curEditNode
==
node
&&
node
.
editNameFlag
)
{
setTimeout
(
function
()
{
tools
.
inputFocus
(
root
.
curEditInput
);},
0
);
setTimeout
(
function
()
{
tools
.
inputFocus
(
root
.
curEditInput
);
},
0
);
return
;
}
node
.
editNameFlag
=
true
;
...
...
@@ -875,20 +882,20 @@
tools
.
inputFocus
(
inputObj
);
}
inputObj
.
bind
(
'
blur
'
,
function
(
event
)
{
inputObj
.
bind
(
'
blur
'
,
function
(
event
)
{
if
(
!
view
.
editNodeBlur
)
{
view
.
cancelCurEditNode
(
setting
);
}
}).
bind
(
'
keydown
'
,
function
(
event
)
{
if
(
event
.
keyCode
==
"
13
"
)
{
}).
bind
(
'
keydown
'
,
function
(
event
)
{
if
(
event
.
keyCode
==
"
13
"
)
{
view
.
editNodeBlur
=
true
;
view
.
cancelCurEditNode
(
setting
);
}
else
if
(
event
.
keyCode
==
"
27
"
)
{
}
else
if
(
event
.
keyCode
==
"
27
"
)
{
view
.
cancelCurEditNode
(
setting
,
null
,
true
);
}
}).
bind
(
'
click
'
,
function
(
event
)
{
}).
bind
(
'
click
'
,
function
(
event
)
{
return
false
;
}).
bind
(
'
dblclick
'
,
function
(
event
)
{
}).
bind
(
'
dblclick
'
,
function
(
event
)
{
return
false
;
});
...
...
@@ -897,11 +904,11 @@
root
.
noSelection
=
false
;
root
.
curEditNode
=
node
;
},
moveNode
:
function
(
setting
,
targetNode
,
node
,
moveType
,
animateFlag
,
isSilent
)
{
moveNode
:
function
(
setting
,
targetNode
,
node
,
moveType
,
animateFlag
,
isSilent
)
{
var
root
=
data
.
getRoot
(
setting
);
if
(
targetNode
==
node
)
return
;
if
(
setting
.
data
.
keep
.
leaf
&&
targetNode
&&
!
data
.
nodeIsParent
(
setting
,
targetNode
)
&&
moveType
==
consts
.
move
.
TYPE_INNER
)
return
;
var
oldParentNode
=
(
node
.
parentTId
?
node
.
getParentNode
()
:
root
),
var
oldParentNode
=
(
node
.
parentTId
?
node
.
getParentNode
()
:
root
),
targetNodeIsRoot
=
(
targetNode
===
null
||
targetNode
==
root
);
if
(
targetNodeIsRoot
&&
targetNode
===
null
)
targetNode
=
root
;
if
(
targetNodeIsRoot
)
moveType
=
consts
.
move
.
TYPE_INNER
;
...
...
@@ -960,7 +967,7 @@
}
//repair the data after move
var
i
,
l
,
var
i
,
l
,
tmpSrcIndex
=
-
1
,
tmpTargetIndex
=
0
,
oldNeighbor
=
null
,
...
...
@@ -971,12 +978,12 @@
var
targetChildren
=
data
.
nodeChildren
(
setting
,
targetNode
);
if
(
node
.
isFirstNode
)
{
tmpSrcIndex
=
0
;
if
(
oldChildren
.
length
>
1
)
{
if
(
oldChildren
.
length
>
1
)
{
oldNeighbor
=
oldChildren
[
1
];
oldNeighbor
.
isFirstNode
=
true
;
}
}
else
if
(
node
.
isLastNode
)
{
tmpSrcIndex
=
oldChildren
.
length
-
1
;
tmpSrcIndex
=
oldChildren
.
length
-
1
;
oldNeighbor
=
oldChildren
[
tmpSrcIndex
-
1
];
oldNeighbor
.
isLastNode
=
true
;
}
else
{
...
...
@@ -1074,19 +1081,19 @@
view
.
expandCollapseParentNode
(
setting
,
node
.
getParentNode
(),
true
,
animateFlag
);
}
},
removeEditBtn
:
function
(
setting
,
node
)
{
removeEditBtn
:
function
(
setting
,
node
)
{
$$
(
node
,
consts
.
id
.
EDIT
,
setting
).
unbind
().
remove
();
},
removeRemoveBtn
:
function
(
setting
,
node
)
{
removeRemoveBtn
:
function
(
setting
,
node
)
{
$$
(
node
,
consts
.
id
.
REMOVE
,
setting
).
unbind
().
remove
();
},
removeTreeDom
:
function
(
setting
,
node
)
{
removeTreeDom
:
function
(
setting
,
node
)
{
node
.
isHover
=
false
;
view
.
removeEditBtn
(
setting
,
node
);
view
.
removeRemoveBtn
(
setting
,
node
);
tools
.
apply
(
setting
.
view
.
removeHoverDom
,
[
setting
.
treeId
,
node
]);
},
repairNodeLevelClass
:
function
(
setting
,
node
,
oldLevel
)
{
repairNodeLevelClass
:
function
(
setting
,
node
,
oldLevel
)
{
if
(
oldLevel
===
node
.
level
)
return
;
var
liObj
=
$$
(
node
,
setting
),
aObj
=
$$
(
node
,
consts
.
id
.
A
,
setting
),
...
...
@@ -1100,9 +1107,9 @@
ulObj
.
removeClass
(
oldClass
);
ulObj
.
addClass
(
newClass
);
},
selectNodes
:
function
(
setting
,
nodes
)
{
for
(
var
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
view
.
selectNode
(
setting
,
nodes
[
i
],
i
>
0
);
selectNodes
:
function
(
setting
,
nodes
)
{
for
(
var
i
=
0
,
l
=
nodes
.
length
;
i
<
l
;
i
++
)
{
view
.
selectNode
(
setting
,
nodes
[
i
],
i
>
0
);
}
}
},
...
...
@@ -1136,7 +1143,7 @@
var
_cancelPreSelectedNode
=
view
.
cancelPreSelectedNode
;
view
.
cancelPreSelectedNode
=
function
(
setting
,
node
)
{
var
list
=
data
.
getRoot
(
setting
).
curSelectedList
;
for
(
var
i
=
0
,
j
=
list
.
length
;
i
<
j
;
i
++
)
{
for
(
var
i
=
0
,
j
=
list
.
length
;
i
<
j
;
i
++
)
{
if
(
!
node
||
node
===
list
[
i
])
{
view
.
removeTreeDom
(
setting
,
list
[
i
]);
if
(
node
)
break
;
...
...
@@ -1146,7 +1153,7 @@
}
var
_createNodes
=
view
.
createNodes
;
view
.
createNodes
=
function
(
setting
,
level
,
nodes
,
parentNode
,
index
)
{
view
.
createNodes
=
function
(
setting
,
level
,
nodes
,
parentNode
,
index
)
{
if
(
_createNodes
)
{
_createNodes
.
apply
(
view
,
arguments
);
}
...
...
@@ -1157,12 +1164,12 @@
}
var
_makeNodeUrl
=
view
.
makeNodeUrl
;
view
.
makeNodeUrl
=
function
(
setting
,
node
)
{
view
.
makeNodeUrl
=
function
(
setting
,
node
)
{
return
setting
.
edit
.
enable
?
null
:
(
_makeNodeUrl
.
apply
(
view
,
arguments
));
}
var
_removeNode
=
view
.
removeNode
;
view
.
removeNode
=
function
(
setting
,
node
)
{
view
.
removeNode
=
function
(
setting
,
node
)
{
var
root
=
data
.
getRoot
(
setting
);
if
(
root
.
curEditNode
===
node
)
root
.
curEditNode
=
null
;
if
(
_removeNode
)
{
...
...
@@ -1171,7 +1178,7 @@
}
var
_selectNode
=
view
.
selectNode
;
view
.
selectNode
=
function
(
setting
,
node
,
addFlag
)
{
view
.
selectNode
=
function
(
setting
,
node
,
addFlag
)
{
var
root
=
data
.
getRoot
(
setting
);
if
(
data
.
isSelectedNode
(
setting
,
node
)
&&
root
.
curEditNode
==
node
&&
node
.
editNameFlag
)
{
return
false
;
...
...
@@ -1182,7 +1189,7 @@
}
var
_uCanDo
=
tools
.
uCanDo
;
tools
.
uCanDo
=
function
(
setting
,
e
)
{
tools
.
uCanDo
=
function
(
setting
,
e
)
{
var
root
=
data
.
getRoot
(
setting
);
if
(
e
&&
(
tools
.
eqs
(
e
.
type
,
"
mouseover
"
)
||
tools
.
eqs
(
e
.
type
,
"
mouseout
"
)
||
tools
.
eqs
(
e
.
type
,
"
mousedown
"
)
||
tools
.
eqs
(
e
.
type
,
"
mouseup
"
)))
{
return
true
;
...
...
js/jquery.ztree.exedit.min.js
浏览文件 @
9523be07
/*
* JQuery zTree exedit v3.5.3
6
* JQuery zTree exedit v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
B
){
var
I
=
{
event
:{
DRAG
:
"
ztree_drag
"
,
DROP
:
"
ztree_drop
"
,
RENAME
:
"
ztree_rename
"
,
DRAGMOVE
:
"
ztree_dragmove
"
},
id
:{
EDIT
:
"
_edit
"
,
INPUT
:
"
_input
"
,
REMOVE
:
"
_remove
"
},
move
:{
TYPE_INNER
:
"
inner
"
,
TYPE_PREV
:
"
prev
"
,
TYPE_NEXT
:
"
next
"
},
node
:{
CURSELECTED_EDIT
:
"
curSelectedNode_Edit
"
,
TMPTARGET_TREE
:
"
tmpTargetzTree
"
,
TMPTARGET_NODE
:
"
tmpTargetNode
"
}},
v
=
{
onHoverOverNode
:
function
(
a
,
b
){
var
c
=
i
.
getSetting
(
a
.
data
.
treeId
),
d
=
i
.
getRoot
(
c
);
if
(
d
.
curHoverNode
!=
b
)
v
.
onHoverOutNode
(
a
);
d
.
curHoverNode
=
b
;
e
.
addHoverDom
(
c
,
b
)},
onHoverOutNode
:
function
(
a
){
var
a
=
i
.
getSetting
(
a
.
data
.
treeId
),
b
=
i
.
getRoot
(
a
);
if
(
b
.
curHoverNode
&&!
i
.
isSelectedNode
(
a
,
b
.
curHoverNode
))
e
.
removeTreeDom
(
a
,
b
.
curHoverNode
),
b
.
curHoverNode
=
null
},
onMousedownNode
:
function
(
a
,
b
){
function
c
(
a
){
if
(
m
.
dragFlag
==
0
&&
Math
.
abs
(
N
-
a
.
clientX
)
<
f
.
edit
.
drag
.
minMoveSize
&&
Math
.
abs
(
O
-
a
.
clientY
)
<
f
.
edit
.
drag
.
minMoveSize
)
return
!
0
;
var
b
,
c
,
g
,
j
;
L
.
css
(
"
cursor
"
,
"
pointer
"
);
if
(
m
.
dragFlag
==
0
){
if
(
k
.
apply
(
f
.
callback
.
beforeDrag
,[
f
.
treeId
,
n
],
!
0
)
==!
1
)
return
l
(
a
),
!
0
;
for
(
b
=
0
,
c
=
n
.
length
;
b
<
c
;
b
++
){
if
(
b
==
0
)
m
.
dragNodeShowBefore
=
[];
...
...
js/jquery.ztree.exhide.js
浏览文件 @
9523be07
/*
* JQuery zTree exHideNodes v3.5.3
6
* JQuery zTree exHideNodes v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -8,9 +8,9 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
$
)
{
(
function
(
$
)
{
var
_setting
=
{
data
:
{
key
:
{
...
...
@@ -19,28 +19,29 @@
}
};
//default init node of exLib
var
_initNode
=
function
(
setting
,
level
,
n
,
parentNode
,
isFirstNode
,
isLastNode
,
openFlag
)
{
var
_initNode
=
function
(
setting
,
level
,
n
,
parentNode
,
isFirstNode
,
isLastNode
,
openFlag
)
{
var
isHidden
=
data
.
isHidden
(
setting
,
n
);
data
.
isHidden
(
setting
,
n
,
isHidden
);
data
.
initHideForExCheck
(
setting
,
n
);
},
//add dom for check
_beforeA
=
function
(
setting
,
node
,
html
)
{},
_beforeA
=
function
(
setting
,
node
,
html
)
{
},
//update zTreeObj, add method of exLib
_zTreeTools
=
function
(
setting
,
zTreeTools
)
{
zTreeTools
.
showNodes
=
function
(
nodes
,
options
)
{
_zTreeTools
=
function
(
setting
,
zTreeTools
)
{
zTreeTools
.
showNodes
=
function
(
nodes
,
options
)
{
view
.
showNodes
(
setting
,
nodes
,
options
);
}
zTreeTools
.
showNode
=
function
(
node
,
options
)
{
zTreeTools
.
showNode
=
function
(
node
,
options
)
{
if
(
!
node
)
{
return
;
}
view
.
showNodes
(
setting
,
[
node
],
options
);
}
zTreeTools
.
hideNodes
=
function
(
nodes
,
options
)
{
zTreeTools
.
hideNodes
=
function
(
nodes
,
options
)
{
view
.
hideNodes
(
setting
,
nodes
,
options
);
}
zTreeTools
.
hideNode
=
function
(
node
,
options
)
{
zTreeTools
.
hideNode
=
function
(
node
,
options
)
{
if
(
!
node
)
{
return
;
}
...
...
@@ -49,7 +50,7 @@
var
_checkNode
=
zTreeTools
.
checkNode
;
if
(
_checkNode
)
{
zTreeTools
.
checkNode
=
function
(
node
,
checked
,
checkTypeFlag
,
callbackFlag
)
{
zTreeTools
.
checkNode
=
function
(
node
,
checked
,
checkTypeFlag
,
callbackFlag
)
{
if
(
!!
node
&&
!!
data
.
isHidden
(
setting
,
node
))
{
return
;
}
...
...
@@ -59,10 +60,10 @@
},
//method of operate data
_data
=
{
initHideForExCheck
:
function
(
setting
,
n
)
{
initHideForExCheck
:
function
(
setting
,
n
)
{
var
isHidden
=
data
.
isHidden
(
setting
,
n
);
if
(
isHidden
&&
setting
.
check
&&
setting
.
check
.
enable
)
{
if
(
typeof
n
.
_nocheck
==
"
undefined
"
)
{
if
(
typeof
n
.
_nocheck
==
"
undefined
"
)
{
n
.
_nocheck
=
!!
n
.
nocheck
n
.
nocheck
=
true
;
}
...
...
@@ -72,10 +73,10 @@
}
}
},
initShowForExCheck
:
function
(
setting
,
n
)
{
initShowForExCheck
:
function
(
setting
,
n
)
{
var
isHidden
=
data
.
isHidden
(
setting
,
n
);
if
(
!
isHidden
&&
setting
.
check
&&
setting
.
check
.
enable
)
{
if
(
typeof
n
.
_nocheck
!=
"
undefined
"
)
{
if
(
typeof
n
.
_nocheck
!=
"
undefined
"
)
{
n
.
nocheck
=
n
.
_nocheck
;
delete
n
.
_nocheck
;
}
...
...
@@ -91,9 +92,9 @@
},
//method of operate ztree dom
_view
=
{
clearOldFirstNode
:
function
(
setting
,
node
)
{
clearOldFirstNode
:
function
(
setting
,
node
)
{
var
n
=
node
.
getNextNode
();
while
(
!!
n
)
{
while
(
!!
n
)
{
if
(
n
.
isFirstNode
)
{
n
.
isFirstNode
=
false
;
view
.
setNodeLineIcos
(
setting
,
n
);
...
...
@@ -105,9 +106,9 @@
n
=
n
.
getNextNode
();
}
},
clearOldLastNode
:
function
(
setting
,
node
,
openFlag
)
{
clearOldLastNode
:
function
(
setting
,
node
,
openFlag
)
{
var
n
=
node
.
getPreNode
();
while
(
!!
n
)
{
while
(
!!
n
)
{
if
(
n
.
isLastNode
)
{
n
.
isLastNode
=
false
;
if
(
openFlag
)
{
...
...
@@ -121,21 +122,21 @@
n
=
n
.
getPreNode
();
}
},
makeDOMNodeMainBefore
:
function
(
html
,
setting
,
node
)
{
makeDOMNodeMainBefore
:
function
(
html
,
setting
,
node
)
{
var
isHidden
=
data
.
isHidden
(
setting
,
node
);
html
.
push
(
"
<li
"
,
(
isHidden
?
"
style='display:none;'
"
:
""
),
"
id='
"
,
node
.
tId
,
"
' class='
"
,
consts
.
className
.
LEVEL
,
node
.
level
,
"
' tabindex='0' hidefocus='true' treenode>
"
);
html
.
push
(
"
<li
"
,
(
isHidden
?
"
style='display:none;'
"
:
""
),
"
id='
"
,
node
.
tId
,
"
' class='
"
,
consts
.
className
.
LEVEL
,
node
.
level
,
"
' tabindex='0' hidefocus='true' treenode>
"
);
},
showNode
:
function
(
setting
,
node
,
options
)
{
showNode
:
function
(
setting
,
node
,
options
)
{
data
.
isHidden
(
setting
,
node
,
false
);
data
.
initShowForExCheck
(
setting
,
node
);
$$
(
node
,
setting
).
show
();
},
showNodes
:
function
(
setting
,
nodes
,
options
)
{
showNodes
:
function
(
setting
,
nodes
,
options
)
{
if
(
!
nodes
||
nodes
.
length
==
0
)
{
return
;
}
var
pList
=
{},
i
,
j
;
for
(
i
=
0
,
j
=
nodes
.
length
;
i
<
j
;
i
++
)
{
for
(
i
=
0
,
j
=
nodes
.
length
;
i
<
j
;
i
++
)
{
var
n
=
nodes
[
i
];
if
(
!
pList
[
n
.
parentTId
])
{
var
pn
=
n
.
getParentNode
();
...
...
@@ -149,7 +150,7 @@
view
.
setLastNodeForShow
(
setting
,
children
);
}
},
hideNode
:
function
(
setting
,
node
,
options
)
{
hideNode
:
function
(
setting
,
node
,
options
)
{
data
.
isHidden
(
setting
,
node
,
true
);
node
.
isFirstNode
=
false
;
node
.
isLastNode
=
false
;
...
...
@@ -157,12 +158,12 @@
view
.
cancelPreSelectedNode
(
setting
,
node
);
$$
(
node
,
setting
).
hide
();
},
hideNodes
:
function
(
setting
,
nodes
,
options
)
{
hideNodes
:
function
(
setting
,
nodes
,
options
)
{
if
(
!
nodes
||
nodes
.
length
==
0
)
{
return
;
}
var
pList
=
{},
i
,
j
;
for
(
i
=
0
,
j
=
nodes
.
length
;
i
<
j
;
i
++
)
{
for
(
i
=
0
,
j
=
nodes
.
length
;
i
<
j
;
i
++
)
{
var
n
=
nodes
[
i
];
if
((
n
.
isFirstNode
||
n
.
isLastNode
)
&&
!
pList
[
n
.
parentTId
])
{
var
pn
=
n
.
getParentNode
();
...
...
@@ -176,7 +177,7 @@
view
.
setLastNodeForHide
(
setting
,
children
);
}
},
setFirstNode
:
function
(
setting
,
parentNode
)
{
setFirstNode
:
function
(
setting
,
parentNode
)
{
var
children
=
data
.
nodeChildren
(
setting
,
parentNode
);
var
isHidden
=
data
.
isHidden
(
setting
,
children
[
0
],
false
);
if
(
children
.
length
>
0
&&
!
isHidden
)
{
...
...
@@ -185,7 +186,7 @@
view
.
setFirstNodeForHide
(
setting
,
children
);
}
},
setLastNode
:
function
(
setting
,
parentNode
)
{
setLastNode
:
function
(
setting
,
parentNode
)
{
var
children
=
data
.
nodeChildren
(
setting
,
parentNode
);
var
isHidden
=
data
.
isHidden
(
setting
,
children
[
0
]);
if
(
children
.
length
>
0
&&
!
isHidden
)
{
...
...
@@ -194,9 +195,9 @@
view
.
setLastNodeForHide
(
setting
,
children
);
}
},
setFirstNodeForHide
:
function
(
setting
,
nodes
)
{
var
n
,
i
,
j
;
for
(
i
=
0
,
j
=
nodes
.
length
;
i
<
j
;
i
++
)
{
setFirstNodeForHide
:
function
(
setting
,
nodes
)
{
var
n
,
i
,
j
;
for
(
i
=
0
,
j
=
nodes
.
length
;
i
<
j
;
i
++
)
{
n
=
nodes
[
i
];
if
(
n
.
isFirstNode
)
{
break
;
...
...
@@ -212,9 +213,9 @@
}
return
n
;
},
setFirstNodeForShow
:
function
(
setting
,
nodes
)
{
var
n
,
i
,
j
,
first
,
old
;
for
(
i
=
0
,
j
=
nodes
.
length
;
i
<
j
;
i
++
)
{
setFirstNodeForShow
:
function
(
setting
,
nodes
)
{
var
n
,
i
,
j
,
first
,
old
;
for
(
i
=
0
,
j
=
nodes
.
length
;
i
<
j
;
i
++
)
{
n
=
nodes
[
i
];
var
isHidden
=
data
.
isHidden
(
setting
,
n
);
if
(
!
first
&&
!
isHidden
&&
n
.
isFirstNode
)
{
...
...
@@ -233,11 +234,11 @@
n
=
null
;
}
}
return
{
"
new
"
:
first
,
"
old
"
:
old
};
return
{
"
new
"
:
first
,
"
old
"
:
old
};
},
setLastNodeForHide
:
function
(
setting
,
nodes
)
{
var
n
,
i
;
for
(
i
=
nodes
.
length
-
1
;
i
>=
0
;
i
--
)
{
setLastNodeForHide
:
function
(
setting
,
nodes
)
{
var
n
,
i
;
for
(
i
=
nodes
.
length
-
1
;
i
>=
0
;
i
--
)
{
n
=
nodes
[
i
];
if
(
n
.
isLastNode
)
{
break
;
...
...
@@ -253,9 +254,9 @@
}
return
n
;
},
setLastNodeForShow
:
function
(
setting
,
nodes
)
{
var
n
,
i
,
j
,
last
,
old
;
for
(
i
=
nodes
.
length
-
1
;
i
>=
0
;
i
--
)
{
setLastNodeForShow
:
function
(
setting
,
nodes
)
{
var
n
,
i
,
j
,
last
,
old
;
for
(
i
=
nodes
.
length
-
1
;
i
>=
0
;
i
--
)
{
n
=
nodes
[
i
];
var
isHidden
=
data
.
isHidden
(
setting
,
n
);
if
(
!
last
&&
!
isHidden
&&
n
.
isLastNode
)
{
...
...
@@ -274,7 +275,7 @@
n
=
null
;
}
}
return
{
"
new
"
:
last
,
"
old
"
:
old
};
return
{
"
new
"
:
last
,
"
old
"
:
old
};
}
},
...
...
@@ -292,7 +293,7 @@
event
=
zt
.
_z
.
event
,
$$
=
tools
.
$
;
data
.
isHidden
=
function
(
setting
,
node
,
newIsHidden
)
{
data
.
isHidden
=
function
(
setting
,
node
,
newIsHidden
)
{
if
(
!
node
)
{
return
false
;
}
...
...
@@ -314,8 +315,8 @@
// Override method in core
var
_dInitNode
=
data
.
initNode
;
data
.
initNode
=
function
(
setting
,
level
,
node
,
parentNode
,
isFirstNode
,
isLastNode
,
openFlag
)
{
var
tmpPNode
=
(
parentNode
)
?
parentNode
:
data
.
getRoot
(
setting
),
data
.
initNode
=
function
(
setting
,
level
,
node
,
parentNode
,
isFirstNode
,
isLastNode
,
openFlag
)
{
var
tmpPNode
=
(
parentNode
)
?
parentNode
:
data
.
getRoot
(
setting
),
children
=
tmpPNode
[
setting
.
data
.
key
.
children
];
data
.
tmpHideFirstNode
=
view
.
setFirstNodeForHide
(
setting
,
children
);
data
.
tmpHideLastNode
=
view
.
setLastNodeForHide
(
setting
,
children
);
...
...
@@ -333,7 +334,7 @@
var
_makeChkFlag
=
data
.
makeChkFlag
;
if
(
!!
_makeChkFlag
)
{
data
.
makeChkFlag
=
function
(
setting
,
node
)
{
data
.
makeChkFlag
=
function
(
setting
,
node
)
{
if
(
!!
node
&&
!!
data
.
isHidden
(
setting
,
node
))
{
return
;
}
...
...
@@ -343,7 +344,7 @@
var
_getTreeCheckedNodes
=
data
.
getTreeCheckedNodes
;
if
(
!!
_getTreeCheckedNodes
)
{
data
.
getTreeCheckedNodes
=
function
(
setting
,
nodes
,
checked
,
results
)
{
data
.
getTreeCheckedNodes
=
function
(
setting
,
nodes
,
checked
,
results
)
{
if
(
!!
nodes
&&
nodes
.
length
>
0
)
{
var
p
=
nodes
[
0
].
getParentNode
();
if
(
!!
p
&&
!!
data
.
isHidden
(
setting
,
p
))
{
...
...
@@ -356,7 +357,7 @@
var
_getTreeChangeCheckedNodes
=
data
.
getTreeChangeCheckedNodes
;
if
(
!!
_getTreeChangeCheckedNodes
)
{
data
.
getTreeChangeCheckedNodes
=
function
(
setting
,
nodes
,
results
)
{
data
.
getTreeChangeCheckedNodes
=
function
(
setting
,
nodes
,
results
)
{
if
(
!!
nodes
&&
nodes
.
length
>
0
)
{
var
p
=
nodes
[
0
].
getParentNode
();
if
(
!!
p
&&
!!
data
.
isHidden
(
setting
,
p
))
{
...
...
@@ -369,7 +370,7 @@
var
_expandCollapseSonNode
=
view
.
expandCollapseSonNode
;
if
(
!!
_expandCollapseSonNode
)
{
view
.
expandCollapseSonNode
=
function
(
setting
,
node
,
expandFlag
,
animateFlag
,
callback
)
{
view
.
expandCollapseSonNode
=
function
(
setting
,
node
,
expandFlag
,
animateFlag
,
callback
)
{
if
(
!!
node
&&
!!
data
.
isHidden
(
setting
,
node
))
{
return
;
}
...
...
@@ -379,7 +380,7 @@
var
_setSonNodeCheckBox
=
view
.
setSonNodeCheckBox
;
if
(
!!
_setSonNodeCheckBox
)
{
view
.
setSonNodeCheckBox
=
function
(
setting
,
node
,
value
,
srcNode
)
{
view
.
setSonNodeCheckBox
=
function
(
setting
,
node
,
value
,
srcNode
)
{
if
(
!!
node
&&
!!
data
.
isHidden
(
setting
,
node
))
{
return
;
}
...
...
@@ -389,7 +390,7 @@
var
_repairParentChkClassWithSelf
=
view
.
repairParentChkClassWithSelf
;
if
(
!!
_repairParentChkClassWithSelf
)
{
view
.
repairParentChkClassWithSelf
=
function
(
setting
,
node
)
{
view
.
repairParentChkClassWithSelf
=
function
(
setting
,
node
)
{
if
(
!!
node
&&
!!
data
.
isHidden
(
setting
,
node
))
{
return
;
}
...
...
js/jquery.ztree.exhide.min.js
浏览文件 @
9523be07
/*
* JQuery zTree exHideNodes v3.5.3
6
* JQuery zTree exHideNodes v3.5.3
7
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
...
...
@@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2018-0
6-26
* Date: 2018-0
8-21
*/
(
function
(
j
){
j
.
extend
(
!
0
,
j
.
fn
.
zTree
.
_z
,{
view
:{
clearOldFirstNode
:
function
(
c
,
a
){
for
(
var
b
=
a
.
getNextNode
();
b
;){
if
(
b
.
isFirstNode
){
b
.
isFirstNode
=!
1
;
e
.
setNodeLineIcos
(
c
,
b
);
break
}
if
(
b
.
isLastNode
)
break
;
b
=
b
.
getNextNode
()}},
clearOldLastNode
:
function
(
c
,
a
,
b
){
for
(
a
=
a
.
getPreNode
();
a
;){
if
(
a
.
isLastNode
){
a
.
isLastNode
=!
1
;
b
&&
e
.
setNodeLineIcos
(
c
,
a
);
break
}
if
(
a
.
isFirstNode
)
break
;
a
=
a
.
getPreNode
()}},
makeDOMNodeMainBefore
:
function
(
c
,
a
,
b
){
a
=
d
.
isHidden
(
a
,
b
);
c
.
push
(
"
<li
"
,
a
?
"
style='display:none;'
"
:
""
,
"
id='
"
,
b
.
tId
,
"
' class='
"
,
l
.
className
.
LEVEL
,
b
.
level
,
"
' tabindex='0' hidefocus='true' treenode>
"
)},
showNode
:
function
(
c
,
a
){
d
.
isHidden
(
c
,
a
,
!
1
);
d
.
initShowForExCheck
(
c
,
a
);
k
(
a
,
c
).
show
()},
showNodes
:
function
(
c
,
a
,
b
){
if
(
a
&&
a
.
length
!=
0
){
var
f
=
{},
g
,
i
;
for
(
g
=
0
,
i
=
a
.
length
;
g
<
i
;
g
++
){
var
h
=
a
[
g
];
if
(
!
f
[
h
.
parentTId
]){
var
u
=
h
.
getParentNode
();
f
[
h
.
parentTId
]
=
u
===
null
?
d
.
getRoot
(
c
):
h
.
getParentNode
()}
e
.
showNode
(
c
,
h
,
b
)}
for
(
var
j
in
f
)
a
=
d
.
nodeChildren
(
c
,
f
[
j
]),
e
.
setFirstNodeForShow
(
c
,
a
),
e
.
setLastNodeForShow
(
c
,
a
)}},
hideNode
:
function
(
c
,
a
){
d
.
isHidden
(
c
,
a
,
...
...
log v3.x.txt
浏览文件 @
9523be07
...
...
@@ -13,6 +13,10 @@
</font>
*2018.08.21* v3.5.37
* [修改] 替换 scrollIntoViewIfNeeded 方法 Thanks @jocki84
* [修改] 部分 API 文字错误
*2018.06.26* v3.5.36
* [增加] setting.async.headers & setting.async.xhrFields
...
...
@@ -150,8 +154,8 @@
*2013.03.11* v3.5.12
* [修改] 由于 jquery 1.9 中移除 event.srcElement 导致的 js 报错的bug。
* [修改] 在异步加载模式下,使用 moveNode 方法,且 moveType != "inner" 时,也会导致 targetNode 自动加载子节点的 bug
* [修改] 对已经显示的节点(nocheck
ed
=true)使用 showNodes 或 showNode 方法后,导致勾选框出现的bug。
* [修改] 对已经隐藏的节点(nocheck
ed
=false)使用 hideNodes 或 hideNode 方法后,导致勾选框消失的bug。
* [修改] 对已经显示的节点(nocheck=true)使用 showNodes 或 showNode 方法后,导致勾选框出现的bug。
* [修改] 对已经隐藏的节点(nocheck=false)使用 hideNodes 或 hideNode 方法后,导致勾选框消失的bug。
* [修改] getNodesByParamFuzzy 支持 大小写模糊。
* [修改] className 结构,提取 _consts.className.BUTTON / LEVEL / ICO_LOADING / SWITCH,便于快速修改 css 冲突。
例如:与 WordPress 产生冲突后,直接修改 core 中的 "button" 和 "level" 即可。 Issue: https://github.com/zTree/zTree_v3/issues/2
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录