From b71740f4c12afa0553d21d129051de94e3ce2fbc Mon Sep 17 00:00:00 2001 From: jary Date: Thu, 11 Aug 2022 15:28:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=88=97=E8=BF=87?= =?UTF-8?q?=E5=A4=9A=E4=B8=94=E6=97=A0=E6=95=B0=E6=8D=AE=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=95=E9=83=A8=E6=BB=9A=E5=8A=A8=E6=9D=A1?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E4=BE=BF=E6=9F=A5=E7=9C=8B=E6=89=80=E6=9C=89?= =?UTF-8?q?=E7=9A=84=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/table.js b/src/modules/table.js index 25cd0f60..1a710d6e 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -790,7 +790,14 @@ layui.define(['laytpl', 'laypage', 'form', 'util'], function(exports){ } that.setGroupWidth(); - + + // 如果表格内容为空(无数据 或 请求异常) + if (that.layMain.find('tbody').is(":empty")) { + // 将表格宽度设置为跟表头一样的宽度,使之可以出现底部滚动条,以便滚动查看所有字段 + const headerWidth = that.layHeader.first().children('table').width() + that.layMain.find('table').width(headerWidth); + } + that.loading(!0); }; From cc466ff905624c196c7b3c92bec67edca178346f Mon Sep 17 00:00:00 2001 From: key <495214601@qq.com> Date: Tue, 16 Aug 2022 00:36:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93=E5=BC=80?= =?UTF-8?q?=E5=90=AFeven:true=E5=90=8E,=E5=A4=9A=E8=A1=8C=E8=A1=A8?= =?UTF-8?q?=E5=A4=B4=E4=B9=9F=E4=BC=9A=E8=B7=9F=E7=9D=80=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=8F=98=E8=89=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/css/layui.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/css/layui.css b/src/css/layui.css index e6b31ab6..e8fd6c54 100644 --- a/src/css/layui.css +++ b/src/css/layui.css @@ -840,7 +840,6 @@ a cite{font-style: normal; *cursor:pointer;} .layui-table-hover, .layui-table-click{background-color: #FAFAFA;} -.layui-table[lay-even] tr:nth-child(even){background-color: #f2f2f2;} .layui-table th, .layui-table td, @@ -937,6 +936,7 @@ a cite{font-style: normal; *cursor:pointer;} .layui-table-body{position: relative; overflow: auto; margin-right: -1px; margin-bottom: -1px;} .layui-table-body .layui-none{line-height: 26px; padding: 30px 15px; text-align: center; color: #999;} +.layui-table-body .layui-table[lay-even] tr:nth-child(even){background-color: #f2f2f2;} .layui-table-fixed{position: absolute; left: 0; top: 0; z-index: 101;} .layui-table-fixed .layui-table-body{overflow: hidden;} .layui-table-fixed-l{box-shadow: 1px 0 8px rgba(0,0,0,.08);}