fix(table): 修复无数据时,点击右上角工具栏图标出现提示错位的问题 (#2067)

pull/2084/head
贤心 2024-06-28 16:53:32 +08:00 committed by GitHub
parent 1e548d7c48
commit 47728370e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 4 deletions

View File

@ -706,10 +706,11 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
var data = obj.data; var data = obj.data;
var options = obj.config; var options = obj.config;
var openPanel = obj.openPanel; var openPanel = obj.openPanel;
var elem = obj.elem;
if (!data.length) return layer.tips('当前表格无数据', this, {tips: 3}); if (!data.length) return layer.tips('当前表格无数据', elem, {tips: 3});
if(device.ie){ if(device.ie){
layer.tips('导出功能不支持 IE请用 Chrome 等高级浏览器导出', this, { layer.tips('导出功能不支持 IE请用 Chrome 等高级浏览器导出', elem, {
tips: 3 tips: 3
}); });
} else { } else {
@ -736,8 +737,9 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
onClick: function(obj) { onClick: function(obj) {
var data = obj.data; var data = obj.data;
var options = obj.config; var options = obj.config;
var elem = obj.elem;
if (!data.length) return layer.tips('当前表格无数据', this, {tips: 3}); if (!data.length) return layer.tips('当前表格无数据', elem, {tips: 3});
var printWin = window.open('about:blank', '_blank'); var printWin = window.open('about:blank', '_blank');
var style = ['<style>', var style = ['<style>',
'body{font-size: 12px; color: #5F5F5F;}', 'body{font-size: 12px; color: #5F5F5F;}',
@ -2189,7 +2191,8 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
typeof item.onClick === 'function' && item.onClick({ typeof item.onClick === 'function' && item.onClick({
data: data, data: data,
config: options, config: options,
openPanel: openPanel openPanel: openPanel,
elem: othis
}); });
return true; return true;
} }