优化 table 打印内容中包含过大图片时的显示问题

pull/1249/head
贤心 2023-05-04 09:51:26 +08:00
parent f59f29ec11
commit 792e0709fc
1 changed files with 13 additions and 12 deletions

View File

@ -1881,15 +1881,16 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
}
break;
case 'LAYTABLE_PRINT': // 打印
var printWin = window.open('about:blank', '_blank')
,style = ['<style>'
,'body{font-size: 12px; color: #5F5F5F;}'
,'table{width: 100%; border-collapse: collapse; border-spacing: 0;}'
,'th,td{line-height: 20px; padding: 9px 15px; border: 1px solid #ccc; text-align: left; font-size: 12px; color: #5F5F5F;}'
,'a{color: #5F5F5F; text-decoration:none;}'
,'*.layui-hide{display: none}'
,'</style>'].join('')
,html = $(that.layHeader.html()); //输出表头
var printWin = window.open('about:blank', '_blank');
var style = ['<style>',
'body{font-size: 12px; color: #5F5F5F;}',
'table{width: 100%; border-collapse: collapse; border-spacing: 0;}',
'th,td{line-height: 20px; padding: 9px 15px; border: 1px solid #ccc; text-align: left; font-size: 12px; color: #5F5F5F;}',
'a{color: #5F5F5F; text-decoration:none;}',
'img{max-height: 100%;}',
'*.layui-hide{display: none}',
'</style>'].join('')
var html = $(that.layHeader.html()); // 输出表头
html.append(that.layMain.find('table').html()); // 输出表体
html.append(that.layTotal.find('table').html()) // 输出合计行