Browse Source

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

* commit '9bdd3550d606c64c00e44eeb41cc6834224a8616':
  BI-48963 refactor: state_editor新增defaultText && 去掉因为标灰而做的mounted
es6
guy 5 years ago
parent
commit
03cc51a36f
  1. 54
      dist/2.0/fineui.ie.js
  2. 54
      dist/2.0/fineui.js
  3. 54
      dist/bundle.ie.js
  4. 54
      dist/bundle.js
  5. 30
      dist/case.js
  6. 54
      dist/fineui.ie.js
  7. 54
      dist/fineui.js
  8. 54
      dist/fineui_without_jquery_polyfill.js
  9. 24
      dist/widget.js
  10. 16
      src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js
  11. 14
      src/case/editor/editor.state.js
  12. 4
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js
  13. 13
      src/widget/multilayersingletree/multilayersingletree.trigger.js
  14. 1
      src/widget/multiselect/trigger/editor.multiselect.js
  15. 6
      src/widget/singleselect/trigger/editor.singleselect.js

54
dist/2.0/fineui.ie.js vendored

@ -56859,16 +56859,11 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: this._getText(), defaultText: o.text,
text: this._digest(o.value, o.items),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: ""
listeners: [{
eventName: BI.Events.MOUNT,
action: function () {
self.editor.setState(self._digest(o.value, o.items));
}
}]
}, },
popup: { popup: {
type: "bi.search_text_value_combo_popup", type: "bi.search_text_value_combo_popup",
@ -56903,11 +56898,6 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
this.editor.setState(v); this.editor.setState(v);
}, },
_getText: function () {
var o = this.options;
return (BI.isKey(o.value) && o.text === this._digest(o.value, o.items)) ? "" : o.text;
},
_digest: function(vals, items){ _digest: function(vals, items){
var o = this.options; var o = this.options;
vals = BI.isArray(vals) ? vals : [vals]; vals = BI.isArray(vals) ? vals : [vals];
@ -58229,7 +58219,8 @@ BI.StateEditor = BI.inherit(BI.Widget, {
watermark: "", watermark: "",
errorText: "", errorText: "",
height: 24, height: 24,
text: BI.i18nText("BI-Basic_Unrestricted") defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: BI.i18nText("BI-Basic_Unrestricted") // 显示值
}); });
}, },
@ -58456,20 +58447,21 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.text.setText(BI.i18nText("BI-Select_Part")); this.text.setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
} else { } else {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} }
return; return;
} }
if (BI.isString(v)) { if (BI.isString(v)) {
this.text.setText(v); this.text.setText(v);
v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); // 配置了defaultText才判断标灰,其他情况不标灰
(BI.isKey(o.defaultText) && o.defaultText === v) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
return; return;
} }
if (BI.isArray(v)) { if (BI.isArray(v)) {
if (BI.isEmpty(v)) { if (BI.isEmpty(v)) {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} else if (v.length === 1) { } else if (v.length === 1) {
this.text.setText(v[0]); this.text.setText(v[0]);
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
@ -69033,6 +69025,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
defaultText: o.text,
text: this._digest(o.value), text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
@ -69113,7 +69106,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}, },
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -70006,7 +70000,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: o.text, defaultText: o.text,
text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: "",
@ -70085,15 +70080,9 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
mounted: function () {
var o = this.options;
if(BI.isKey(o.value)) {
this.setValue([o.value]);
}
},
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -73581,6 +73570,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
defaultText: o.text,
text: o.text, text: o.text,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,
@ -81611,7 +81601,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-editor", baseCls: "bi-single-select-editor",
el: {} el: {},
text: BI.i18nText("BI-Basic_Please_Select")
}); });
}, },
@ -81625,7 +81616,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
text: o.text defaultText: o.text,
text: o.text,
}); });
this.editor.on(BI.Controller.EVENT_CHANGE, function () { this.editor.on(BI.Controller.EVENT_CHANGE, function () {

54
dist/2.0/fineui.js vendored

@ -57263,16 +57263,11 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: this._getText(), defaultText: o.text,
text: this._digest(o.value, o.items),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: ""
listeners: [{
eventName: BI.Events.MOUNT,
action: function () {
self.editor.setState(self._digest(o.value, o.items));
}
}]
}, },
popup: { popup: {
type: "bi.search_text_value_combo_popup", type: "bi.search_text_value_combo_popup",
@ -57307,11 +57302,6 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
this.editor.setState(v); this.editor.setState(v);
}, },
_getText: function () {
var o = this.options;
return (BI.isKey(o.value) && o.text === this._digest(o.value, o.items)) ? "" : o.text;
},
_digest: function(vals, items){ _digest: function(vals, items){
var o = this.options; var o = this.options;
vals = BI.isArray(vals) ? vals : [vals]; vals = BI.isArray(vals) ? vals : [vals];
@ -58633,7 +58623,8 @@ BI.StateEditor = BI.inherit(BI.Widget, {
watermark: "", watermark: "",
errorText: "", errorText: "",
height: 24, height: 24,
text: BI.i18nText("BI-Basic_Unrestricted") defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: BI.i18nText("BI-Basic_Unrestricted") // 显示值
}); });
}, },
@ -58860,20 +58851,21 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.text.setText(BI.i18nText("BI-Select_Part")); this.text.setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
} else { } else {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} }
return; return;
} }
if (BI.isString(v)) { if (BI.isString(v)) {
this.text.setText(v); this.text.setText(v);
v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); // 配置了defaultText才判断标灰,其他情况不标灰
(BI.isKey(o.defaultText) && o.defaultText === v) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
return; return;
} }
if (BI.isArray(v)) { if (BI.isArray(v)) {
if (BI.isEmpty(v)) { if (BI.isEmpty(v)) {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} else if (v.length === 1) { } else if (v.length === 1) {
this.text.setText(v[0]); this.text.setText(v[0]);
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
@ -69437,6 +69429,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
defaultText: o.text,
text: this._digest(o.value), text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
@ -69517,7 +69510,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}, },
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -70410,7 +70404,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: o.text, defaultText: o.text,
text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: "",
@ -70489,15 +70484,9 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
mounted: function () {
var o = this.options;
if(BI.isKey(o.value)) {
this.setValue([o.value]);
}
},
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -73985,6 +73974,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
defaultText: o.text,
text: o.text, text: o.text,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,
@ -82015,7 +82005,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-editor", baseCls: "bi-single-select-editor",
el: {} el: {},
text: BI.i18nText("BI-Basic_Please_Select")
}); });
}, },
@ -82029,7 +82020,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
text: o.text defaultText: o.text,
text: o.text,
}); });
this.editor.on(BI.Controller.EVENT_CHANGE, function () { this.editor.on(BI.Controller.EVENT_CHANGE, function () {

54
dist/bundle.ie.js vendored

@ -56859,16 +56859,11 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: this._getText(), defaultText: o.text,
text: this._digest(o.value, o.items),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: ""
listeners: [{
eventName: BI.Events.MOUNT,
action: function () {
self.editor.setState(self._digest(o.value, o.items));
}
}]
}, },
popup: { popup: {
type: "bi.search_text_value_combo_popup", type: "bi.search_text_value_combo_popup",
@ -56903,11 +56898,6 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
this.editor.setState(v); this.editor.setState(v);
}, },
_getText: function () {
var o = this.options;
return (BI.isKey(o.value) && o.text === this._digest(o.value, o.items)) ? "" : o.text;
},
_digest: function(vals, items){ _digest: function(vals, items){
var o = this.options; var o = this.options;
vals = BI.isArray(vals) ? vals : [vals]; vals = BI.isArray(vals) ? vals : [vals];
@ -58229,7 +58219,8 @@ BI.StateEditor = BI.inherit(BI.Widget, {
watermark: "", watermark: "",
errorText: "", errorText: "",
height: 24, height: 24,
text: BI.i18nText("BI-Basic_Unrestricted") defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: BI.i18nText("BI-Basic_Unrestricted") // 显示值
}); });
}, },
@ -58456,20 +58447,21 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.text.setText(BI.i18nText("BI-Select_Part")); this.text.setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
} else { } else {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} }
return; return;
} }
if (BI.isString(v)) { if (BI.isString(v)) {
this.text.setText(v); this.text.setText(v);
v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); // 配置了defaultText才判断标灰,其他情况不标灰
(BI.isKey(o.defaultText) && o.defaultText === v) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
return; return;
} }
if (BI.isArray(v)) { if (BI.isArray(v)) {
if (BI.isEmpty(v)) { if (BI.isEmpty(v)) {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} else if (v.length === 1) { } else if (v.length === 1) {
this.text.setText(v[0]); this.text.setText(v[0]);
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
@ -69033,6 +69025,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
defaultText: o.text,
text: this._digest(o.value), text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
@ -69113,7 +69106,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}, },
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -70006,7 +70000,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: o.text, defaultText: o.text,
text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: "",
@ -70085,15 +70080,9 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
mounted: function () {
var o = this.options;
if(BI.isKey(o.value)) {
this.setValue([o.value]);
}
},
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -73581,6 +73570,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
defaultText: o.text,
text: o.text, text: o.text,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,
@ -81611,7 +81601,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-editor", baseCls: "bi-single-select-editor",
el: {} el: {},
text: BI.i18nText("BI-Basic_Please_Select")
}); });
}, },
@ -81625,7 +81616,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
text: o.text defaultText: o.text,
text: o.text,
}); });
this.editor.on(BI.Controller.EVENT_CHANGE, function () { this.editor.on(BI.Controller.EVENT_CHANGE, function () {

54
dist/bundle.js vendored

@ -57263,16 +57263,11 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: this._getText(), defaultText: o.text,
text: this._digest(o.value, o.items),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: ""
listeners: [{
eventName: BI.Events.MOUNT,
action: function () {
self.editor.setState(self._digest(o.value, o.items));
}
}]
}, },
popup: { popup: {
type: "bi.search_text_value_combo_popup", type: "bi.search_text_value_combo_popup",
@ -57307,11 +57302,6 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
this.editor.setState(v); this.editor.setState(v);
}, },
_getText: function () {
var o = this.options;
return (BI.isKey(o.value) && o.text === this._digest(o.value, o.items)) ? "" : o.text;
},
_digest: function(vals, items){ _digest: function(vals, items){
var o = this.options; var o = this.options;
vals = BI.isArray(vals) ? vals : [vals]; vals = BI.isArray(vals) ? vals : [vals];
@ -58633,7 +58623,8 @@ BI.StateEditor = BI.inherit(BI.Widget, {
watermark: "", watermark: "",
errorText: "", errorText: "",
height: 24, height: 24,
text: BI.i18nText("BI-Basic_Unrestricted") defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: BI.i18nText("BI-Basic_Unrestricted") // 显示值
}); });
}, },
@ -58860,20 +58851,21 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.text.setText(BI.i18nText("BI-Select_Part")); this.text.setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
} else { } else {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} }
return; return;
} }
if (BI.isString(v)) { if (BI.isString(v)) {
this.text.setText(v); this.text.setText(v);
v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); // 配置了defaultText才判断标灰,其他情况不标灰
(BI.isKey(o.defaultText) && o.defaultText === v) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
return; return;
} }
if (BI.isArray(v)) { if (BI.isArray(v)) {
if (BI.isEmpty(v)) { if (BI.isEmpty(v)) {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} else if (v.length === 1) { } else if (v.length === 1) {
this.text.setText(v[0]); this.text.setText(v[0]);
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
@ -69437,6 +69429,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
defaultText: o.text,
text: this._digest(o.value), text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
@ -69517,7 +69510,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}, },
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -70410,7 +70404,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: o.text, defaultText: o.text,
text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: "",
@ -70489,15 +70484,9 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
mounted: function () {
var o = this.options;
if(BI.isKey(o.value)) {
this.setValue([o.value]);
}
},
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -73985,6 +73974,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
defaultText: o.text,
text: o.text, text: o.text,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,
@ -82015,7 +82005,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-editor", baseCls: "bi-single-select-editor",
el: {} el: {},
text: BI.i18nText("BI-Basic_Please_Select")
}); });
}, },
@ -82029,7 +82020,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
text: o.text defaultText: o.text,
text: o.text,
}); });
this.editor.on(BI.Controller.EVENT_CHANGE, function () { this.editor.on(BI.Controller.EVENT_CHANGE, function () {

30
dist/case.js vendored

@ -4839,16 +4839,11 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: this._getText(), defaultText: o.text,
text: this._digest(o.value, o.items),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: ""
listeners: [{
eventName: BI.Events.MOUNT,
action: function () {
self.editor.setState(self._digest(o.value, o.items));
}
}]
}, },
popup: { popup: {
type: "bi.search_text_value_combo_popup", type: "bi.search_text_value_combo_popup",
@ -4883,11 +4878,6 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
this.editor.setState(v); this.editor.setState(v);
}, },
_getText: function () {
var o = this.options;
return (BI.isKey(o.value) && o.text === this._digest(o.value, o.items)) ? "" : o.text;
},
_digest: function(vals, items){ _digest: function(vals, items){
var o = this.options; var o = this.options;
vals = BI.isArray(vals) ? vals : [vals]; vals = BI.isArray(vals) ? vals : [vals];
@ -6209,7 +6199,8 @@ BI.StateEditor = BI.inherit(BI.Widget, {
watermark: "", watermark: "",
errorText: "", errorText: "",
height: 24, height: 24,
text: BI.i18nText("BI-Basic_Unrestricted") defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: BI.i18nText("BI-Basic_Unrestricted") // 显示值
}); });
}, },
@ -6436,20 +6427,21 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.text.setText(BI.i18nText("BI-Select_Part")); this.text.setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
} else { } else {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} }
return; return;
} }
if (BI.isString(v)) { if (BI.isString(v)) {
this.text.setText(v); this.text.setText(v);
v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); // 配置了defaultText才判断标灰,其他情况不标灰
(BI.isKey(o.defaultText) && o.defaultText === v) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
return; return;
} }
if (BI.isArray(v)) { if (BI.isArray(v)) {
if (BI.isEmpty(v)) { if (BI.isEmpty(v)) {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} else if (v.length === 1) { } else if (v.length === 1) {
this.text.setText(v[0]); this.text.setText(v[0]);
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");

54
dist/fineui.ie.js vendored

@ -57104,16 +57104,11 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: this._getText(), defaultText: o.text,
text: this._digest(o.value, o.items),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: ""
listeners: [{
eventName: BI.Events.MOUNT,
action: function () {
self.editor.setState(self._digest(o.value, o.items));
}
}]
}, },
popup: { popup: {
type: "bi.search_text_value_combo_popup", type: "bi.search_text_value_combo_popup",
@ -57148,11 +57143,6 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
this.editor.setState(v); this.editor.setState(v);
}, },
_getText: function () {
var o = this.options;
return (BI.isKey(o.value) && o.text === this._digest(o.value, o.items)) ? "" : o.text;
},
_digest: function(vals, items){ _digest: function(vals, items){
var o = this.options; var o = this.options;
vals = BI.isArray(vals) ? vals : [vals]; vals = BI.isArray(vals) ? vals : [vals];
@ -58474,7 +58464,8 @@ BI.StateEditor = BI.inherit(BI.Widget, {
watermark: "", watermark: "",
errorText: "", errorText: "",
height: 24, height: 24,
text: BI.i18nText("BI-Basic_Unrestricted") defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: BI.i18nText("BI-Basic_Unrestricted") // 显示值
}); });
}, },
@ -58701,20 +58692,21 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.text.setText(BI.i18nText("BI-Select_Part")); this.text.setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
} else { } else {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} }
return; return;
} }
if (BI.isString(v)) { if (BI.isString(v)) {
this.text.setText(v); this.text.setText(v);
v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); // 配置了defaultText才判断标灰,其他情况不标灰
(BI.isKey(o.defaultText) && o.defaultText === v) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
return; return;
} }
if (BI.isArray(v)) { if (BI.isArray(v)) {
if (BI.isEmpty(v)) { if (BI.isEmpty(v)) {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} else if (v.length === 1) { } else if (v.length === 1) {
this.text.setText(v[0]); this.text.setText(v[0]);
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
@ -69278,6 +69270,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
defaultText: o.text,
text: this._digest(o.value), text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
@ -69358,7 +69351,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}, },
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -70251,7 +70245,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: o.text, defaultText: o.text,
text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: "",
@ -70330,15 +70325,9 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
mounted: function () {
var o = this.options;
if(BI.isKey(o.value)) {
this.setValue([o.value]);
}
},
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -73826,6 +73815,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
defaultText: o.text,
text: o.text, text: o.text,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,
@ -81856,7 +81846,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-editor", baseCls: "bi-single-select-editor",
el: {} el: {},
text: BI.i18nText("BI-Basic_Please_Select")
}); });
}, },
@ -81870,7 +81861,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
text: o.text defaultText: o.text,
text: o.text,
}); });
this.editor.on(BI.Controller.EVENT_CHANGE, function () { this.editor.on(BI.Controller.EVENT_CHANGE, function () {

54
dist/fineui.js vendored

@ -57508,16 +57508,11 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: this._getText(), defaultText: o.text,
text: this._digest(o.value, o.items),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: ""
listeners: [{
eventName: BI.Events.MOUNT,
action: function () {
self.editor.setState(self._digest(o.value, o.items));
}
}]
}, },
popup: { popup: {
type: "bi.search_text_value_combo_popup", type: "bi.search_text_value_combo_popup",
@ -57552,11 +57547,6 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
this.editor.setState(v); this.editor.setState(v);
}, },
_getText: function () {
var o = this.options;
return (BI.isKey(o.value) && o.text === this._digest(o.value, o.items)) ? "" : o.text;
},
_digest: function(vals, items){ _digest: function(vals, items){
var o = this.options; var o = this.options;
vals = BI.isArray(vals) ? vals : [vals]; vals = BI.isArray(vals) ? vals : [vals];
@ -58878,7 +58868,8 @@ BI.StateEditor = BI.inherit(BI.Widget, {
watermark: "", watermark: "",
errorText: "", errorText: "",
height: 24, height: 24,
text: BI.i18nText("BI-Basic_Unrestricted") defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: BI.i18nText("BI-Basic_Unrestricted") // 显示值
}); });
}, },
@ -59105,20 +59096,21 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.text.setText(BI.i18nText("BI-Select_Part")); this.text.setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
} else { } else {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} }
return; return;
} }
if (BI.isString(v)) { if (BI.isString(v)) {
this.text.setText(v); this.text.setText(v);
v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); // 配置了defaultText才判断标灰,其他情况不标灰
(BI.isKey(o.defaultText) && o.defaultText === v) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
return; return;
} }
if (BI.isArray(v)) { if (BI.isArray(v)) {
if (BI.isEmpty(v)) { if (BI.isEmpty(v)) {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} else if (v.length === 1) { } else if (v.length === 1) {
this.text.setText(v[0]); this.text.setText(v[0]);
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
@ -69682,6 +69674,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
defaultText: o.text,
text: this._digest(o.value), text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
@ -69762,7 +69755,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}, },
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -70655,7 +70649,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: o.text, defaultText: o.text,
text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: "",
@ -70734,15 +70729,9 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
mounted: function () {
var o = this.options;
if(BI.isKey(o.value)) {
this.setValue([o.value]);
}
},
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -74230,6 +74219,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
defaultText: o.text,
text: o.text, text: o.text,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,
@ -82260,7 +82250,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-editor", baseCls: "bi-single-select-editor",
el: {} el: {},
text: BI.i18nText("BI-Basic_Please_Select")
}); });
}, },
@ -82274,7 +82265,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
text: o.text defaultText: o.text,
text: o.text,
}); });
this.editor.on(BI.Controller.EVENT_CHANGE, function () { this.editor.on(BI.Controller.EVENT_CHANGE, function () {

54
dist/fineui_without_jquery_polyfill.js vendored

@ -40390,16 +40390,11 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: this._getText(), defaultText: o.text,
text: this._digest(o.value, o.items),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: ""
listeners: [{
eventName: BI.Events.MOUNT,
action: function () {
self.editor.setState(self._digest(o.value, o.items));
}
}]
}, },
popup: { popup: {
type: "bi.search_text_value_combo_popup", type: "bi.search_text_value_combo_popup",
@ -40434,11 +40429,6 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
this.editor.setState(v); this.editor.setState(v);
}, },
_getText: function () {
var o = this.options;
return (BI.isKey(o.value) && o.text === this._digest(o.value, o.items)) ? "" : o.text;
},
_digest: function(vals, items){ _digest: function(vals, items){
var o = this.options; var o = this.options;
vals = BI.isArray(vals) ? vals : [vals]; vals = BI.isArray(vals) ? vals : [vals];
@ -41760,7 +41750,8 @@ BI.StateEditor = BI.inherit(BI.Widget, {
watermark: "", watermark: "",
errorText: "", errorText: "",
height: 24, height: 24,
text: BI.i18nText("BI-Basic_Unrestricted") defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: BI.i18nText("BI-Basic_Unrestricted") // 显示值
}); });
}, },
@ -41987,20 +41978,21 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.text.setText(BI.i18nText("BI-Select_Part")); this.text.setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
} else { } else {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} }
return; return;
} }
if (BI.isString(v)) { if (BI.isString(v)) {
this.text.setText(v); this.text.setText(v);
v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); // 配置了defaultText才判断标灰,其他情况不标灰
(BI.isKey(o.defaultText) && o.defaultText === v) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
return; return;
} }
if (BI.isArray(v)) { if (BI.isArray(v)) {
if (BI.isEmpty(v)) { if (BI.isEmpty(v)) {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} else if (v.length === 1) { } else if (v.length === 1) {
this.text.setText(v[0]); this.text.setText(v[0]);
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
@ -52288,6 +52280,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
defaultText: o.text,
text: this._digest(o.value), text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
@ -52368,7 +52361,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}, },
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -53261,7 +53255,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: o.text, defaultText: o.text,
text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: "",
@ -53340,15 +53335,9 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
mounted: function () {
var o = this.options;
if(BI.isKey(o.value)) {
this.setValue([o.value]);
}
},
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -56836,6 +56825,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
defaultText: o.text,
text: o.text, text: o.text,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,
@ -64866,7 +64856,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-editor", baseCls: "bi-single-select-editor",
el: {} el: {},
text: BI.i18nText("BI-Basic_Please_Select")
}); });
}, },
@ -64880,7 +64871,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
text: o.text defaultText: o.text,
text: o.text,
}); });
this.editor.on(BI.Controller.EVENT_CHANGE, function () { this.editor.on(BI.Controller.EVENT_CHANGE, function () {

24
dist/widget.js vendored

@ -7092,6 +7092,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
defaultText: o.text,
text: this._digest(o.value), text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
@ -7172,7 +7173,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}, },
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -8065,7 +8067,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: o.text, defaultText: o.text,
text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: "",
@ -8144,15 +8147,9 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
mounted: function () {
var o = this.options;
if(BI.isKey(o.value)) {
this.setValue([o.value]);
}
},
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {
@ -11640,6 +11637,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
defaultText: o.text,
text: o.text, text: o.text,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,
@ -19670,7 +19668,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-editor", baseCls: "bi-single-select-editor",
el: {} el: {},
text: BI.i18nText("BI-Basic_Please_Select")
}); });
}, },
@ -19684,7 +19683,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
text: o.text defaultText: o.text,
text: o.text,
}); });
this.editor.on(BI.Controller.EVENT_CHANGE, function () { this.editor.on(BI.Controller.EVENT_CHANGE, function () {

16
src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js

@ -25,16 +25,11 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: this._getText(), defaultText: o.text,
text: this._digest(o.value, o.items),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: ""
listeners: [{
eventName: BI.Events.MOUNT,
action: function () {
self.editor.setState(self._digest(o.value, o.items));
}
}]
}, },
popup: { popup: {
type: "bi.search_text_value_combo_popup", type: "bi.search_text_value_combo_popup",
@ -69,11 +64,6 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
this.editor.setState(v); this.editor.setState(v);
}, },
_getText: function () {
var o = this.options;
return (BI.isKey(o.value) && o.text === this._digest(o.value, o.items)) ? "" : o.text;
},
_digest: function(vals, items){ _digest: function(vals, items){
var o = this.options; var o = this.options;
vals = BI.isArray(vals) ? vals : [vals]; vals = BI.isArray(vals) ? vals : [vals];

14
src/case/editor/editor.state.js

@ -21,7 +21,8 @@ BI.StateEditor = BI.inherit(BI.Widget, {
watermark: "", watermark: "",
errorText: "", errorText: "",
height: 24, height: 24,
text: BI.i18nText("BI-Basic_Unrestricted") defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: BI.i18nText("BI-Basic_Unrestricted") // 显示值
}); });
}, },
@ -248,20 +249,21 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.text.setText(BI.i18nText("BI-Select_Part")); this.text.setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");
} else { } else {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} }
return; return;
} }
if (BI.isString(v)) { if (BI.isString(v)) {
this.text.setText(v); this.text.setText(v);
v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); // 配置了defaultText才判断标灰,其他情况不标灰
(BI.isKey(o.defaultText) && o.defaultText === v) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
return; return;
} }
if (BI.isArray(v)) { if (BI.isArray(v)) {
if (BI.isEmpty(v)) { if (BI.isEmpty(v)) {
this.text.setText(o.text); this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this.text.element.addClass("bi-water-mark"); BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} else if (v.length === 1) { } else if (v.length === 1) {
this.text.setText(v[0]); this.text.setText(v[0]);
this.text.element.removeClass("bi-water-mark"); this.text.element.removeClass("bi-water-mark");

4
src/widget/multilayerselecttree/multilayerselecttree.trigger.js

@ -29,6 +29,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
defaultText: o.text,
text: this._digest(o.value), text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
@ -109,7 +110,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}, },
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {

13
src/widget/multilayersingletree/multilayersingletree.trigger.js

@ -29,7 +29,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
text: o.text, defaultText: o.text,
text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: "",
@ -108,15 +109,9 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
mounted: function () {
var o = this.options;
if(BI.isKey(o.value)) {
this.setValue([o.value]);
}
},
_digest: function (v) { _digest: function (v) {
return this.options.valueFormatter(v); var o = this.options;
return o.valueFormatter(v) || o.text;
}, },
stopEditing: function () { stopEditing: function () {

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

@ -23,6 +23,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
defaultText: o.text,
text: o.text, text: o.text,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,

6
src/widget/singleselect/trigger/editor.singleselect.js

@ -9,7 +9,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-editor", baseCls: "bi-single-select-editor",
el: {} el: {},
text: BI.i18nText("BI-Basic_Please_Select")
}); });
}, },
@ -23,7 +24,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
text: o.text defaultText: o.text,
text: o.text,
}); });
this.editor.on(BI.Controller.EVENT_CHANGE, function () { this.editor.on(BI.Controller.EVENT_CHANGE, function () {

Loading…
Cancel
Save