From 2e305edce32feb6e03df17598216bff64defdf04 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 13 Sep 2022 10:04:07 +0800 Subject: [PATCH 1/4] =?UTF-8?q?KERNEL-12735=20feat:=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A7=E4=BB=B6=E6=B0=B4=E5=8D=B0=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/dynamicdate/dynamicdate.trigger.js | 4 ++-- src/widget/time/time.trigger.js | 9 +++++---- src/widget/timeinterval/dateinterval.js | 8 ++++---- src/widget/timeinterval/timeinterval.js | 10 +++++----- src/widget/yearinterval/yearinterval.js | 9 +++++---- src/widget/yearmonth/combo.yearmonth.js | 3 ++- src/widget/yearmonth/trigger.yearmonth.js | 10 +++++++--- src/widget/yearmonthinterval/yearmonthinterval.js | 7 ++++--- src/widget/yearquarter/combo.yearquarter.js | 3 ++- src/widget/yearquarter/trigger.yearquarter.js | 10 +++++++--- src/widget/yearquarterinterval/yearquarterinterval.js | 9 +++++---- 11 files changed, 48 insertions(+), 34 deletions(-) diff --git a/src/widget/dynamicdate/dynamicdate.trigger.js b/src/widget/dynamicdate/dynamicdate.trigger.js index 1412fae69..adac3cadc 100644 --- a/src/widget/dynamicdate/dynamicdate.trigger.js +++ b/src/widget/dynamicdate/dynamicdate.trigger.js @@ -17,7 +17,7 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { iconWidth: 24, format: "", // 显示的日期格式化方式 allowEdit: true, // 是否允许编辑 - watermark: "" + watermark: BI.i18nText("BI-Basic_Unrestricted"), }, _init: function () { @@ -44,7 +44,7 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { hgap: c.hgap, vgap: c.vgap, allowBlank: true, - watermark: BI.isKey(o.watermark) ? o.watermark : BI.i18nText("BI-Basic_Unrestricted"), + watermark: o.watermark, errorText: function (v) { var str = ""; if (!BI.isKey(o.format)) { diff --git a/src/widget/time/time.trigger.js b/src/widget/time/time.trigger.js index cd8e25cd4..099cabeac 100644 --- a/src/widget/time/time.trigger.js +++ b/src/widget/time/time.trigger.js @@ -27,7 +27,8 @@ extraCls: "bi-time-trigger", value: {}, format: "", - allowEdit: false + allowEdit: false, + watermark: BI.i18nText("BI-Basic_Unrestricted"), }, render: function () { @@ -52,7 +53,7 @@ value: this._formatValue(o.value), hgap: 4, allowBlank: true, - watermark: BI.isKey(o.watermark) ? o.watermark : BI.i18nText("BI-Basic_Unrestricted"), + watermark: o.watermark, title: BI.bind(this._getTitle, this), listeners: [{ eventName: "EVENT_KEY_DOWN", @@ -185,7 +186,7 @@ focus: function () { this.editor.focus(); }, - + blur: function () { this.editor.blur(); }, @@ -195,4 +196,4 @@ } }); BI.shortcut("bi.time_trigger", BI.TimeTrigger); -})(); \ No newline at end of file +})(); diff --git a/src/widget/timeinterval/dateinterval.js b/src/widget/timeinterval/dateinterval.js index e20188d37..f6b2176c6 100644 --- a/src/widget/timeinterval/dateinterval.js +++ b/src/widget/timeinterval/dateinterval.js @@ -24,8 +24,8 @@ BI.DateInterval = BI.inherit(BI.Single, { BI.DateInterval.superclass._init.apply(this, arguments); o.value = o.value || {}; - this.left = this._createCombo(o.value.start); - this.right = this._createCombo(o.value.end); + this.left = this._createCombo(o.value.start, o.watermark?.start); + this.right = this._createCombo(o.value.end, o.watermark?.end); this.label = BI.createWidget({ type: "bi.label", height: o.height, @@ -65,7 +65,7 @@ BI.DateInterval = BI.inherit(BI.Single, { }); }, - _createCombo: function (v) { + _createCombo: function (v, watermark) { var self = this, o = this.options; var combo = BI.createWidget({ type: "bi.dynamic_date_combo", @@ -74,7 +74,7 @@ BI.DateInterval = BI.inherit(BI.Single, { maxDate: o.maxDate, simple: o.simple, behaviors: o.behaviors, - watermark: o.watermark, + watermark: watermark, value: v, height: o.height, listeners: [{ diff --git a/src/widget/timeinterval/timeinterval.js b/src/widget/timeinterval/timeinterval.js index 95fd88bfe..3910c77e8 100644 --- a/src/widget/timeinterval/timeinterval.js +++ b/src/widget/timeinterval/timeinterval.js @@ -24,8 +24,8 @@ BI.TimeInterval = BI.inherit(BI.Single, { BI.TimeInterval.superclass._init.apply(this, arguments); o.value = o.value || {}; - this.left = this._createCombo(o.value.start); - this.right = this._createCombo(o.value.end); + this.left = this._createCombo(o.value.start, o.watermark?.start); + this.right = this._createCombo(o.value.end, o.watermark?.end); this.label = BI.createWidget({ type: "bi.label", height: o.height, @@ -65,7 +65,7 @@ BI.TimeInterval = BI.inherit(BI.Single, { }); }, - _createCombo: function (v) { + _createCombo: function (v, watermark) { var self = this, o = this.options; var combo = BI.createWidget({ type: "bi.dynamic_date_time_combo", @@ -74,7 +74,7 @@ BI.TimeInterval = BI.inherit(BI.Single, { minDate: o.minDate, maxDate: o.maxDate, behaviors: o.behaviors, - watermark: o.watermark, + watermark: watermark, value: v, height: o.height, }); @@ -202,4 +202,4 @@ BI.TimeInterval = BI.inherit(BI.Single, { BI.TimeInterval.EVENT_VALID = "EVENT_VALID"; BI.TimeInterval.EVENT_ERROR = "EVENT_ERROR"; BI.TimeInterval.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.time_interval", BI.TimeInterval); \ No newline at end of file +BI.shortcut("bi.time_interval", BI.TimeInterval); diff --git a/src/widget/yearinterval/yearinterval.js b/src/widget/yearinterval/yearinterval.js index 7c27f24f4..9f48d7f5f 100644 --- a/src/widget/yearinterval/yearinterval.js +++ b/src/widget/yearinterval/yearinterval.js @@ -23,8 +23,8 @@ BI.YearInterval = BI.inherit(BI.Single, { var self = this, o = this.options; o.value = o.value || {}; - this.left = this._createCombo(o.value.start); - this.right = this._createCombo(o.value.end); + this.left = this._createCombo(o.value.start, o.watermark?.start); + this.right = this._createCombo(o.value.end, o.watermark?.end); return [{ type: "bi.center", @@ -63,7 +63,7 @@ BI.YearInterval = BI.inherit(BI.Single, { }] }, - _createCombo: function (v) { + _createCombo: function (v, watermark) { var self = this, o = this.options; var combo = BI.createWidget({ type: "bi.dynamic_year_combo", @@ -73,6 +73,7 @@ BI.YearInterval = BI.inherit(BI.Single, { height: o.height, behaviors: o.behaviors, value: v, + watermark: watermark, listeners: [{ eventName: BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW, action: function () { @@ -206,4 +207,4 @@ BI.YearInterval.EVENT_VALID = "EVENT_VALID"; BI.YearInterval.EVENT_ERROR = "EVENT_ERROR"; BI.YearInterval.EVENT_CHANGE = "EVENT_CHANGE"; BI.YearInterval.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; -BI.shortcut("bi.year_interval", BI.YearInterval); \ No newline at end of file +BI.shortcut("bi.year_interval", BI.YearInterval); diff --git a/src/widget/yearmonth/combo.yearmonth.js b/src/widget/yearmonth/combo.yearmonth.js index 45431225b..a6de2de6f 100644 --- a/src/widget/yearmonth/combo.yearmonth.js +++ b/src/widget/yearmonth/combo.yearmonth.js @@ -23,7 +23,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { min: o.minDate, max: o.maxDate, height: o.height - border, - value: o.value || "" + value: o.value || "", + watermark: o.watermark, }); this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN, function () { self.combo.isViewVisible() && self.combo.hideView(); diff --git a/src/widget/yearmonth/trigger.yearmonth.js b/src/widget/yearmonth/trigger.yearmonth.js index 56a6b420a..a17e6ec48 100644 --- a/src/widget/yearmonth/trigger.yearmonth.js +++ b/src/widget/yearmonth/trigger.yearmonth.js @@ -9,7 +9,11 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { extraCls: "bi-year-month-trigger", min: "1900-01-01", // 最小日期 max: "2099-12-31", // 最大日期 - height: 24 + height: 24, + watermark: { + year: BI.i18nText("BI-Basic_Unrestricted"), + month: BI.i18nText("BI-Basic_Unrestricted"), + }, }, beforeInit: function (callback) { @@ -80,7 +84,7 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { quitChecker: function () { return false; }, - watermark: BI.i18nText("BI-Basic_Unrestricted"), + watermark: isYear ? o.watermark?.year : o.watermark.month, errorText: function (v) { var year = isYear ? v : self.yearEditor.getValue(); var month = isYear ? self.monthEditor.getValue() : v; @@ -288,4 +292,4 @@ BI.DynamicYearMonthTrigger.EVENT_START = "EVENT_START"; BI.DynamicYearMonthTrigger.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.DynamicYearMonthTrigger.EVENT_STOP = "EVENT_STOP"; BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; -BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger); \ No newline at end of file +BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger); diff --git a/src/widget/yearmonthinterval/yearmonthinterval.js b/src/widget/yearmonthinterval/yearmonthinterval.js index c915c51f3..85e982e22 100644 --- a/src/widget/yearmonthinterval/yearmonthinterval.js +++ b/src/widget/yearmonthinterval/yearmonthinterval.js @@ -19,8 +19,8 @@ BI.YearMonthInterval = BI.inherit(BI.Single, { BI.YearMonthInterval.superclass._init.apply(this, arguments); o.value = o.value || {}; - this.left = this._createCombo(o.value.start); - this.right = this._createCombo(o.value.end); + this.left = this._createCombo(o.value.start, o.watermark?.start); + this.right = this._createCombo(o.value.end, o.watermark?.end); this.label = BI.createWidget({ type: "bi.label", height: o.height, @@ -61,7 +61,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, { }); }, - _createCombo: function (v) { + _createCombo: function (v, watermark) { var self = this, o = this.options; var combo = BI.createWidget({ type: "bi.dynamic_year_month_combo", @@ -71,6 +71,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, { maxDate: o.maxDate, behaviors: o.behaviors, value: v, + watermark: watermark, listeners: [{ eventName: BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW, action: function () { diff --git a/src/widget/yearquarter/combo.yearquarter.js b/src/widget/yearquarter/combo.yearquarter.js index 16537990c..9ec93454b 100644 --- a/src/widget/yearquarter/combo.yearquarter.js +++ b/src/widget/yearquarter/combo.yearquarter.js @@ -26,7 +26,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { min: o.minDate, max: o.maxDate, height: o.height - border, - value: o.value || "" + value: o.value || "", + watermark: o.watermark, }); this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN, function () { self.combo.isViewVisible() && self.combo.hideView(); diff --git a/src/widget/yearquarter/trigger.yearquarter.js b/src/widget/yearquarter/trigger.yearquarter.js index ea7cb6f4e..a7e5a59ca 100644 --- a/src/widget/yearquarter/trigger.yearquarter.js +++ b/src/widget/yearquarter/trigger.yearquarter.js @@ -9,7 +9,11 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { extraCls: "bi-year-quarter-trigger", min: "1900-01-01", // 最小日期 max: "2099-12-31", // 最大日期 - height: 24 + height: 24, + watermark: { + year: BI.i18nText("BI-Basic_Unrestricted"), + quarter: BI.i18nText("BI-Basic_Unrestricted"), + }, }, _init: function () { @@ -96,7 +100,7 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { BI.getQuarter(end) ); }, - watermark: BI.i18nText("BI-Basic_Unrestricted"), + watermark: isYear ? o.watermark?.year : o.watermark?.quarter, hgap: c.hgap, vgap: c.vgap, allowBlank: true @@ -272,4 +276,4 @@ BI.DynamicYearQuarterTrigger.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.DynamicYearQuarterTrigger.EVENT_STOP = "EVENT_STOP"; BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; BI.DynamicYearQuarterTrigger.EVENT_VALID = "EVENT_VALID"; -BI.shortcut("bi.dynamic_year_quarter_trigger", BI.DynamicYearQuarterTrigger); \ No newline at end of file +BI.shortcut("bi.dynamic_year_quarter_trigger", BI.DynamicYearQuarterTrigger); diff --git a/src/widget/yearquarterinterval/yearquarterinterval.js b/src/widget/yearquarterinterval/yearquarterinterval.js index e148a92f0..f23134a09 100644 --- a/src/widget/yearquarterinterval/yearquarterinterval.js +++ b/src/widget/yearquarterinterval/yearquarterinterval.js @@ -23,8 +23,8 @@ BI.YearQuarterInterval = BI.inherit(BI.Single, { var self = this, o = this.options; o.value = o.value || {}; - this.left = this._createCombo(o.value.start); - this.right = this._createCombo(o.value.end); + this.left = this._createCombo(o.value.start, o.watermark?.start); + this.right = this._createCombo(o.value.end, o.watermark?.end); return [{ type: "bi.center", @@ -63,7 +63,7 @@ BI.YearQuarterInterval = BI.inherit(BI.Single, { }] }, - _createCombo: function (v) { + _createCombo: function (v, watermark) { var self = this, o = this.options; var combo = BI.createWidget({ type: "bi.dynamic_year_quarter_combo", @@ -73,6 +73,7 @@ BI.YearQuarterInterval = BI.inherit(BI.Single, { behaviors: o.behaviors, value: v, height: o.height, + watermark: watermark, listeners: [{ eventName: BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW, action: function () { @@ -204,4 +205,4 @@ BI.YearQuarterInterval.EVENT_VALID = "EVENT_VALID"; BI.YearQuarterInterval.EVENT_ERROR = "EVENT_ERROR"; BI.YearQuarterInterval.EVENT_CHANGE = "EVENT_CHANGE"; BI.YearQuarterInterval.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; -BI.shortcut("bi.year_quarter_interval", BI.YearQuarterInterval); \ No newline at end of file +BI.shortcut("bi.year_quarter_interval", BI.YearQuarterInterval); From 2e6b165994c300bf3240d9239e3697be93770b4e Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 13 Sep 2022 10:20:22 +0800 Subject: [PATCH 2/4] =?UTF-8?q?KERNEL-12735=20feat:=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A7=E4=BB=B6=E6=B0=B4=E5=8D=B0=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/timeinterval/timeperiods.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/widget/timeinterval/timeperiods.js b/src/widget/timeinterval/timeperiods.js index 45c5a970f..5a0edf56d 100644 --- a/src/widget/timeinterval/timeperiods.js +++ b/src/widget/timeinterval/timeperiods.js @@ -51,7 +51,7 @@ ref: function (_ref) { self.left = _ref; } - }, this._createCombo(o.value.start)), + }, this._createCombo(o.value.start, o.watermark?.start)), left: this.constants.offset, right: 0, top: 0, @@ -64,7 +64,7 @@ ref: function (_ref) { self.right = _ref; } - }, this._createCombo(o.value.end)), + }, this._createCombo(o.value.end, o.watermark?.end)), left: 0, right: this.constants.offset, top: 0, @@ -80,13 +80,14 @@ }; }, - _createCombo: function (v) { + _createCombo: function (v, watermark) { var self = this; var o = this.options; return { type: "bi.time_combo", value: v, height: o.height, + watermark: watermark, listeners: [{ eventName: BI.TimeCombo.EVENT_BEFORE_POPUPVIEW, action: function () { @@ -119,4 +120,4 @@ BI.TimePeriods.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.TimePeriods.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.time_periods", BI.TimePeriods); -})(); \ No newline at end of file +})(); From a8859107c3117fe74ea70dff3d5a206475e08b17 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 13 Sep 2022 11:16:07 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=97=A0JRIA=20fix:=20valueFormatter=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/trigger/trigger.text.select.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/case/trigger/trigger.text.select.js b/src/case/trigger/trigger.text.select.js index dd7849115..ccae85610 100644 --- a/src/case/trigger/trigger.text.select.js +++ b/src/case/trigger/trigger.text.select.js @@ -52,8 +52,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { _digest: function (val, items) { var o = this.options; - val = BI.isArray(val) ? val : [val]; - + // 提升valueFormatter的优先级 if (o.valueFormatter !== BI.emptyFn && BI.isFunction(o.valueFormatter)) { return { @@ -61,6 +60,8 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { }; } + val = BI.isArray(val) ? val : [val]; + var result = []; var formatItems = BI.Tree.transformToArrayFormat(items); From 53dd4ddd6577b47ef1ac8c24d53e8b5f2fa737aa Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 13 Sep 2022 11:45:47 +0800 Subject: [PATCH 4/4] =?UTF-8?q?REPORT-76823=20fix:=20FR11=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F-=E6=8E=A7=E4=BB=B6-=E4=B8=8B=E6=8B=89=E6=A0=91?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=EF=BC=8C=E7=82=B9=E5=87=BB=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E5=90=8E=EF=BC=8C=E6=97=A0=E6=B3=95=E5=86=8D?= =?UTF-8?q?=E6=AC=A1=E7=82=B9=E5=87=BB=E6=94=B6=E8=B5=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/base/trigger/trigger.less | 4 +- .../multilayersingletree.combo.less | 10 ++ .../multilayerselecttree.combo.js | 3 +- .../multilayersingletree.combo.js | 101 ++++++++++-------- .../multilayersingletree.trigger.js | 13 +-- 5 files changed, 74 insertions(+), 57 deletions(-) diff --git a/src/less/base/trigger/trigger.less b/src/less/base/trigger/trigger.less index bcd89590a..70e1f277f 100644 --- a/src/less/base/trigger/trigger.less +++ b/src/less/base/trigger/trigger.less @@ -1,7 +1,7 @@ @import "../../index.less"; .bi-trigger{ - & .bi-trigger-icon-button{ + & .bi-trigger-icon-button, &.bi-trigger-icon-button { font-size: @font-size-16; } -} \ No newline at end of file +} diff --git a/src/less/widget/multilayersingletree/multilayersingletree.combo.less b/src/less/widget/multilayersingletree/multilayersingletree.combo.less index 15df50877..b190d19c1 100644 --- a/src/less/widget/multilayersingletree/multilayersingletree.combo.less +++ b/src/less/widget/multilayersingletree/multilayersingletree.combo.less @@ -1,6 +1,16 @@ @import "../../index.less"; +@val: transform .3s ease; .bi-multilayer-single-tree-combo { + + // 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下 + & .bi-combo.bi-combo-popup + .bi-trigger-icon-button { + & .x-icon { + .rotate(180deg); + .transition(@val); + } + } + &.status-error { &.bi-border, &.bi-border-bottom { border-color: @border-color-negative; diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index e748ee1c5..7263346b0 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -35,7 +35,6 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { var baseConfig = this._getBaseConfig(); - if (o.allowEdit) { return { type: "bi.absolute", @@ -210,7 +209,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { var self = this, o = this.options; return { type: "bi.trigger_icon_button", - cls: "trigger-icon-button", + cls: "bi-trigger trigger-icon-button", ref: function (_ref) { self.triggerBtn = _ref; }, diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index 364f1e008..d06f1a8c6 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -33,14 +33,48 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; - return (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); + var cls = (o.simple ? "bi-border-bottom " : "bi-border bi-border-radius ") + (BI.isKey(o.status) ? ("status-" + o.status) : ""); + + var baseConfig = this._getBaseConfig(); + + if (o.allowEdit) { + return { + type: "bi.absolute", + cls, + items: [ + { + el: BI.extend(baseConfig, this._getSearchConfig()), + top: 0, bottom: 0, right: 0, left: 0 + }, { + el: self._getTriggerIconButton(), + top: 0, bottom: 0, right: 0, + }, + ] + }; + } + + return BI.extend(baseConfig, { + el: { + type: "bi.single_tree_trigger", + ref: function (_ref) { + self.textTrigger = _ref; + }, + text: o.text, + defaultText: o.defaultText, + height: o.height, + items: o.items, + value: o.value, + tipType: o.tipType, + warningTitle: o.warningTitle, + valueFormatter: o.valueFormatter, + }, + }, { cls }); }, _getBaseConfig: function () { var self = this, o = this.options; return { type: "bi.combo", - cls: (o.simple ? "bi-border-bottom" : "bi-border bi-border-radius ") + (BI.isKey(o.status) ? ("status-" + o.status) : ""), container: o.container, destroyWhenHide: o.destroyWhenHide, adjustLength: 2, @@ -152,7 +186,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { // IE11下,popover(position: fixed)下放置下拉控件(position: fixed), 滚动的时候会异常卡顿 // 通过container参数将popup放置于popover之外解决此问题, 其他下拉控件由于元素少或者有分页,所以 // 卡顿不明显, 先在此做尝试, 并在FineUI特殊处理待解决文档中标记跟踪 - return !(o.container && self.trigger.getSearcher().isSearching() && self.trigger.getSearcher().getView().element.find(e.target).length > 0); + return (o.container && self.trigger.getSearcher().isSearching() && self.trigger.getSearcher().getView().element.find(e.target).length > 0) ? false : self.triggerBtn?.element.find(e.target).length === 0; }, listeners: [{ eventName: BI.Combo.EVENT_AFTER_HIDEVIEW, @@ -168,46 +202,29 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { }; }, - _getSyncConfig: function () { - var o = this.options, self = this; - var baseConfig = this._getBaseConfig(); - return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : { - el: { - type: "bi.single_tree_trigger", - ref: function (_ref) { - self.textTrigger = _ref; - }, - text: o.text, - defaultText: o.defaultText, - height: o.height, - items: o.items, - value: o.value, - tipType: o.tipType, - warningTitle: o.warningTitle, - valueFormatter: o.valueFormatter, - }, - }); - }, - - _getAsyncConfig: function () { - var o = this.options, self = this; - var baseConfig = this._getBaseConfig(); - return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : { - el: { - type: "bi.single_tree_trigger", - ref: function (_ref) { - self.textTrigger = _ref; - }, - text: o.text, - defaultText: o.defaultText, - height: o.height, - items: o.items, - value: o.value, - tipType: o.tipType, - warningTitle: o.warningTitle, - valueFormatter: o.valueFormatter, + _getTriggerIconButton: function () { + var self = this, o = this.options; + return { + type: "bi.trigger_icon_button", + cls: "bi-trigger trigger-icon-button", + ref: function (_ref) { + self.triggerBtn = _ref; }, - }); + width: o.height, + height: o.height, + listeners: [ + { + eventName: BI.TriggerIconButton.EVENT_CHANGE, + action: function () { + if (self.combo.isViewVisible()) { + self.combo.hideView(); + } else { + self.combo.showView(); + } + } + } + ] + }; }, getSearcher: function () { diff --git a/src/widget/multilayersingletree/multilayersingletree.trigger.js b/src/widget/multilayersingletree/multilayersingletree.trigger.js index b4f5c8dd9..617c70d7b 100644 --- a/src/widget/multilayersingletree/multilayersingletree.trigger.js +++ b/src/widget/multilayersingletree/multilayersingletree.trigger.js @@ -102,17 +102,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { }] }, width: "fill", - }, { - el: { - type: "bi.trigger_icon_button", - cls: "trigger-icon-button", - ref: function (_ref) { - self.triggerBtn = _ref; - }, - width: 24, - }, - width: 24 - } + rgap: 24, + }, ] }; },