From 4aacda1707ed2bae7afa613458029c287533042d Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 16 Jul 2020 17:10:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E5=90=8C?= =?UTF-8?q?=E6=AD=A5insert=5Fcombo=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../multiselect/multiselect.combo.nobar.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/widget/multiselect/multiselect.combo.nobar.js b/src/widget/multiselect/multiselect.combo.nobar.js index 3c3da7379..10faf902c 100644 --- a/src/widget/multiselect/multiselect.combo.nobar.js +++ b/src/widget/multiselect/multiselect.combo.nobar.js @@ -78,6 +78,11 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { self._setStartValue(""); self.fireEvent(BI.MultiSelectNoBarCombo.EVENT_STOP); }); + this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () { + if (this.getSearcher().hasMatched()) { + self._addItem(assertShowValue); + } + }); this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) { var last = BI.last(keywords); @@ -272,6 +277,25 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { }); }, + _addItem: function (assertShowValue) { + var self = this; + var keyword = this.trigger.getSearcher().getKeyword(); + this._join({ + type: BI.Selection.Multi, + value: [keyword] + }, function () { + // 如果在不选的状态下直接把该值添加进来 + if (self.storeValue.type === BI.Selection.Multi) { + BI.pushDistinct(self.storeValue.value, keyword); + } + self.combo.setValue(self.storeValue); + self._setStartValue(keyword); + assertShowValue(); + self.populate(); + self._setStartValue(""); + }); + }, + _itemsCreator4Trigger: function (op, callback) { var self = this, o = this.options; o.itemsCreator(op, function (res) { From 83104257560490f3443b8e01a54ec24194ca3445 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 16 Jul 2020 19:40:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-35605=20fix:=20=E6=9C=88=E4=BB=BD?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/date/calendar/picker.date.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/widget/date/calendar/picker.date.js b/src/widget/date/calendar/picker.date.js index 6ba45d705..0d5d48d7b 100644 --- a/src/widget/date/calendar/picker.date.js +++ b/src/widget/date/calendar/picker.date.js @@ -141,9 +141,16 @@ BI.DatePicker = BI.inherit(BI.Widget, { _getAllowMonths: function () { var self = this, o = this.options; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"); + var maxDate = BI.parseDateTime(o.max, "%Y-%X-%d"); + minDate.setDate(1); + maxDate.setDate(1); + var calcMin = BI.print(minDate, "%Y-%X-%d"); + var calcMax = BI.print(maxDate, "%Y-%X-%d"); + return BI.filter(BI.range(1, 13), function (idx, v) { - return !BI.checkDateVoid(self.year.getValue(), v, 1, o.min, o.max)[0]; - }) + return !BI.checkDateVoid(self.year.getValue(), v, 1, calcMin, calcMax)[0]; + }); }, _checkLeftValid: function () {