forked from liangrui1988/java-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserAdd.html
More file actions
262 lines (203 loc) · 8.23 KB
/
Copy pathuserAdd.html
File metadata and controls
262 lines (203 loc) · 8.23 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<!DOCTYPE html>
<html>
<head>
<title>用户管理</title>
<!-- <link href="../../../common/bootstrap/css/bootstrap.min.css" -->
<!-- rel="stylesheet"> -->
<!-- <link href="../../resources/css/sys/pager.css" -->
<!-- rel="stylesheet"> -->
<!-- <script src="../../../common/jquery/jquery-1.12.3.js"></script> -->
<!-- <script src="../../../common/jquery/jquery.validate/jquery.validate.js"></script> -->
<!-- <script src="../../../common/jquery/jquery.validate/jquery.validate.method.js"></script> -->
<!-- <script src="../../../common/bootstrap/js/bootstrap.js"></script> -->
<!-- <script src="../../../common/bootstrap/js/bootstrap.js"></script> -->
<!-- <script src="../../../common/sys.js"></script> -->
<!-- <script src="../../../common/util/common.js"></script> -->
<link href="../../../common/all.css" rel="stylesheet">
<script type="text/javascript" src="../../../common/all.js"></script>
<style type="text/css">
.form-actions{
padding-right: 1000px;
}
#messageBox{
color: red;
}
</style>
</head>
<body style="overflow-x: hidden; overflow-y: hidden;">
<ul class="nav nav-tabs">
<li >
<a href="userlist.html">用户列表</a>
</li>
<li class="active">
<a href="userAdd.html">添加用户</a>
</li>
</ul>
<br/>
<div class="userAddClz">
<form id="inputForm" action="" class="form-horizontal" role="form">
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-2 control-label" > <span class="help-inline"><font color="red">*</font> </span>登陆名: -->
<!-- </label> -->
<!-- <div class="col-sm-2"> -->
<!-- <input class="input-xlarge" name="userName" type="text" placeholder="192.168.1.161"/> -->
<!-- </div> -->
<!-- <label class="col-sm-4 control-label" ><span class="help-inline"><font color="red">*</font> </span>密码: -->
<!-- </label> -->
<!-- <div class="col-sm-2"> -->
<!-- <input class="input-xlarge" type="password" placeholder="msh"/> -->
<!-- </div> -->
<!-- </div> -->
<div class="form-group">
<label class="col-sm-2 control-label" > <span class="help-inline"><font color="red">*</font> </span>登陆名:
</label>
<div class="col-sd-1">
<input class="required input-xlarge" maxlength="20" name="userName" id="_userName" type="text" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" ><span class="help-inline"><font color="red">*</font> </span>密码:
</label>
<div class="col-sd-1">
<input class="required" maxlength="16" name="password" type="password" id="_password"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" ><span class="help-inline"><font color="red">*</font> </span>重新输入密码:
</label>
<div class="col-sd-1">
<input class="required" maxlength="16" name="repeatPassword" type="password" id="_repeatPassword"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label "> <span class="help-inline"></span><font color="red">*</font>姓名:</label>
<div class="col-sd-1">
<input class="required" maxlength="20" type="text" name="fullName" id="_fullName"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label " >
<span class="help-inline"></span><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-2 control-label ">邮箱:</label>
<div class="col-sd-1">
<input type="text" maxlength="30" name="email" id="_email"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label ">用户类型:</label>
<div class="col-sd-1">
<select name="type" id="_type">
<!-- <option value="1">系统管理员</option> -->
<!-- <option value="2">商家管理xx</option> -->
<!-- <option value="3">政府管理xx</option> -->
</select>
</div>
</div>
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-2 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-2 control-label "><span class="help-inline"><font color="red">*</font> </span>角色:</label>
<div class="col-sd-1" id="_role_plan_div">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label " >
备注:</label>
<div class="col-sm-2">
<textarea rows="6" cols="60" maxlength="200" 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">
$(document).ready(function() {
initAddUser();
$("#inputForm").validate({
submitHandler: function(form){
//loading('正在提交,请稍等...');
addUser();
//form.submit();
},
// rules: {
// test: '999999999.99'
// },
// messages: {
// userName: {
// required: "必填信息"
// }
// },
//onkeyup:true,
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);
}
}
});
});
function initAddUser()
{
//获取角色
$.ajax({
url : getContextPath()+"/sys/role/listAll",
type : "GET",
//contentType: "application/json; charset=utf-8",
dataType : "json",
//data :{productVoJson:JSON.stringify(objVo)},
data :'',
success : function(returnData,status,XMLHttpRequest)
{
//console.log(returnData);
if(resolveResultBeanIsError(returnData,status))
{
var rolelist=returnData.data;
var roleHtml='';
for(var i=0;i<rolelist.length;i++)
{
var roleObj=rolelist[i];
roleHtml+=' <input value="'+roleObj.id+'" type="checkbox" name="roles['+i+'].id"/>';
roleHtml+=roleObj.name;
roleHtml+=' ';
}
$("#_role_plan_div").html(roleHtml);
}
}
});
//字典
initDictByType("user_type","_type");
}
function addUser(){
var jobj=$("#inputForm").serialize();
$.ajax({
url : getContextPath()+"/sys/user/add",
type : "POST",
dataType : "json",
data :jobj,
success : function(returnData,status,XMLHttpRequest)
{ //console.log(returnData);
if(resolveResultBeanIsOk(returnData,status))
{
location.href=getContextPath()+"/views/modules/sys/user/userlist.html";
}
}
});
}
</script>
</body>
</html>