Browse Source

Pull request #1577: DEC-15889 fix: 多层级单选树选中效果异常

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit '99e5e2f1ca6b241d5d9f095a73717b9925c412e3':
  DEC-15889 fix: 多层级单选树选中效果异常
es6
windy 4 years ago
parent
commit
72448518b0
  1. 7
      src/base/combination/searcher.js
  2. 1
      src/case/tree/treeexpander/tree.expander.js
  3. 4
      src/case/tree/treeexpander/tree.expander.popup.js

7
src/base/combination/searcher.js

@ -101,20 +101,19 @@ BI.Searcher = BI.inherit(BI.Widget, {
if (type === BI.Events.CLICK) { if (type === BI.Events.CLICK) {
if (o.isAutoSync) { if (o.isAutoSync) {
var values = o.adapter && o.adapter.getValue(); var values = o.adapter && o.adapter.getValue();
if (!obj.isSelected()) {
o.adapter && o.adapter.setValue(BI.deepWithout(values, obj.getValue()));
} else {
switch (o.chooseType) { switch (o.chooseType) {
case BI.ButtonGroup.CHOOSE_TYPE_SINGLE: case BI.ButtonGroup.CHOOSE_TYPE_SINGLE:
o.adapter && o.adapter.setValue([obj.getValue()]); o.adapter && o.adapter.setValue([obj.getValue()]);
break; break;
case BI.ButtonGroup.CHOOSE_TYPE_MULTI: case BI.ButtonGroup.CHOOSE_TYPE_MULTI:
if (!obj.isSelected()) {
o.adapter && o.adapter.setValue(BI.deepWithout(values, obj.getValue()));
}
values.push(obj.getValue()); values.push(obj.getValue());
o.adapter && o.adapter.setValue(values); o.adapter && o.adapter.setValue(values);
break; break;
} }
} }
}
self.fireEvent(BI.Searcher.EVENT_CHANGE, value, obj); self.fireEvent(BI.Searcher.EVENT_CHANGE, value, obj);
} }
}); });

1
src/case/tree/treeexpander/tree.expander.js

@ -35,6 +35,7 @@
isFirstNode: o.isFirstNode || o.el.isFirstNode, isFirstNode: o.isFirstNode || o.el.isFirstNode,
el: o.popup, el: o.popup,
}, },
value: o.value,
listeners: [ listeners: [
{ {
eventName: BI.Controller.EVENT_CHANGE, eventName: BI.Controller.EVENT_CHANGE,

4
src/case/tree/treeexpander/tree.expander.popup.js

@ -12,7 +12,9 @@
var self = this; var self = this;
var o = this.options; var o = this.options;
this.popupView = BI.createWidget(o.el, this); this.popupView = BI.createWidget(BI.extend(o.el, {
value: o.value
}), this);
this.popupView.on(BI.Controller.EVENT_CHANGE, function () { this.popupView.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);

Loading…
Cancel
Save