From 707fd941e9af83cce7ecaacf1a141e1cf44ff4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Fri, 21 Apr 2023 08:24:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=BB=9A=20table=20=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E5=A4=9A=E7=BA=A7=E8=A1=A8=E5=A4=B4=E6=9C=80=E5=90=8E=E4=B8=80?= =?UTF-8?q?=E5=88=97=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/modules/table.js b/src/modules/table.js index 6facaaae..39268a07 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -814,20 +814,13 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ if(that.autoColNums > 0 && patchNums >= -colNums && patchNums <= colNums){ var getEndTh = function(th){ - var field, thRet; - th = th || that.layHeader.eq(0).find('thead th:last-child') - layui.each(th, function (thIndex, thElem) { - thElem = $(thElem); - if (!thElem.children('.'+ELEM_GROUP).length) { // 排除合并表头 - field = thElem.attr('data-field'); - thRet = thElem; - } - }) - + var field; + th = th || that.layHeader.eq(0).find('thead > tr:first-child > th:last-child') + field = th.data('field'); if(!field && th.prev()[0]){ return getEndTh(th.prev()) } - return thRet + return th; }; var th = getEndTh(); var key = th.data('key');