From 8a0d76fe2598b11673ae9ed4f495180ed73c146a Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 24 Jun 2020 14:18:53 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-34299=20=E4=B8=8B=E6=8B=89=E6=A0=91?= =?UTF-8?q?=E7=B3=BB=E5=88=97=E6=94=AF=E6=8C=81isNeedAdjustWidth=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + .../treevaluechooser/combo.listtreevaluechooser.js | 4 +++- .../treevaluechooser/combo.treevaluechooser.insert.js | 4 +++- src/component/treevaluechooser/combo.treevaluechooser.js | 4 +++- .../multilayerselecttree/multilayerselecttree.combo.js | 5 ++++- .../multilayersingletree/multilayersingletree.combo.js | 5 ++++- src/widget/multitree/multi.tree.combo.js | 7 +++++-- src/widget/multitree/multi.tree.insert.combo.js | 7 +++++-- src/widget/multitree/multi.tree.list.combo.js | 7 +++++-- 9 files changed, 33 insertions(+), 11 deletions(-) diff --git a/changelog.md b/changelog.md index bef9a247c..aeab84ac2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-06) +- 下拉树系列支持isNeedAdjustWidth以动态变化宽度 - 修复了新增值的下拉控件传递valueFormatter搜索完全匹配项提示新增 - 修复了选色控件历史记录没有选中的问题的问题 - 修复了单选下拉框新增值的时候没有发事件的问题 diff --git a/src/component/treevaluechooser/combo.listtreevaluechooser.js b/src/component/treevaluechooser/combo.listtreevaluechooser.js index 4286b9cd7..7fa35c6cf 100644 --- a/src/component/treevaluechooser/combo.listtreevaluechooser.js +++ b/src/component/treevaluechooser/combo.listtreevaluechooser.js @@ -13,7 +13,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, width: 200, height: 24, items: null, - itemsCreator: BI.emptyFn + itemsCreator: BI.emptyFn, + isNeedAdjustWidth: true, }); }, @@ -25,6 +26,7 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, } this.combo = BI.createWidget({ type: "bi.multi_tree_list_combo", + isNeedAdjustWidth: o.isNeedAdjustWidth, element: this, text: o.text, value: o.value, diff --git a/src/component/treevaluechooser/combo.treevaluechooser.insert.js b/src/component/treevaluechooser/combo.treevaluechooser.insert.js index 3527c5d3a..5ef51011c 100644 --- a/src/component/treevaluechooser/combo.treevaluechooser.insert.js +++ b/src/component/treevaluechooser/combo.treevaluechooser.insert.js @@ -13,7 +13,8 @@ BI.TreeValueChooserInsertCombo = BI.inherit(BI.AbstractTreeValueChooser, { width: 200, height: 24, items: null, - itemsCreator: BI.emptyFn + itemsCreator: BI.emptyFn, + isNeedAdjustWidth: true }); }, @@ -25,6 +26,7 @@ BI.TreeValueChooserInsertCombo = BI.inherit(BI.AbstractTreeValueChooser, { } this.combo = BI.createWidget({ type: "bi.multi_tree_insert_combo", + isNeedAdjustWidth: o.isNeedAdjustWidth, allowEdit: o.allowEdit, text: o.text, value: o.value, diff --git a/src/component/treevaluechooser/combo.treevaluechooser.js b/src/component/treevaluechooser/combo.treevaluechooser.js index a859fed0f..99ccfbbf7 100644 --- a/src/component/treevaluechooser/combo.treevaluechooser.js +++ b/src/component/treevaluechooser/combo.treevaluechooser.js @@ -13,7 +13,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, { width: 200, height: 24, items: null, - itemsCreator: BI.emptyFn + itemsCreator: BI.emptyFn, + isNeedAdjustWidth: true }); }, @@ -34,6 +35,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, { valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, height: o.height, + isNeedAdjustWidth: o.isNeedAdjustWidth, listeners: [{ eventName: BI.MultiTreeCombo.EVENT_FOCUS, action: function () { diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index fbfec9380..fd4779572 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -18,7 +18,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { }, allowEdit: false, allowSearchValue: false, - allowInsertValue: false + allowInsertValue: false, + isNeedAdjustWidth: true }); }, @@ -95,8 +96,10 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { }, value: o.value, maxHeight: 400, + maxWidth: o.isNeedAdjustWidth ? "auto" : 500, minHeight: 240 }, + isNeedAdjustWidth: o.isNeedAdjustWidth, listeners: [{ eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW, action: function () { diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index 5534e27ac..5cf34118d 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -21,7 +21,8 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { }, allowEdit: false, allowSearchValue: false, - allowInsertValue: false + allowInsertValue: false, + isNeedAdjustWidth: true }); }, @@ -98,8 +99,10 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { }, value: o.value, maxHeight: 400, + maxWidth: o.isNeedAdjustWidth ? "auto" : 500, minHeight: 240 }, + isNeedAdjustWidth: o.isNeedAdjustWidth, listeners: [{ eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW, action: function () { diff --git a/src/widget/multitree/multi.tree.combo.js b/src/widget/multitree/multi.tree.combo.js index 97b28d492..e431d918d 100644 --- a/src/widget/multitree/multi.tree.combo.js +++ b/src/widget/multitree/multi.tree.combo.js @@ -21,7 +21,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - allowEdit: true + allowEdit: true, + isNeedAdjustWidth: true, }); }, @@ -106,8 +107,10 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { self.numberCounter.adjustView(); self.trigger.getSearcher().adjustView(); }); - } + }, + maxWidth: o.isNeedAdjustWidth ? "auto" : 500, }, + isNeedAdjustWidth: o.isNeedAdjustWidth, value: {value: o.value || {}}, hideChecker: function (e) { return triggerBtn.element.find(e.target).length === 0 && diff --git a/src/widget/multitree/multi.tree.insert.combo.js b/src/widget/multitree/multi.tree.insert.combo.js index e005b8097..b44176039 100644 --- a/src/widget/multitree/multi.tree.insert.combo.js +++ b/src/widget/multitree/multi.tree.insert.combo.js @@ -21,7 +21,8 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - allowEdit: true + allowEdit: true, + isNeedAdjustWidth: true }); }, @@ -121,8 +122,10 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { self.numberCounter.adjustView(); self.trigger.getSearcher().adjustView(); }); - } + }, + maxWidth: o.isNeedAdjustWidth ? "auto" : 500, }, + isNeedAdjustWidth: o.isNeedAdjustWidth, value: {value: o.value || {}}, hideChecker: function (e) { return triggerBtn.element.find(e.target).length === 0 && diff --git a/src/widget/multitree/multi.tree.list.combo.js b/src/widget/multitree/multi.tree.list.combo.js index 31fb9893d..72ba8966d 100644 --- a/src/widget/multitree/multi.tree.list.combo.js +++ b/src/widget/multitree/multi.tree.list.combo.js @@ -22,7 +22,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { valueFormatter: BI.emptyFn, height: 24, allowEdit: true, - allowInsertValue: true + allowInsertValue: true, + isNeedAdjustWidth: true }); }, @@ -140,8 +141,10 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { self.numberCounter.adjustView(); self.trigger.getSearcher().adjustView(); }); - } + }, + maxWidth: o.isNeedAdjustWidth ? "auto" : 500, }, + isNeedAdjustWidth: o.isNeedAdjustWidth, value: {value: o.value || {}}, hideChecker: function (e) { return triggerBtn.element.find(e.target).length === 0 &&