懒羊羊
2023-08-30 1ac2bc1590406d9babec036e154d8d08f34a6aa1
提交 | 用户 | 时间
1ac2bc 1 <!DOCTYPE html>
2 <html>
3 <head>
4     <meta charset="utf-8">
5     <meta http-equiv="X-UA-Compatible" content="IE=edge">
6     <meta name="viewport" content="width=device-width, initial-scale=1">
7
8     <title>${constants.getSystemName()}</title>
9     <meta name="description" content="${constants.getSystemName()}">
10     <meta name="author" content="stylefeng">
11
12     <link rel="stylesheet" href="${ctxPath}/assets/common/libs/layui/css/layui.css?v=${constants.getReleaseVersion()}"/>
13     <link href="${ctxPath}/assets/expand/plugins/ztree/zTreeStyle.css?v=${constants.getReleaseVersion()}" rel="stylesheet" type="text/css"/>
14 </head>
15
16 <body>
17 <div id="deptForm" class="layui-fluid">
18     <div class="layui-row" style="margin-top:15px;background: #f2f7f8;padding: 20px;">
19         <ul id="zTree" class="ztree"></ul>
20     </div>
21     <div class="layui-row" style="background: #CFD4D5;padding: 10px;">
22         <div style="text-align: center;">
23             <button class="layui-btn layui-btn-sm" id="saveButton">${lang.get("BTN_SAVE","保存")}</button>
24             <button class="layui-btn layui-btn-sm layui-btn-primary" type="button" ew-event="closeDialog">${lang.get("BTN_CANCEL","取消")}</button>
25         </div>
26     </div>
27 </div>
28
29 @/* 加入contextPath属性和session超时的配置 */
30 <script type="text/javascript">
31     var Feng = {
32         ctxPath: "${ctxPath}",
33         version: '${constants.getReleaseVersion()}'
34     };
35 </script>
36 <script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script>
37 <script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script>
38
39 <!--其他插件js-->
40 <script type="text/javascript" src="${ctxPath}/assets/expand/plugins/jquery/jquery-3.2.1.min.js?v=${constants.getReleaseVersion()}"></script>
41 <script type="text/javascript" src="${ctxPath}/assets/expand/plugins/ztree/jquery.ztree.all.min.js?v=${constants.getReleaseVersion()}"></script>
42
43 <script type="text/javascript">
44
45     layui.use(['ztree', 'ax'], function () {
46         var $ZTree = layui.ztree;
47         var $ax = layui.ax;
48
49         var ZTreeDlg = {
50             index: parent.layer.getFrameIndex(window.name)
51         };
52
53         $("#saveButton").bind("click", function () {
54             var ids = Feng.zTreeCheckedNodes("zTree");
55             var ajax = new $ax(Feng.ctxPath + "/mgr/setRole", function (data) {
56                 Feng.success("分配角色成功!");
57                 parent.layer.close(ZTreeDlg.index);
58             }, function (data) {
59                 Feng.error("分配角色失败!" + data.responseJSON.message + "!");
60             });
61             ajax.set("roleIds", ids);
62             ajax.set("userId", "${userId}");
63             ajax.start();
64         });
65
66         var setting = {
67             check: {
68                 enable: true,
69                 chkboxType: {
70                     "Y": "",
71                     "N": ""
72                 }
73             },
74             data: {
75                 simpleData: {
76                     enable: true
77                 }
78             }
79         };
80
81         var ztree = new $ZTree("zTree", "/role/roleTreeListByUserId/${userId}");
82         ztree.setSettings(setting);
83         ztree.init();
84     });
85
86 </script>
87
88 </body>
89
90 </html>