From d6ce996fbad3bd124814f2f9311802d59b72095d Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 28 Jun 2019 16:29:41 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=8D=E9=80=89multilayertree=E7=9A=84getValue?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../multilayerselecttree.leveltree.js | 10 +++++++--- .../multilayersingletree.leveltree.js | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js index 74d8792fa..49319ea9d 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js @@ -111,9 +111,9 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Pane, { el: { type: "bi.loader", isDefaultInit: o.itemsCreator !== BI.emptyFn, - chooseType: o.chooseType, el: { type: "bi.button_tree", + chooseType: o.chooseType, behaviors: o.behaviors, layouts: [{ type: "bi.vertical" @@ -150,8 +150,12 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Pane, { }, setValue: function (v) { - this.storeValue = v; - this.tree.setValue(v); + // getValue依赖于storeValue, 那么不选的时候就不要更新storeValue了 + if(this.options.chooseType === BI.Selection.None) { + } else { + this.storeValue = v; + this.tree.setValue(v); + } }, getValue: function () { diff --git a/src/widget/multilayersingletree/multilayersingletree.leveltree.js b/src/widget/multilayersingletree/multilayersingletree.leveltree.js index f067f2ef0..9a06dccb0 100644 --- a/src/widget/multilayersingletree/multilayersingletree.leveltree.js +++ b/src/widget/multilayersingletree/multilayersingletree.leveltree.js @@ -110,9 +110,9 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Pane, { el: { type: "bi.loader", isDefaultInit: o.itemsCreator !== BI.emptyFn, - chooseType: o.chooseType, el: { type: "bi.button_tree", + chooseType: o.chooseType, behaviors: o.behaviors, layouts: [{ type: "bi.vertical" @@ -149,8 +149,12 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Pane, { }, setValue: function (v) { - this.storeValue = v; - this.tree.setValue(v); + // getValue依赖于storeValue, 那么不选的时候就不要更新storeValue了 + if(this.options.chooseType === BI.Selection.None) { + } else { + this.storeValue = v; + this.tree.setValue(v); + } }, getValue: function () { From 77a952f704fb5e1a40625292333bc6277816471c Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 28 Jun 2019 16:47:03 +0800 Subject: [PATCH 2/4] =?UTF-8?q?button=E5=8F=AF=E9=85=8Dicon=E5=AE=BD?= =?UTF-8?q?=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/button/buttons/button.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index a76540c21..b3f6cf075 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -48,9 +48,12 @@ BI.Button = BI.inherit(BI.BasicButton, { } if (BI.isKey(o.iconCls)) { this.icon = BI.createWidget({ - type: "bi.icon", + type: "bi.icon_label", + cls: o.iconCls, width: 18, - height: o.height - 2 + height: o.height - 2, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight }); this.text = BI.createWidget({ type: "bi.label", @@ -60,7 +63,6 @@ BI.Button = BI.inherit(BI.BasicButton, { }); BI.createWidget({ type: "bi.center_adapt", - cls: o.iconCls, element: this, hgap: o.hgap, vgap: o.vgap, From 50e0826515016a8c81f246748453cadca380d4b2 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 28 Jun 2019 17:16:58 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/button/buttons/button.js | 4 ---- src/core/wrapper/layout/flex/flex.center.js | 13 +++++++++++-- .../wrapper/layout/flex/flex.horizontal.center.js | 5 ----- .../wrapper/layout/flex/flex.vertical.center.js | 5 ----- .../layout/flex/wrapper/flex.wrapper.center.js | 8 +++++++- .../flex/wrapper/flex.wrapper.horizontal.center.js | 5 ----- .../flex/wrapper/flex.wrapper.vertical.center.js | 5 ----- 7 files changed, 18 insertions(+), 27 deletions(-) diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index b3f6cf075..85ab78d06 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -66,10 +66,6 @@ BI.Button = BI.inherit(BI.BasicButton, { element: this, hgap: o.hgap, vgap: o.vgap, - tgap: o.tgap, - bgap: o.bgap, - lgap: o.lgap, - rgap: o.rgap, items: [{ type: "bi.horizontal", items: [this.icon, this.text] diff --git a/src/core/wrapper/layout/flex/flex.center.js b/src/core/wrapper/layout/flex/flex.center.js index f6073505e..add02edbb 100644 --- a/src/core/wrapper/layout/flex/flex.center.js +++ b/src/core/wrapper/layout/flex/flex.center.js @@ -8,7 +8,9 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, { props: function () { return BI.extend(BI.FlexCenterLayout.superclass.props.apply(this, arguments), { - baseCls: "bi-flex-center-adapt-layout" + baseCls: "bi-flex-center-adapt-layout", + hgap: 0, + vgap: 0 }); }, render: function () { @@ -19,7 +21,14 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, { _addElement: function (i, item) { var o = this.options; var w = BI.FlexCenterLayout.superclass._addElement.apply(this, arguments); - w.element.css({position: "relative", "flex-shrink": "0"}); + w.element.css({ + position: "relative", + "flex-shrink": "0", + "margin-left": (i === 0 ? o.hgap : 0) + "px", + "margin-right": o.hgap + "px", + "margin-top": o.vgap + "px", + "margin-bottom": o.vgap + "px" + }); return w; }, diff --git a/src/core/wrapper/layout/flex/flex.horizontal.center.js b/src/core/wrapper/layout/flex/flex.horizontal.center.js index 602e4b8cc..6a06ed277 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.center.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.center.js @@ -33,11 +33,6 @@ BI.FlexHorizontalCenter = BI.inherit(BI.Layout, { scrolly: o.scrolly, scrollable: o.scrollable, hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, items: o.items }; }, diff --git a/src/core/wrapper/layout/flex/flex.vertical.center.js b/src/core/wrapper/layout/flex/flex.vertical.center.js index fea81ef49..e99c44853 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.center.js +++ b/src/core/wrapper/layout/flex/flex.vertical.center.js @@ -33,12 +33,7 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, { scrollx: o.scrollx, scrolly: o.scrolly, scrollable: o.scrollable, - hgap: o.hgap, vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, items: o.items }; }, diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js index 7ba06fe75..9be30ab8f 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js @@ -21,7 +21,13 @@ BI.FlexWrapperCenterLayout = BI.inherit(BI.Layout, { _addElement: function (i, item) { var o = this.options; var w = BI.FlexWrapperCenterLayout.superclass._addElement.apply(this, arguments); - w.element.css({position: "relative"}); + w.element.css({ + position: "relative", + "margin-left": (i === 0 ? o.hgap : 0) + "px", + "margin-right": o.hgap + "px", + "margin-top": o.vgap + "px", + "margin-bottom": o.vgap + "px" + }); return w; }, diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js index 9a4d271eb..2f97dcd40 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js @@ -35,11 +35,6 @@ BI.FlexWrapperHorizontalCenter = BI.inherit(BI.Layout, { scrolly: o.scrolly, scrollable: o.scrollable, hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, items: o.items }; }, diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js index c5a6a029b..f4d2424c1 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js @@ -34,12 +34,7 @@ BI.FlexWrapperVerticalCenter = BI.inherit(BI.Layout, { scrollx: o.scrollx, scrolly: o.scrolly, scrollable: o.scrollable, - hgap: o.hgap, vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, items: o.items }; }, From 6af640df7e6d91c110708d98cb14b09bbebdeb8b Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 28 Jun 2019 17:25:55 +0800 Subject: [PATCH 4/4] update --- src/core/wrapper/layout/flex/flex.horizontal.center.js | 3 +++ src/core/wrapper/layout/flex/flex.vertical.center.js | 3 +++ .../layout/flex/wrapper/flex.wrapper.horizontal.center.js | 3 +++ .../layout/flex/wrapper/flex.wrapper.vertical.center.js | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/core/wrapper/layout/flex/flex.horizontal.center.js b/src/core/wrapper/layout/flex/flex.horizontal.center.js index 6a06ed277..6639e46de 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.center.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.center.js @@ -33,6 +33,9 @@ BI.FlexHorizontalCenter = BI.inherit(BI.Layout, { scrolly: o.scrolly, scrollable: o.scrollable, hgap: o.hgap, + vgap: o.vgap, + tgap: o.tgap, + bgap: o.bgap, items: o.items }; }, diff --git a/src/core/wrapper/layout/flex/flex.vertical.center.js b/src/core/wrapper/layout/flex/flex.vertical.center.js index e99c44853..a87ad2da7 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.center.js +++ b/src/core/wrapper/layout/flex/flex.vertical.center.js @@ -34,6 +34,9 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, { scrolly: o.scrolly, scrollable: o.scrollable, vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + hgap: o.hgap, items: o.items }; }, diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js index 2f97dcd40..0f54ab6cf 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js @@ -35,6 +35,9 @@ BI.FlexWrapperHorizontalCenter = BI.inherit(BI.Layout, { scrolly: o.scrolly, scrollable: o.scrollable, hgap: o.hgap, + vgap: o.vgap, + tgap: o.tgap, + bgap: o.bgap, items: o.items }; }, diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js index f4d2424c1..b572b3088 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js @@ -34,7 +34,10 @@ BI.FlexWrapperVerticalCenter = BI.inherit(BI.Layout, { scrollx: o.scrollx, scrolly: o.scrolly, scrollable: o.scrollable, + hgap: o.hgap, vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, items: o.items }; },