windy 6 years ago
parent
commit
c17aa448b2
  1. 4
      changelog.md
  2. 27
      demo/js/component/demo.treevaluechoosercombo.js
  3. 5
      src/case/tree/ztree/tree.list.display.js

4
changelog.md

@ -4,6 +4,7 @@
- 新增`bi.multi_tree_insert_combo`控件, 此下拉树可以插入不存在的新值 - 新增`bi.multi_tree_insert_combo`控件, 此下拉树可以插入不存在的新值
- 新增`bi.list_tree_value_chooser_insert_combo`部件, 封装`bi.multi_tree_list_combo`数据处理逻辑 - 新增`bi.list_tree_value_chooser_insert_combo`部件, 封装`bi.multi_tree_list_combo`数据处理逻辑
- 新增`bi.tree_value_chooser_insert_combo`部件, 封装`bi.multi_tree_insert_combo`数据处理逻辑 - 新增`bi.tree_value_chooser_insert_combo`部件, 封装`bi.multi_tree_insert_combo`数据处理逻辑
- 增加BI.DOM.ready方法
2.0(2019-03) 2.0(2019-03)
- 新增`bi.time_combo`时分秒控件和`bi.time_periods`时间选择区间,时间区间无有效值校验 - 新增`bi.time_combo`时分秒控件和`bi.time_periods`时间选择区间,时间区间无有效值校验
@ -34,6 +35,3 @@
2.0(2018-08) 2.0(2018-08)
- 增加BI.mount方法,支持同构 - 增加BI.mount方法,支持同构
2.0(2019-04)
- 增加BI.DOM.ready方法

27
demo/js/component/demo.treevaluechoosercombo.js

@ -5,41 +5,18 @@ Demo.TreeValueChooser = BI.inherit(BI.Widget, {
render: function () { render: function () {
var widget = BI.createWidget({ var widget = BI.createWidget({
type: "bi.tree_value_chooser_insert_combo", type: "bi.tree_value_chooser_combo",
width: 300, width: 300,
// items: BI.deepClone(Demo.CONSTANTS.TREEITEMS), // items: BI.deepClone(Demo.CONSTANTS.TREEITEMS),
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
callback(BI.deepClone(Demo.CONSTANTS.TREEITEMS)); callback(BI.deepClone(Demo.CONSTANTS.TREEITEMS));
} }
}); });
var widget1 = BI.createWidget({
type: "bi.list_tree_value_chooser_insert_combo",
itemsCreator: function (op, callback) {
callback(BI.deepClone(Demo.CONSTANTS.TREEITEMS));
}
});
widget.setValue({
"中国": {
"安徽省": {
"安庆市": {}
}
},
"newValue": {}
});
widget1.setValue([
["中国", "安徽省"],
["中国", "安徽省", "安庆市"],
["newValue"]
]);
return { return {
type: "bi.vertical", type: "bi.vertical",
items: [{
type: "bi.vertical_adapt",
hgap: 200, hgap: 200,
vgap: 10, vgap: 10,
items: [widget, widget1] items: [widget]
}]
}; };
} }
}); });

5
src/case/tree/ztree/tree.list.display.js

@ -44,7 +44,7 @@ BI.ListDisplayTree = BI.inherit(BI.ListTreeView, {
} }
function getFont(treeId, node) { function getFont(treeId, node) {
return node.font ? node.font : {color: "#999999"}; return node.isLeaf ? {} : {color: "#999999"};
} }
return setting; return setting;
@ -60,9 +60,6 @@ BI.ListDisplayTree = BI.inherit(BI.ListTreeView, {
node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")"; node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")";
} }
} }
if(node.isLeaf === true) {
node.font = {color: "#3d4d66"};
}
}); });
return nodes; return nodes;
}, },

Loading…
Cancel
Save