修改用户管理,及新增界面样式

This commit is contained in:
zhanghongqing
2018-03-21 08:59:23 +08:00
parent 794efde16b
commit 890e2622cf
3 changed files with 279 additions and 148 deletions

View File

@@ -27,7 +27,7 @@
<div class="input-append">
<input id="${id}Id" name="${name}" class="${cssClass} singleClass" type="hidden" value="${value}" />
<input id="${id}Name" name="${labelName}" ${allowInput?'':'readonly="readonly"'} type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}" placeholder="${value}"
class="${cssClass}" style="${cssStyle}"/><a id="${id}Button" href="javascript:" class="btn ${disabled} ${hideBtn ? 'hide' : ''}" style="${smallBtn?'padding:4px 2px;':''}">&nbsp;<i class="icon-search"></i>&nbsp;</a>&nbsp;&nbsp;
class="${cssClass}" style="${cssStyle} background-color:transparent"/><a id="${id}Button" href="javascript:" class="btn ${disabled} ${hideBtn ? 'hide' : ''}" style="${smallBtn?'padding:4px 2px;':''}">&nbsp;<i class="icon-search"></i>&nbsp;</a>&nbsp;&nbsp;
</div>
<script type="text/javascript">
$("#${id}Button, #${id}Name").click(function(){

View File

@@ -68,131 +68,158 @@
</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"></shiro:hasPermission>${not empty user.id?'修改':'添加'}
<shiro:lacksPermission name="sys:user:edit">查看</shiro:lacksPermission>
</a></li>
</ul><br/>
<div class="page-content">
<div class="row">
<!-- <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"></shiro:hasPermission>${not empty user.id?'修改':'添加'} --%>
<%-- <shiro:lacksPermission name="sys:user:edit">查看</shiro:lacksPermission> --%>
<!-- </a></li> -->
<!-- </ul><br/> -->
<div class="theme-panel hidden-xs hidden-sm">
<button type="button" class="btn btn-default" onclick="history.go(-1)"><spring:message code="back"/></button>
</div>
<h3 class="page-title">
<spring:message code="userManage"/>
</h3>
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i><c:if test="${not empty user.id}"><spring:message code="edit"/></c:if><c:if test="${empty user.id}"><spring:message code="add"/></c:if></div>
</div>
<div class="portlet-body form">
<form:form id="inputForm" modelAttribute="sysUser" action="${ctx}/sys/user/saveOrUpdate" 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">
<div class="form-body">
<div class="form-group">
<label class="col-md-3 control-label">头像:</label>
<div class="col-md-4">
<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">
<div class="form-group">
<label class="col-md-3 control-label">登录名:</label>
<div class="col-md-4">
<input id="oldLoginId" name="oldLoginId" type="hidden" value="${user.loginId}">
<c:if test="${not empty user.id}" var="exisitUser">
<form:input path="loginId" htmlEscape="false" maxlength="50" readonly="true" class="required userName"/>
<form:input path="loginId" htmlEscape="false" maxlength="50" readonly="true" class="required userName form-control"/>
</c:if>
<c:if test="${!exisitUser}">
<form:input path="loginId" htmlEscape="false" maxlength="50" class="required userName"/>
<form:input path="loginId" htmlEscape="false" maxlength="50" class="required userName form-control"/>
</c:if>
<span class="help-inline"><font color="red">*</font> </span>
</div>
<span class="help-inline"><font color="red">*</font> </span>
</div>
<div class="control-group">
<label class="control-label">归属公司:</label>
<div class="controls">
<div class="form-group">
<label class="col-md-3 control-label">归属公司:</label>
<div class="col-md-4">
<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" notAllowSelectRoot="true"/>
title="公司" url="/sys/office/treeData?type=1" cssClass="required form-control" notAllowSelectRoot="true"/>
</div>
</div>
<div class="control-group">
<label class="control-label">归属单位:</label>
<div class="controls">
<div class="form-group">
<label class="col-md-3 control-label">归属单位:</label>
<div class="col-md-4">
<sys:treeselect id="entity" name="entity.id" value="${user.entity.id}" labelName="entity.name" labelValue="${user.entity.name}"
title="单位" url="/sys/office/treeData?type=2" cssClass="required" notAllowSelectRoot="true"/>
title="单位" url="/sys/office/treeData?type=2" cssClass="required form-control" notAllowSelectRoot="true"/>
</div>
</div>
<div class="control-group">
<label class="control-label">归属部门:</label>
<div class="controls">
<div class="form-group">
<label class="col-md-3 control-label">归属部门:</label>
<div class="col-md-4">
<sys:treeselect id="office" name="office.id" value="${user.office.id}" labelName="office.name" labelValue="${user.office.name}"
title="部门" url="/sys/office/treeData?type=3" cssClass="required" notAllowSelectRoot="true"/>
title="部门" url="/sys/office/treeData?type=3" cssClass="required form-control" notAllowSelectRoot="true"/>
</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 class="form-group">
<label class="col-md-3 control-label">姓名:</label>
<div class="col-md-4">
<form:input path="name" htmlEscape="false" maxlength="50" class="required form-control"/>
</div>
<span class="help-inline"><font color="red">*</font> </span>
</div>
<div class="control-group">
<label class="control-label">密码:</label>
<div class="controls">
<input id="newPassword" name="newPassword" type="password" value="" maxlength="50" minlength="3" class="${empty user.id?'required':''}"/>
<div class="form-group">
<label class="col-md-3 control-label">密码:</label>
<div class="col-md-4">
<input id="newPassword" name="newPassword" type="password" value="" maxlength="50" minlength="3" class="${empty user.id?'required':''} form-control"/>
</div>
<c:if test="${empty user.id}"><span class="help-inline"><font color="red">*</font> </span></c:if>
<c:if test="${not empty user.id}"><span class="help-inline">若不修改密码,请留空。</span></c:if>
</div>
</div>
<div class="control-group">
<label class="control-label">确认密码:</label>
<div class="controls">
<input id="confirmNewPassword" name="confirmNewPassword" type="password" value="" maxlength="50" minlength="3" equalTo="#newPassword"/>
<c:if test="${empty user.id}"><span class="help-inline"><font color="red">*</font> </span></c:if>
<div class="form-group">
<label class="col-md-3 control-label">确认密码:</label>
<div class="col-md-4">
<input id="confirmNewPassword" name="confirmNewPassword" type="password" value="" maxlength="50" minlength="3" equalTo="#newPassword" class="form-control"/>
<c:if test="${empty user.id}"></c:if>
</div>
<span class="help-inline"><font color="red">*</font> </span>
</div>
<div class="control-group">
<label class="control-label">身份标识:</label>
<div class="controls">
<form:select path="identity" class="input-medium">
<div class="form-group">
<label class="col-md-3 control-label">身份标识:</label>
<div class="col-md-4 ">
<form:select path="identity" class="selectpicker select2 form-control">
<form:option value="0">普通人员</form:option>
<form:option value="1">管理人员</form:option>
</form:select>
<span class="help-inline">管理人员需指定身份标识为“管理人员”,否则影响信访审核流程!</span>
</div>
<span class="help-inline"><font>管理人员需指定身份标识为“管理人员”,否则影响审核流程!</font></span>
</div>
<div class="control-group">
<label class="control-label">邮箱:</label>
<div class="controls">
<form:input path="email" htmlEscape="false" maxlength="100" class="required email"/><span class="help-inline"><font color="red">*</font> </span>
<div class="form-group">
<label class="col-md-3 control-label">邮箱:</label>
<div class="col-md-4">
<form:input path="email" htmlEscape="false" maxlength="100" class="required email form-control"/>
</div>
<span class="help-inline"><font color="red">*</font> </span>
</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 class="form-group">
<label class="col-md-3 control-label">用户角色:</label>
<div class="col-md-8">
<form:checkboxes path="roleIdList" items="${allRoles}" itemLabel="name" itemValue="id" htmlEscape="false" class="required" style="vertical-align:middle;display:inline-block;margin-bottom:4px"/>
<span class="help-inline "><font color="red">*</font> </span>
</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.createTime}" type="both" dateStyle="full"/></label>
<div class="form-group">
<label class="col-md-3 control-label">创建时间:</label>
<div class="col-md-4">
<label class="lbl form-control"><fmt:formatDate value="${user.createTime}" type="both" dateStyle="full"/></label>
</div>
</div>
</c:if>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-offset-3 col-md-9">
<shiro:hasPermission name="sys:user:edit"></shiro:hasPermission>
<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
<button type="submit" class="btn btn-circle green"><spring:message code="submit"></spring:message></button>
<button type="button" class="btn btn-circle grey-salsa btn-outline" onclick="history.go(-1)"><spring:message code="cancel"></spring:message></button>
</div>
</div>
</div>
</form:form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -5,95 +5,199 @@
<title>用户管理</title>
<script type="text/javascript">
$(document).ready(function() {
$("#btnExport").click(function(){
top.$.jBox.confirm("确认要导出用户数据吗?","系统提示",function(v,h,f){
if(v=="ok"){
$("#searchForm").attr("action","${ctx}/sys/user/export");
$("#btnExport").click(function() {
top.$.jBox.confirm("确认要导出用户数据吗?", "系统提示", function(v, h, f) {
if (v == "ok") {
$("#searchForm").attr("action", "${ctx}/sys/user/export");
$("#searchForm").submit();
}
},{buttonsFocus:1});
top.$('.jbox-body .jbox-icon').css('top','55px');
}, {
buttonsFocus : 1
});
top.$('.jbox-body .jbox-icon').css('top', '55px');
});
$("#btnImport").click(function(){
$.jBox($("#importBox").html(), {title:"导入数据", buttons:{"关闭":true},
bottomText:"导入文件不能超过5M仅允许导入“xls”或“xlsx”格式文件"});
$("#btnImport").click(function() {
$.jBox($("#importBox").html(), {
title : "导入数据",
buttons : {
"关闭" : true
},
bottomText : "导入文件不能超过5M仅允许导入“xls”或“xlsx”格式文件"
});
});
});
function page(n,s){
if(n) $("#pageNo").val(n);
if(s) $("#pageSize").val(s);
$("#searchForm").attr("action","${ctx}/sys/user/list");
function page(n, s) {
if (n)
$("#pageNo").val(n);
if (s)
$("#pageSize").val(s);
$("#searchForm").attr("action", "${ctx}/sys/user/list");
$("#searchForm").submit();
return false;
}
return false;
}
</script>
</head>
<body>
<div id="importBox" class="hide">
<form id="importForm" action="${ctx}/sys/user/import" method="post" enctype="multipart/form-data"
class="form-search" style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入,请稍等...');"><br/>
<input id="uploadFile" name="file" type="file" style="width:330px"/><br/><br/>  
<input id="btnImportSubmit" class="btn btn-primary" type="submit" value=" 导 入 "/>
<a href="${ctx}/sys/user/import/template">下载模板</a>
</form>
</div>
<ul class="nav nav-tabs">
<li class="active"><a href="${ctx}/sys/user/list">用户列表</a></li>
<shiro:hasPermission name="sys:user:edit"></shiro:hasPermission>
<li><a href="${ctx}/sys/user/form">用户添加</a></li>
</ul>
<form:form id="searchForm" modelAttribute="sysUser" action="${ctx}/sys/user/list" method="post" class="breadcrumb form-search ">
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
<ul class="ul-form">
<li><label>归属公司:</label><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="input-small" allowClear="true"/></li>
<li><label>登录名:</label><form:input path="loginId" htmlEscape="false" maxlength="50" class="input-medium"/></li>
<li><label>姓&nbsp;&nbsp;&nbsp;名:</label><form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/></li>
<li class="clearfix"></li>
<li><label>归属部门:</label><sys:treeselect id="office" name="office.id" value="${user.office.id}" labelName="office.name" labelValue="${user.office.name}"
title="部门" url="/sys/office/treeData?type=3" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/></li>
<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return page();"/>
<input id="btnImport" class="btn btn-success" type="button" value="导入"/>
<input id="btnExport" class="btn btn btn-inverse" type="button" value="导出"/>
<div class="page-content">
<div id="importBox" class="hide">
<form id="importForm" action="${ctx}/sys/user/import" method="post"
enctype="multipart/form-data" class="form-search"
style="padding-left: 20px; text-align: center;"
onsubmit="loading('正在导入,请稍等...');">
<br /> <input id="uploadFile" name="file" type="file"
style="width: 330px" /><br />
<br /> <input id="btnImportSubmit" class="btn btn-primary"
type="submit" value=" 导 入 " /> <a
href="${ctx}/sys/user/import/template">下载模板</a>
</form>
</div>
<!-- <ul class="nav nav-tabs"> -->
<%-- <li class="active"><a href="${ctx}/sys/user/list">用户列表</a></li> --%>
<%-- <shiro:hasPermission name="sys:user:edit"></shiro:hasPermission> --%>
<%-- <li><a href="${ctx}/sys/user/form">用户添加</a></li> --%>
<!-- </ul> -->
<shiro:hasPermission name="sys:user:edit">
<div class="theme-panel hidden-xs hidden-sm">
<button type="button" class="btn btn-default" onclick="javascript:window.location='${ctx}/sys/user/list'"><spring:message code="refresh"></spring:message></button>
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/sys/user/form'">
<i class="fa fa-plus"></i>
<spring:message code="add" />
</button>
</div>
</shiro:hasPermission>
<h3 class="page-title">
<spring:message code="userManage"></spring:message>
<small><spring:message code="date_list" /></small>
</h3>
<h5 class="page-header"></h5>
<!-- 筛选搜索内容栏默认隐藏-->
<div class="row">
<div class="col-md-12">
<form:form id="searchForm" modelAttribute="sysUser"
action="${ctx}/sys/user/list" method="post" class="form-search ">
<input id="pageNo" name="pageNo" type="hidden"
value="${page.pageNo}" />
<input id="pageSize" name="pageSize" type="hidden"
value="${page.pageSize}" />
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
callback="page();" />
<div class="col-md-12 filter-action-select-panle"
style="background-color: transparent">
<div class="row">
<div class="col-md-3">
<div class="pull-left">
<label>归属公司:</label>
</div>
<div class="pull-left">
<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="form-control"
allowClear="true"/>
</div>
</div>
<div class="col-md-3">
<div class="pull-left">
<label>登录名:</label>
</div>
<div class="pull-left">
<form:input path="loginId" htmlEscape="false" maxlength="50"
class="form-control" />
</div>
</div>
<div class="col-md-3">
<div class="pull-left">
<label>姓名:</label>
</div>
<div class="pull-left">
<form:input path="name" htmlEscape="false" maxlength="50"
class="form-control" />
</div>
</div>
<div class="col-md-3">
<div class="pull-left">
<label>归属部门:</label>
</div>
<div class="pull-left">
<sys:treeselect id="office" name="office.id" value="${user.office.id}" labelName="office.name"
labelValue="${user.office.name}" title="部门"
url="/sys/office/treeData?type=3" cssClass="form-control" allowClear="true"
notAllowSelectParent="true"/>
</div>
</div>
</div>
<div class="row">
<div class="pull-left">
<button type="submit" class="btn blue" onclick="return page();">
<i class="fa fa-search"></i>
<spring:message code="search" />
</button>
<button type="reset" class="btn btn-default">
<i class="fa fa-refresh"></i>
<spring:message code="reset" />
</button>
</div>
</div>
</div>
</form:form>
</div>
</div>
<sys:message content="${message}" />
<table id="contentTable"
class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>所属公司</th>
<th>所属部门</th>
<th class="sort-column login_id">登录名</th>
<th class="sort-column name">姓名</th>
<th>身份标识</th>
<th>邮箱</th>
<th>创建时间</th>
<%--<th>角色</th> --%>
<shiro:hasPermission name="sys:user:edit">
<th>操作</th>
</shiro:hasPermission>
</tr>
</thead>
<tbody>
<c:forEach items="${page.list}" var="user">
<tr>
<td>${user.company.name}</td>
<td>${fns:getOfficeDesc(user.office.id)}</td>
<td><a href="${ctx}/sys/user/form?id=${user.id}">${user.loginId}</a></td>
<td>${user.name}</td>
<td>${user.identity eq 1 ?'信访办':'办理人员'}</td>
<td>${user.email}</td>
<td><fmt:formatDate value="${user.createTime}"
pattern="yyyy-MM-dd HH:mm:ss" /></td>
<shiro:hasPermission name="sys:user:edit"></shiro:hasPermission>
<td><a href="${ctx}/sys/user/form?id=${user.id}">修改</a> <a
href="${ctx}/sys/user/delete?id=${user.id}"
onclick="return confirmx('确认要删除该用户吗?', this.href)">删除</a></td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page">${page}</div>
</div>
</li>
<li class="clearfix"></li>
</ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead><tr><th>所属公司</th><th>所属部门</th><th class="sort-column login_id">登录名</th><th class="sort-column name">姓名</th><th>身份标识</th><th>邮箱</th><th>创建时间</th><%--<th>角色</th> --%><shiro:hasPermission name="sys:user:edit"><th>操作</th></shiro:hasPermission></tr></thead>
<tbody>
<c:forEach items="${page.list}" var="user">
<tr>
<td>${user.company.name}</td>
<td>${fns:getOfficeDesc(user.office.id)}</td>
<td><a href="${ctx}/sys/user/form?id=${user.id}">${user.loginId}</a></td>
<td>${user.name}</td>
<td>${user.identity eq 1 ?'信访办':'办理人员'}</td>
<td>${user.email}</td>
<td><fmt:formatDate value="${user.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<shiro:hasPermission name="sys:user:edit"></shiro:hasPermission>
<td>
<a href="${ctx}/sys/user/form?id=${user.id}">修改</a>
<a href="${ctx}/sys/user/delete?id=${user.id}" onclick="return confirmx('确认要删除该用户吗?', this.href)">删除</a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>