Browse Source

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

* commit '4efc8663d6a8e0631093c6d7e2dc7fe6549eaf83':
  REPORT-28557 fix: type改一下
  REPORT-28586 open属性问题
  changelog
  REPORT-28581 && REPORT-28577 && REPORT-28580
es6
windy 5 years ago
parent
commit
d3c60742b9
  1. 1
      changelog.md
  2. 23
      src/case/editor/editor.state.js
  3. 22
      src/case/editor/editor.state.simple.js
  4. 1
      src/component/treevaluechooser/abstract.treevaluechooser.list.js
  5. 7
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js
  6. 2
      src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js
  7. 7
      src/widget/multilayersingletree/multilayersingletree.trigger.js
  8. 5
      src/widget/multiselect/multiselect.insert.trigger.js
  9. 5
      src/widget/multiselect/multiselect.trigger.js
  10. 4
      src/widget/multiselect/trigger/editor.multiselect.js
  11. 4
      src/widget/multiselect/trigger/searcher.multiselect.insert.js
  12. 4
      src/widget/multiselect/trigger/searcher.multiselect.js
  13. 4
      src/widget/multitree/trigger/searcher.list.multi.tree.js
  14. 4
      src/widget/multitree/trigger/searcher.multi.tree.js
  15. 5
      src/widget/singleselect/singleselect.trigger.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志 # 更新日志
2.0(2020-03) 2.0(2020-03)
- 修复了下拉类型控件不允许编辑的时候没有title的问题
- 修复了连续多次调用BI.Msg.alert后只有最后弹出的可以关闭的问题 - 修复了连续多次调用BI.Msg.alert后只有最后弹出的可以关闭的问题
- 修复了time_combo设置格式为%M:%S后value设置大于30分钟的值时标红的问题 - 修复了time_combo设置格式为%M:%S后value设置大于30分钟的值时标红的问题
- 复选下拉树系列展开节点性能优化 - 复选下拉树系列展开节点性能优化

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

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

1
src/component/treevaluechooser/abstract.treevaluechooser.list.js

@ -229,6 +229,7 @@ BI.AbstractListTreeValueChooser = BI.inherit(BI.AbstractTreeValueChooser, {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value]))); allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
}); });
BI.each(allNodes, function (idx, node) { BI.each(allNodes, function (idx, node) {
var valueMap = dealWithSelectedValue(node.parentValues, selectedValues);
var checked = BI.has(valueMap, node.value); var checked = BI.has(valueMap, node.value);
result.push({ result.push({
id: node.id, id: node.id,

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

@ -12,7 +12,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}, },
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search"), 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); return o.valueFormatter(v);
}, },
_getShowText: function () {
return this.editor.getText();
},
stopEditing: function () { stopEditing: function () {
this.searcher.stopSearch(); this.searcher.stopSearch();
}, },

2
src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js

@ -21,7 +21,7 @@ BI.MultiLayerSingleTreeInsertSearchPane = BI.inherit(BI.Widget, {
render: function() { render: function() {
var self = this, o = this.options; var self = this, o = this.options;
this.tree = BI.createWidget({ this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree", type: "bi.multilayer_single_level_tree",
isDefaultInit: o.isDefaultInit, isDefaultInit: o.isDefaultInit,
items: o.items, items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {

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

@ -12,7 +12,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}, },
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search"), 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 () { stopEditing: function () {
this.searcher.stopSearch(); this.searcher.stopSearch();
}, },

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

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

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

@ -94,7 +94,10 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
element: this, element: this,
items: [{ items: [{
el: { el: {
type: "bi.layout" type: "bi.text",
title: function () {
return self.searcher.getState();
}
}, },
left: 0, left: 0,
right: 24, 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 () { getKeywords: function () {
var val = this.editor.getLastChangedValue(); var val = this.editor.getLastChangedValue();
var keywords = val.match(/[\S]+/g); 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) { setValue: function (ob) {
this.setState(ob); this.setState(ob);
this.searcher.setValue(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) { setValue: function (ob) {
this.setState(ob); this.setState(ob);
this.searcher.setValue(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) { setValue: function (ob) {
this.setState(ob); this.setState(ob);
this.searcher.setValue(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) { setValue: function (ob) {
this.setState(ob); this.setState(ob);
this.searcher.setValue(ob); this.searcher.setValue(ob);

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

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

Loading…
Cancel
Save