userForm.jsp
8.16 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
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>用户管理</title>
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(document).ready(function() {
$("#no").focus();
$("#inputForm").validate({
rules: {
loginName: {remote: "${ctx}/sys/user/checkLoginName?oldLoginName=" + encodeURIComponent('${user.loginName}')},
newPassword: {abcNumber: true, capitalAbc: true}
},
messages: {
loginName: {remote: "用户登录名已存在"},
newPassword: {abcNumber: "密码必须包括英文字母和数字", capitalAbc: "必须包含有大写字母"},
confirmNewPassword: {equalTo: "输入与上面相同的密码"}
},
submitHandler: function(form){
loading('正在提交,请稍等...');
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>
<ul class="nav nav-tabs">
<li><a href="${ctx}/sys/user/list">用户列表</a></li>
<li class="active"><a href="${ctx}/sys/user/form?id=${user.id}">用户<shiro:hasPermission name="sys:user:edit">${not empty user.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="sys:user:edit">查看</shiro:lacksPermission></a></li>
</ul><br/>
<form:form id="inputForm" modelAttribute="user" action="${ctx}/sys/user/save" method="post" class="form-horizontal">
<form:hidden path="id"/>
<sys:message content="${message}"/>
<div class="control-group">
<label class="control-label">头像:</label>
<div class="controls">
<form:hidden id="nameImage" path="photo" htmlEscape="false" maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="nameImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
</div>
</div>
<div class="control-group">
<label class="control-label">归属单位:</label>
<div class="controls">
<sys:treeselect id="company" name="company.id" value="${user.company.id}" labelName="company.name" labelValue="${user.company.name}"
title="公司" url="/sys/office/treeData?type=1" cssClass="required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">归属部门:</label>
<div class="controls">
<sys:treeselect id="office" name="office.id" value="${user.office.id}" labelName="office.name" labelValue="${user.office.name}"
title="部门" url="/sys/office/treeData?type=2" cssClass="required" notAllowSelectParent="true"/>
</div>
</div>
<div class="control-group">
<label class="control-label">工号:</label>
<div class="controls">
<form:input path="no" htmlEscape="false" maxlength="50" class="required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">姓名:</label>
<div class="controls">
<form:input path="name" htmlEscape="false" maxlength="50" class="required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">登录名:</label>
<div class="controls">
<input id="oldLoginName" name="oldLoginName" type="hidden" value="${user.loginName}">
<form:input path="loginName" htmlEscape="false" maxlength="50" class="required userName"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">密码:</label>
<div class="controls">
<c:if test="${empty user.id}">
<input id="newPassword" name="newPassword" type="password" value="1ab2AB" maxlength="50" minlength="6" class="${empty user.id?'required':''}"/>
<span class="help-inline">此处新增时不修改就视为系统默认密码 1ab2AB 【下同】<font color="red">* (说明:密码由六位以上的字母加数字组成,并且必须含有大写字母。)</font> </span>
</c:if>
<c:if test="${not empty user.id}">
<input id="newPassword" name="newPassword" type="password" value="" maxlength="50" minlength="6" class="${empty user.id?'required':''}"/>
<span class="help-inline"><font color="red">* (说明:密码由六位以上的字母加数字组成,并且必须含有大写字母。)</font>若不修改密码,请留空。</span>
</c:if>
</div>
</div>
<div class="control-group">
<label class="control-label">确认密码:</label>
<div class="controls">
<c:if test="${empty user.id}">
<input id="confirmNewPassword" name="confirmNewPassword" type="password" value="1ab2AB" maxlength="50" minlength="6" equalTo="#newPassword"/>
<span class="help-inline"><font color="red">*</font> </span>
</c:if>
<c:if test="${not empty user.id}">
<input id="confirmNewPassword" name="confirmNewPassword" type="password" value="" maxlength="50" minlength="6" equalTo="#newPassword"/>
</c:if>
</div>
</div>
<div class="control-group">
<label class="control-label">窗口编号:</label>
<div class="controls">
<form:input path="ckbh" htmlEscape="false" maxlength="100"/>
</div>
</div>
<div class="control-group">
<label class="control-label">邮箱:</label>
<div class="controls">
<form:input path="email" htmlEscape="false" maxlength="100" class="email"/>
</div>
</div>
<div class="control-group">
<label class="control-label">电话:</label>
<div class="controls">
<form:input path="phone" htmlEscape="false" maxlength="100"/>
</div>
</div>
<div class="control-group">
<label class="control-label">手机:</label>
<div class="controls">
<form:input path="mobile" htmlEscape="false" maxlength="100"/>
</div>
</div>
<div class="control-group">
<label class="control-label">是否允许登录:</label>
<div class="controls">
<form:select path="loginFlag">
<form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
</form:select>
<span class="help-inline"><font color="red">*</font> “是”代表此账号允许登录,“否”则表示此账号不允许登录</span>
</div>
</div>
<div class="control-group">
<label class="control-label">用户类型:</label>
<div class="controls">
<form:select path="userType" class="input-xlarge">
<form:option value="" label="请选择"/>
<form:options items="${fns:getDictList('sys_user_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
</form:select>
</div>
</div>
<div class="control-group">
<label class="control-label">用户角色:</label>
<div class="controls">
<form:checkboxes path="roleIdList" items="${allRoles}" itemLabel="name" itemValue="id" htmlEscape="false" class="required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">备注:</label>
<div class="controls">
<form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="200" class="input-xlarge"/>
</div>
</div>
<c:if test="${not empty user.id}">
<div class="control-group">
<label class="control-label">创建时间:</label>
<div class="controls">
<label class="lbl"><fmt:formatDate value="${user.createDate}" type="both" dateStyle="full"/></label>
</div>
</div>
<div class="control-group">
<label class="control-label">最后登陆:</label>
<div class="controls">
<label class="lbl">IP: ${user.loginIp} 时间:<fmt:formatDate value="${user.loginDate}" type="both" dateStyle="full"/></label>
</div>
</div>
</c:if>
<div class="form-actions">
<shiro:hasPermission name="sys:user:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/> </shiro:hasPermission>
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
</div>
</form:form>
</body>
</html>