From 689866c483c3fda7595f8863e8b7281f783d9025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=AB=E7=83=88=E9=B8=9F?= <31432203+mek1986@users.noreply.github.com> Date: Sun, 10 Sep 2023 20:30:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20table=20=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=B9=A6=E5=86=99=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/modules/table.js b/src/modules/table.js index 3c2288cf..332ef5ad 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -1111,7 +1111,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ curr = curr || 1 layui.each(data, function(i1, item1){ - var tds = []; + var tds = []; var tds_fixed = []; var tds_fixed_r = []; var numbers = i1 + options.limit*(curr - 1) + 1; // 序号 @@ -1208,7 +1208,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ case 'numbers': return numbers; //break; - }; + } //解析工具列模板 if(item3.toolbar){ @@ -1771,7 +1771,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ //获取滚动条宽度 Class.prototype.getScrollWidth = function(elem){ - var width = 0; + var width; if(elem){ width = elem.offsetWidth - elem.clientWidth; } else { @@ -1791,19 +1791,19 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ Class.prototype.scrollPatch = function(){ var that = this; var layMainTable = that.layMain.children('table'); - var scollWidth = that.layMain.width() - that.layMain.prop('clientWidth'); // 纵向滚动条宽度 - var scollHeight = that.layMain.height() - that.layMain.prop('clientHeight'); // 横向滚动条高度 + var scrollWidth = that.layMain.width() - that.layMain.prop('clientWidth'); // 纵向滚动条宽度 + var scrollHeight = that.layMain.height() - that.layMain.prop('clientHeight'); // 横向滚动条高度 var getScrollWidth = that.getScrollWidth(that.layMain[0]); // 获取主容器滚动条宽度,如果有的话 var outWidth = layMainTable.outerWidth() - that.layMain.width(); // 表格内容器的超出宽度 // 添加补丁 var addPatch = function(elem){ - if(scollWidth && scollHeight){ + if(scrollWidth && scrollHeight){ elem = elem.eq(0); if(!elem.find('.layui-table-patch')[0]){ var patchElem = $('
'); // 补丁元素 patchElem.find('div').css({ - width: scollWidth + width: scrollWidth }); elem.find('tr').append(patchElem); } @@ -1817,7 +1817,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ // 固定列区域高度 var mainHeight = that.layMain.height(); - var fixHeight = mainHeight - scollHeight; + var fixHeight = mainHeight - scrollHeight; that.layFixed.find(ELEM_BODY).css( 'height', @@ -1832,7 +1832,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ ](HIDE); // 操作栏 - that.layFixRight.css('right', scollWidth - 1); + that.layFixRight.css('right', scrollWidth - 1); }; // 事件处理 @@ -1972,7 +1972,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ printWin.document.write(style + html.prop('outerHTML')); printWin.document.close(); - + if(layui.device('edg').edg){ printWin.onafterprint = printWin.close; printWin.print(); @@ -2319,7 +2319,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ ].join(','); if( $(e.target).is(UNROW) || $(e.target).closest(UNROW)[0]){ return; - }; + } setRowEvent.call(this, 'row'); }).on('dblclick', 'tr', function(){ // 双击行 setRowEvent.call(this, 'rowDouble');