From 531099dd113891573e5b792e8e7efe3647d1dc79 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 9 Dec 2020 14:53:26 +0800 Subject: [PATCH] =?UTF-8?q?BI-76381=20=E5=90=8C=E6=AD=A5=E6=A0=91=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=94=AF=E6=8C=81=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=B1=95?= =?UTF-8?q?=E5=BC=80=E6=94=B6=E8=B5=B7=E8=8A=82=E7=82=B9=E5=92=8C=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + src/base/tree/ztree/asynctree.js | 4 +++- src/base/tree/ztree/treeview.js | 9 ++++++--- src/component/treevaluechooser/pane.treevaluechooser.js | 6 ++++-- src/less/base/tree/ztree.less | 9 +++++++++ src/widget/multiselecttree/multiselecttree.js | 3 ++- src/widget/multiselecttree/multiselecttree.popup.js | 1 + src/widget/multitree/multi.tree.popup.js | 1 + 8 files changed, 27 insertions(+), 7 deletions(-) diff --git a/changelog.md b/changelog.md index cf06f448c7..ec029ccac3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-12) +- 同步树列表系列支持不显示节点连接线和展开收起图标 - 规范了下拉树trigger中显示值的显示顺序 - bi.editor支持传入autocomplete - [视觉]editor水印间距统一与文本域水印不可选中 diff --git a/src/base/tree/ztree/asynctree.js b/src/base/tree/ztree/asynctree.js index 89f02680a2..21ed1c1613 100644 --- a/src/base/tree/ztree/asynctree.js +++ b/src/base/tree/ztree/asynctree.js @@ -21,6 +21,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, { // 配置属性 _configSetting: function () { + var o = this.options; var paras = this.options.paras; var self = this; var setting = { @@ -44,7 +45,8 @@ BI.AsyncTree = BI.inherit(BI.TreeView, { showIcon: false, expandSpeed: "", nameIsHTML: true, - dblClickExpand: false + dblClickExpand: false, + showLine: o.showLine }, callback: { beforeCheck: beforeCheck, diff --git a/src/base/tree/ztree/treeview.js b/src/base/tree/ztree/treeview.js index 2250b4fb71..62abc929e6 100644 --- a/src/base/tree/ztree/treeview.js +++ b/src/base/tree/ztree/treeview.js @@ -11,7 +11,8 @@ BI.TreeView = BI.inherit(BI.Pane, { paras: { selectedValues: {} }, - itemsCreator: BI.emptyFn + itemsCreator: BI.emptyFn, + showLine: true }); }, _init: function () { @@ -69,6 +70,7 @@ BI.TreeView = BI.inherit(BI.Pane, { _configSetting: function () { var paras = this.options.paras; var self = this; + var o = this.options; var setting = { async: { enable: true, @@ -92,7 +94,8 @@ BI.TreeView = BI.inherit(BI.Pane, { showIcon: false, expandSpeed: "", nameIsHTML: true, // 节点可以用html标签代替 - dblClickExpand: false + dblClickExpand: false, + showLine: o.showLine, }, callback: { beforeExpand: beforeExpand, @@ -333,7 +336,7 @@ BI.TreeView = BI.inherit(BI.Pane, { BI.each(ns, function (i, n) { n.title = n.title || n.text || n.value; n.isParent = n.isParent || n.parent; - n.value = n.value || n.text; + n.value = BI.isUndefined(n.value) ? n.text : n.value; // 处理标红 if (BI.isKey(o.paras.keyword)) { n.text = BI.$("
").__textKeywordMarked__(BI.Text.formatText(n.text + ""), o.paras.keyword, n.py).html(); diff --git a/src/component/treevaluechooser/pane.treevaluechooser.js b/src/component/treevaluechooser/pane.treevaluechooser.js index 1d961a517a..06a9b0e3e8 100644 --- a/src/component/treevaluechooser/pane.treevaluechooser.js +++ b/src/component/treevaluechooser/pane.treevaluechooser.js @@ -11,7 +11,8 @@ BI.TreeValueChooserPane = BI.inherit(BI.AbstractTreeValueChooser, { return BI.extend(BI.TreeValueChooserPane.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-tree-value-chooser-pane", items: null, - itemsCreator: BI.emptyFn + itemsCreator: BI.emptyFn, + showLine: false }); }, @@ -19,8 +20,9 @@ BI.TreeValueChooserPane = BI.inherit(BI.AbstractTreeValueChooser, { BI.TreeValueChooserPane.superclass._init.apply(this, arguments); var self = this, o = this.options; this.pane = BI.createWidget({ - type: "bi.multi_select_tree", + type: o.hideSearch ? "bi.multi_select_tree_popup" : "bi.multi_select_tree", element: this, + showLine: o.showLine, itemsCreator: BI.bind(this._itemsCreator, this) }); diff --git a/src/less/base/tree/ztree.less b/src/less/base/tree/ztree.less index 472bf063e8..181aa69e4f 100644 --- a/src/less/base/tree/ztree.less +++ b/src/less/base/tree/ztree.less @@ -189,6 +189,14 @@ height: 24px } +.ztree li span.button.switch.noline_open { + width: 0; +} + +.ztree li span.button.switch.noline_close { + width: 0; +} + .ztree li span.button.noline_open { background-position: -92px -72px } @@ -203,6 +211,7 @@ .ztree li span.button.noline_docu { background: none; + width: 0; } .ztree li span.button.ico_open { diff --git a/src/widget/multiselecttree/multiselecttree.js b/src/widget/multiselecttree/multiselecttree.js index 3771673ced..8654996c05 100644 --- a/src/widget/multiselecttree/multiselecttree.js +++ b/src/widget/multiselecttree/multiselecttree.js @@ -20,7 +20,8 @@ BI.MultiSelectTree = BI.inherit(BI.Single, { this.adapter = BI.createWidget({ type: "bi.multi_select_tree_popup", - itemsCreator: o.itemsCreator + itemsCreator: o.itemsCreator, + showLine: o.showLine }); this.adapter.on(BI.MultiSelectTreePopup.EVENT_CHANGE, function () { if (self.searcher.isSearching()) { diff --git a/src/widget/multiselecttree/multiselecttree.popup.js b/src/widget/multiselecttree/multiselecttree.popup.js index 4c28651a8f..95af718cee 100644 --- a/src/widget/multiselecttree/multiselecttree.popup.js +++ b/src/widget/multiselecttree/multiselecttree.popup.js @@ -13,6 +13,7 @@ BI.MultiSelectTreePopup = BI.inherit(BI.Widget, { var self = this, o = this.options; this.popup = BI.createWidget({ type: "bi.async_tree", + showLine: o.showLine, element: this, itemsCreator: o.itemsCreator }); diff --git a/src/widget/multitree/multi.tree.popup.js b/src/widget/multitree/multi.tree.popup.js index e39033b16a..14c7165d8d 100644 --- a/src/widget/multitree/multi.tree.popup.js +++ b/src/widget/multitree/multi.tree.popup.js @@ -27,6 +27,7 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, { this.tree = BI.createWidget(opts.el, { type: "bi.async_tree", + showLine: opts.showLine, height: 400, cls: "popup-view-tree", itemsCreator: opts.itemsCreator,