完成系统组织用户角色权限菜单查询

This commit is contained in:
shuzheng 2017-02-12 22:59:16 +08:00
parent 530195243a
commit 2b7961d40e
8 changed files with 830 additions and 8 deletions

View File

@ -10,7 +10,7 @@ Target Server Type : MYSQL
Target Server Version : 50621
File Encoding : 65001
Date: 2017-02-12 11:17:58
Date: 2017-02-12 22:58:12
*/
SET FOREIGN_KEY_CHECKS=0;
@ -411,11 +411,12 @@ CREATE TABLE `upms_organization` (
`description` varchar(1000) DEFAULT NULL COMMENT '组织描述',
`ctime` bigint(20) DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`organization_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组织';
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='组织';
-- ----------------------------
-- Records of upms_organization
-- ----------------------------
INSERT INTO `upms_organization` VALUES ('1', '总部', '北京总部', '1');
-- ----------------------------
-- Table structure for upms_permission
@ -436,7 +437,7 @@ CREATE TABLE `upms_permission` (
PRIMARY KEY (`permission_id`),
KEY `FK_Reference_29` (`system_id`),
CONSTRAINT `FK_Reference_29` FOREIGN KEY (`system_id`) REFERENCES `upms_system` (`system_id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COMMENT='权限';
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COMMENT='权限';
-- ----------------------------
-- Records of upms_permission
@ -457,13 +458,28 @@ INSERT INTO `upms_permission` VALUES ('13', '1', '12', '公共码表', '1', 'upm
INSERT INTO `upms_permission` VALUES ('14', '1', '12', '会话管理', '1', 'upms:session:read', '/manage/session/index', '', '1', '14', '14');
INSERT INTO `upms_permission` VALUES ('15', '1', '12', '日志记录', '1', 'upms:log:read', '/manage/log/index', '', '1', '15', '15');
INSERT INTO `upms_permission` VALUES ('16', '1', '12', '键值设置', '1', 'upms:map:read', '/manage/map/index', '', '1', '16', '16');
INSERT INTO `upms_permission` VALUES ('17', '2', null, '标签类目管理', '1', null, null, 'zmdi zmdi-labels', '1', '17', '17');
INSERT INTO `upms_permission` VALUES ('17', '2', null, '标签类目管理', '1', null, null, 'zmdi zmdi-menu', '1', '17', '17');
INSERT INTO `upms_permission` VALUES ('18', '2', '17', '标签管理', '1', 'cms:tag:read', '/manage/tag/index', null, '1', '18', '18');
INSERT INTO `upms_permission` VALUES ('19', '2', '17', '类目管理', '1', 'cms:category:read', '/manage/category/index', null, '1', '19', '19');
INSERT INTO `upms_permission` VALUES ('20', '2', null, '文章内容管理', '1', null, null, null, '1', '20', '20');
INSERT INTO `upms_permission` VALUES ('20', '2', null, '文章内容管理', '1', null, null, 'zmdi zmdi-collection-text', '1', '20', '20');
INSERT INTO `upms_permission` VALUES ('21', '2', '20', '文章管理', '1', 'cms:article:read', '/manage/article/index', null, '1', '21', '21');
INSERT INTO `upms_permission` VALUES ('22', '2', '20', '回收管理', '1', 'cms:article:read', '/manage/article/recycle', null, '1', '22', '22');
INSERT INTO `upms_permission` VALUES ('23', '1', '7', '按钮管理', '1', 'upms:permission:read', '/manage/permission/button', null, '1', '24', '24');
INSERT INTO `upms_permission` VALUES ('23', '1', '7', '按钮管理', '1', 'upms:permission:read', '/manage/permission/button', null, '1', '23', '23');
INSERT INTO `upms_permission` VALUES ('24', '1', '2', '新增', '2', 'upms:system:create', '/manage/system/add', null, '1', '24', '24');
INSERT INTO `upms_permission` VALUES ('25', '1', '2', '编辑', '2', 'upms:system:update', '/manage/system/update', null, '1', '25', '25');
INSERT INTO `upms_permission` VALUES ('26', '1', '2', '删除', '2', 'upms:system:delete', '/manage/system/delete', null, '1', '26', '26');
INSERT INTO `upms_permission` VALUES ('27', '1', '3', '新增', '2', 'upms:organization:create', '/manage/organization/add', null, '1', '27', '27');
INSERT INTO `upms_permission` VALUES ('28', '1', '3', '编辑', '2', 'upms:organization:update', '/manage/organization/update', '', '1', '28', '28');
INSERT INTO `upms_permission` VALUES ('29', '1', '3', '删除', '2', 'upms:organization:delete', '/manage/organization/delete', '', '1', '29', '29');
INSERT INTO `upms_permission` VALUES ('30', '1', '5', '新增', '2', 'upms:user:create', '/manage/user/add', null, '1', '30', '30');
INSERT INTO `upms_permission` VALUES ('31', '1', '5', '编辑', '2', 'upms:user:update', '/manage/user/update', null, '1', '31', '31');
INSERT INTO `upms_permission` VALUES ('32', '1', '5', '删除', '2', 'upms:user:delete', '/manage/user/delete', null, '1', '32', '32');
INSERT INTO `upms_permission` VALUES ('33', '1', '5', '新增', '2', 'upms:role:create', '/manage/role/add', null, '1', '33', '33');
INSERT INTO `upms_permission` VALUES ('34', '1', '5', '编辑', '2', 'upms:role:update', '/manage/role/update', null, '1', '34', '34');
INSERT INTO `upms_permission` VALUES ('35', '1', '5', '删除', '2', 'upms:role:delete', '/manage/role/delete', null, '1', '35', '35');
INSERT INTO `upms_permission` VALUES ('36', '1', '8', '新增', '2', 'upms:permission:create', '/manage/permission/add', null, '1', '36', '36');
INSERT INTO `upms_permission` VALUES ('37', '1', '8', '编辑', '2', 'upms:permission:update', '/manage/permission/update', null, '1', '37', '37');
INSERT INTO `upms_permission` VALUES ('38', '1', '8', '删除', '2', 'upms:permission:delete', '/manage/permission/delete', null, '1', '38', '38');
-- ----------------------------
-- Table structure for upms_role
@ -494,7 +510,7 @@ CREATE TABLE `upms_role_permission` (
PRIMARY KEY (`role_permission_id`),
KEY `FK_Reference_22` (`permission_id`),
CONSTRAINT `FK_Reference_22` FOREIGN KEY (`permission_id`) REFERENCES `upms_permission` (`permission_id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COMMENT='角色权限关联表';
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COMMENT='角色权限关联表';
-- ----------------------------
-- Records of upms_role_permission
@ -522,6 +538,21 @@ INSERT INTO `upms_role_permission` VALUES ('20', '1', '20');
INSERT INTO `upms_role_permission` VALUES ('21', '1', '21');
INSERT INTO `upms_role_permission` VALUES ('22', '1', '22');
INSERT INTO `upms_role_permission` VALUES ('23', '1', '23');
INSERT INTO `upms_role_permission` VALUES ('24', '1', '24');
INSERT INTO `upms_role_permission` VALUES ('25', '1', '25');
INSERT INTO `upms_role_permission` VALUES ('26', '1', '26');
INSERT INTO `upms_role_permission` VALUES ('27', '1', '27');
INSERT INTO `upms_role_permission` VALUES ('28', '1', '28');
INSERT INTO `upms_role_permission` VALUES ('29', '1', '29');
INSERT INTO `upms_role_permission` VALUES ('30', '1', '30');
INSERT INTO `upms_role_permission` VALUES ('31', '1', '31');
INSERT INTO `upms_role_permission` VALUES ('32', '1', '32');
INSERT INTO `upms_role_permission` VALUES ('33', '1', '33');
INSERT INTO `upms_role_permission` VALUES ('34', '1', '34');
INSERT INTO `upms_role_permission` VALUES ('35', '1', '35');
INSERT INTO `upms_role_permission` VALUES ('36', '1', '36');
INSERT INTO `upms_role_permission` VALUES ('37', '1', '37');
INSERT INTO `upms_role_permission` VALUES ('38', '1', '38');
-- ----------------------------
-- Table structure for upms_system
@ -579,11 +610,12 @@ CREATE TABLE `upms_user_organization` (
`user_id` int(10) unsigned NOT NULL,
`organization_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`user_organization_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户组织关联表';
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='用户组织关联表';
-- ----------------------------
-- Records of upms_user_organization
-- ----------------------------
INSERT INTO `upms_user_organization` VALUES ('1', '1', '1');
-- ----------------------------
-- Table structure for upms_user_permission

View File

@ -38,6 +38,20 @@ public class UpmsPermissionController extends BaseController {
return "/manage/permission/index";
}
@ApiOperation(value = "菜单权限首页")
@RequiresPermissions("upms:permission:read")
@RequestMapping(value = "/menu", method = RequestMethod.GET)
public String menu() {
return "/manage/permission/menu";
}
@ApiOperation(value = "按钮权限首页")
@RequiresPermissions("upms:permission:read")
@RequestMapping(value = "/button", method = RequestMethod.GET)
public String button() {
return "/manage/permission/button";
}
@ApiOperation(value = "权限列表")
@RequiresPermissions("upms:permission:read")
@RequestMapping("/list")
@ -45,10 +59,15 @@ public class UpmsPermissionController extends BaseController {
public Object list(
@RequestParam(required = false, defaultValue = "0", value = "offset") int offset,
@RequestParam(required = false, defaultValue = "10", value = "limit") int limit,
@RequestParam(required = false, defaultValue = "0", value = "type") int type,
@RequestParam(required = false, value = "sort") String sort,
@RequestParam(required = false, value = "order") String order) {
// 数据列表
UpmsPermissionExample upmsPermissionExample = new UpmsPermissionExample();
if (0 != type) {
upmsPermissionExample.createCriteria()
.andTypeEqualTo((byte) type);
}
upmsPermissionExample.setOffset(offset);
upmsPermissionExample.setLimit(limit);
if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {

View File

@ -0,0 +1,110 @@
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>组织管理</title>
<link href="${basePath}/resources/zheng-admin/plugins/bootstrap-3.3.0/css/bootstrap.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/material-design-iconic-font-2.2.0/css/material-design-iconic-font.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/bootstrap-table.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/waves-0.7.5/waves.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/css/common.css" rel="stylesheet"/>
</head>
<body>
<div id="main">
<div id="toolbar">
<shiro:hasPermission name="upms:organization:create"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增组织</a></shiro:hasPermission>
<shiro:hasPermission name="upms:organization:update"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑组织</a></shiro:hasPermission>
<shiro:hasPermission name="upms:organization:delete"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除组织</a></shiro:hasPermission>
</div>
<table id="table"></table>
</div>
<script src="${basePath}/resources/zheng-admin/plugins/jquery.1.12.4.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-3.3.0/js/bootstrap.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/bootstrap-table.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/waves-0.7.5/waves.min.js"></script>
<script src="${basePath}/resources/zheng-admin/js/common.js"></script>
<style>
body{font-size: 12px;}
.table i{font-size: 12px; color: #000;}
.bootstrap-table .table>thead>tr>th{border-bottom: none;}
</style>
<script>
$(function() {
// bootstrap table初始化
$('#table').bootstrapTable({
url: '${basePath}/manage/organization/list',
height: getHeight(),
striped: true,
search: true,
showRefresh: true,
showColumns: true,
minimumCountColumns: 2,
clickToSelect: true,
detailView: true,
detailFormatter: 'detailFormatter',
pagination: true,
toolbar: '#toolbar',
columns: [
{field: 'state', checkbox: true},
{field: 'organizationId', title: '编号', sortable: true, align: 'center'},
{field: 'name', title: '组织名称'},
{field: 'description', title: '组织描述'},
{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents'}
]
}).on('all.bs.table', function (e, name, args) {
$('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="popover"]').popover();
});
$(window).resize(function () {
$('#table').bootstrapTable('resetView', {
height: getHeight()
});
});
});
// 格式化操作按钮
function actionFormatter(value, row, index) {
return [
'<a class="update" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
].join('');
}
// 操作按钮事件
window.actionEvents = {
'click .update': function (e, value, row, index) {
alert('You click update icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .delete': function (e, value, row, index) {
alert('You click delete icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
// 展开内容
function detailFormatter(index, row) {
var html = [];
$.each(row, function (key, value) {
html.push('<p><b>' + key + ':</b> ' + value + '</p>');
});
return html.join('');
}
// 动态高度
function getHeight() {
return $(window).height() - 20;
}
</script>
</body>
</html>

View File

@ -0,0 +1,138 @@
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>权限管理</title>
<link href="${basePath}/resources/zheng-admin/plugins/bootstrap-3.3.0/css/bootstrap.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/material-design-iconic-font-2.2.0/css/material-design-iconic-font.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/bootstrap-table.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/waves-0.7.5/waves.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/css/common.css" rel="stylesheet"/>
</head>
<body>
<div id="main">
<div id="toolbar">
<shiro:hasPermission name="upms:permission:create"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:update"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:delete"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除权限</a></shiro:hasPermission>
</div>
<table id="table"></table>
</div>
<script src="${basePath}/resources/zheng-admin/plugins/jquery.1.12.4.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-3.3.0/js/bootstrap.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/bootstrap-table.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/waves-0.7.5/waves.min.js"></script>
<script src="${basePath}/resources/zheng-admin/js/common.js"></script>
<style>
body{font-size: 12px;}
.table i{font-size: 12px; color: #000;}
.bootstrap-table .table>thead>tr>th{border-bottom: none;}
</style>
<script>
$(function() {
// bootstrap table初始化
$('#table').bootstrapTable({
url: '${basePath}/manage/permission/list?type=2',
height: getHeight(),
striped: true,
search: true,
showRefresh: true,
showColumns: true,
minimumCountColumns: 2,
clickToSelect: true,
detailView: true,
detailFormatter: 'detailFormatter',
pagination: true,
toolbar: '#toolbar',
columns: [
{field: 'state', checkbox: true},
{field: 'permissionId', title: '编号', sortable: true, align: 'center'},
{field: 'systemId', title: '所属系统'},
{field: 'pid', title: '所属上级'},
{field: 'name', title: '权限名称'},
{field: 'type', title: '类型', formatter: 'typeFormatter'},
{field: 'permissionValue', title: '权限值'},
{field: 'uri', title: '路径'},
{field: 'icon', title: '图标', align: 'center', formatter: 'iconFormatter'},
{field: 'status', title: '状态', sortable: true, align: 'center', formatter: 'statusFormatter'},
{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents'}
]
}).on('all.bs.table', function (e, name, args) {
$('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="popover"]').popover();
});
$(window).resize(function () {
$('#table').bootstrapTable('resetView', {
height: getHeight()
});
});
});
// 格式化操作按钮
function actionFormatter(value, row, index) {
return [
'<a class="update" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
].join('');
}
// 格式化图标
function iconFormatter(value, row, index) {
return '<i class="' + value + '"></i>';
}
// 格式化类型
function typeFormatter(value, row, index) {
if (value == 1) {
return '菜单';
}
if (value == 2) {
return '按钮';
}
return '-';
}
// 格式化状态
function statusFormatter(value, row, index) {
if (value == 1) {
return '<span class="label label-success">正常</span>';
} else {
return '<span class="label label-danger">锁定</span>';
}
}
// 操作按钮事件
window.actionEvents = {
'click .update': function (e, value, row, index) {
alert('You click update icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .delete': function (e, value, row, index) {
alert('You click delete icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
// 展开内容
function detailFormatter(index, row) {
var html = [];
$.each(row, function (key, value) {
html.push('<p><b>' + key + ':</b> ' + value + '</p>');
});
return html.join('');
}
// 动态高度
function getHeight() {
return $(window).height() - 20;
}
</script>
</body>
</html>

View File

@ -0,0 +1,138 @@
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>权限管理</title>
<link href="${basePath}/resources/zheng-admin/plugins/bootstrap-3.3.0/css/bootstrap.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/material-design-iconic-font-2.2.0/css/material-design-iconic-font.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/bootstrap-table.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/waves-0.7.5/waves.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/css/common.css" rel="stylesheet"/>
</head>
<body>
<div id="main">
<div id="toolbar">
<shiro:hasPermission name="upms:permission:create"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:update"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:delete"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除权限</a></shiro:hasPermission>
</div>
<table id="table"></table>
</div>
<script src="${basePath}/resources/zheng-admin/plugins/jquery.1.12.4.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-3.3.0/js/bootstrap.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/bootstrap-table.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/waves-0.7.5/waves.min.js"></script>
<script src="${basePath}/resources/zheng-admin/js/common.js"></script>
<style>
body{font-size: 12px;}
.table i{font-size: 12px; color: #000;}
.bootstrap-table .table>thead>tr>th{border-bottom: none;}
</style>
<script>
$(function() {
// bootstrap table初始化
$('#table').bootstrapTable({
url: '${basePath}/manage/permission/list',
height: getHeight(),
striped: true,
search: true,
showRefresh: true,
showColumns: true,
minimumCountColumns: 2,
clickToSelect: true,
detailView: true,
detailFormatter: 'detailFormatter',
pagination: true,
toolbar: '#toolbar',
columns: [
{field: 'state', checkbox: true},
{field: 'permissionId', title: '编号', sortable: true, align: 'center'},
{field: 'systemId', title: '所属系统'},
{field: 'pid', title: '所属上级'},
{field: 'name', title: '权限名称'},
{field: 'type', title: '类型', formatter: 'typeFormatter'},
{field: 'permissionValue', title: '权限值'},
{field: 'uri', title: '路径'},
{field: 'icon', title: '图标', align: 'center', formatter: 'iconFormatter'},
{field: 'status', title: '状态', sortable: true, align: 'center', formatter: 'statusFormatter'},
{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents'}
]
}).on('all.bs.table', function (e, name, args) {
$('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="popover"]').popover();
});
$(window).resize(function () {
$('#table').bootstrapTable('resetView', {
height: getHeight()
});
});
});
// 格式化操作按钮
function actionFormatter(value, row, index) {
return [
'<a class="update" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
].join('');
}
// 格式化图标
function iconFormatter(value, row, index) {
return '<i class="' + value + '"></i>';
}
// 格式化类型
function typeFormatter(value, row, index) {
if (value == 1) {
return '菜单';
}
if (value == 2) {
return '按钮';
}
return '-';
}
// 格式化状态
function statusFormatter(value, row, index) {
if (value == 1) {
return '<span class="label label-success">正常</span>';
} else {
return '<span class="label label-danger">锁定</span>';
}
}
// 操作按钮事件
window.actionEvents = {
'click .update': function (e, value, row, index) {
alert('You click update icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .delete': function (e, value, row, index) {
alert('You click delete icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
// 展开内容
function detailFormatter(index, row) {
var html = [];
$.each(row, function (key, value) {
html.push('<p><b>' + key + ':</b> ' + value + '</p>');
});
return html.join('');
}
// 动态高度
function getHeight() {
return $(window).height() - 20;
}
</script>
</body>
</html>

View File

@ -0,0 +1,138 @@
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>权限管理</title>
<link href="${basePath}/resources/zheng-admin/plugins/bootstrap-3.3.0/css/bootstrap.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/material-design-iconic-font-2.2.0/css/material-design-iconic-font.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/bootstrap-table.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/waves-0.7.5/waves.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/css/common.css" rel="stylesheet"/>
</head>
<body>
<div id="main">
<div id="toolbar">
<shiro:hasPermission name="upms:permission:create"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:update"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:delete"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除权限</a></shiro:hasPermission>
</div>
<table id="table"></table>
</div>
<script src="${basePath}/resources/zheng-admin/plugins/jquery.1.12.4.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-3.3.0/js/bootstrap.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/bootstrap-table.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/waves-0.7.5/waves.min.js"></script>
<script src="${basePath}/resources/zheng-admin/js/common.js"></script>
<style>
body{font-size: 12px;}
.table i{font-size: 12px; color: #000;}
.bootstrap-table .table>thead>tr>th{border-bottom: none;}
</style>
<script>
$(function() {
// bootstrap table初始化
$('#table').bootstrapTable({
url: '${basePath}/manage/permission/list?type=1',
height: getHeight(),
striped: true,
search: true,
showRefresh: true,
showColumns: true,
minimumCountColumns: 2,
clickToSelect: true,
detailView: true,
detailFormatter: 'detailFormatter',
pagination: true,
toolbar: '#toolbar',
columns: [
{field: 'state', checkbox: true},
{field: 'permissionId', title: '编号', sortable: true, align: 'center'},
{field: 'systemId', title: '所属系统'},
{field: 'pid', title: '所属上级'},
{field: 'name', title: '权限名称'},
{field: 'type', title: '类型', formatter: 'typeFormatter'},
{field: 'permissionValue', title: '权限值'},
{field: 'uri', title: '路径'},
{field: 'icon', title: '图标', align: 'center', formatter: 'iconFormatter'},
{field: 'status', title: '状态', sortable: true, align: 'center', formatter: 'statusFormatter'},
{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents'}
]
}).on('all.bs.table', function (e, name, args) {
$('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="popover"]').popover();
});
$(window).resize(function () {
$('#table').bootstrapTable('resetView', {
height: getHeight()
});
});
});
// 格式化操作按钮
function actionFormatter(value, row, index) {
return [
'<a class="update" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
].join('');
}
// 格式化图标
function iconFormatter(value, row, index) {
return '<i class="' + value + '"></i>';
}
// 格式化类型
function typeFormatter(value, row, index) {
if (value == 1) {
return '菜单';
}
if (value == 2) {
return '按钮';
}
return '-';
}
// 格式化状态
function statusFormatter(value, row, index) {
if (value == 1) {
return '<span class="label label-success">正常</span>';
} else {
return '<span class="label label-danger">锁定</span>';
}
}
// 操作按钮事件
window.actionEvents = {
'click .update': function (e, value, row, index) {
alert('You click update icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .delete': function (e, value, row, index) {
alert('You click delete icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
// 展开内容
function detailFormatter(index, row) {
var html = [];
$.each(row, function (key, value) {
html.push('<p><b>' + key + ':</b> ' + value + '</p>');
});
return html.join('');
}
// 动态高度
function getHeight() {
return $(window).height() - 20;
}
</script>
</body>
</html>

View File

@ -0,0 +1,110 @@
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>角色管理</title>
<link href="${basePath}/resources/zheng-admin/plugins/bootstrap-3.3.0/css/bootstrap.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/material-design-iconic-font-2.2.0/css/material-design-iconic-font.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/bootstrap-table.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/waves-0.7.5/waves.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/css/common.css" rel="stylesheet"/>
</head>
<body>
<div id="main">
<div id="toolbar">
<shiro:hasPermission name="upms:role:create"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增角色</a></shiro:hasPermission>
<shiro:hasPermission name="upms:role:update"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑角色</a></shiro:hasPermission>
<shiro:hasPermission name="upms:role:delete"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除角色</a></shiro:hasPermission>
</div>
<table id="table"></table>
</div>
<script src="${basePath}/resources/zheng-admin/plugins/jquery.1.12.4.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-3.3.0/js/bootstrap.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/bootstrap-table.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/waves-0.7.5/waves.min.js"></script>
<script src="${basePath}/resources/zheng-admin/js/common.js"></script>
<style>
body{font-size: 12px;}
.table i{font-size: 12px; color: #000;}
.bootstrap-table .table>thead>tr>th{border-bottom: none;}
</style>
<script>
$(function() {
// bootstrap table初始化
$('#table').bootstrapTable({
url: '${basePath}/manage/role/list',
height: getHeight(),
striped: true,
search: true,
showRefresh: true,
showColumns: true,
minimumCountColumns: 2,
clickToSelect: true,
detailView: true,
detailFormatter: 'detailFormatter',
pagination: true,
toolbar: '#toolbar',
columns: [
{field: 'state', checkbox: true},
{field: 'roleId', title: '编号', sortable: true, align: 'center'},
{field: 'name', title: '角色名称'},
{field: 'description', title: '角色描述'},
{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents'}
]
}).on('all.bs.table', function (e, name, args) {
$('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="popover"]').popover();
});
$(window).resize(function () {
$('#table').bootstrapTable('resetView', {
height: getHeight()
});
});
});
// 格式化操作按钮
function actionFormatter(value, row, index) {
return [
'<a class="update" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
].join('');
}
// 操作按钮事件
window.actionEvents = {
'click .update': function (e, value, row, index) {
alert('You click update icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .delete': function (e, value, row, index) {
alert('You click delete icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
// 展开内容
function detailFormatter(index, row) {
var html = [];
$.each(row, function (key, value) {
html.push('<p><b>' + key + ':</b> ' + value + '</p>');
});
return html.join('');
}
// 动态高度
function getHeight() {
return $(window).height() - 20;
}
</script>
</body>
</html>

View File

@ -0,0 +1,137 @@
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>用户管理</title>
<link href="${basePath}/resources/zheng-admin/plugins/bootstrap-3.3.0/css/bootstrap.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/material-design-iconic-font-2.2.0/css/material-design-iconic-font.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/bootstrap-table.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/plugins/waves-0.7.5/waves.min.css" rel="stylesheet"/>
<link href="${basePath}/resources/zheng-admin/css/common.css" rel="stylesheet"/>
</head>
<body>
<div id="main">
<div id="toolbar">
<shiro:hasPermission name="upms:user:create"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增用户</a></shiro:hasPermission>
<shiro:hasPermission name="upms:user:update"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑用户</a></shiro:hasPermission>
<shiro:hasPermission name="upms:user:delete"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除用户</a></shiro:hasPermission>
</div>
<table id="table"></table>
</div>
<script src="${basePath}/resources/zheng-admin/plugins/jquery.1.12.4.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-3.3.0/js/bootstrap.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/bootstrap-table.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/bootstrap-table-1.11.0/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="${basePath}/resources/zheng-admin/plugins/waves-0.7.5/waves.min.js"></script>
<script src="${basePath}/resources/zheng-admin/js/common.js"></script>
<style>
body{font-size: 12px;}
.table i{font-size: 12px; color: #000;}
.bootstrap-table .table>thead>tr>th{border-bottom: none;}
</style>
<script>
$(function() {
// bootstrap table初始化
$('#table').bootstrapTable({
url: '${basePath}/manage/user/list',
height: getHeight(),
striped: true,
search: true,
showRefresh: true,
showColumns: true,
minimumCountColumns: 2,
clickToSelect: true,
detailView: true,
detailFormatter: 'detailFormatter',
pagination: true,
toolbar: '#toolbar',
columns: [
{field: 'state', checkbox: true},
{field: 'userId', title: '编号', sortable: true, align: 'center'},
{field: 'username', title: '帐号'},
{field: 'realname', title: '姓名'},
{field: 'avatar', title: '头像', align: 'center', formatter: 'avatarFormatter'},
{field: 'phone', title: '电话'},
{field: 'email', title: '邮箱'},
{field: 'sex', title: '性别', formatter: 'sexFormatter'},
{field: 'locked', title: '状态', sortable: true, align: 'center', formatter: 'statusFormatter'},
{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents'}
]
}).on('all.bs.table', function (e, name, args) {
$('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="popover"]').popover();
});
$(window).resize(function () {
$('#table').bootstrapTable('resetView', {
height: getHeight()
});
});
});
// 格式化操作按钮
function actionFormatter(value, row, index) {
return [
'<a class="update" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
].join('');
}
// 格式化图标
function avatarFormatter(value, row, index) {
return '<img src="${basePath}' + value + '" style="width:20px;height:20px;"/>';
}
// 格式化性别
function sexFormatter(value, row, index) {
if (value == 1) {
return '男';
}
if (value == 2) {
return '女';
}
return '-';
}
// 格式化状态
function statusFormatter(value, row, index) {
if (value == 1) {
return '<span class="label label-danger">锁定</span>';
} else {
return '<span class="label label-success">正常</span>';
}
}
// 操作按钮事件
window.actionEvents = {
'click .update': function (e, value, row, index) {
alert('You click update icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .delete': function (e, value, row, index) {
alert('You click delete icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
// 展开内容
function detailFormatter(index, row) {
var html = [];
$.each(row, function (key, value) {
html.push('<p><b>' + key + ':</b> ' + value + '</p>');
});
return html.join('');
}
// 动态高度
function getHeight() {
return $(window).height() - 20;
}
</script>
</body>
</html>