若依 4.2

This commit is contained in:
RuoYi
2020-03-23 09:02:04 +08:00
parent 5c736e96c9
commit d066539616
60 changed files with 745 additions and 121 deletions

View File

@@ -108,7 +108,10 @@
},
{
field: 'remark',
title: '备注'
title: '备注',
formatter: function(value, row, index) {
return $.table.tooltip(value);
}
},
{
field: 'createTime',

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('角色用户分配')" />
<th:block th:include="include :: header('角色分配用户')" />
</head>
<body class="gray-bg">
<div class="container-div">

View File

@@ -117,7 +117,7 @@
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.roleId + '\')"><i class="fa fa-remove"></i>删除</a> ');
var more = [];
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authDataScope(" + row.roleId + ")'><i class='fa fa-check-square-o'></i>数据权限</a> ");
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authUser(" + row.roleId + ")'><i class='fa fa-user'></i>分配用户</a> ");
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authUser(" + row.roleId + ")'><i class='fa fa-user'></i>分配用户</a>");
actions.push('<a class="btn btn-info btn-xs" role="button" data-toggle="popover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');
return actions.join('');
}

View File

@@ -0,0 +1,103 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('用户分配角色')" />
</head>
<body>
<div class="main-content">
<form id="form-user-add" class="form-horizontal">
<input type="hidden" id="userId" name="userId" th:value="${user.userId}">
<h4 class="form-header h4">基本信息</h4>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">用户名称:</label>
<div class="col-sm-8">
<input name="userName" class="form-control" type="text" disabled th:value="${user.userName}">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">登录账号:</label>
<div class="col-sm-8">
<input name="loginName" class="form-control" type="text" disabled th:value="${user.loginName}">
</div>
</div>
</div>
</div>
<h4 class="form-header h4">分配角色</h4>
<div class="row">
<div class="col-sm-12">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</form>
</div>
<div class="row">
<div class="col-sm-offset-5 col-sm-10">
<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/user/authRole";
var userRoles = [[${userRoles}]]
$(function() {
var options = {
url: ctx + "system/role/list",
sortName: "roleSort",
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
clickToSelect: true,
columns: [{
checkbox: true,
formatter:function (value, row, index) {
for (var i = 0; i < userRoles.length; i++) {
if (userRoles[i].roleId == row.roleId) {
return { checked: true };
}
}
return { checked: false };
}
},
{
field: 'roleId',
title: '角色编号'
},
{
field: 'roleName',
title: '角色名称',
sortable: true
},
{
field: 'roleKey',
title: '权限字符',
sortable: true
},
{
field: 'createTime',
title: '创建时间',
sortable: true
}]
};
$.table.init(options);
});
/* 添加角色-提交 */
function submitHandler(index, layero){
var rows = $.table.selectFirstColumns();
var data = { "userId": $("#userId").val(), "roleIds": rows.join() };
$.operate.saveTab(prefix + "/insertAuthRole", data);
}
</script>
</body>
</html>

View File

@@ -27,7 +27,7 @@
<b class="font-noraml">手机号码:</b>
<p class="pull-right">[[${user.phonenumber}]]</p>
</li>
<li class="list-group-item"><i class="fa fa-group"></i>
<li class="list-group-item" th:if="${user.dept?.deptName != null}"><i class="fa fa-group"></i>
<b class="font-noraml">所属部门:</b>
<p class="pull-right" >[[${user.dept?.deptName}]] / [[${#strings.defaultString(postGroup,'无岗位')}]]</p>
</li>

View File

@@ -166,7 +166,10 @@
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.userId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>删除</a> ');
actions.push('<a class="btn btn-info btn-xs ' + resetPwdFlag + '" href="javascript:void(0)" onclick="resetPwd(\'' + row.userId + '\')"><i class="fa fa-key"></i>重置</a>');
var more = [];
more.push("<a class='btn btn-default btn-xs " + resetPwdFlag + "' href='javascript:void(0)' onclick='resetPwd(" + row.userId + ")'><i class='fa fa-key'></i>重置密码</a> ");
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authRole(" + row.userId + ")'><i class='fa fa-check-square-o'></i>分配角色</a>");
actions.push('<a class="btn btn-info btn-xs" role="button" data-toggle="popover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');
return actions.join('');
}
}]
@@ -219,6 +222,12 @@
$.modal.open("重置密码", url, '800', '300');
}
/* 用户管理-分配角色 */
function authRole(userId) {
var url = prefix + '/authRole/' + userId;
$.modal.openTab("用户分配角色", url);
}
/* 用户状态显示 */
function statusTools(row) {
if (row.status == 1) {