表头固定

master
zengwh 5 years ago
parent 0bda2a0c95
commit e35996f9b2

2
.gitignore vendored

@ -1,3 +1,3 @@
/power-service/target/
target
/.idea/
*.iml

@ -55,10 +55,6 @@ public class LoginController {
//添加进操作日志
Power_Log log = new Power_Log();
if(user != null){
//如处于登录状态,先清除缓存
//CacheManager.removeCacheByObject(user);
//记住
MyCookieUtil.remember(request, response);
//存session密码置空
//是否记住密码功能
MyCookieUtil.remember(request, response);

@ -62,8 +62,17 @@
}
//重设表格高度
function reloadTableHeight(tableId) {
$("#"+tableId+".fixed-table-container").css({ "padding-bottom": "0px", height: $("#"+tableId+".fixed-table-body table").height() + 20 });
//获取表格内容高度
var height = $(".fixed-table-body #"+tableId).height();
//刷新
$('#'+tableId).bootstrapTable('resetView', { height: "auto" });
//计算body所需高度
var tableBodyHeight = height-6;
//赋值body高度且定义最高高度
if(maxHeight == 0){
maxHeight = tableBodyHeight;
}
$(".fixed-table-body").css({height:tableBodyHeight,"max-height":maxHeight});
}
</script>
<%@ include file="/WEB-INF/jspf/confirmJsp.jspf"%>

@ -36,11 +36,6 @@
width:50%;
float:left;
}
/*按钮组*/
.btns{
text-align: right;
margin-bottom: 5px;
}
/*模态框*/
.modal-header{
text-align: center;
@ -59,9 +54,6 @@
.operBtns{
margin-left:10px;
}
.tableDiv{
margin-left:14px;
}
.shortInput{
width:80px;
}

@ -48,11 +48,6 @@
width:50%;
float:left;
}
/*按钮组*/
.btns{
text-align: right;
margin-bottom: 10px;
}
/*模态框*/
.modal-header{
text-align: center;
@ -69,11 +64,6 @@
margin-left: 38px;
margin-bottom: 16px;
}
.tableDiv{
margin-left:15px;
margin-right:25px;
padding-right: 15px;
}
.shortInput{
width:80px;
}

@ -71,69 +71,52 @@
padding-top: 3px;
margin-left: 2%;
}
/**查询按钮组*/
.btnsDiv {
width: 100%;
height: 32px;
text-align: right;
padding-top: 5px;
padding-right: 22px;
}
/**表格div*/
.tableDiv {
margin-left: 14px;
margin-top: -9px !important;
}
</style>
</head>
<body>
<div class="main">
<div class="">
<div class="panel-heading"><h4>其他管理/日志管理</h4></div>
<hr>
<div class="searchDiv">
<div class="searchInput left" style="margin-left: 14px">
<div class="searchElement left">
<div style="width: 100%;height: 100%;overflow: auto">
<div class="row" style="margin-right: 0px;">
<div class="col-md-12">
<div class="panel-heading"><h4>其他管理/日志管理</h4></div>
<hr>
<form class="form-inline searchDiv" role="form">
<div class="form-group">
<label class="labelDiv">日志主题:</label>
</div>
<div class="searchInputElement left">
<input type="text" class="form-control input-sm" id="logTitle" maxlength="50">
</div>
</div>
<div class="searchInput left">
<div class="searchElement left">
<label class="labelDiv">日志内容:</label>
</div>
<div class="searchInputElement left">
<input type="text" class="form-control input-sm" id="logContent" maxlength="500">
<div class="searchInput left">
<div class="searchElement left">
<label class="labelDiv">日志内容:</label>
</div>
<div class="searchInputElement left">
<input type="text" class="form-control input-sm" id="logContent" maxlength="500">
</div>
</div>
</div>
<div class="searchInput left">
<div class="searchElement left">
<label class="labelDiv">操作人:</label>
<div class="searchInput left">
<div class="searchElement left">
<label class="labelDiv">操作人:</label>
</div>
<div class="searchInputElement left">
<input type="text" class="form-control input-sm" id="creater" maxlength="8">
</div>
</div>
<div class="searchInputElement left">
<input type="text" class="form-control input-sm" id="creater" maxlength="8">
<div class="dateSearchDiv left">
<div class="dateLabelDiv left">
<label class="labelDiv">操作时间:</label>
</div>
<div class="dateSearchInput left">
<input type="text" class="form-control input-sm" id="startTime1" placeholder="开始时间" maxlength="10" autocomplete="off">
</div>
<div class="dateSearchInput left">
<input type="text" class="form-control input-sm" id="endTime1" placeholder="结束时间" maxlength="10" autocomplete="off">
</div>
</div>
</div>
<div class="dateSearchDiv left">
<div class="dateLabelDiv left">
<label class="labelDiv">操作时间:</label>
<div class="left">
<button type="button" class="btn btn-sm btn-primary" onclick="refreshTable()">查询</button>
</div>
<div class="dateSearchInput left">
<input type="text" class="form-control input-sm" id="startTime1" placeholder="开始时间" maxlength="10" autocomplete="off">
</div>
<div class="dateSearchInput left">
<input type="text" class="form-control input-sm" id="endTime1" placeholder="结束时间" maxlength="10" autocomplete="off">
</div>
</div>
<div class="left">
<button type="button" class="btn btn-sm btn-primary" onclick="refreshTable()">查询</button>
</div>
</div>
<div class="btnsDiv">
<div class="btns">
<pm:myPermissions permissions="/otherManage/exportExcel">
<button type="button" class="btn btn-sm btn-primary" onclick="exportExcel()"><i class="fa fa-reply"></i>导出
</button>

@ -36,11 +36,6 @@
width:50%;
float:left;
}
/*按钮组*/
.btns{
text-align: right;
margin-bottom: 5px;
}
/*模态框*/
.modal-header{
text-align: center;
@ -56,9 +51,6 @@
margin-left: 38px;
margin-bottom: 16px;
}
.tableDiv{
margin-left:14px;
}
.shortInput{
width:80px;
}

@ -40,12 +40,6 @@
width:50%;
float:left;
}
/*按钮组*/
.btns{
margin-top:5px;
text-align: right;
margin-bottom: 5px;
}
/*模态框*/
.modal-header{
text-align: center;
@ -64,9 +58,6 @@
.operBtns{
margin-left:10px;
}
.tableDiv{
margin-left:14px;
}
.shortInput{
width:80px;
}
@ -103,45 +94,43 @@
<div class="panel-heading"><h4>基本管理/用户管理</h4></div>
<hr>
<form class="form-inline searchDiv" role="form">
<div class="">
<div class="form-group">
<label for="user_name">账号:</label>
<input type="text" class="form-control input-sm" id="user_name" maxlength="16"/>
</div>
<%-- <div class="form-group">
<label for="user_email">邮箱地址:</label>
<input type="text" class="form-control input-sm" id="user_email" maxlength="25"/>
</div>--%>
<div class="form-group">
<label>所属角色:</label>
<div class=" form-group form-inline">
<select class=" form-control input-sm" style="width:106px" id="roleId">
<option value="">全部</option>
</select>
</div>
</div>
<div class="form-group">
<label for="dept_id">所属科室:</label>
<div class=" form-group form-inline">
<select class="form-control input-sm" style="width:106px" id="dept_id">
<option value="">全部</option>
</select>
</div>
<div class="form-group">
<label for="user_name">账号:</label>
<input type="text" class="form-control input-sm" id="user_name" maxlength="16"/>
</div>
<%-- <div class="form-group">
<label for="user_email">邮箱地址:</label>
<input type="text" class="form-control input-sm" id="user_email" maxlength="25"/>
</div>--%>
<div class="form-group">
<label>所属角色:</label>
<div class=" form-group form-inline">
<select class=" form-control input-sm" style="width:106px" id="roleId">
<option value="">全部</option>
</select>
</div>
<div class="form-group">
<label for="effective">是否有效:</label>
<div class=" form-group form-inline">
<select class=" form-control input-sm" id="effective">
<option value="">全部</option>
<option value="1">是</option>
<option value="0">否</option>
</select>
</div>
</div>
<div class="form-group">
<label for="dept_id">所属科室:</label>
<div class=" form-group form-inline">
<select class="form-control input-sm" style="width:106px" id="dept_id">
<option value="">全部</option>
</select>
</div>
<div class="form-group">
<button type="button" id="queryBtn" class="btn btn-primary btn-sm form-group">查询</button>
</div>
<div class="form-group">
<label for="effective">是否有效:</label>
<div class=" form-group form-inline">
<select class=" form-control input-sm" id="effective">
<option value="">全部</option>
<option value="1">是</option>
<option value="0">否</option>
</select>
</div>
</div>
<div class="form-group">
<button type="button" id="queryBtn" class="btn btn-primary btn-sm form-group">查询</button>
</div>
</form>
</div>
</div>
@ -159,7 +148,9 @@
<button type="button" class="btn btn-primary btn-sm" onclick="exportExcel()">导出Excel</button>
</pm:myPermissions>
</div>
<table id="bootstrapTable" class="table text-nowrap table-striped"></table>
<div class="tableDiv">
<table id="bootstrapTable" class="table text-nowrap table-striped"></table>
</div>
</div>
<!-- 模态框Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">

@ -22,4 +22,16 @@
margin-left: 5px;
margin-top: 3px;
height: 30px;
}
/*表格外层div*/
.tableDiv{
margin-left:14px;
margin-right:15px;
}
/*按钮组*/
.btns{
margin-top:5px;
margin-right:15px;
text-align: right;
margin-bottom: 5px;
}

@ -1,5 +1,7 @@
var form = ''
var pageNumber = 1;
//定义表格内容最大高度
var maxHeight = 0;
$(function(){
var columns = [];
columns.push({

@ -1,5 +1,7 @@
//初始化时间控件
initDateInput(1);
//定义表格内容最大高度
var maxHeight = 0;
var setting = {
view:{
fontCss : {"font-family": "微软雅黑","color":"blue"}

@ -3,6 +3,8 @@
*/
var pageNumber = 1;
var form = '';
//定义表格内容最大高度
var maxHeight = 0;
$(function(){
$('#myModal').modal('hide');
//先销毁表格

@ -1,186 +1,188 @@
var pageNumber=1;
var form = '';
$(function(){
$('#myModal').modal('hide');
loadDept();
loadRole();
//先销毁表格
$('#bootstrapTable').bootstrapTable({
//表格高度
//height: getHeight(),
method : 'get',
url :path+ "/user/pageList",//请求路径
striped : true, //是否显示行间隔色
pageNumber : 1, //初始化加载第一页
pagination : true,//是否分页
sidePagination : 'server',//server:服务器端分页|client前端分页
pageSize : 10,//单页记录数
pageList : [ 5, 10, 20, 30 ],//可选择单页记录数
cache: false,
paginationPreText : '上一页',
paginationNextText : '下一页',
queryParams : function(params) {//上传服务器的参数
var temp = {//如果是在服务器端实现分页limit、offset这两个参数是必须的
limit : params.limit, // 每页显示数量
offset : params.offset, // SQL语句起始索引
page : (params.offset / params.limit) + 1, //当前页码
userName:$("#user_name").val(),
userEmail:$("#user_email").val(),
searchRoleId:$("#roleId").val(),
deptId : $("#dept_id option:selected").val(),
effective : $("#effective option:selected").val(),
};
return temp;
//定义表格内容最大高度
var maxHeight = 0;
$(function(){
$('#myModal').modal('hide');
loadDept();
loadRole();
//先销毁表格
$('#bootstrapTable').bootstrapTable({
//表格高度
//height: getHeight(),
method : 'get',
url :path+ "/user/pageList",//请求路径
striped : true, //是否显示行间隔色
pageNumber : 1, //初始化加载第一页
pagination : true,//是否分页
sidePagination : 'server',//server:服务器端分页|client前端分页
pageSize : 10,//单页记录数
pageList : [ 5, 10, 20, 30 ],//可选择单页记录数
cache: false,
paginationPreText : '上一页',
paginationNextText : '下一页',
queryParams : function(params) {//上传服务器的参数
var temp = {//如果是在服务器端实现分页limit、offset这两个参数是必须的
limit : params.limit, // 每页显示数量
offset : params.offset, // SQL语句起始索引
page : (params.offset / params.limit) + 1, //当前页码
userName:$("#user_name").val(),
userEmail:$("#user_email").val(),
searchRoleId:$("#roleId").val(),
deptId : $("#dept_id option:selected").val(),
effective : $("#effective option:selected").val(),
};
return temp;
},
columns : [{
checkbox:true
},
columns : [{
checkbox:true
},
{
title:'序号',
field:'no',
formatter: function (value, row, index) {
//获取每页显示的数量
var pageSize = $('#bootstrapTable').bootstrapTable('getOptions').pageSize;
//获取当前是第几页
if(pageNumber == 1){
pageNumber = $('#bootstrapTable').bootstrapTable('getOptions').pageNumber;
}
//返回序号注意index是从0开始的所以要加上1
return pageSize * (pageNumber - 1) + index + 1;
}
},
{
title:'账号',
field:'userName',
},
{
title:'姓名',
field:'name',
},
{
title:'性别',
field:'userSex',
formatter: function (value, row, index) {
if(value ==1){
return '女'
}else if(value ==0){
return '男'
}
}
},
{
title:'年龄',
field:'userAge',
},
{
title:'移动电话',
field:'userTel',
},
{
title:'邮箱地址',
field:'userEmail',
},
{
title:'用户职位',
field:'userPosition',
},
{
title:'所属角色',
field:'roleName',
},
{
title:'所属科室',
field:'powerDepts',
formatter:paramsMatter,
},
{
title:'是否有效',
field:'effective',
formatter: function (value, row, index) {
if(value ==1){
return '是'
}else if(value ==0){
return '否'
}
{
title:'序号',
field:'no',
formatter: function (value, row, index) {
//获取每页显示的数量
var pageSize = $('#bootstrapTable').bootstrapTable('getOptions').pageSize;
//获取当前是第几页
if(pageNumber == 1){
pageNumber = $('#bootstrapTable').bootstrapTable('getOptions').pageNumber;
}
},
{
title:'创建时间',
field:'createDate',
},
{
title:'创建人',
field:'creater',
},
{
title:'修改时间',
field:'updateDate',
},
{
title:'修改人',
field:'updater',
},
{
title:'操作',
field:'userId', formatter: function(value,row,index){
var editanddrop = '';
if(row.isUpdate == 1){
editanddrop += '<button type="button" onclick="edit('+row.userId+')" class="btn btn-info operBtns btn-sm" >编辑</button>';
}
if(row.isDelete == 1){
editanddrop += '<button type="button" onclick="drop('+row.userId+')" class="btn btn-danger operBtns btn-sm">删除</button>';
}
return editanddrop;
//返回序号注意index是从0开始的所以要加上1
return pageSize * (pageNumber - 1) + index + 1;
}
},
{
title:'账号',
field:'userName',
},
{
title:'姓名',
field:'name',
},
{
title:'性别',
field:'userSex',
formatter: function (value, row, index) {
if(value ==1){
return '女'
}else if(value ==0){
return '男'
}
}
],
onLoadSuccess: function(){ //加载成功时执行
$(".page-list").show();
$("th").css({'text-align':'center','vertical-align':'middle'});
$("td").css({'text-align':'center','vertical-align':'middle'});
reloadTableHeight("bootstrapTable");
},
//监听分页点击事件
onPageChange: function(num, type) {
pageNumber = num;
{
title:'年龄',
field:'userAge',
},
{
title:'移动电话',
field:'userTel',
},
{
title:'邮箱地址',
field:'userEmail',
},
{
title:'用户职位',
field:'userPosition',
},
//选中单个复选框
onCheck:function(row){
var checks = $("#checks").val();
var userNames = $("#userNames").val();
$("#checks").val(checks+=row.userId + ",");
$("#userNames").val(userNames+=row.userName + ",");
{
title:'所属角色',
field:'roleName',
},
//取消单个复选框
onUncheck:function(row){
var checks = $("#checks").val();
var userNames = $("#userNames").val();
checks = checks.replace(row.userId + ",","");
userNames = userNames.replace(row.userName + ",","");
$("#checks").val(checks);
$("#userNames").val(userNames);
{
title:'所属科室',
field:'powerDepts',
formatter:paramsMatter,
},
//全选
onCheckAll:function(rows){
$("#checks").val("");
$("#userNames").val("");
var checks = '';
var userNames = '';
for(var i=0;i<rows.length;i++)
{
checks += rows[i].userId + ","
userNames += rows[i].userName + ","
{
title:'是否有效',
field:'effective',
formatter: function (value, row, index) {
if(value ==1){
return '是'
}else if(value ==0){
return '否'
}
}
$("#checks").val(checks);
$("#userNames").val(userNames);
},
//全不选
onUncheckAll: function (rows) {
$("#checks").val("");
$("#userNames").val("");
{
title:'创建时间',
field:'createDate',
},
{
title:'创建人',
field:'creater',
},
{
title:'修改时间',
field:'updateDate',
},
{
title:'修改人',
field:'updater',
},
{
title:'操作',
field:'userId', formatter: function(value,row,index){
var editanddrop = '';
if(row.isUpdate == 1){
editanddrop += '<button type="button" onclick="edit('+row.userId+')" class="btn btn-info operBtns btn-sm" >编辑</button>';
}
if(row.isDelete == 1){
editanddrop += '<button type="button" onclick="drop('+row.userId+')" class="btn btn-danger operBtns btn-sm">删除</button>';
}
return editanddrop;
}
}
});
],
onLoadSuccess: function(){ //加载成功时执行
$(".page-list").show();
$("th").css({'text-align':'center','vertical-align':'middle'});
$("td").css({'text-align':'center','vertical-align':'middle'});
reloadTableHeight("bootstrapTable");
},
//监听分页点击事件
onPageChange: function(num, type) {
pageNumber = num;
},
//选中单个复选框
onCheck:function(row){
var checks = $("#checks").val();
var userNames = $("#userNames").val();
$("#checks").val(checks+=row.userId + ",");
$("#userNames").val(userNames+=row.userName + ",");
},
//取消单个复选框
onUncheck:function(row){
var checks = $("#checks").val();
var userNames = $("#userNames").val();
checks = checks.replace(row.userId + ",","");
userNames = userNames.replace(row.userName + ",","");
$("#checks").val(checks);
$("#userNames").val(userNames);
},
//全选
onCheckAll:function(rows){
$("#checks").val("");
$("#userNames").val("");
var checks = '';
var userNames = '';
for(var i=0;i<rows.length;i++)
{
checks += rows[i].userId + ","
userNames += rows[i].userName + ","
}
$("#checks").val(checks);
$("#userNames").val(userNames);
},
//全不选
onUncheckAll: function (rows) {
$("#checks").val("");
$("#userNames").val("");
}
});
});
//格式化科室列
function paramsMatter(value, row, index) {
value = '<p class="hidden-xs" title="'+value+'">'+value+'</p>'

@ -49,8 +49,10 @@ public class CacheManager {
public static void putCache(String key, Cache obj) {
cacheMap.put(key, obj);
//移除不属于该token的
Power_UserVo powerUser = (Power_UserVo)obj.getValue();
CacheManager.removeCacheByObject(powerUser,key);
if(obj.getValue() instanceof Power_UserVo) {
Power_UserVo powerUser = (Power_UserVo) obj.getValue();
CacheManager.removeCacheByObject(powerUser, key);
}
}
public static Cache getCacheInfo(String key) {

Loading…
Cancel
Save