From 42a9365503ea0cca38f084c553cb098995ad0aff Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 23 Mar 2020 16:46:05 +0800 Subject: [PATCH 1/4] REPORT-28581 && REPORT-28577 && REPORT-28580 --- src/case/editor/editor.state.js | 23 +++++++++++++------ src/case/editor/editor.state.simple.js | 22 ++++++++++++------ .../multilayerselecttree.trigger.js | 7 +++++- .../multilayersingletree.trigger.js | 7 +++++- .../multiselect/multiselect.insert.trigger.js | 5 +++- src/widget/multiselect/multiselect.trigger.js | 5 +++- .../multiselect/trigger/editor.multiselect.js | 4 ++++ .../trigger/searcher.multiselect.insert.js | 4 ++++ .../trigger/searcher.multiselect.js | 4 ++++ .../trigger/searcher.list.multi.tree.js | 4 ++++ .../multitree/trigger/searcher.multi.tree.js | 4 ++++ .../singleselect/singleselect.trigger.js | 5 +++- 12 files changed, 75 insertions(+), 19 deletions(-) diff --git a/src/case/editor/editor.state.js b/src/case/editor/editor.state.js index a121e764e..a41ea6df0 100644 --- a/src/case/editor/editor.state.js +++ b/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"; diff --git a/src/case/editor/editor.state.simple.js b/src/case/editor/editor.state.simple.js index c95b160a0..10cb45057 100644 --- a/src/case/editor/editor.state.simple.js +++ b/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"; diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js index b112061f8..7022259f0 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js +++ b/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(); }, diff --git a/src/widget/multilayersingletree/multilayersingletree.trigger.js b/src/widget/multilayersingletree/multilayersingletree.trigger.js index c92a1d416..960f9838b 100644 --- a/src/widget/multilayersingletree/multilayersingletree.trigger.js +++ b/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(); }, diff --git a/src/widget/multiselect/multiselect.insert.trigger.js b/src/widget/multiselect/multiselect.insert.trigger.js index cd6f9fb71..d85721577 100644 --- a/src/widget/multiselect/multiselect.insert.trigger.js +++ b/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, diff --git a/src/widget/multiselect/multiselect.trigger.js b/src/widget/multiselect/multiselect.trigger.js index d1b7bc821..642db0f72 100644 --- a/src/widget/multiselect/multiselect.trigger.js +++ b/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, diff --git a/src/widget/multiselect/trigger/editor.multiselect.js b/src/widget/multiselect/trigger/editor.multiselect.js index 78b38a73f..22a4992d4 100644 --- a/src/widget/multiselect/trigger/editor.multiselect.js +++ b/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); diff --git a/src/widget/multiselect/trigger/searcher.multiselect.insert.js b/src/widget/multiselect/trigger/searcher.multiselect.insert.js index e5014bf8b..722d73012 100644 --- a/src/widget/multiselect/trigger/searcher.multiselect.insert.js +++ b/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); diff --git a/src/widget/multiselect/trigger/searcher.multiselect.js b/src/widget/multiselect/trigger/searcher.multiselect.js index abac99999..a23b1c321 100644 --- a/src/widget/multiselect/trigger/searcher.multiselect.js +++ b/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); diff --git a/src/widget/multitree/trigger/searcher.list.multi.tree.js b/src/widget/multitree/trigger/searcher.list.multi.tree.js index 0985f9849..a116bb482 100644 --- a/src/widget/multitree/trigger/searcher.list.multi.tree.js +++ b/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); diff --git a/src/widget/multitree/trigger/searcher.multi.tree.js b/src/widget/multitree/trigger/searcher.multi.tree.js index e7f27d1e3..db3451844 100644 --- a/src/widget/multitree/trigger/searcher.multi.tree.js +++ b/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); diff --git a/src/widget/singleselect/singleselect.trigger.js b/src/widget/singleselect/singleselect.trigger.js index c32395a55..53605bf5b 100644 --- a/src/widget/singleselect/singleselect.trigger.js +++ b/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, From 0017aa833f2f7d4adf8bcb6c2bc5d83694548a9a Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 23 Mar 2020 16:51:52 +0800 Subject: [PATCH 2/4] changelog --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 0116c51ab..3fde730da 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-03) +- 修复了下拉类型控件不允许编辑的时候没有title的问题 - 修复了连续多次调用BI.Msg.alert后只有最后弹出的可以关闭的问题 - 修复了time_combo设置格式为%M:%S后value设置大于30分钟的值时标红的问题 - 复选下拉树系列展开节点性能优化 From f1d186952f77d02cb02798698107ab23cebc27c4 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 23 Mar 2020 17:22:10 +0800 Subject: [PATCH 3/4] =?UTF-8?q?REPORT-28586=20open=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/treevaluechooser/abstract.treevaluechooser.list.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.list.js b/src/component/treevaluechooser/abstract.treevaluechooser.list.js index 526ce4c67..048a656f8 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.list.js +++ b/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]))); }); BI.each(allNodes, function (idx, node) { + var valueMap = dealWithSelectedValue(node.parentValues, selectedValues); var checked = BI.has(valueMap, node.value); result.push({ id: node.id, From 4efc8663d6a8e0631093c6d7e2dc7fe6549eaf83 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 23 Mar 2020 17:38:33 +0800 Subject: [PATCH 4/4] =?UTF-8?q?REPORT-28557=20fix:=20type=E6=94=B9?= =?UTF-8?q?=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../multilayersingletree.insert.search.pane.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js b/src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js index cc3872191..8e7fa06de 100644 --- a/src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js +++ b/src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js @@ -21,7 +21,7 @@ BI.MultiLayerSingleTreeInsertSearchPane = BI.inherit(BI.Widget, { render: function() { var self = this, o = this.options; this.tree = BI.createWidget({ - type: "bi.multilayer_select_level_tree", + type: "bi.multilayer_single_level_tree", isDefaultInit: o.isDefaultInit, items: o.items, itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {