Files
RuoYi/src/main/resources/templates/system/user/user.html

211 lines
7.4 KiB
HTML
Raw Normal View History

2018-07-09 08:44:52 +08:00
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
2018-09-03 08:45:08 +08:00
<link th:href="@{/ajax/libs/jquery-layout/jquery.layout-latest.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
2018-07-09 08:44:52 +08:00
<body class="gray-bg">
<div class="ui-layout-west">
<div class="main-content">
<div class="box box-main">
<div class="box-header">
<div class="box-title">
<i class="fa icon-grid"></i> 组织机构
</div>
<div class="box-tools pull-right">
2018-09-03 08:45:08 +08:00
<a type="button" class="btn btn-box-tool menuItem" href="#" onclick="dept()" title="管理部门"><i class="fa fa-edit"></i></a>
2018-07-09 08:44:52 +08:00
<button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
2018-09-03 08:45:08 +08:00
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>
2018-07-09 08:44:52 +08:00
</div>
</div>
<div class="ui-layout-content">
<div id="tree" class="ztree"></div>
</div>
</div>
</div>
</div>
<div class="container-div ui-layout-center">
<div class="row">
2018-10-01 21:32:01 +08:00
<div class="col-sm-12 search-collapse">
2018-07-15 20:39:59 +08:00
<form id="user-form">
2018-07-09 08:44:52 +08:00
<input type="hidden" id="deptId" name="deptId">
<input type="hidden" id="parentId" name="parentId">
2018-08-01 10:07:28 +08:00
<div class="select-list">
2018-07-09 08:44:52 +08:00
<ul>
<li>
登录名称:<input type="text" name="loginName"/>
</li>
<li>
手机号码:<input type="text" name="phonenumber"/>
</li>
<li>
2018-07-22 23:05:50 +08:00
用户状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
2018-07-09 08:44:52 +08:00
<option value="">所有</option>
2018-08-23 17:06:31 +08:00
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
2018-07-09 08:44:52 +08:00
</select>
</li>
2018-08-23 17:06:31 +08:00
<li class="select-time">
2018-07-19 21:17:17 +08:00
<label>创建时间: </label>
2018-08-01 10:12:34 +08:00
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
2018-07-19 21:17:17 +08:00
<span>-</span>
2018-08-01 10:12:34 +08:00
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
2018-07-19 21:17:17 +08:00
</li>
2018-07-09 08:44:52 +08:00
<li>
2018-07-27 21:56:08 +08:00
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
2018-08-01 11:42:13 +08:00
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:user:export"><i class="fa fa-download"></i>&nbsp;导出</a>
2018-07-09 08:44:52 +08:00
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group hidden-xs" id="toolbar" role="group">
<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="system:user:add">
<i class="fa fa-plus"></i> 新增
</a>
2018-08-23 17:06:31 +08:00
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">
2018-07-09 08:44:52 +08:00
<i class="fa fa-trash-o"></i> 删除
</a>
</div>
2018-08-23 17:06:31 +08:00
<div class="col-sm-12 select-table table-striped">
2018-07-09 08:44:52 +08:00
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:src="@{/ajax/libs/jquery-layout/jquery.layout-latest.js}"></script>
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
<script th:inline="javascript">
2018-07-22 23:05:50 +08:00
var editFlag = [[${@permission.hasPermi('system:user:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:user:remove')}]];
var resetPwdFlag = [[${@permission.hasPermi('system:user:resetPwd')}]];
var datas = [[${@dict.getType('sys_normal_disable')}]];
2018-07-09 08:44:52 +08:00
var prefix = ctx + "system/user"
2018-09-03 08:45:08 +08:00
$(function() {
2018-07-09 08:44:52 +08:00
$('body').layout({ west__size: 185 });
queryUserList();
2018-09-03 08:45:08 +08:00
queryDeptTree();
2018-07-09 08:44:52 +08:00
});
function queryUserList() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
sortName: "createTime",
sortOrder: "desc",
modalName: "用户",
search: false,
showExport: false,
columns: [{
checkbox: true
},
{
field: 'userId',
title: '用户ID'
},
{
field: 'loginName',
title: '登录名称',
sortable: true
},
{
field: 'userName',
title: '用户名称'
},
{
field: 'dept.deptName',
title: '部门'
},
{
field: 'email',
2018-07-20 17:21:43 +08:00
title: '邮箱',
visible: false
2018-07-09 08:44:52 +08:00
},
{
field: 'phonenumber',
title: '手机'
},
{
field: 'status',
title: '状态',
align: 'center',
formatter: function(value, row, index) {
2018-07-22 23:05:50 +08:00
return $.table.selectDictLabel(datas, value);
2018-07-09 08:44:52 +08:00
}
},
{
2018-07-19 21:17:17 +08:00
field: 'createTime',
title: '创建时间',
sortable: true
2018-07-09 08:44:52 +08:00
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.userId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>删除</a> ');
actions.push('<a class="btn btn-info btn-xs ' + resetPwdFlag + '" href="#" onclick="resetPwd(\'' + row.userId + '\')"><i class="fa fa-key"></i>重置</a>');
return actions.join('');
}
}]
};
$.table.init(options);
}
2018-09-03 08:45:08 +08:00
function queryDeptTree()
2018-07-09 08:44:52 +08:00
{
2018-09-03 08:45:08 +08:00
var url = ctx + "system/dept/treeData";
var options = {
url: url,
expandLevel: 2,
onClick : zOnClick
};
$.tree.init(options);
2018-07-09 08:44:52 +08:00
2018-09-03 08:45:08 +08:00
function zOnClick(event, treeId, treeNode) {
$("#deptId").val(treeNode.id);
$("#parentId").val(treeNode.pId);
$.table.search();
}
2018-07-09 08:44:52 +08:00
}
2018-09-03 08:45:08 +08:00
$('#btnExpand').click(function() {
$._tree.expandAll(true);
$(this).hide();
$('#btnCollapse').show();
});
$('#btnCollapse').click(function() {
$._tree.expandAll(false);
$(this).hide();
$('#btnExpand').show();
});
$('#btnRefresh').click(function() {
queryDeptTree();
});
2018-07-09 08:44:52 +08:00
/*用户管理-部门*/
function dept() {
var url = ctx + "system/dept";
createMenuItem(url, "部门管理");
}
/*用户管理-重置密码*/
function resetPwd(userId) {
var url = prefix + '/resetPwd/' + userId;
$.modal.open("重置密码", url, '800', '300');
}
</script>
</body>
</html>