Browse Source

BI-76381 同步树列表支持不显示展开收起节点和连接线

es6
windy 4 years ago
parent
commit
531099dd11
  1. 1
      changelog.md
  2. 4
      src/base/tree/ztree/asynctree.js
  3. 9
      src/base/tree/ztree/treeview.js
  4. 6
      src/component/treevaluechooser/pane.treevaluechooser.js
  5. 9
      src/less/base/tree/ztree.less
  6. 3
      src/widget/multiselecttree/multiselecttree.js
  7. 1
      src/widget/multiselecttree/multiselecttree.popup.js
  8. 1
      src/widget/multitree/multi.tree.popup.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志 # 更新日志
2.0(2020-12) 2.0(2020-12)
- 同步树列表系列支持不显示节点连接线和展开收起图标
- 规范了下拉树trigger中显示值的显示顺序 - 规范了下拉树trigger中显示值的显示顺序
- bi.editor支持传入autocomplete - bi.editor支持传入autocomplete
- [视觉]editor水印间距统一与文本域水印不可选中 - [视觉]editor水印间距统一与文本域水印不可选中

4
src/base/tree/ztree/asynctree.js

@ -21,6 +21,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
// 配置属性 // 配置属性
_configSetting: function () { _configSetting: function () {
var o = this.options;
var paras = this.options.paras; var paras = this.options.paras;
var self = this; var self = this;
var setting = { var setting = {
@ -44,7 +45,8 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
showIcon: false, showIcon: false,
expandSpeed: "", expandSpeed: "",
nameIsHTML: true, nameIsHTML: true,
dblClickExpand: false dblClickExpand: false,
showLine: o.showLine
}, },
callback: { callback: {
beforeCheck: beforeCheck, beforeCheck: beforeCheck,

9
src/base/tree/ztree/treeview.js

@ -11,7 +11,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
paras: { paras: {
selectedValues: {} selectedValues: {}
}, },
itemsCreator: BI.emptyFn itemsCreator: BI.emptyFn,
showLine: true
}); });
}, },
_init: function () { _init: function () {
@ -69,6 +70,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
_configSetting: function () { _configSetting: function () {
var paras = this.options.paras; var paras = this.options.paras;
var self = this; var self = this;
var o = this.options;
var setting = { var setting = {
async: { async: {
enable: true, enable: true,
@ -92,7 +94,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
showIcon: false, showIcon: false,
expandSpeed: "", expandSpeed: "",
nameIsHTML: true, // 节点可以用html标签代替 nameIsHTML: true, // 节点可以用html标签代替
dblClickExpand: false dblClickExpand: false,
showLine: o.showLine,
}, },
callback: { callback: {
beforeExpand: beforeExpand, beforeExpand: beforeExpand,
@ -333,7 +336,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
BI.each(ns, function (i, n) { BI.each(ns, function (i, n) {
n.title = n.title || n.text || n.value; n.title = n.title || n.text || n.value;
n.isParent = n.isParent || n.parent; 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)) { if (BI.isKey(o.paras.keyword)) {
n.text = BI.$("<div>").__textKeywordMarked__(BI.Text.formatText(n.text + ""), o.paras.keyword, n.py).html(); n.text = BI.$("<div>").__textKeywordMarked__(BI.Text.formatText(n.text + ""), o.paras.keyword, n.py).html();

6
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), { return BI.extend(BI.TreeValueChooserPane.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-tree-value-chooser-pane", baseCls: "bi-tree-value-chooser-pane",
items: null, 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); BI.TreeValueChooserPane.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.pane = BI.createWidget({ this.pane = BI.createWidget({
type: "bi.multi_select_tree", type: o.hideSearch ? "bi.multi_select_tree_popup" : "bi.multi_select_tree",
element: this, element: this,
showLine: o.showLine,
itemsCreator: BI.bind(this._itemsCreator, this) itemsCreator: BI.bind(this._itemsCreator, this)
}); });

9
src/less/base/tree/ztree.less

@ -189,6 +189,14 @@
height: 24px 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 { .ztree li span.button.noline_open {
background-position: -92px -72px background-position: -92px -72px
} }
@ -203,6 +211,7 @@
.ztree li span.button.noline_docu { .ztree li span.button.noline_docu {
background: none; background: none;
width: 0;
} }
.ztree li span.button.ico_open { .ztree li span.button.ico_open {

3
src/widget/multiselecttree/multiselecttree.js

@ -20,7 +20,8 @@ BI.MultiSelectTree = BI.inherit(BI.Single, {
this.adapter = BI.createWidget({ this.adapter = BI.createWidget({
type: "bi.multi_select_tree_popup", type: "bi.multi_select_tree_popup",
itemsCreator: o.itemsCreator itemsCreator: o.itemsCreator,
showLine: o.showLine
}); });
this.adapter.on(BI.MultiSelectTreePopup.EVENT_CHANGE, function () { this.adapter.on(BI.MultiSelectTreePopup.EVENT_CHANGE, function () {
if (self.searcher.isSearching()) { if (self.searcher.isSearching()) {

1
src/widget/multiselecttree/multiselecttree.popup.js

@ -13,6 +13,7 @@ BI.MultiSelectTreePopup = BI.inherit(BI.Widget, {
var self = this, o = this.options; var self = this, o = this.options;
this.popup = BI.createWidget({ this.popup = BI.createWidget({
type: "bi.async_tree", type: "bi.async_tree",
showLine: o.showLine,
element: this, element: this,
itemsCreator: o.itemsCreator itemsCreator: o.itemsCreator
}); });

1
src/widget/multitree/multi.tree.popup.js

@ -27,6 +27,7 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
this.tree = BI.createWidget(opts.el, { this.tree = BI.createWidget(opts.el, {
type: "bi.async_tree", type: "bi.async_tree",
showLine: opts.showLine,
height: 400, height: 400,
cls: "popup-view-tree", cls: "popup-view-tree",
itemsCreator: opts.itemsCreator, itemsCreator: opts.itemsCreator,

Loading…
Cancel
Save