forked from liangrui1988/java-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroleAdd.html
More file actions
197 lines (155 loc) · 6.33 KB
/
Copy pathroleAdd.html
File metadata and controls
197 lines (155 loc) · 6.33 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
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
195
196
197
<!DOCTYPE html>
<html>
<head>
<title>用户管理</title>
<link href="../../../common/all.css" rel="stylesheet">
<script type="text/javascript" src="../../../common/all.js"></script>
<script type="text/javascript" src="../../../common/util/menuAuthorization.js"></script>
<link rel="stylesheet" href="../../../common/style/zTreeStyle/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="../../../common/jquery/jquery.ztree/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="../../../common/jquery/jquery.ztree/jquery.ztree.excheck-3.5.js"></script>
<style type="text/css">
.form-actions{
padding-right: 1000px;
}
#messageBox{
color: red;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
//initAddUser();
$("#inputForm").validate({
submitHandler: function(form){
//loading('正在提交,请稍等...');
addRole();
//form.submit();
},
errorContainer: "#messageBox",
errorPlacement: function(error, element) {
$("#messageBox").text("输入有误,请先更正。");
if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
error.appendTo(element.parent().parent());
} else {
error.insertAfter(element);
}
}
});
});
</script>
</head>
<body style="overflow-x: hidden; overflow-y: hidden;">
<ul class="nav nav-tabs">
<li >
<a href="rolelist.html">角色列表</a>
</li>
<li class="active">
<a href="roleAdd.html">添加角色</a>
</li>
</ul>
<br/>
<div class="addClz">
<form id="inputForm" action="" class="form-horizontal" role="form">
<div class="form-group">
<label class="col-sm-1 control-label" > <span class="help-inline"><font color="red">*</font> </span>角色名称:
</label>
<div class="col-sd-1">
<input class="required input-xlarge" name="name" id="_roleName" type="text" />
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label " >
<span class="help-inline"><font color="red">*</font>状态:</label>
<div class="col-sd-1">
启用 <input type="radio" name="status" value="0" checked="checked"/> 禁用<input type="radio" name="status" value="1"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label ">角色类型:</label>
<div class="col-sd-1">
<select name="types" id="_type">
<!-- <option value="1">系统管理角色</option> -->
<!-- <option value="2">商家角色</option> -->
<!-- <option value="3">政府角色</option> -->
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label ">权限分配:</label>
<div class="col-sd-1" id="_permission_plan_div">
<input id="citySel" type="text" readonly value="" placeholder="点击选择权限" style="width:220px;" onclick="showMenu(); return false;"/>
<input id="areaCodeV" type="hidden" >
<div id="menuContent" class="menuContent" style="display:none; width:600px; height:800px;z-index:9999, position: absolute; background:rgb(242, 242, 242);OVERFLOW-Y: auto; OVERFLOW-X:hidden; ">
<!-- <a href="javascript:claclArea()">清空</a> -->
<a href="javascript:checkAllNodes()" >全选</a>
<a href="javascript:cancelAllNodes()" >全取消</a>
<a href="javascript:expandAll(true)" >展开</a>
<a href="javascript:expandAll(false)" >折叠</a>
<a href="javascript:enterSel()">确定</a>
<ul id="treeDemo" class="ztree" style="margin-top:0; width:160px;"></ul>
</div>
</div>
</div>
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-1 control-label ">部门:</label> -->
<!-- <div class="col-sd-1"> -->
<!-- <input value="1" type="checkbox" name="department.id"/> -->
<!-- </div> -->
<!-- </div> -->
<div class="form-group">
<label class="col-sm-1 control-label " >
备注:</label>
<div class="col-sm-1">
<textarea rows="6" cols="60" name="remake" id="_remake"></textarea>
</div>
</div>
<div class="form-actions">
<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
</div>
</form>
</div>
<script type="text/javascript">
$(function(){
//初始字典
initDictByType('role_type',"_type");
})
function addRole(){
var roleObj=$("#inputForm").serialize();
var menuIds=getCheckedAll();
// alert(JSON.stringify(menuIds))
var menuStr="";
if(menuIds!=""&&menuIds.length>0){
for(var i=0;i<menuIds.length;i++){
var menuId=menuIds[i];
menuStr+="&menuIds["+i+"]="+menuId;
}
}
//menuStr=encodeURI(menuStr);
roleObj+=menuStr;
// console.log(roleObj);
$.ajax({
url : getContextPath()+"/sys/role/add",
type : "POST",
//contentType: "application/json; charset=utf-8",
dataType : "json",
data :roleObj,
success : function(returnData,status,XMLHttpRequest)
{
resolveResultBeanIsOk(returnData,status);
},
error : function() {
alert("请求异常!");
}
});
}
</script>
</body>
</html>