cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8" />
<title>角色权限</title>
 
[#include "/business/pages/include/static.html" /]
 
<style>
/* 清除浮动 */
.clearfix:before, .clearfix:after {
    content: "\0020";
    display: block;
    height: 0;
    overflow: hidden;
    }  
.clearfix:after { clear: both; }  
.clearfix { zoom: 1; }
.personwrap{margin:10px;}
.personcont {
    width: 100%;
    font: 12px "宋体";
    min-width: 800px;
}
.personalist {
    border-bottom: dotted 1px #d1d1d1;
    line-height: 30px;
    padding: 8px 0;
    overflow: hidden;
    zoom: 1;
}
.personalistl {
    width: 18%;
    float: left;
}
.personalist span {
    color: #434343;
    font-weight: bold;
}
.personalistTit{margin-top:5px;}
.personalistTit span{
    color:#1076e5;
    font-size:16px;
    }
.personalist_chk {
    margin: 9px 8px 10px 16px;
    float:left;
}
.personalist_chkbox {
    margin:8px 8px 11px 20%;
    float:left;
}
.personalistr {
    float: left;
    width: 82%;
}
.personalistr li {
    width: 20%;
    float: left;
    color: #666;
    list-style: none;
    margin-bottom: 0px;
}
.personalistr li.li {
    color: #333;
}
.personalistr li.li a {
    color: #666;
    text-decoration:none;
    cursor:pointer;
}
.personalistr li.li a:hover {
    color: #00f;
}
</style>
 
<script type="text/javascript">
 
    $(function() {
    
    
       $.formValidator.initConfig({formID:"myform",onError:function(msg){popupTips(msg)},onSuccess:function(){
                        document.getElementById("myform").target = window.top.openDialog("1","操作",
                         {},
                         {"width":30,"height":30,"noclose":true},[{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
                         return true;
        }});
    
    
        //点击一级功能菜单
        $("input[name='yjgn']").bind("click",function() {
            var isChecked = $(this).is(":checked");
            $(this).parents("div[class='panel']").find(":checkbox").attr("checked",isChecked);
        });
        
        //点击二级功能菜单
        $("input[name='ejgn']").bind("click",function() {
            var isChecked = $(this).is(":checked");
            var $pan = $(this).parent().next("div.sj");
            if(isChecked) {
                $pan.find(":checkbox").attr("checked",true);
                //选中上级
                $(this).parents(".panel").find(":checkbox[name='yjgn']").attr("checked",true);
            } else {
                //下级取消选中
                $pan.find(":checkbox").attr("checked",false);
                //判断同等级的二级是否都没有选中,如果都没有选中,则取消选中一级
                var $panel = $(this).parents(".panel");
                var checkedLen = $panel.find(":checkbox[name='ejgn']:checked").length;
                if(checkedLen == 0) {
                    $panel.find(":checkbox[name='yjgn']").attr("checked",false);
                }
            }
        });
        
        
        
        //点击三级功能菜单
        $("input[name='sjgn']").bind("click",function() {
            var isChecked = $(this).is(":checked");
            var $panel = $(this).parents(".panel");
            
            var $sjPanel = $(this).parents("tr.sjPanel");
            if(isChecked) {
                
                //选中一级
                $panel.find(":checkbox[name='yjgn']").attr("checked",true);
                //选中当前三级所在的二级
                $(this).parents("div.ejpanel").find(":checkbox[name='ejgn']").attr("checked",true);
                
            } else {
                //判断当前跟我同级的三级是否有选中,若没有,则取消选中我所在的二级
                var checkedSjLen = $(this).parents("div.ejpanel").find(":checkbox[name='sjgn']:checked").length;
                if(checkedSjLen==0) {
                    //取消选中二级
                    $(this).parents("div.ejpanel").find(":checkbox[name='ejgn']").attr("checked",false);
                    
                    //判断当前是否有选中的二级,如果没有选中的二级,则取消一级选中
                    var checkedEjLen = $panel.find(":checkbox[name='ejgn']:checked").length;
                    if(checkedEjLen == 0) {
                        $panel.find(":checkbox[name='yjgn']").attr("checked",false);
                    }
                }
            }
        });
        
        
    })
    
    
    
    function onDialogBtnClick(btnID, dialogID, config){
        if(btnID == "btnSure"){
            if(!window.top.openConfirm('确定要重新分配权限吗?')) return false;
            $("#myform").submit();
        }
    }
    
</script>
 
</head>
<body class="personwrap">
<form action="qxInRoleSubmit.html" method="post" id="myform">
        <input type="hidden" value="${RequestParameters.id}" name="roleid" />
<div class="personcont">
  [#list menuList as yjgn ]
      <div class="panel">
      <div class="personalist clearfix personalistTit">
        <div class="personalistl">
          <input class="personalist_chk" type="checkbox"  name="yjgn" value="${yjgn.ID}" [#if yjgn.CHECKED??]checked="checked"[/#if]>
          <span>${yjgn.GNMC}:</span></div>
      </div>
      
      [#list yjgn.GNLIST as ejgn]
          <div class="personalist clearfix personalistnon ejpanel">
            <div class="personalistl">
              <input class="personalist_chk personalist_chkbox" name="ejgn" value="${ejgn.ID}" [#if ejgn.CHECKED??]checked="checked"[/#if] type="checkbox" >
              <span>${ejgn.GNMC}:</span> </div>
            <div class="personalistr sj">
            [#list ejgn.GNLIST as sjgn]
              <li class="li">
                <input class="personalist_chk"  name="sjgn" value="${sjgn.ID}"  [#if sjgn.CHECKED??]checked="checked"[/#if] type="checkbox">
                <a href="#">${sjgn.GNMC}</a>
              </li>
            [/#list]
            </div>
          </div>
      [/#list]
      </div>
  [/#list]
</div>
</form>
</body>
</html>