liujie
2023-08-16 db7fa6a91b9534ac90e219b6f554c54c43c83a5a
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
@layout("/common/_container.html"){
 
 
<script type="text/javascript">
    $(function () {
 
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
 
        $("#btn_close").bind("click", function () {
            parent.layer.close(index);
        });
 
        $("#btn_save").bind("click", function () {
            var ids = Feng.zTreeCheckedNodes("zTree");
            var ajax = new $ax(Feng.ctxPath + "/mgr/setRole", function (data) {
                Feng.success("分配角色成功!");
                window.parent.MgrUser.table.refresh();
                parent.layer.close(index);
            }, function (data) {
                Feng.error("分配角色失败!" + data.responseJSON.message + "!");
            });
            ajax.set("roleIds", ids);
            ajax.set("userId", "${userId}");
            ajax.start();
        });
 
        initZtree();
    });
 
    function initZtree() {
        var setting = {
            check: {
                enable: true,
                chkboxType: {
                    "Y": "",
                    "N": ""
                }
            },
            data: {
                simpleData: {
                    enable: true
                }
            }
        };
 
        var ztree = new $ZTree("zTree", "/role/roleTreeListByUserId/${userId}");
        ztree.setSettings(setting);
        ztree.init();
    }
</script>
 
 
<!-- 配置grid -->
<div class="container"
     style="padding:  0px 10px !important; margin-top: -10px; text-align: center !important;">
    <div class="row">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>${userAccount!}</h5>
            </div>
            <div class="ibox-content">
                <ul id="zTree" class="ztree"></ul>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <button class="btn btn-sm btn-info" type="button" id="btn_save">
                <i class="ace-icon fa fa-check bigger-110"></i> 保存
            </button>
            &nbsp;
            <button class="btn btn-sm btn-danger" type="button" id="btn_close">
                <i class="ace-icon fa fa-close bigger-110"></i> 关闭
            </button>
        </div>
    </div>
</div>
 
@}