Initial commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-form timo-compile">
|
||||
<form th:action="@{/system/role/save}">
|
||||
<input type="hidden" name="id" th:if="${role}" th:value="${role.id}"/>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">角色标识</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" type="text" name="name" placeholder="请输入角色编号" th:value="${role?.name}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">角色名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" type="text" name="title" placeholder="请输入角色名称" th:value="${role?.title}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">备注</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea placeholder="请输入内容" class="layui-textarea" name="remark">[[${role?.remark}]]</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item timo-finally">
|
||||
<button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
|
||||
<button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script th:replace="/common/template :: script"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,100 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
|
||||
<link rel="stylesheet" th:href="@{/lib/zTree_v3/css/zTreeStyle/zTreeStyle.css}" type="text/css">
|
||||
<style>
|
||||
.ztree{
|
||||
margin-left: 12px;
|
||||
margin-bottom: 70px;
|
||||
}
|
||||
.timo-compile .timo-finally{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding-bottom: 14px;
|
||||
margin-bottom: 0;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-form timo-compile">
|
||||
<ul id="authTree" class="ztree" th:attr="data-url=@{/system/role/authList(ids=${id})}"></ul>
|
||||
<div class="layui-form-item timo-finally">
|
||||
<button id="submit" class="layui-btn" th:attr="data-url=@{/system/role/auth}, data-id=${id}"><i class="fa fa-check-circle"></i> 保存</button>
|
||||
<button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<script th:replace="/common/template :: script"></script>
|
||||
<script type="text/javascript" th:src="@{/js/plugins/jquery-3.3.1.min.js}"></script>
|
||||
<script type="text/javascript" th:src="@{/lib/zTree_v3/js/jquery.ztree.core.min.js}"></script>
|
||||
<script type="text/javascript" th:src="@{/lib/zTree_v3/js/jquery.ztree.excheck.min.js}"></script>
|
||||
<SCRIPT type="text/javascript">
|
||||
$(function(){
|
||||
var setting = {
|
||||
check: {
|
||||
enable: true,
|
||||
chkboxType: { "Y" : "ps", "N" : "ps" }
|
||||
},
|
||||
data: {
|
||||
simpleData: {
|
||||
enable: true
|
||||
}
|
||||
}
|
||||
};
|
||||
$.get($("#authTree").data("url"), function(result){
|
||||
var keyPid = [];
|
||||
result.data.forEach(function(item){
|
||||
keyPid[item.pid] = true;
|
||||
});
|
||||
var zNodes =[];
|
||||
result.data.forEach(function (item) {
|
||||
var menu = {
|
||||
id: item.id,
|
||||
pId: item.pid,
|
||||
name: item.title
|
||||
};
|
||||
if(item.pid === 0){
|
||||
menu.open = true;
|
||||
}
|
||||
if(item.url.indexOf("/index") !== -1 && keyPid[item.id]){
|
||||
var index = {
|
||||
id: item.id*-1,
|
||||
pId: item.id,
|
||||
name: "列表"
|
||||
};
|
||||
if(item.remark === "auth:true"){
|
||||
index.checked = true;
|
||||
}
|
||||
zNodes.push(index);
|
||||
}
|
||||
if(item.remark === "auth:true"){
|
||||
menu.checked = true;
|
||||
}
|
||||
zNodes.push(menu);
|
||||
});
|
||||
$.fn.zTree.init($("#authTree"), setting, zNodes);
|
||||
});
|
||||
|
||||
$("#submit").click(function () {
|
||||
var zTreeObj = $.fn.zTree.getZTreeObj("authTree");
|
||||
var authList = zTreeObj.getCheckedNodes(true);
|
||||
var authIds = [];
|
||||
authIds.push("id="+$(this).data("id"));
|
||||
authList.forEach(function(item){
|
||||
if(item.id > 0){
|
||||
authIds.push("authId="+item.id);
|
||||
}
|
||||
});
|
||||
$.post($(this).data("url"), authIds.join("&"), function(result){
|
||||
if (result.data == null) {
|
||||
result.data = 'submit[refresh]';
|
||||
}
|
||||
$.fn.Messager(result);
|
||||
});
|
||||
});
|
||||
});
|
||||
</SCRIPT>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
|
||||
</head>
|
||||
<body>
|
||||
<div class="timo-detail-page">
|
||||
<div class="timo-detail-title">基本信息</div>
|
||||
<table class="layui-table timo-detail-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th width='100px'>角色ID</th>
|
||||
<td th:text="${role.id}"></td>
|
||||
<th width='100px'>角色编号名称</th>
|
||||
<td>[[${role.title}]]([[${role.name}]])</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>创建用户</th>
|
||||
<td th:text="${role.createBy?.nickname}"></td>
|
||||
<th>更新用户</th>
|
||||
<td th:text="${role.updateBy?.nickname}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>创建时间</th>
|
||||
<td th:text="${#dates.format(role.createDate, 'yyyy-MM-dd HH:mm:ss')}"></td>
|
||||
<th>最后修改</th>
|
||||
<td th:text="${#dates.format(role.updateDate, 'yyyy-MM-dd HH:mm:ss')}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td th:text="${role.remark}" colspan="4"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div th:replace="/common/fragment :: log(${role})"></div>
|
||||
</div>
|
||||
<script th:replace="/common/template :: script"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,95 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org"
|
||||
>
|
||||
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
|
||||
</head>
|
||||
<body class="timo-layout-page">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header timo-card-header">
|
||||
<span><i class="fa fa-bars"></i> 角色管理</span>
|
||||
<i class="layui-icon layui-icon-refresh refresh-btn"></i>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-row timo-card-screen">
|
||||
<div class="pull-left layui-form-pane timo-search-box">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">状态</label>
|
||||
<div class="layui-input-block timo-search-status">
|
||||
<select class="timo-search-select" name="status" mo:dict="SEARCH_STATUS" mo-selected="${param.status}"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">编号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="name" th:value="${param.name}" placeholder="请输入角色编号" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" th:value="${param.title}" placeholder="请输入角色名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn timo-search-btn">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-right screen-btn-group">
|
||||
<button class="layui-btn open-popup" data-title="添加角色" th:attr="data-url=@{/system/role/add}" data-size="460,357">
|
||||
<i class="fa fa-plus"></i> 添加</button>
|
||||
<button class="layui-btn open-popup-param" data-type="radio" data-title="授权管理" th:attr="data-url=@{/system/role/auth}" data-size="600,500">
|
||||
<i class="fa fa-user-secret"></i> 授权</button>
|
||||
<div class="btn-group">
|
||||
<button class="layui-btn">操作<span class="caret"></span></button>
|
||||
<dl class="layui-nav-child layui-anim layui-anim-upbit">
|
||||
<dd><a class="ajax-status" th:href="@{/system/role/status/ok}">启用</a></dd>
|
||||
<dd><a class="ajax-status" th:href="@{/system/role/status/freezed}">冻结</a></dd>
|
||||
<dd><a class="ajax-status" th:href="@{/system/role/status/delete}">删除</a></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="timo-table-wrap">
|
||||
<table class="layui-table timo-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="timo-table-checkbox">
|
||||
<label class="timo-checkbox"><input type="checkbox">
|
||||
<i class="layui-icon layui-icon-ok"></i></label>
|
||||
</th>
|
||||
<th class="sortable" data-field="name">角色编号</th>
|
||||
<th class="sortable" data-field="title">角色名称</th>
|
||||
<th class="sortable" data-field="createDate">创建时间</th>
|
||||
<th class="sortable" data-field="updateDate">更新时间</th>
|
||||
<th>查看</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="item:${list}">
|
||||
<td><label class="timo-checkbox"><input type="checkbox" th:value="${item.id}">
|
||||
<i class="layui-icon layui-icon-ok"></i></label></td>
|
||||
<td th:text="${item.name}">角色编号</td>
|
||||
<td th:text="${item.title}">角色名称</td>
|
||||
<td th:text="${#dates.format(item.createDate, 'yyyy-MM-dd HH:mm:ss')}">创建时间</td>
|
||||
<td th:text="${#dates.format(item.updateDate, 'yyyy-MM-dd HH:mm:ss')}">更新时间</td>
|
||||
<td>
|
||||
<a class="open-popup" data-title="用户列表" th:attr="data-url=@{'/system/role/userList/'+${item.id}}" data-size="800,600" href="#">用户列表</a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="open-popup" data-title="编辑角色" th:attr="data-url=@{'/system/role/edit/'+${item.id}}" data-size="460,357" href="#">编辑</a>
|
||||
<a class="open-popup" data-title="详细信息" th:attr="data-url=@{'/system/role/detail/'+${item.id}}" data-size="800,600" href="#">详细</a>
|
||||
<a class="ajax-get" data-msg="您是否确认删除" th:href="@{/system/role/status/delete(ids=${item.id})}">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div th:replace="/common/fragment :: page"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script th:replace="/common/template :: script"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
|
||||
<style>
|
||||
a{
|
||||
color: #009688;
|
||||
}
|
||||
a:hover{
|
||||
color: #004a43;
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="timo-detail-page">
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>用户名</th>
|
||||
<th>用户昵称</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="item:${list}">
|
||||
<td>[[${item.username}]]</td>
|
||||
<td>[[${item.nickname}]]</td>
|
||||
<td><a th:href="@{/system/user/index(id=${item.id})}">查看</a></td>
|
||||
</tr>
|
||||
<tr th:if="${list.isEmpty()}">
|
||||
<td style="text-align: center" colspan="3">未有分配该角色的用户</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script th:replace="/common/template :: script"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user