From 2c7ec58932c29a7d51fe97730cb5bd375b5d07c9 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 8 Jul 2019 18:02:41 +0800 Subject: [PATCH 1/5] =?UTF-8?q?BI-47433=20fix:=20=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E5=88=97=E8=A1=A8setEnable=E4=B8=BAfalse=E4=BB=8D=E7=84=B6?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E9=80=89=E4=B8=ADitem=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/multiselect.loader.js | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/widget/multiselect/multiselect.loader.js b/src/widget/multiselect/multiselect.loader.js index 53e4466b6d..4f9e0fd973 100644 --- a/src/widget/multiselect/multiselect.loader.js +++ b/src/widget/multiselect/multiselect.loader.js @@ -148,6 +148,36 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, { val.value || (val.value = []); }, + _assertMasker: function() { + var self = this, o = this.options; + if(BI.isNull(this.masker)) { + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: { + type: "bi.layout", + cls: "disable-mask", + invisible: !o.disabled, + ref: function () { + self.masker = this; + } + }, + left: 0, + right: 0, + top: 0, + bottom: 0 + }] + }) + } + }, + + _setEnable: function (enable) { + BI.MultiSelectLoader.superclass._setEnable.apply(this, arguments); + this._assertMasker(); + this.masker.setVisible(!enable); + }, + setStartValue: function (v) { this._startValue = v; }, From a3a34982138eb6d8616cdbf9316dd30fc3ffdab0 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 8 Jul 2019 19:47:17 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20=E6=83=B3=E4=BA=86=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E6=94=B9=E4=B8=80=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/list/list.select.js | 7 ++++--- src/widget/multiselect/multiselect.loader.js | 7 +------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/case/list/list.select.js b/src/case/list/list.select.js index 861e111de4..9d5f47ddec 100644 --- a/src/case/list/list.select.js +++ b/src/case/list/list.select.js @@ -52,7 +52,7 @@ BI.SelectList = BI.inherit(BI.Widget, { callback.apply(self, arguments); if (op.times === 1) { self.toolbar.setVisible(items && items.length > 0); - self.toolbar.setEnable(items && items.length > 0); + self.toolbar.setEnable(!o.disabled && items && items.length > 0); } self._checkAllSelected(); }); @@ -151,7 +151,7 @@ BI.SelectList = BI.inherit(BI.Widget, { value: this.list.getNotSelectedValue(), assist: this.list.getValue() }; - + }, empty: function () { @@ -159,8 +159,9 @@ BI.SelectList = BI.inherit(BI.Widget, { }, populate: function (items) { + var o = this.options; this.toolbar.setVisible(!BI.isEmptyArray(items)); - this.toolbar.setEnable(!BI.isEmptyArray(items)); + this.toolbar.setEnable(!o.disabled && !BI.isEmptyArray(items)); this.list.populate.apply(this.list, arguments); this._checkAllSelected(); }, diff --git a/src/widget/multiselect/multiselect.loader.js b/src/widget/multiselect/multiselect.loader.js index 4f9e0fd973..456562995a 100644 --- a/src/widget/multiselect/multiselect.loader.js +++ b/src/widget/multiselect/multiselect.loader.js @@ -127,6 +127,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, { cls: "bi-list-item-active", height: 24, selected: this.isAllSelected(), + disabled: this.options.disabled, iconWrapperWidth: 36 }); }, @@ -172,12 +173,6 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, { } }, - _setEnable: function (enable) { - BI.MultiSelectLoader.superclass._setEnable.apply(this, arguments); - this._assertMasker(); - this.masker.setVisible(!enable); - }, - setStartValue: function (v) { this._startValue = v; }, From 6ff429535506ecb8b2ff623b247b91aff98a147e Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 8 Jul 2019 19:58:00 +0800 Subject: [PATCH 3/5] update --- src/widget/multiselect/multiselect.loader.js | 24 -------------------- 1 file changed, 24 deletions(-) diff --git a/src/widget/multiselect/multiselect.loader.js b/src/widget/multiselect/multiselect.loader.js index 456562995a..90a42a7309 100644 --- a/src/widget/multiselect/multiselect.loader.js +++ b/src/widget/multiselect/multiselect.loader.js @@ -149,30 +149,6 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, { val.value || (val.value = []); }, - _assertMasker: function() { - var self = this, o = this.options; - if(BI.isNull(this.masker)) { - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: { - type: "bi.layout", - cls: "disable-mask", - invisible: !o.disabled, - ref: function () { - self.masker = this; - } - }, - left: 0, - right: 0, - top: 0, - bottom: 0 - }] - }) - } - }, - setStartValue: function (v) { this._startValue = v; }, From 15c92d3d63067e6749e307a51d5dc0807671229e Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 9 Jul 2019 11:16:06 +0800 Subject: [PATCH 4/5] =?UTF-8?q?BI-47681=20refactor:=20=E7=AE=80=E5=8D=95?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E9=80=89=E6=8B=A9=E5=99=A8=E4=BB=8D=E7=84=B6?= =?UTF-8?q?=E4=BC=9A=E6=94=B6=E5=88=B0auto=E5=92=8Ctransparent=E5=BD=B1?= =?UTF-8?q?=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/colorchooser/colorchooser.popup.js | 21 +++++++++++++++---- .../colorchooser/colorchooser.popup.simple.js | 4 +--- src/case/list/list.select.js | 4 ++-- src/widget/multiselect/multiselect.loader.js | 1 - 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/case/colorchooser/colorchooser.popup.js b/src/case/colorchooser/colorchooser.popup.js index 2931c80a02..7781980cd7 100644 --- a/src/case/colorchooser/colorchooser.popup.js +++ b/src/case/colorchooser/colorchooser.popup.js @@ -10,13 +10,14 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, { props: { baseCls: "bi-color-chooser-popup", width: 230, - height: 145 + height: 145, + simple: false // 简单模式, popup中没有自动和透明 }, render: function () { var self = this, o = this.options; this.colorEditor = BI.createWidget(o.editor, { - type: "bi.color_picker_editor", + type: o.simple ? "bi.simple_color_picker_editor" : "bi.color_picker_editor", value: o.value, cls: "bi-header-background bi-border-bottom", height: 30 @@ -31,7 +32,7 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, { this.storeColors = BI.createWidget({ type: "bi.color_picker", cls: "bi-border-bottom bi-border-right", - items: [this._digestStoreColors(BI.string2Array(BI.Cache.getItem("colors") || ""))], + items: [this._digestStoreColors(this._getStoreColors())], width: 210, height: 24, value: o.value @@ -175,7 +176,7 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, { _dealStoreColors: function () { var color = this.getValue(); - var colors = BI.string2Array(BI.Cache.getItem("colors") || ""); + var colors = this._getStoreColors(); var que = new BI.Queue(8); que.fromArray(colors); que.remove(color); @@ -200,6 +201,18 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, { return items; }, + _getStoreColors: function() { + var self = this, o = this.options; + var colorsArray = BI.string2Array(BI.Cache.getItem("colors") || ""); + return BI.filter(colorsArray, function (idx, color) { + return o.simple ? self._isRGBColor(color) : true; + }); + }, + + _isRGBColor: function (color) { + return BI.isNotEmptyString(color) && color !== "transparent"; + }, + setStoreColors: function (colors) { if (BI.isArray(colors)) { this.storeColors.populate([this._digestStoreColors(colors)]); diff --git a/src/case/colorchooser/colorchooser.popup.simple.js b/src/case/colorchooser/colorchooser.popup.simple.js index 8f77dbd458..bae3a1455f 100644 --- a/src/case/colorchooser/colorchooser.popup.simple.js +++ b/src/case/colorchooser/colorchooser.popup.simple.js @@ -20,9 +20,7 @@ BI.SimpleColorChooserPopup = BI.inherit(BI.Widget, { type: "bi.color_chooser_popup", value: o.value, element: this, - editor: { - type: "bi.simple_color_picker_editor" - } + simple: true // 是否有自动 }); this.popup.on(BI.ColorChooserPopup.EVENT_CHANGE, function () { self.fireEvent(BI.SimpleColorChooserPopup.EVENT_CHANGE, arguments); diff --git a/src/case/list/list.select.js b/src/case/list/list.select.js index 9d5f47ddec..4f3eb91534 100644 --- a/src/case/list/list.select.js +++ b/src/case/list/list.select.js @@ -52,7 +52,7 @@ BI.SelectList = BI.inherit(BI.Widget, { callback.apply(self, arguments); if (op.times === 1) { self.toolbar.setVisible(items && items.length > 0); - self.toolbar.setEnable(!o.disabled && items && items.length > 0); + self.toolbar.setEnable(items && items.length > 0); } self._checkAllSelected(); }); @@ -161,7 +161,7 @@ BI.SelectList = BI.inherit(BI.Widget, { populate: function (items) { var o = this.options; this.toolbar.setVisible(!BI.isEmptyArray(items)); - this.toolbar.setEnable(!o.disabled && !BI.isEmptyArray(items)); + this.toolbar.setEnable(!BI.isEmptyArray(items)); this.list.populate.apply(this.list, arguments); this._checkAllSelected(); }, diff --git a/src/widget/multiselect/multiselect.loader.js b/src/widget/multiselect/multiselect.loader.js index 90a42a7309..53e4466b6d 100644 --- a/src/widget/multiselect/multiselect.loader.js +++ b/src/widget/multiselect/multiselect.loader.js @@ -127,7 +127,6 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, { cls: "bi-list-item-active", height: 24, selected: this.isAllSelected(), - disabled: this.options.disabled, iconWrapperWidth: 36 }); }, From b41c5e84cb4dc4246a56a65504ea4296aa1ba055 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 9 Jul 2019 11:17:09 +0800 Subject: [PATCH 5/5] update --- src/case/list/list.select.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/case/list/list.select.js b/src/case/list/list.select.js index 4f3eb91534..27a0227b0a 100644 --- a/src/case/list/list.select.js +++ b/src/case/list/list.select.js @@ -159,7 +159,6 @@ BI.SelectList = BI.inherit(BI.Widget, { }, populate: function (items) { - var o = this.options; this.toolbar.setVisible(!BI.isEmptyArray(items)); this.toolbar.setEnable(!BI.isEmptyArray(items)); this.list.populate.apply(this.list, arguments);