Browse Source

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

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit '531099dd113891573e5b792e8e7efe3647d1dc79':
  BI-76381 同步树列表支持不显示展开收起节点和连接线
es6
windy 4 years ago
parent
commit
c5b55170f9
  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)
- 同步树列表系列支持不显示节点连接线和展开收起图标
- 规范了下拉树trigger中显示值的显示顺序
- bi.editor支持传入autocomplete
- [视觉]editor水印间距统一与文本域水印不可选中

4
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,

9
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.$("<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), {
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)
});

9
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 {

3
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()) {

1
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
});

1
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,

Loading…
Cancel
Save