Browse Source

Pull request #1578: DEC-15891 fix: 补充唯一根节点item场景

Merge in VISUAL/fineui from ~DAILER/fineui:master to master

* commit '65a432a6fedb6d5119aac23eb481278be2d51d67':
  DEC-15891 fix: 补充唯一根节点item场景
  DEC-15891 fix: 补充唯一根节点item场景
es6
parent
commit
eab0c89a94
  1. 74
      src/case/button/treeitem/item.root.treeleaf.js
  2. 4
      src/widget/multilayerselecttree/multilayerselecttree.leveltree.js
  3. 2
      src/widget/multilayersingletree/multilayersingletree.leveltree.js

74
src/case/button/treeitem/item.root.treeleaf.js

@ -0,0 +1,74 @@
BI.RootTreeLeafItem = BI.inherit(BI.BasicButton, {
props: {
baseCls: "bi-root-tree-leaf-item bi-list-item-active",
logic: {
dynamic: false
},
id: "",
pId: "",
layer: 0,
height: 24
},
render: function () {
var self = this;
var o = this.options;
var text = {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword
};
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 24,
el: {
type: "bi.layout",
width: 24,
height: o.height
}
}, {
el: text
});
return BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
getId: function () {
return this.options.id;
},
getPId: function () {
return this.options.pId;
}
});
BI.shortcut("bi.root_tree_leaf_item", BI.RootTreeLeafItem);

4
src/widget/multilayerselecttree/multilayerselecttree.leveltree.js

@ -54,14 +54,12 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Pane, {
extend.type = "bi.multilayer_select_tree_mid_plus_group_node"; extend.type = "bi.multilayer_select_tree_mid_plus_group_node";
} }
BI.defaults(node, extend); BI.defaults(node, extend);
self._formatItems(node.children, layer + 1, node); self._formatItems(node.children, layer + 1, node);
} else { } else {
if (layer === 0 && extend.isFirstNode && extend.isLastNode) { if (layer === 0 && extend.isFirstNode && extend.isLastNode) {
extend.type = ""; // todo 缺一个根节点的item extend.type = "bi.root_tree_leaf_item";
} else if (layer === 0 && extend.isFirstNode) { } else if (layer === 0 && extend.isFirstNode) {
extend.type = "bi.multilayer_single_tree_first_tree_leaf_item"; extend.type = "bi.multilayer_single_tree_first_tree_leaf_item";
} else if (extend.isLastNode) { } else if (extend.isLastNode) {

2
src/widget/multilayersingletree/multilayersingletree.leveltree.js

@ -59,7 +59,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Pane, {
} else { } else {
if (layer === 0 && extend.isFirstNode && extend.isLastNode) { if (layer === 0 && extend.isFirstNode && extend.isLastNode) {
extend.type = ""; // todo 缺一个根节点的item extend.type = "bi.root_tree_leaf_item";
} else if (layer === 0 && extend.isFirstNode) { } else if (layer === 0 && extend.isFirstNode) {
extend.type = "bi.multilayer_single_tree_first_tree_leaf_item"; extend.type = "bi.multilayer_single_tree_first_tree_leaf_item";
} else if (extend.isLastNode) { } else if (extend.isLastNode) {

Loading…
Cancel
Save