Browse Source

REPORT-28581 && REPORT-28577 && REPORT-28580

es6
windy 5 years ago
parent
commit
42a9365503
  1. 23
      src/case/editor/editor.state.js
  2. 22
      src/case/editor/editor.state.simple.js
  3. 7
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js
  4. 7
      src/widget/multilayersingletree/multilayersingletree.trigger.js
  5. 5
      src/widget/multiselect/multiselect.insert.trigger.js
  6. 5
      src/widget/multiselect/multiselect.trigger.js
  7. 4
      src/widget/multiselect/trigger/editor.multiselect.js
  8. 4
      src/widget/multiselect/trigger/searcher.multiselect.insert.js
  9. 4
      src/widget/multiselect/trigger/searcher.multiselect.js
  10. 4
      src/widget/multitree/trigger/searcher.list.multi.tree.js
  11. 4
      src/widget/multitree/trigger/searcher.multi.tree.js
  12. 5
      src/widget/singleselect/singleselect.trigger.js

23
src/case/editor/editor.state.js

@ -201,6 +201,11 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.text.visible();
},
_setText: function (v) {
this.text.setText(v);
this.text.setTitle(v);
},
isValid: function () {
return this.editor.isValid();
},
@ -243,32 +248,32 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.stateValue = v;
if (BI.isNumber(v)) {
if (v === BI.Selection.All) {
this.text.setText(BI.i18nText("BI-Select_All"));
this._setText(BI.i18nText("BI-Select_All"));
this.text.element.removeClass("bi-water-mark");
} else if (v === BI.Selection.Multi) {
this.text.setText(BI.i18nText("BI-Select_Part"));
this._setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark");
} else {
this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this._setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
}
return;
}
if (BI.isString(v)) {
this.text.setText(v);
this._setText(v);
// 配置了defaultText才判断标灰,其他情况不标灰
(BI.isKey(o.defaultText) && o.defaultText === v) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
return;
}
if (BI.isArray(v)) {
if (BI.isEmpty(v)) {
this.text.setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
this._setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} else if (v.length === 1) {
this.text.setText(v[0]);
this._setText(v[0]);
this.text.element.removeClass("bi-water-mark");
} else {
this.text.setText(BI.i18nText("BI-Select_Part"));
this._setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark");
}
}
@ -276,6 +281,10 @@ BI.StateEditor = BI.inherit(BI.Widget, {
setTipType: function (v) {
this.text.options.tipType = v;
},
getText: function () {
return this.text.getText();
}
});
BI.StateEditor.EVENT_CHANGE = "EVENT_CHANGE";

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

@ -187,6 +187,11 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
this.text.visible();
},
_setText: function (v) {
this.text.setText(v);
this.text.setTitle(v);
},
isValid: function () {
return this.editor.isValid();
},
@ -228,28 +233,31 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
BI.SimpleStateEditor.superclass.setValue.apply(this, arguments);
if (BI.isNumber(v)) {
if (v === BI.Selection.All) {
this.text.setText(BI.i18nText("BI-Already_Selected"));
this._setText(BI.i18nText("BI-Already_Selected"));
this.text.element.removeClass("bi-water-mark");
} else if (v === BI.Selection.Multi) {
this.text.setText(BI.i18nText("BI-Already_Selected"));
this._setText(BI.i18nText("BI-Already_Selected"));
this.text.element.removeClass("bi-water-mark");
} else {
this.text.setText(o.text);
this._setText(o.text);
this.text.element.addClass("bi-water-mark");
}
return;
}
if (!BI.isArray(v) || v.length === 1) {
this.text.setText(v);
this.text.setTitle(v);
this._setText(v);
this.text.element.removeClass("bi-water-mark");
} else if (BI.isEmpty(v)) {
this.text.setText(o.text);
this._setText(o.text);
this.text.element.addClass("bi-water-mark");
} else {
this.text.setText(BI.i18nText("BI-Already_Selected"));
this._setText(BI.i18nText("BI-Already_Selected"));
this.text.element.removeClass("bi-water-mark");
}
},
getText: function () {
return this.text.getText();
}
});
BI.SimpleStateEditor.EVENT_CHANGE = "EVENT_CHANGE";

7
src/widget/multilayerselecttree/multilayerselecttree.trigger.js

@ -12,7 +12,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search"),
allowSearchValue: false
allowSearchValue: false,
title: BI.bind(this._getShowText, this)
};
},
@ -210,6 +211,10 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
return o.valueFormatter(v);
},
_getShowText: function () {
return this.editor.getText();
},
stopEditing: function () {
this.searcher.stopSearch();
},

7
src/widget/multilayersingletree/multilayersingletree.trigger.js

@ -12,7 +12,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search"),
allowSearchValue: false
allowSearchValue: false,
title: BI.bind(this._getShowText, this)
};
},
@ -211,6 +212,10 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
},
_getShowText: function () {
return this.editor.getText();
},
stopEditing: function () {
this.searcher.stopSearch();
},

5
src/widget/multiselect/multiselect.insert.trigger.js

@ -97,7 +97,10 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
element: this,
items: [{
el: {
type: "bi.layout"
type: "bi.text",
title: function () {
return self.searcher.getState();
}
},
left: 0,
right: 24,

5
src/widget/multiselect/multiselect.trigger.js

@ -94,7 +94,10 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
element: this,
items: [{
el: {
type: "bi.layout"
type: "bi.text",
title: function () {
return self.searcher.getState();
}
},
left: 0,
right: 24,

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

@ -74,6 +74,10 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
},
getState: function () {
return this.editor.getText();
},
getKeywords: function () {
var val = this.editor.getLastChangedValue();
var keywords = val.match(/[\S]+/g);

4
src/widget/multiselect/trigger/searcher.multiselect.insert.js

@ -166,6 +166,10 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
}
},
getState: function() {
return this.editor.getState();
},
setValue: function (ob) {
this.setState(ob);
this.searcher.setValue(ob);

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

@ -160,6 +160,10 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
}
},
getState: function() {
return this.editor.getState();
},
setValue: function (ob) {
this.setState(ob);
this.searcher.setValue(ob);

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

@ -134,6 +134,10 @@ BI.MultiListTreeSearcher = BI.inherit(BI.Widget, {
}
},
getState: function() {
return this.editor.getState();
},
setValue: function (ob) {
this.setState(ob);
this.searcher.setValue(ob);

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

@ -165,6 +165,10 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
}
},
getState: function() {
return this.editor.getState();
},
setValue: function (ob) {
this.setState(ob);
this.searcher.setValue(ob);

5
src/widget/singleselect/singleselect.trigger.js

@ -88,7 +88,10 @@ BI.SingleSelectTrigger = BI.inherit(BI.Trigger, {
element: this,
items: [{
el: {
type: "bi.layout"
type: "bi.text",
title: function () {
return self.searcher.getState();
}
},
left: 0,
right: 24,

Loading…
Cancel
Save