diff --git a/cloud-common-plugin/src/main/resources/templates/tree/tree.html b/cloud-common-plugin/src/main/resources/templates/tree/tree.html index 2b13208..533e780 100644 --- a/cloud-common-plugin/src/main/resources/templates/tree/tree.html +++ b/cloud-common-plugin/src/main/resources/templates/tree/tree.html @@ -95,9 +95,6 @@ function initSelectNodes() { showSelectNodes(); var nodes = zTree.getNodes(); - if(nodes.length == 0) { - top.DialogBox.msg('暂无数据'); - } for(var i = 0, item = nodes[i]; item = nodes[i++];) { for(var j = 0, node = selectedNodes[j]; node = selectedNodes[j++];) { if(item[selectTree.primaryKey] == node[selectTree.primaryKey]) { @@ -196,6 +193,11 @@ } }, onAsyncSuccess: function(event, treeId, treeNode, msg) { + var nodes = zTree.getNodes(); + if(nodes.length == 0) { + top.DialogBox.msg('暂无数据'); + return; + } // 自动打钩 if(selectTree.check.enable) { if(typeof(treeNode) != 'undefined') {