Browse Source

Merge pull request #1312 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit '821d8fb5f2c653055dcf0ef37897740f89ad45cb':
  BI-64703 fix: 搜索校验取最大值
  REPORT-30722 下拉树提供before_popup_view事件
es6
windy 5 years ago
parent
commit
c9012e4756
  1. 1
      changelog.md
  2. 37
      src/base/tree/ztree/parttree.js
  3. 6
      src/component/treevaluechooser/combo.listtreevaluechooser.js
  4. 6
      src/component/treevaluechooser/combo.treevaluechooser.insert.js
  5. 6
      src/component/treevaluechooser/combo.treevaluechooser.js
  6. 7
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  7. 7
      src/widget/multilayersingletree/multilayersingletree.combo.js
  8. 3
      src/widget/multitree/multi.tree.combo.js
  9. 3
      src/widget/multitree/multi.tree.insert.combo.js
  10. 3
      src/widget/multitree/multi.tree.list.combo.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志 # 更新日志
2.0(2020-04) 2.0(2020-04)
- 下拉树系列添加下拉popup弹出前事件
- 修复了复选下拉勾选值和搜索结果中含有父子串关系时提示不正确的问题 - 修复了复选下拉勾选值和搜索结果中含有父子串关系时提示不正确的问题
- searcher提供可配是否支持搜索空格的allSearchBlank - searcher提供可配是否支持搜索空格的allSearchBlank
- 修复了复选下拉全选状态下使用空格添加值trigger显示更新不对的问题 - 修复了复选下拉全选状态下使用空格添加值trigger显示更新不对的问题

37
src/base/tree/ztree/parttree.js

@ -42,7 +42,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode); var name = this._getNodeValue(treeNode);
if (treeNode.checked === true) { if (treeNode.checked === true) {
this.options.paras.selectedValues = this._getJoinValue(); this.options.paras.selectedValues = this._getUnionValue();
// this._buildTree(self.options.paras.selectedValues, BI.concat(parentValues, name)); // this._buildTree(self.options.paras.selectedValues, BI.concat(parentValues, name));
o.itemsCreator(BI.extend({}, o.paras, { o.itemsCreator(BI.extend({}, o.paras, {
type: BI.TreeView.REQ_TYPE_ADJUST_DATA, type: BI.TreeView.REQ_TYPE_ADJUST_DATA,
@ -155,6 +155,41 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
return BI.deepClone(this.options.paras.selectedValues || {}); return BI.deepClone(this.options.paras.selectedValues || {});
}, },
_getUnionValue: function () {
if (!this.nodes) {
return {};
}
var checkedValues = this._getSelectedValues();
if (BI.isEmpty(checkedValues)) {
return BI.deepClone(this.options.paras.selectedValues);
}
if (BI.isEmpty(this.options.paras.selectedValues)) {
return checkedValues;
}
return this._union(checkedValues, this.options.paras.selectedValues);
},
_union: function (valueA, valueB) {
var self = this;
var map = {};
track([], valueA, valueB);
track([], valueB, valueA);
function track (parent, node, compare) {
BI.each(node, function (n, item) {
if (BI.isNull(compare[n])) {
self._addTreeNode(map, parent, n, item);
} else if (BI.isEmpty(compare[n])) {
self._addTreeNode(map, parent, n, {});
} else {
track(parent.concat([n]), node[n], compare[n]);
}
});
}
return map;
},
// 生成树方法 // 生成树方法
stroke: function (config) { stroke: function (config) {
var o = this.options; var o = this.options;

6
src/component/treevaluechooser/combo.listtreevaluechooser.js

@ -65,6 +65,11 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser,
action: function () { action: function () {
self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM); self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM);
} }
}, {
eventName: BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_BEFORE_POPUPVIEW);
}
}] }]
}); });
}, },
@ -89,4 +94,5 @@ BI.ListTreeValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.ListTreeValueChooserInsertCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.list_tree_value_chooser_insert_combo", BI.ListTreeValueChooserInsertCombo); BI.shortcut("bi.list_tree_value_chooser_insert_combo", BI.ListTreeValueChooserInsertCombo);

6
src/component/treevaluechooser/combo.treevaluechooser.insert.js

@ -64,6 +64,11 @@ BI.TreeValueChooserInsertCombo = BI.inherit(BI.AbstractTreeValueChooser, {
action: function () { action: function () {
self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CONFIRM); self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CONFIRM);
} }
}, {
eventName: BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_BEFORE_POPUPVIEW);
}
}] }]
}); });
}, },
@ -88,4 +93,5 @@ BI.TreeValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.TreeValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; BI.TreeValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.TreeValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.TreeValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TreeValueChooserInsertCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.tree_value_chooser_insert_combo", BI.TreeValueChooserInsertCombo); BI.shortcut("bi.tree_value_chooser_insert_combo", BI.TreeValueChooserInsertCombo);

6
src/component/treevaluechooser/combo.treevaluechooser.js

@ -64,6 +64,11 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, {
action: function () { action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM); self.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM);
} }
}, {
eventName: BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_BEFORE_POPUPVIEW);
}
}] }]
}); });
}, },
@ -82,6 +87,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, {
} }
}); });
BI.TreeValueChooserCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.TreeValueChooserCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.TreeValueChooserCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TreeValueChooserCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.TreeValueChooserCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.TreeValueChooserCombo.EVENT_BLUR = "EVENT_BLUR"; BI.TreeValueChooserCombo.EVENT_BLUR = "EVENT_BLUR";

7
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -96,7 +96,13 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
value: o.value, value: o.value,
maxHeight: 400, maxHeight: 400,
minHeight: 240 minHeight: 240
},
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW);
} }
}]
}; };
}, },
@ -209,4 +215,5 @@ BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR"; BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo); BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);

7
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -99,7 +99,13 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
value: o.value, value: o.value,
maxHeight: 400, maxHeight: 400,
minHeight: 240 minHeight: 240
},
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW);
} }
}]
}; };
}, },
@ -211,4 +217,5 @@ BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR"; BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo); BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);

3
src/widget/multitree/multi.tree.combo.js

@ -195,7 +195,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue);
self.populate(); self.populate();
self.fireEvent(BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW);
}); });
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
if (isSearching()) { if (isSearching()) {
@ -333,5 +333,6 @@ BI.MultiTreeCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; BI.MultiTreeCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiTreeCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; BI.MultiTreeCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiTreeCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.MultiTreeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multi_tree_combo", BI.MultiTreeCombo); BI.shortcut("bi.multi_tree_combo", BI.MultiTreeCombo);

3
src/widget/multitree/multi.tree.insert.combo.js

@ -205,7 +205,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue);
self.populate(); self.populate();
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_BEFORE_POPUPVIEW);
}); });
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
if (isSearching()) { if (isSearching()) {
@ -348,5 +348,6 @@ BI.MultiTreeInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiTreeInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; BI.MultiTreeInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiTreeInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.MultiTreeInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MultiTreeInsertCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multi_tree_insert_combo", BI.MultiTreeInsertCombo); BI.shortcut("bi.multi_tree_insert_combo", BI.MultiTreeInsertCombo);

3
src/widget/multitree/multi.tree.list.combo.js

@ -224,7 +224,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue);
self.populate(); self.populate();
self.fireEvent(BI.MultiTreeListCombo.EVENT_BEFORE_POPUPVIEW);
}); });
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
if (isSearching()) { if (isSearching()) {
@ -372,5 +372,6 @@ BI.MultiTreeListCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeListCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; BI.MultiTreeListCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiTreeListCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; BI.MultiTreeListCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiTreeListCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.MultiTreeListCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MultiTreeListCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multi_tree_list_combo", BI.MultiTreeListCombo); BI.shortcut("bi.multi_tree_list_combo", BI.MultiTreeListCombo);
Loading…
Cancel
Save