提交 | 用户 | 时间
|
1ac2bc
|
1 |
<!DOCTYPE html> |
懒 |
2 |
<html class="bg-white"> |
|
3 |
@/** |
|
4 |
@ * 本页面所用的模板变量 |
|
5 |
@ * |
|
6 |
@ * treeUrl : 加载树的url |
|
7 |
@ * fromName : 需要设置的显示名称 |
|
8 |
@ * fromId : 需要设置的隐藏id |
|
9 |
@ **/ |
|
10 |
<head> |
|
11 |
<meta charset="utf-8"> |
|
12 |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
|
13 |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|
14 |
|
|
15 |
<title>${constants.getSystemName()}</title> |
|
16 |
<meta name="description" content="${constants.getSystemName()}"> |
|
17 |
<meta name="author" content="stylefeng"> |
|
18 |
|
|
19 |
<!--其他插件css--> |
|
20 |
<link rel="stylesheet" href="${ctxPath}/assets/common/libs/layui/css/layui.css?v=${constants.getReleaseVersion()}"/> |
|
21 |
<link href="${ctxPath}/assets/expand/plugins/ztree/zTreeStyle.css?v=${constants.getReleaseVersion()}" rel="stylesheet" type="text/css"/> |
|
22 |
</head> |
|
23 |
|
|
24 |
<body> |
|
25 |
<div id="deptForm" class="layui-fluid"> |
|
26 |
<div class="layui-row" style="margin-top:15px;background: #f2f7f8;padding: 20px;"> |
|
27 |
<ul id="zTree" class="ztree"></ul> |
|
28 |
</div> |
|
29 |
<div class="layui-row" style="background: #CFD4D5;padding: 10px;"> |
|
30 |
<div style="text-align: center;"> |
|
31 |
<button class="layui-btn layui-btn-sm" id="saveButton">保存</button> |
|
32 |
<button class="layui-btn layui-btn-sm layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
|
33 |
</div> |
|
34 |
</div> |
|
35 |
</div> |
|
36 |
</body> |
|
37 |
|
|
38 |
|
|
39 |
@/* 加入contextPath属性和session超时的配置 */ |
|
40 |
<script type="text/javascript"> |
|
41 |
var Feng = { |
|
42 |
ctxPath: "${ctxPath}", |
|
43 |
version: '${constants.getReleaseVersion()}' |
|
44 |
}; |
|
45 |
</script> |
|
46 |
<script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script> |
|
47 |
<script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script> |
|
48 |
|
|
49 |
<script type="text/javascript" src="${ctxPath}/assets/expand/plugins/jquery/jquery-3.2.1.min.js?v=${constants.getReleaseVersion()}"></script> |
|
50 |
<script type="text/javascript" src="${ctxPath}/assets/expand/plugins/ztree/jquery.ztree.all.min.js?v=${constants.getReleaseVersion()}"></script> |
|
51 |
|
|
52 |
<script type="text/javascript"> |
|
53 |
|
|
54 |
|
|
55 |
layui.use(['ztree'], function () { |
|
56 |
var $ZTree = layui.ztree; |
|
57 |
|
|
58 |
var ZTreeDlg = { |
|
59 |
index: parent.layer.getFrameIndex(window.name), |
|
60 |
tempName: "", |
|
61 |
tempId: "" |
|
62 |
}; |
|
63 |
|
|
64 |
ZTreeDlg.onClickItem = function (e, treeId, treeNode) { |
|
65 |
ZTreeDlg.tempName = ZTreeDlg.instance.getSelectedVal(); |
|
66 |
ZTreeDlg.tempId = treeNode.id; |
|
67 |
}; |
|
68 |
|
|
69 |
ZTreeDlg.onDBClickItem = function (e, treeId, treeNode) { |
|
70 |
${formName} = ZTreeDlg.instance.getSelectedVal(); |
|
71 |
${formId} = treeNode.id; |
|
72 |
parent.layer.close(ZTreeDlg.index); |
|
73 |
}; |
|
74 |
|
|
75 |
$("#saveButton").bind("click", function () { |
|
76 |
${formName} = ZTreeDlg.tempName; |
|
77 |
${formId} = ZTreeDlg.tempId; |
|
78 |
parent.layer.close(ZTreeDlg.index); |
|
79 |
}); |
|
80 |
|
|
81 |
var ztree = new $ZTree("zTree", "${treeUrl}"); |
|
82 |
ztree.bindOnClick(ZTreeDlg.onClickItem); |
|
83 |
ztree.bindOnDblClick(ZTreeDlg.onDBClickItem); |
|
84 |
ztree.init(); |
|
85 |
ZTreeDlg.instance = ztree; |
|
86 |
}); |
|
87 |
|
|
88 |
</script> |
|
89 |
|
|
90 |
</body> |
|
91 |
|
|
92 |
</html> |