From 5456bc1c3e85abfefa6223b199f0085bf203fe61 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 3 Jan 2020 17:31:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=A0=91=E7=88=B6=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E5=85=BC=E5=AE=B90,'0','',null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ajax/libs/bootstrap-treetable/bootstrap-treetable.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js index 477ce186..26159ba5 100644 --- a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js +++ b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js @@ -252,8 +252,12 @@ $.each(data, function(index, item) { // 添加一个默认属性,用来判断当前节点有没有被显示 item.isShow = false; - // 顶级节点校验判断 - var _defaultRootFlag = $.inArray(item[options.code], parentCodes) > 0 && !rootFlag; + // 顶级节点校验判断,兼容0,'0','',null + var _defaultRootFlag = item[options.parentCode] == '0' || + item[options.parentCode] == 0 || + item[options.parentCode] == null || + item[options.parentCode] == '' || + $.inArray(item[options.code], parentCodes) > 0 && !rootFlag; if (!item[options.parentCode] || (_root ? (item[options.parentCode] == options.rootIdValue) : _defaultRootFlag)) { rootFlag = true; if (!target.data_list["_root_"]) {