修改表格高度

master
zengwh 5 years ago
parent b7100325e2
commit 8dfd73c39a

@ -60,5 +60,10 @@
$("#pageNum").val(pageNum) $("#pageNum").val(pageNum)
},500) },500)
} }
//重设表格高度
function reloadTableHeight(tableId) {
$("#"+tableId+".fixed-table-container").css({ "padding-bottom": "0px", height: $("#"+tableId+".fixed-table-body table").height() + 20 });
$('#'+tableId).bootstrapTable('resetView', { height: "auto" });
}
</script> </script>
<%@ include file="/WEB-INF/jspf/confirmJsp.jspf"%> <%@ include file="/WEB-INF/jspf/confirmJsp.jspf"%>

@ -75,11 +75,11 @@
</style> </style>
</head> </head>
<body> <body>
<div style="width: 100%"> <div style="width: 100%;height: 100%;overflow: auto">
<input type="hidden" id="roleId" value="${user.roleId}"> <input type="hidden" id="roleId" value="${user.roleId}">
<input type="hidden" id="checks"> <input type="hidden" id="checks">
<input type="hidden" id="userNames"> <input type="hidden" id="userNames">
<div class="row"> <div class="row" style="margin-right: 0px;">
<div class="col-md-12"> <div class="col-md-12">
<div class="panel-heading"><h4>基本管理/科室管理</h4></div> <div class="panel-heading"><h4>基本管理/科室管理</h4></div>
<hr> <hr>

@ -270,7 +270,7 @@
<div class="page-content-wrapper"> <div class="page-content-wrapper">
<div class="page-content"> <div class="page-content">
<div class="container-fluid"> <div class="container-fluid">
<iframe class="row-fluid" style="height:78%;width:100%;" id="iFrame1" name="iFrame1" scrolling="no" frameborder="0"></iframe> <iframe class="row-fluid" style="width:100%;" id="iFrame1" name="iFrame1" scrolling="no" frameborder="0"></iframe>
</div> </div>
</div> </div>
</div> </div>
@ -288,5 +288,14 @@
</div> </div>
<%@ include file="/WEB-INF/jspf/webSocket.jspf" %> <%@ include file="/WEB-INF/jspf/webSocket.jspf" %>
<script type="text/javascript" src="${path}/static/js/menu.js?time=2019-12-15"></script> <script type="text/javascript" src="${path}/static/js/menu.js?time=2019-12-15"></script>
<script type="text/javascript">
$(document).ready(function () {
var headerHeight = $(".main-header").height() || 0;
var footerHeight = ($(".main-footer").height() || 0) + 31;
var windowHeight = $(window).height();
$("#iFrame1").css("height", windowHeight - headerHeight - footerHeight - 36);
$("#indexTreeMenu").css("height",windowHeight - headerHeight);
})
</script>
</body> </body>
</html> </html>

@ -75,10 +75,10 @@
</style> </style>
</head> </head>
<body> <body>
<div style="width: 100%"> <div style="width: 100%;height: 100%;overflow: auto">
<input type="hidden" id="checks"> <input type="hidden" id="checks">
<input type="hidden" id="userNames"> <input type="hidden" id="userNames">
<div class="row"> <div class="row" style="margin-right: 0px;">
<div class="col-md-12"> <div class="col-md-12">
<div class="panel-heading"><h4>基本管理/角色管理</h4></div> <div class="panel-heading"><h4>基本管理/角色管理</h4></div>
<hr> <hr>

@ -95,10 +95,10 @@
</style> </style>
</head> </head>
<body> <body>
<div style="width: 100%"> <div style="width: 100%;height: 100%;overflow: auto">
<input type="hidden" id="checks"> <input type="hidden" id="checks">
<input type="hidden" id="userNames"> <input type="hidden" id="userNames">
<div class="row"> <div class="row" style="margin-right: 0px;">
<div class="col-md-12"> <div class="col-md-12">
<div class="panel-heading"><h4>基本管理/用户管理</h4></div> <div class="panel-heading"><h4>基本管理/用户管理</h4></div>
<hr> <hr>
@ -159,9 +159,7 @@
<button type="button" class="btn btn-primary btn-sm" onclick="exportExcel()">导出Excel</button> <button type="button" class="btn btn-primary btn-sm" onclick="exportExcel()">导出Excel</button>
</pm:myPermissions> </pm:myPermissions>
</div> </div>
<div class="tableDiv"> <table id="bootstrapTable" class="table text-nowrap table-striped"></table>
<table id="bootstrapTable" class="table text-nowrap table-bordered"></table>
</div>
</div> </div>
<!-- 模态框Modal --> <!-- 模态框Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false"> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">

@ -76,7 +76,7 @@ $(function(){
//先销毁表格 //先销毁表格
$('#bootstrapTable').bootstrapTable({ $('#bootstrapTable').bootstrapTable({
//表格高度 //表格高度
height: getHeight(), //height: getHeight(),
method : 'get', method : 'get',
url :path+ "/dept/pageList",//请求路径 url :path+ "/dept/pageList",//请求路径
striped : true, //是否显示行间隔色 striped : true, //是否显示行间隔色
@ -103,8 +103,9 @@ $(function(){
columns : columns, columns : columns,
onLoadSuccess: function(){ //加载成功时执行 onLoadSuccess: function(){ //加载成功时执行
$(".page-list").show(); $(".page-list").show();
$("th").css({'text-align':'center','vertical-align':'middle'}) $("th").css({'text-align':'center','vertical-align':'middle'});
$("td").css({'text-align':'center','vertical-align':'middle'}) $("td").css({'text-align':'center','vertical-align':'middle'});
reloadTableHeight("bootstrapTable");
}, },
//监听分页点击事件 //监听分页点击事件
onPageChange: function(num, type) { onPageChange: function(num, type) {
@ -387,10 +388,6 @@ $('#queryBtn').click(function () {
$("#checks").val(""); $("#checks").val("");
refresh(); refresh();
}) })
//获取table的高度
function getHeight() {
return $(window).height() * 0.8;
}
//刷新表格 //刷新表格
function refresh() { function refresh() {
$('#bootstrapTable').bootstrapTable('refresh',{ $('#bootstrapTable').bootstrapTable('refresh',{

@ -8,7 +8,7 @@ $(function(){
//先销毁表格 //先销毁表格
$('#bootstrapTable').bootstrapTable({ $('#bootstrapTable').bootstrapTable({
//表格高度 //表格高度
height: getHeight(), //height: getHeight(),
method : 'get', method : 'get',
url : path+ "/role/pageList",//请求路径 url : path+ "/role/pageList",//请求路径
striped : true, //是否显示行间隔色 striped : true, //是否显示行间隔色
@ -100,8 +100,9 @@ $(function(){
], ],
onLoadSuccess: function(){ //加载成功时执行 onLoadSuccess: function(){ //加载成功时执行
$(".page-list").show(); $(".page-list").show();
$("th").css({'text-align':'center','vertical-align':'middle'}) $("th").css({'text-align':'center','vertical-align':'middle'});
$("td").css({'text-align':'center','vertical-align':'middle'}) $("td").css({'text-align':'center','vertical-align':'middle'});
reloadTableHeight("bootstrapTable");
}, },
//监听分页点击事件 //监听分页点击事件
onPageChange: function(num, type) { onPageChange: function(num, type) {

@ -7,7 +7,7 @@ var form = '';
//先销毁表格 //先销毁表格
$('#bootstrapTable').bootstrapTable({ $('#bootstrapTable').bootstrapTable({
//表格高度 //表格高度
height: getHeight(), //height: getHeight(),
method : 'get', method : 'get',
url :path+ "/user/pageList",//请求路径 url :path+ "/user/pageList",//请求路径
striped : true, //是否显示行间隔色 striped : true, //是否显示行间隔色
@ -136,8 +136,9 @@ var form = '';
], ],
onLoadSuccess: function(){ //加载成功时执行 onLoadSuccess: function(){ //加载成功时执行
$(".page-list").show(); $(".page-list").show();
$("th").css({'text-align':'center','vertical-align':'middle'}) $("th").css({'text-align':'center','vertical-align':'middle'});
$("td").css({'text-align':'center','vertical-align':'middle'}) $("td").css({'text-align':'center','vertical-align':'middle'});
reloadTableHeight("bootstrapTable");
}, },
//监听分页点击事件 //监听分页点击事件
onPageChange: function(num, type) { onPageChange: function(num, type) {
@ -470,10 +471,6 @@ function saveForm(){
}) })
} }
} }
//获取table的高度
function getHeight() {
return $(window).height() * 0.8;
}
//刷新表格 //刷新表格
function refresh() { function refresh() {
$('#bootstrapTable').bootstrapTable('refresh',{ $('#bootstrapTable').bootstrapTable('refresh',{

Loading…
Cancel
Save