diff --git a/demo/config.js b/demo/config.js index cc3e5dfe71..71893d1b28 100644 --- a/demo/config.js +++ b/demo/config.js @@ -1524,13 +1524,19 @@ Demo.CONSTANTS = { {id: 121, pId: 12, value: "第三级目录1", text: "第三级目录1"}, {id: 122, pId: 12, value: "第三级文件1", text: "第三级文件1"}, {id: 1211, pId: 121, value: "第四级目录1", text: "第四级目录1"}, - {id: 12111, pId: 1211, value: "第五级文件1", text: "第五级文件111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}, + { + id: 12111, + pId: 1211, + value: "第五级文件1", + text: "第五级文件111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + }, {id: 2, pId: -1, value: "第一级目录2", text: "第一级目录2"}, {id: 21, pId: 2, value: "第二级目录3", text: "第二级目录3"}, {id: 22, pId: 2, value: "第二级文件2", text: "第二级文件2"}, {id: 211, pId: 21, value: "第三级目录2", text: "第三级目录2"}, {id: 212, pId: 21, value: "第三级文件2", text: "第三级文件2"}, - {id: 2111, pId: 211, value: "第四级文件1", text: "第四级文件1"}], + {id: 2111, pId: 211, value: "第四级文件1", text: "第四级文件1"}, + {id: 3, pId: -1, value: "第一级目录3", text: "第一级目录3", isParent: true}], LEVELTREE: [{ id: 1, text: "第一项", diff --git a/src/case/tree/tree.level.js b/src/case/tree/tree.level.js index 1600a0d717..193ce0e7ad 100644 --- a/src/case/tree/tree.level.js +++ b/src/case/tree/tree.level.js @@ -31,7 +31,7 @@ BI.LevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.last_plus_group_node"; diff --git a/src/case/tree/ztree/tree.display.js b/src/case/tree/ztree/tree.display.js index 002ede97d2..b54a1c0d9a 100644 --- a/src/case/tree/ztree/tree.display.js +++ b/src/case/tree/ztree/tree.display.js @@ -38,7 +38,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { } }; - function beforeCollapse (treeId, treeNode) { + function beforeCollapse(treeId, treeNode) { return false; } @@ -49,6 +49,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { nodes = BI.DisplayTree.superclass._dealWidthNodes.apply(this, arguments); var self = this, o = this.options; BI.each(nodes, function (i, node) { + node.isParent = node.isParent || node.parent; if (node.text == null) { if (node.count > 0) { node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")"; diff --git a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js index 5f072737e5..48ba3ce1d9 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js @@ -30,7 +30,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_select_tree_last_plus_group_node"; diff --git a/src/widget/multilayersingletree/multilayersingletree.leveltree.js b/src/widget/multilayersingletree/multilayersingletree.leveltree.js index 76086042b2..220af07b00 100644 --- a/src/widget/multilayersingletree/multilayersingletree.leveltree.js +++ b/src/widget/multilayersingletree/multilayersingletree.leveltree.js @@ -30,7 +30,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_single_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_single_tree_last_plus_group_node"; diff --git a/src/widget/selecttree/selecttree.popup.js b/src/widget/selecttree/selecttree.popup.js index b190686d66..f2aeea4284 100644 --- a/src/widget/selecttree/selecttree.popup.js +++ b/src/widget/selecttree/selecttree.popup.js @@ -20,7 +20,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, { var extend = {layer: layer}; node.id = node.id || BI.UUID(); extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.select_tree_last_plus_group_node";