deptTree.html
1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
<div class="row">
<div class="col-sm-12">
<div class="ibox-content">
<div id="deptTree"></div>
</div>
<div class="form-group hidden">
<div class="col-sm-12 col-sm-offset-12">
<button type="submit" class="btn btn-primary">提交</button>
</div>
</div>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script type="text/javascript">
$(document).ready(function() {
getTreeData()
});
function getTreeData() {
$.ajax({
type : "GET",
url : "/system/sysDept/tree",
success : function(tree) {
loadTree(tree);
}
});
}
function loadTree(tree) {
$('#deptTree').jstree({
'core' : {
'data' : tree
},
"plugins" : [ "search" ]
});
$('#deptTree').jstree().open_all();
}
$('#deptTree').on("changed.jstree", function(e, data) {
if(data.node.id!=-1){
parent.loadDept(data.node.id,data.node.text);
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
}
});
</script>
</body>
</html>