guy 7 years ago
parent
commit
33c4827c82
  1. 42
      bi/base.js
  2. 42
      dist/base.js
  3. 42
      dist/bundle.js
  4. 8
      dist/bundle.min.js

42
bi/base.js

@ -2023,13 +2023,13 @@ BI.shortcut("bi.tree_view", BI.TreeView);/**
*/ */
BI.AsyncTree = BI.inherit(BI.TreeView, { BI.AsyncTree = BI.inherit(BI.TreeView, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {}) return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {});
}, },
_init: function () { _init: function () {
BI.AsyncTree.superclass._init.apply(this, arguments); BI.AsyncTree.superclass._init.apply(this, arguments);
}, },
//配置属性 // 配置属性
_configSetting: function () { _configSetting: function () {
var paras = this.options.paras; var paras = this.options.paras;
var self = this; var self = this;
@ -2066,23 +2066,23 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
} }
}; };
function onClick(event, treeId, treeNode) { function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId); var zTree = $.fn.zTree.getZTreeObj(treeId);
zTree.checkNode(treeNode, !treeNode.checked, true, true); zTree.checkNode(treeNode, !treeNode.checked, true, true);
} }
function beforeCheck(treeId, treeNode) { function beforeCheck (treeId, treeNode) {
treeNode.halfCheck = false; treeNode.halfCheck = false;
if (treeNode.checked === true) { if (treeNode.checked === true) {
//将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy // 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy
//所有的半选状态都需要取消halfCheck=true的情况 // 所有的半选状态都需要取消halfCheck=true的情况
function track(children) { function track (children) {
BI.each(children, function (i, ch) { BI.each(children, function (i, ch) {
if (ch.halfCheck === true) { if (ch.halfCheck === true) {
ch.halfCheck = false; ch.halfCheck = false;
track(ch.children); track(ch.children);
} }
}) });
} }
track(treeNode.children); track(treeNode.children);
@ -2091,23 +2091,23 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
var nodes = treeObj.getSelectedNodes(); var nodes = treeObj.getSelectedNodes();
BI.each(nodes, function (index, node) { BI.each(nodes, function (index, node) {
node.halfCheck = false; node.halfCheck = false;
}) });
} }
} }
function beforeExpand(treeId, treeNode) { function beforeExpand (treeId, treeNode) {
self._beforeExpandNode(treeId, treeNode); self._beforeExpandNode(treeId, treeNode);
} }
function onCheck(event, treeId, treeNode) { function onCheck (event, treeId, treeNode) {
self._selectTreeNode(treeId, treeNode); self._selectTreeNode(treeId, treeNode);
} }
function onExpand(event, treeId, treeNode) { function onExpand (event, treeId, treeNode) {
treeNode.halfCheck = false; treeNode.halfCheck = false;
} }
function onCollapse(event, treeId, treeNode) { function onCollapse (event, treeId, treeNode) {
treeNode.halfCheck = false; treeNode.halfCheck = false;
} }
@ -2118,7 +2118,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
var self = this, o = this.options; var self = this, o = this.options;
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode); var name = this._getNodeValue(treeNode);
// var values = parentValues.concat([name]); // var values = parentValues.concat([name]);
if (treeNode.checked === true) { if (treeNode.checked === true) {
} else { } else {
var tNode = treeNode; var tNode = treeNode;
@ -2139,7 +2139,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments); BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments);
}, },
//展开节点 // 展开节点
_beforeExpandNode: function (treeId, treeNode) { _beforeExpandNode: function (treeId, treeNode) {
var self = this, o = this.options; var self = this, o = this.options;
var parentValues = treeNode.parentValues || self._getParentValues(treeNode); var parentValues = treeNode.parentValues || self._getParentValues(treeNode);
@ -2157,7 +2157,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
}; };
var times = 1; var times = 1;
function callback(nodes, hasNext) { function callback (nodes, hasNext) {
self.nodes.addNodes(treeNode, nodes); self.nodes.addNodes(treeNode, nodes);
if (hasNext === true) { if (hasNext === true) {
@ -2170,7 +2170,9 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
} }
if (!treeNode.children) { if (!treeNode.children) {
o.itemsCreator(op, complete) setTimeout(function () {
o.itemsCreator(op, complete);
}, 17);
} }
}, },
@ -2179,7 +2181,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
var map = {}; var map = {};
track([], valueA, valueB); track([], valueA, valueB);
track([], valueB, valueA); track([], valueB, valueA);
function track(parent, node, compare) { function track (parent, node, compare) {
BI.each(node, function (n, item) { BI.each(node, function (n, item) {
if (BI.isNull(compare[n])) { if (BI.isNull(compare[n])) {
self._addTreeNode(map, parent, n, item); self._addTreeNode(map, parent, n, item);
@ -2188,7 +2190,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
} else { } else {
track(parent.concat([n]), node[n], compare[n]); track(parent.concat([n]), node[n], compare[n]);
} }
}) });
} }
return map; return map;
@ -2212,7 +2214,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
return this._join(checkedValues, this.options.paras.selectedValues); return this._join(checkedValues, this.options.paras.selectedValues);
}, },
//生成树方法 // 生成树方法
stroke: function (config) { stroke: function (config) {
delete this.options.keyword; delete this.options.keyword;
BI.extend(this.options.paras, config); BI.extend(this.options.paras, config);

42
dist/base.js vendored

@ -2023,13 +2023,13 @@ BI.shortcut("bi.tree_view", BI.TreeView);/**
*/ */
BI.AsyncTree = BI.inherit(BI.TreeView, { BI.AsyncTree = BI.inherit(BI.TreeView, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {}) return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {});
}, },
_init: function () { _init: function () {
BI.AsyncTree.superclass._init.apply(this, arguments); BI.AsyncTree.superclass._init.apply(this, arguments);
}, },
//配置属性 // 配置属性
_configSetting: function () { _configSetting: function () {
var paras = this.options.paras; var paras = this.options.paras;
var self = this; var self = this;
@ -2066,23 +2066,23 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
} }
}; };
function onClick(event, treeId, treeNode) { function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId); var zTree = $.fn.zTree.getZTreeObj(treeId);
zTree.checkNode(treeNode, !treeNode.checked, true, true); zTree.checkNode(treeNode, !treeNode.checked, true, true);
} }
function beforeCheck(treeId, treeNode) { function beforeCheck (treeId, treeNode) {
treeNode.halfCheck = false; treeNode.halfCheck = false;
if (treeNode.checked === true) { if (treeNode.checked === true) {
//将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy // 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy
//所有的半选状态都需要取消halfCheck=true的情况 // 所有的半选状态都需要取消halfCheck=true的情况
function track(children) { function track (children) {
BI.each(children, function (i, ch) { BI.each(children, function (i, ch) {
if (ch.halfCheck === true) { if (ch.halfCheck === true) {
ch.halfCheck = false; ch.halfCheck = false;
track(ch.children); track(ch.children);
} }
}) });
} }
track(treeNode.children); track(treeNode.children);
@ -2091,23 +2091,23 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
var nodes = treeObj.getSelectedNodes(); var nodes = treeObj.getSelectedNodes();
BI.each(nodes, function (index, node) { BI.each(nodes, function (index, node) {
node.halfCheck = false; node.halfCheck = false;
}) });
} }
} }
function beforeExpand(treeId, treeNode) { function beforeExpand (treeId, treeNode) {
self._beforeExpandNode(treeId, treeNode); self._beforeExpandNode(treeId, treeNode);
} }
function onCheck(event, treeId, treeNode) { function onCheck (event, treeId, treeNode) {
self._selectTreeNode(treeId, treeNode); self._selectTreeNode(treeId, treeNode);
} }
function onExpand(event, treeId, treeNode) { function onExpand (event, treeId, treeNode) {
treeNode.halfCheck = false; treeNode.halfCheck = false;
} }
function onCollapse(event, treeId, treeNode) { function onCollapse (event, treeId, treeNode) {
treeNode.halfCheck = false; treeNode.halfCheck = false;
} }
@ -2118,7 +2118,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
var self = this, o = this.options; var self = this, o = this.options;
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode); var name = this._getNodeValue(treeNode);
// var values = parentValues.concat([name]); // var values = parentValues.concat([name]);
if (treeNode.checked === true) { if (treeNode.checked === true) {
} else { } else {
var tNode = treeNode; var tNode = treeNode;
@ -2139,7 +2139,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments); BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments);
}, },
//展开节点 // 展开节点
_beforeExpandNode: function (treeId, treeNode) { _beforeExpandNode: function (treeId, treeNode) {
var self = this, o = this.options; var self = this, o = this.options;
var parentValues = treeNode.parentValues || self._getParentValues(treeNode); var parentValues = treeNode.parentValues || self._getParentValues(treeNode);
@ -2157,7 +2157,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
}; };
var times = 1; var times = 1;
function callback(nodes, hasNext) { function callback (nodes, hasNext) {
self.nodes.addNodes(treeNode, nodes); self.nodes.addNodes(treeNode, nodes);
if (hasNext === true) { if (hasNext === true) {
@ -2170,7 +2170,9 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
} }
if (!treeNode.children) { if (!treeNode.children) {
o.itemsCreator(op, complete) setTimeout(function () {
o.itemsCreator(op, complete);
}, 17);
} }
}, },
@ -2179,7 +2181,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
var map = {}; var map = {};
track([], valueA, valueB); track([], valueA, valueB);
track([], valueB, valueA); track([], valueB, valueA);
function track(parent, node, compare) { function track (parent, node, compare) {
BI.each(node, function (n, item) { BI.each(node, function (n, item) {
if (BI.isNull(compare[n])) { if (BI.isNull(compare[n])) {
self._addTreeNode(map, parent, n, item); self._addTreeNode(map, parent, n, item);
@ -2188,7 +2190,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
} else { } else {
track(parent.concat([n]), node[n], compare[n]); track(parent.concat([n]), node[n], compare[n]);
} }
}) });
} }
return map; return map;
@ -2212,7 +2214,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
return this._join(checkedValues, this.options.paras.selectedValues); return this._join(checkedValues, this.options.paras.selectedValues);
}, },
//生成树方法 // 生成树方法
stroke: function (config) { stroke: function (config) {
delete this.options.keyword; delete this.options.keyword;
BI.extend(this.options.paras, config); BI.extend(this.options.paras, config);

42
dist/bundle.js vendored

@ -27898,13 +27898,13 @@ BI.shortcut("bi.tree_view", BI.TreeView);/**
*/ */
BI.AsyncTree = BI.inherit(BI.TreeView, { BI.AsyncTree = BI.inherit(BI.TreeView, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {}) return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {});
}, },
_init: function () { _init: function () {
BI.AsyncTree.superclass._init.apply(this, arguments); BI.AsyncTree.superclass._init.apply(this, arguments);
}, },
//配置属性 // 配置属性
_configSetting: function () { _configSetting: function () {
var paras = this.options.paras; var paras = this.options.paras;
var self = this; var self = this;
@ -27941,23 +27941,23 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
} }
}; };
function onClick(event, treeId, treeNode) { function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId); var zTree = $.fn.zTree.getZTreeObj(treeId);
zTree.checkNode(treeNode, !treeNode.checked, true, true); zTree.checkNode(treeNode, !treeNode.checked, true, true);
} }
function beforeCheck(treeId, treeNode) { function beforeCheck (treeId, treeNode) {
treeNode.halfCheck = false; treeNode.halfCheck = false;
if (treeNode.checked === true) { if (treeNode.checked === true) {
//将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy // 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy
//所有的半选状态都需要取消halfCheck=true的情况 // 所有的半选状态都需要取消halfCheck=true的情况
function track(children) { function track (children) {
BI.each(children, function (i, ch) { BI.each(children, function (i, ch) {
if (ch.halfCheck === true) { if (ch.halfCheck === true) {
ch.halfCheck = false; ch.halfCheck = false;
track(ch.children); track(ch.children);
} }
}) });
} }
track(treeNode.children); track(treeNode.children);
@ -27966,23 +27966,23 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
var nodes = treeObj.getSelectedNodes(); var nodes = treeObj.getSelectedNodes();
BI.each(nodes, function (index, node) { BI.each(nodes, function (index, node) {
node.halfCheck = false; node.halfCheck = false;
}) });
} }
} }
function beforeExpand(treeId, treeNode) { function beforeExpand (treeId, treeNode) {
self._beforeExpandNode(treeId, treeNode); self._beforeExpandNode(treeId, treeNode);
} }
function onCheck(event, treeId, treeNode) { function onCheck (event, treeId, treeNode) {
self._selectTreeNode(treeId, treeNode); self._selectTreeNode(treeId, treeNode);
} }
function onExpand(event, treeId, treeNode) { function onExpand (event, treeId, treeNode) {
treeNode.halfCheck = false; treeNode.halfCheck = false;
} }
function onCollapse(event, treeId, treeNode) { function onCollapse (event, treeId, treeNode) {
treeNode.halfCheck = false; treeNode.halfCheck = false;
} }
@ -27993,7 +27993,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
var self = this, o = this.options; var self = this, o = this.options;
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode); var name = this._getNodeValue(treeNode);
// var values = parentValues.concat([name]); // var values = parentValues.concat([name]);
if (treeNode.checked === true) { if (treeNode.checked === true) {
} else { } else {
var tNode = treeNode; var tNode = treeNode;
@ -28014,7 +28014,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments); BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments);
}, },
//展开节点 // 展开节点
_beforeExpandNode: function (treeId, treeNode) { _beforeExpandNode: function (treeId, treeNode) {
var self = this, o = this.options; var self = this, o = this.options;
var parentValues = treeNode.parentValues || self._getParentValues(treeNode); var parentValues = treeNode.parentValues || self._getParentValues(treeNode);
@ -28032,7 +28032,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
}; };
var times = 1; var times = 1;
function callback(nodes, hasNext) { function callback (nodes, hasNext) {
self.nodes.addNodes(treeNode, nodes); self.nodes.addNodes(treeNode, nodes);
if (hasNext === true) { if (hasNext === true) {
@ -28045,7 +28045,9 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
} }
if (!treeNode.children) { if (!treeNode.children) {
o.itemsCreator(op, complete) setTimeout(function () {
o.itemsCreator(op, complete);
}, 17);
} }
}, },
@ -28054,7 +28056,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
var map = {}; var map = {};
track([], valueA, valueB); track([], valueA, valueB);
track([], valueB, valueA); track([], valueB, valueA);
function track(parent, node, compare) { function track (parent, node, compare) {
BI.each(node, function (n, item) { BI.each(node, function (n, item) {
if (BI.isNull(compare[n])) { if (BI.isNull(compare[n])) {
self._addTreeNode(map, parent, n, item); self._addTreeNode(map, parent, n, item);
@ -28063,7 +28065,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
} else { } else {
track(parent.concat([n]), node[n], compare[n]); track(parent.concat([n]), node[n], compare[n]);
} }
}) });
} }
return map; return map;
@ -28087,7 +28089,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
return this._join(checkedValues, this.options.paras.selectedValues); return this._join(checkedValues, this.options.paras.selectedValues);
}, },
//生成树方法 // 生成树方法
stroke: function (config) { stroke: function (config) {
delete this.options.keyword; delete this.options.keyword;
BI.extend(this.options.paras, config); BI.extend(this.options.paras, config);

8
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save