From 8e213098d435efb4a1c1b24624715fb2fadbae6a Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Fri, 5 Mar 2021 19:13:33 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E7=BB=9F?= =?UTF-8?q?=E4=B8=80item.mulitselect=E5=92=8Citem.singleselect.radio=20?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E5=92=8C=E6=96=87=E5=AD=97=E7=9A=84=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E8=A1=8C=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/button/item.multiselect.js | 11 ++++++----- src/case/button/item.singleselect.radio.js | 7 +++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/case/button/item.multiselect.js b/src/case/button/item.multiselect.js index 54d6ebd6f..5a418a9f1 100644 --- a/src/case/button/item.multiselect.js +++ b/src/case/button/item.multiselect.js @@ -11,7 +11,8 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { logic: { dynamic: false }, - iconWrapperWidth: 26 + textHgap: 5, + textRgap: 0 }); }, _init: function () { @@ -27,8 +28,8 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { whiteSpace: "nowrap", textHeight: o.height, height: o.height, - hgap: o.hgap, - rgap: o.rgap, + hgap: o.textHgap, + rgap: o.textHgap, text: o.text, keyword: o.keyword, value: o.value, @@ -46,7 +47,7 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { items: BI.LogicFactory.createLogicItemsByDirection("left", { type: "bi.center_adapt", items: [this.checkbox], - width: o.iconWrapperWidth + width: 16 }, this.text) })))); }, @@ -73,4 +74,4 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { } }); BI.MultiSelectItem.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.multi_select_item", BI.MultiSelectItem); \ No newline at end of file +BI.shortcut("bi.multi_select_item", BI.MultiSelectItem); diff --git a/src/case/button/item.singleselect.radio.js b/src/case/button/item.singleselect.radio.js index 3f17a6bae..83622047d 100644 --- a/src/case/button/item.singleselect.radio.js +++ b/src/case/button/item.singleselect.radio.js @@ -10,7 +10,9 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { logic: { dynamic: false }, - height: 24 + height: 24, + textHgap: 5, + textRgap: 0 }); }, _init: function () { @@ -26,7 +28,8 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { whiteSpace: "nowrap", textHeight: o.height, height: o.height, - hgap: o.hgap, + hgap: o.textHgap, + rgap: o.textHgap, text: o.text, keyword: o.keyword, value: o.value, From c87237089712a2f5aba49f3f64c4a7f0cef0af21 Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Tue, 9 Mar 2021 19:04:31 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20revert:?= =?UTF-8?q?=205fb75ef130a517e53b39421b384fa27914ccf0e0=20[5fb75ef]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index 20f68850c..5d4fdc470 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -71,13 +71,12 @@ BI.Layout = BI.inherit(BI.Widget, { var self = this; var frag = BI.Widget._renderEngine.createFragment(); var hasChild = false; - for (var key in this._children) { - var child = this._children[key]; - if (child.element !== self.element) { - frag.appendChild(child.element[0]); + BI.each(this._children, function (i, widget) { + if (widget.element !== self.element) { + frag.appendChild(widget.element[0]); hasChild = true; } - } + }); if (hasChild === true) { this.appendFragment(frag); } @@ -269,13 +268,19 @@ BI.Layout = BI.inherit(BI.Widget, { if (!child.shouldUpdate) { return null; } - return child.shouldUpdate(this._getOptions(item)); + return child.shouldUpdate(this._getOptions(item)) === true; }, updateItemAt: function (index, item) { if (index < 0 || index > this.options.items.length - 1) { return; } + + var child = this._children[this._getChildName(index)]; + var updated; + if (updated = child.update(this._getOptions(item))) { + return updated; + } var del = this._children[this._getChildName(index)]; delete this._children[this._getChildName(index)]; this.options.items.splice(index, 1); @@ -362,14 +367,7 @@ BI.Layout = BI.inherit(BI.Widget, { patchItem: function (oldVnode, vnode, index) { var shouldUpdate = this.shouldUpdateItem(index, vnode); - var child = this._children[this._getChildName(index)]; - if (shouldUpdate) { - return child._update(this._getOptions(vnode), shouldUpdate); - } - if (shouldUpdate === null && !this._compare(oldVnode, vnode)) { - // if (child.update) { - // return child.update(this._getOptions(vnode)); - // } + if (shouldUpdate === true || (shouldUpdate === null && !this._compare(oldVnode, vnode))) { return this.updateItemAt(index, vnode); } }, From f8a30ba6eca66f17ce7aa4eb299d28e79a52405d Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Tue, 9 Mar 2021 19:16:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E7=BB=9F?= =?UTF-8?q?=E4=B8=80item.mulitselect=E5=92=8Citem.singleselect.radio=20?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E5=92=8C=E6=96=87=E5=AD=97=E7=9A=84=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E8=A1=8C=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/button/item.multiselect.js | 5 +++-- src/case/button/item.singleselect.radio.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/case/button/item.multiselect.js b/src/case/button/item.multiselect.js index 5a418a9f1..7d320c0b2 100644 --- a/src/case/button/item.multiselect.js +++ b/src/case/button/item.multiselect.js @@ -11,7 +11,8 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { logic: { dynamic: false }, - textHgap: 5, + iconWrapperWidth: 16, + textHgap: 0, textRgap: 0 }); }, @@ -47,7 +48,7 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { items: BI.LogicFactory.createLogicItemsByDirection("left", { type: "bi.center_adapt", items: [this.checkbox], - width: 16 + width: o.iconWrapperWidth }, this.text) })))); }, diff --git a/src/case/button/item.singleselect.radio.js b/src/case/button/item.singleselect.radio.js index 83622047d..f84105cda 100644 --- a/src/case/button/item.singleselect.radio.js +++ b/src/case/button/item.singleselect.radio.js @@ -11,7 +11,8 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { dynamic: false }, height: 24, - textHgap: 5, + iconWrapperWidth: 16, + textHgap: 0, textRgap: 0 }); }, @@ -42,7 +43,7 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { items: BI.LogicFactory.createLogicItemsByDirection("left", { type: "bi.center_adapt", items: [this.radio], - width: 16 + width: o.conWrapperWidth }, this.text) })))); },