From 65a432a6fedb6d5119aac23eb481278be2d51d67 Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Fri, 13 Nov 2020 10:05:28 +0800 Subject: [PATCH] =?UTF-8?q?DEC-15891=20fix:=20=E8=A1=A5=E5=85=85=E5=94=AF?= =?UTF-8?q?=E4=B8=80=E6=A0=B9=E8=8A=82=E7=82=B9item=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../button/treeitem/item.root.treeleaf.js | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/case/button/treeitem/item.root.treeleaf.js b/src/case/button/treeitem/item.root.treeleaf.js index 49512e0d1..8e1a9a02f 100644 --- a/src/case/button/treeitem/item.root.treeleaf.js +++ b/src/case/button/treeitem/item.root.treeleaf.js @@ -1,21 +1,23 @@ BI.RootTreeLeafItem = BI.inherit(BI.BasicButton, { - _defaultConfig: function () { - return BI.extend(BI.RootTreeLeafItem.superclass._defaultConfig.apply(this, arguments), { - extraCls: "bi-root-tree-leaf-item bi-list-item-active", - logic: { - dynamic: false - }, - id: "", - pId: "", - layer: 0, - height: 24 - }); + props: { + baseCls: "bi-root-tree-leaf-item bi-list-item-active", + logic: { + dynamic: false + }, + id: "", + pId: "", + layer: 0, + height: 24 }, - _init: function () { - BI.RootTreeLeafItem.superclass._init.apply(this, arguments); + + render: function () { + var self = this; var o = this.options; - this.text = BI.createWidget({ + var text = { type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, textAlign: "left", whiteSpace: "nowrap", textHeight: o.height, @@ -25,7 +27,8 @@ BI.RootTreeLeafItem = BI.inherit(BI.BasicButton, { value: o.value, py: o.py, keyword: o.keyword - }); + }; + var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left); var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, { width: 24, @@ -35,13 +38,12 @@ BI.RootTreeLeafItem = BI.inherit(BI.BasicButton, { height: o.height } }, { - el: this.text + el: text }); - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic(type, BI.extend(o.logic, { + + return BI.LogicFactory.createLogic(type, BI.extend(o.logic, { items: items - })))); + })); }, doRedMark: function () {