From a26d6b165778bf29bd380bc8232a131e05e1b39c Mon Sep 17 00:00:00 2001 From: sunxiaobin89 <470459819@qq.com> Date: Mon, 24 Apr 2023 23:39:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20treeTable=20showIcon?= =?UTF-8?q?=E4=B8=BAfalse=E7=9A=84=E6=97=B6=E5=80=99=E6=8A=98=E5=8F=A0?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E8=B7=9F=E6=A0=87=E9=A2=98=E6=9C=89=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E7=A9=BA=E7=99=BD=E7=9A=84=E9=97=AE=E9=A2=98?= 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 44f2f84a..5cd991e8 100644 --- a/src/css/layui.css +++ b/src/css/layui.css @@ -1115,7 +1115,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh .layui-table-tips-c:before{position: relative; right: -2px;} /** 树表 **/ -.layui-table-tree-nodeIcon {width: 20px;} +.layui-table-tree-nodeIcon {max-width: 20px;} .layui-table-tree-nodeIcon > * {width: 100%;} .layui-table-tree-flexIcon,.layui-table-tree-nodeIcon {margin-right: 2px;} .layui-table-tree-flexIcon {cursor: pointer;} From c1b763040e35d975741480c9611040dde572e899 Mon Sep 17 00:00:00 2001 From: sunxiaobin89 <470459819@qq.com> Date: Mon, 24 Apr 2023 23:40:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20treeTable=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=8E=92=E5=BA=8F=E4=B8=94=E6=98=AFurl=E5=8F=96?= =?UTF-8?q?=E6=95=B0=E7=9A=84=E6=97=B6=E5=80=99=E6=A0=91=E8=A1=A8=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E5=A4=B1=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/treeTable.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/modules/treeTable.js b/src/modules/treeTable.js index 1623354c..96404d3b 100644 --- a/src/modules/treeTable.js +++ b/src/modules/treeTable.js @@ -233,7 +233,6 @@ layui.define(['table'], function (exports) { onExpand: null, // 展开之后的回调 } }, - autoSort: false }; Class.prototype.getOptions = function () { @@ -821,7 +820,7 @@ layui.define(['table'], function (exports) { }); // 对参数进行深度或浅扩展 - that.config = $.extend(deep, {}, that.config, options, {autoSort: false}); + that.config = $.extend(deep, {}, that.config, options); // 执行渲染 that.render(type); @@ -894,6 +893,14 @@ layui.define(['table'], function (exports) { treeTable.reloadData(id); } else { // url异步取数的表格一般需要自己添加监听之后进行reloadData并且把排序参数加入到where中 + if (options.autoSort) { + var tableData = that.initData(); + var res = {}; + res[options.response.dataName] = tableData; + typeof options.done === 'function' && options.done( + res, that.page, that.count + ); + } } }