Browse Source

Merge pull request #137952 in DEC/fineui from master to feature/x

* commit '65a57db488c5b8842aa2fd74bc4619ff7dcb1ae1':
  REPORT-77978 fix: 下拉树水印表现异常问题
master
superman 2 years ago
parent
commit
99f91b4f0f
  1. 5
      src/case/editor/editor.state.simple.js
  2. 1
      src/component/treevaluechooser/combo.listtreevaluechooser.js
  3. 1
      src/component/treevaluechooser/combo.treevaluechooser.insert.js
  4. 1
      src/widget/multiselect/multiselect.trigger.js
  5. 2
      src/widget/multiselect/trigger/editor.multiselect.js
  6. 1
      src/widget/multiselect/trigger/searcher.multiselect.js
  7. 29
      src/widget/multitree/multi.tree.combo.js
  8. 29
      src/widget/multitree/multi.tree.list.combo.js
  9. 1
      src/widget/multitree/trigger/searcher.list.multi.tree.js
  10. 3
      src/widget/multitree/trigger/searcher.multi.tree.js

5
src/case/editor/editor.state.simple.js

@ -136,7 +136,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
if (BI.isNotNull(o.text)) {
this.setState(o.text);
}
},
@ -232,6 +232,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
setState: function (v) {
var o = this.options;
BI.SimpleStateEditor.superclass.setValue.apply(this, arguments);
var defaultText = BI.isFunction(o.defaultText) ? o.defaultText() : o.defaultText;
if (BI.isNumber(v)) {
if (v === BI.Selection.All) {
this._setText(BI.i18nText("BI-Already_Selected"));
@ -240,7 +241,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
this._setText(BI.i18nText("BI-Already_Selected"));
this.text.element.removeClass("bi-water-mark");
} else {
this._setText(o.text);
this._setText(BI.isKey(defaultText) ? defaultText : o.text);
this.text.element.addClass("bi-water-mark");
}
return;

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

@ -30,6 +30,7 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser,
isNeedAdjustWidth: o.isNeedAdjustWidth,
element: this,
text: o.text,
defaultText: o.defaultText,
value: o.value,
watermark: o.watermark,
allowInsertValue: o.allowInsertValue,

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

@ -30,6 +30,7 @@ BI.TreeValueChooserInsertCombo = BI.inherit(BI.AbstractTreeValueChooser, {
isNeedAdjustWidth: o.isNeedAdjustWidth,
allowEdit: o.allowEdit,
text: o.text,
defaultText: o.defaultText,
value: o.value,
watermark: o.watermark,
element: this,

1
src/widget/multiselect/multiselect.trigger.js

@ -37,6 +37,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
type: "bi.multi_select_searcher",
height: o.height,
text: o.text,
defaultText: o.defaultText,
itemsCreator: o.itemsCreator,
itemHeight: o.itemHeight,
valueFormatter: o.valueFormatter,

2
src/widget/multiselect/trigger/editor.multiselect.js

@ -24,7 +24,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,
defaultText: o.defaultText,
text: o.text,
tipType: o.tipType,
warningTitle: o.warningTitle,

1
src/widget/multiselect/trigger/searcher.multiselect.js

@ -27,6 +27,7 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
type: "bi.multi_select_editor",
height: o.height,
text: o.text,
defaultText: o.defaultText,
watermark: o.watermark,
listeners: [{
eventName: BI.MultiSelectEditor.EVENT_FOCUS,

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

@ -22,7 +22,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
var isInit = false;
var want2showCounter = false;
this.storeValue = {value: o.value || {}};
this.storeValue = { value: o.value || {} };
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
@ -30,6 +30,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
height: o.height - (o.simple ? 1 : 2),
valueFormatter: o.valueFormatter,
text: o.text,
defaultText: o.defaultText,
watermark: o.watermark,
// adapter: this.popup,
masker: {
@ -44,7 +45,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
type: "bi.multi_tree_searcher",
itemsCreator: o.itemsCreator
},
value: {value: o.value || {}}
value: { value: o.value || {} }
});
this.combo = BI.createWidget({
@ -105,7 +106,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
maxWidth: o.isNeedAdjustWidth ? "auto" : 500,
},
isNeedAdjustWidth: o.isNeedAdjustWidth,
value: {value: o.value || {}},
value: { value: o.value || {} },
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
@ -131,12 +132,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self.storeValue = {value: self.combo.getValue()};
self.storeValue = { value: self.combo.getValue() };
this.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self.storeValue = {value: this.getValue()};
self.storeValue = { value: this.getValue() };
self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
BI.nextTick(function () {
@ -151,11 +152,11 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
self.fireEvent(BI.MultiTreeCombo.EVENT_SEARCHING);
});
function showCounter () {
function showCounter() {
if (isSearching()) {
self.storeValue = {value: self.trigger.getValue()};
self.storeValue = { value: self.trigger.getValue() };
} else if (isPopupView()) {
self.storeValue = {value: self.combo.getValue()};
self.storeValue = { value: self.combo.getValue() };
}
self.trigger.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
@ -174,7 +175,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
var checked = this.getSearcher().hasChecked();
var val = {
type: BI.Selection.Multi,
value: checked ? {1: 1} : {}
value: checked ? { 1: 1 } : {}
};
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
self.numberCounter.setButtonChecked(val);
@ -186,7 +187,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
return;
}
if (change === true) {
self.storeValue = {value: self.combo.getValue()};
self.storeValue = { value: self.combo.getValue() };
change = false;
}
self.combo.setValue(self.storeValue);
@ -201,9 +202,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
} else {
if (isPopupView()) {
self._stopEditing();
self.storeValue = {value: self.combo.getValue()};
self.storeValue = { value: self.combo.getValue() };
if (clear === true) {
self.storeValue = {value: {}};
self.storeValue = { value: {} };
}
self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM);
}
@ -245,7 +246,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
},
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
value: {value: o.value || {}}
value: { value: o.value || {} }
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
@ -306,7 +307,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
},
_stopEditing: function() {
_stopEditing: function () {
this.trigger.stopEditing();
this.numberCounter.hideView();
},

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

@ -14,6 +14,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
allowEdit: true,
allowInsertValue: true,
isNeedAdjustWidth: true,
text: "",
defaultText: "",
});
},
@ -23,12 +25,13 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
var isInit = false;
var want2showCounter = false;
this.storeValue = {value: o.value || []};
this.storeValue = { value: o.value || [] };
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
allowEdit: o.allowEdit,
text: o.text,
defaultText: o.defaultText,
watermark: o.watermark,
height: o.height - (o.simple ? 1 : 2),
valueFormatter: o.valueFormatter,
@ -74,7 +77,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
itemsCreator: o.itemsCreator
}
},
value: {value: o.value || {}}
value: { value: o.value || {} }
});
@ -139,7 +142,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
maxWidth: o.isNeedAdjustWidth ? "auto" : 500,
},
isNeedAdjustWidth: o.isNeedAdjustWidth,
value: {value: o.value || {}},
value: { value: o.value || {} },
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
@ -165,12 +168,12 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self.storeValue = {value: self.combo.getValue()};
self.storeValue = { value: self.combo.getValue() };
this.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self.storeValue = {value: this.getValue()};
self.storeValue = { value: this.getValue() };
self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
BI.nextTick(function () {
@ -185,11 +188,11 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
self.fireEvent(BI.MultiTreeListCombo.EVENT_SEARCHING);
});
function showCounter () {
function showCounter() {
if (isSearching()) {
self.storeValue = {value: self.trigger.getValue()};
self.storeValue = { value: self.trigger.getValue() };
} else if (isPopupView()) {
self.storeValue = {value: self.combo.getValue()};
self.storeValue = { value: self.combo.getValue() };
}
self.trigger.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
@ -203,7 +206,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
var checked = this.getSearcher().hasChecked();
var val = {
type: BI.Selection.Multi,
value: checked ? {1: 1} : {}
value: checked ? { 1: 1 } : {}
};
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
self.numberCounter.setButtonChecked(val);
@ -215,7 +218,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
return;
}
if (change === true) {
self.storeValue = {value: self.combo.getValue()};
self.storeValue = { value: self.combo.getValue() };
change = false;
}
self.combo.setValue(self.storeValue);
@ -230,9 +233,9 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
} else {
if (isPopupView()) {
self._stopEditing();
self.storeValue = {value: self.combo.getValue()};
self.storeValue = { value: self.combo.getValue() };
if (clear === true) {
self.storeValue = {value: []};
self.storeValue = { value: [] };
}
self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM);
}
@ -340,7 +343,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
this.numberCounter.setButtonChecked(this.storeValue);
},
_stopEditing: function() {
_stopEditing: function () {
this.trigger.stopEditing();
this.numberCounter.hideView();
},

1
src/widget/multitree/trigger/searcher.list.multi.tree.js

@ -27,6 +27,7 @@ BI.MultiListTreeSearcher = BI.inherit(BI.Widget, {
type: "bi.multi_select_editor",
height: o.height,
text: o.text,
defaultText: o.defaultText,
watermark: o.watermark,
el: {
type: "bi.simple_state_editor",

3
src/widget/multitree/trigger/searcher.multi.tree.js

@ -30,6 +30,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
el: {
type: "bi.simple_state_editor",
text: o.text,
defaultText: o.defaultText,
height: o.height
},
listeners: [{
@ -149,7 +150,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
}
}
function getChildrenNode (ob) {
function getChildrenNode(ob) {
var text = "";
var index = 0, size = BI.size(ob);
var names = BI.Func.getSortedResult(BI.keys(ob));

Loading…
Cancel
Save