refactor: 微调脚本与样式适配固定表头是表格高度

This commit is contained in:
Argo Zhang 2020-03-10 10:50:29 +08:00
parent 41d967c910
commit 625267d354
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
4 changed files with 7 additions and 12 deletions

View File

@ -6,6 +6,7 @@
查询结果
</div>
<div class="card-body">
@TableInfoTemplate
<Table @ref="Table" Id="@Id" FixedHeader="@FixedHeader" ShowToolBar="true" ShowExtendButtons="true" ShowRefresh="true" ShowSearch="true" ShowCheckbox="true" ShowDefaultButtons="true" QueryModel="QueryModel" TItem="TItem" SubmitModalTitle="@SubmitModalTitle" OnQuery="QueryData" OnAdd="OnAdd" OnDelete="OnDelete" OnSave="OnSave" OnResetSearch="OnResetSearch">
<TableToolbarTemplate>
@TableToolbarTemplate

View File

@ -136,7 +136,7 @@ nav .dropdown .nav-link-close.dropdown-toggle:after {
}
.bootstrap-table .table-fixed {
height: 388px;
height: 324px;
overflow: hidden;
}
@ -149,7 +149,7 @@ nav .dropdown .nav-link-close.dropdown-toggle:after {
}
.bootstrap-table .fixed-table-body {
min-height: 348px;
min-height: 284px;
}
.bootstrap-table .fixed-table-body table {

View File

@ -187,16 +187,10 @@
$(header).width($(element).width());
});
},
resetTableHeight(source) {
resetTableHeight: function (source) {
var table = source;
var height = 0;
do {
height += source.position().top;
source = source.parent();
if (source.hasClass('tab-content')) break;
}
while (source.length === 1);
height = $(window).height() - height - 15 - 38;
var height = source.parents('.bootstrap-table').position().top;
height = $(window).height() - height - 184 - 51 - 45 - 37;
table.height(height);
},
initTable: function (id, firstRender) {

View File

@ -474,7 +474,7 @@
marginHeight += calcPrevHeight($prev);
marginHeight += calcParentHeight(element.parent());
}
return Math.max(settings.minHeight, $(window).height() - $('header').outerHeight(true) - $('footer').outerHeight(true) - marginHeight - 15 - 10);
return Math.max(settings.minHeight, $(window).height() - $('header').outerHeight(true) - $('footer').outerHeight(true) - marginHeight - 20 - 10);
};
}