guy 8 years ago
parent
commit
aeb4aa3d22
  1. 89
      bi/base.js
  2. 185
      bi/widget.js
  3. 4
      demo/dist/demo.js
  4. 4
      demo/js/widget/demo.multiselectcombo.js
  5. 89
      docs/base.js
  6. 4
      docs/demo.js
  7. 185
      docs/widget.js
  8. 2
      src/base/single/button/button.basic.js
  9. 6
      src/base/table/table.grid.js
  10. 4
      src/base/table/table.grid.quick.js
  11. 32
      src/base/tree/parttree.js
  12. 24
      src/base/tree/synctree.js
  13. 21
      src/base/tree/treeview.js
  14. 4
      src/component/allvaluechooser/combo.allvaluechooser.js
  15. 158
      src/component/treevaluechooser/combo.treevaluechooser.js
  16. 4
      src/component/valuechooser/combo.valuechooser.js
  17. 2
      src/widget/multiselect/check/multiselect.check.pane.js
  18. 2
      src/widget/multiselect/multiselect.loader.js
  19. 2
      src/widget/multiselect/search/multiselect.search.loader.js
  20. 4
      src/widget/multiselect/trigger/searcher.multiselect.js
  21. 4
      src/widget/multitree/check/multi.tree.check.pane.js
  22. 2
      src/widget/multitree/multi.tree.popup.js
  23. 3
      src/widget/sequencetable/listnumber.sequencetable.js

89
bi/base.js

@ -767,12 +767,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
}); });
break; break;
default: default:
if (o.stopEvent || o.stopPropagation) {
hand.mousedown(function (e) { hand.mousedown(function (e) {
ev(e); ev(e);
}); });
hand.mouseup(function (e) { hand.mouseup(function (e) {
ev(e); ev(e);
}); });
}
hand.click(clk); hand.click(clk);
break; break;
} }
@ -1596,8 +1598,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
treeNode.times = treeNode.times || 1; treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id var param = "id=" + treeNode.id
+ "&times=" + (treeNode.times++) + "&times=" + (treeNode.times++)
+ "&parent_values= " + window.encodeURIComponent(BI.jsonEncode(parentNode)) + "&parentValues= " + window.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&check_state=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus())); + "&checkState=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param; return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param;
} }
@ -1728,7 +1730,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
this._buildTree(map, path); this._buildTree(map, path);
return; return;
} }
var storeValues = BI.deepClone(this.options.paras.selected_values); var storeValues = BI.deepClone(this.options.paras.selectedValues);
var treeNode = this._getTree(storeValues, path); var treeNode = this._getTree(storeValues, path);
this._addTreeNode(map, parent, this._getNodeValue(node), treeNode); this._addTreeNode(map, parent, this._getNodeValue(node), treeNode);
}, },
@ -1844,8 +1846,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
self.nodes = $.fn.zTree.init(tree.element, setting, nodes); self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
}; };
var op = BI.extend({}, o.paras, { var op = BI.extend({}, o.paras, {
times: 1, times: 1
type: BI.TreeView.REQ_TYPE_INIT_DATA
}); });
o.itemsCreator(op, function (res) { o.itemsCreator(op, function (res) {
@ -1938,8 +1939,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
}, },
setSelectedValue: function (value) { setSelectedValue: function (value) {
this.options.paras.selected_values = value || {}; this.options.paras.selectedValues = value || {};
this.selected_values = BI.deepClone(value) || {}; this.selectedValues = BI.deepClone(value) || {};
}, },
updateValue: function (values, param) { updateValue: function (values, param) {
@ -1979,10 +1980,10 @@ BI.TreeView = BI.inherit(BI.Pane, {
} }
}); });
BI.extend(BI.TreeView, { BI.extend(BI.TreeView, {
REQ_TYPE_INIT_DATA: 0, REQ_TYPE_INIT_DATA: 1,
REQ_TYPE_ADJUST_DATA: 1, REQ_TYPE_ADJUST_DATA: 2,
REQ_TYPE_CALCULATE_SELECT_DATA: 2, REQ_TYPE_SELECT_DATA: 3,
REQ_TYPE_SELECTED_DATA: 3 REQ_TYPE_GET_SELECTED_DATA: 4
}); });
BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE"; BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE";
@ -2090,21 +2091,21 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
_selectTreeNode: function (treeId, treeNode) { _selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options; var self = this, o = this.options;
var parent_values = 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 = parent_values.concat([name]); // var values = parentValues.concat([name]);
if (treeNode.checked === true) { if (treeNode.checked === true) {
} else { } else {
var tNode = treeNode; var tNode = treeNode;
var pNode = this._getTree(this.selected_values, parent_values); var pNode = this._getTree(this.selectedValues, parentValues);
if (BI.isNotNull(pNode[name])) { if (BI.isNotNull(pNode[name])) {
delete pNode[name]; delete pNode[name];
} }
while (tNode != null && BI.isEmpty(pNode)) { while (tNode != null && BI.isEmpty(pNode)) {
parent_values = parent_values.slice(0, parent_values.length - 1); parentValues = parentValues.slice(0, parentValues.length - 1);
tNode = tNode.getParentNode(); tNode = tNode.getParentNode();
if (tNode != null) { if (tNode != null) {
pNode = this._getTree(this.selected_values, parent_values); pNode = this._getTree(this.selectedValues, parentValues);
name = this._getNodeValue(tNode); name = this._getNodeValue(tNode);
delete pNode[name]; delete pNode[name];
} }
@ -2120,8 +2121,8 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
var op = BI.extend({}, o.paras, { var op = BI.extend({}, o.paras, {
"id": treeNode.id, "id": treeNode.id,
"times": 1, "times": 1,
"parent_values": parentValues.concat(this._getNodeValue(treeNode)), "parentValues": parentValues.concat(this._getNodeValue(treeNode)),
"check_state": treeNode.getCheckStatus() "checkState": treeNode.getCheckStatus()
}); });
var complete = function (d) { var complete = function (d) {
var nodes = d.items || []; var nodes = d.items || [];
@ -2169,7 +2170,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
}, },
hasChecked: function () { hasChecked: function () {
return !BI.isEmpty(this.selected_values) || BI.SyncTree.superclass.hasChecked.apply(this, arguments); return !BI.isEmpty(this.selectedValues) || BI.SyncTree.superclass.hasChecked.apply(this, arguments);
}, },
getValue: function () { getValue: function () {
@ -2178,12 +2179,12 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
} }
var checkedValues = this._getSelectedValues(); var checkedValues = this._getSelectedValues();
if (BI.isEmpty(checkedValues)) { if (BI.isEmpty(checkedValues)) {
return this.selected_values; return this.selectedValues;
} }
if (BI.isEmpty(this.selected_values)) { if (BI.isEmpty(this.selectedValues)) {
return checkedValues; return checkedValues;
} }
return this._join(checkedValues, this.selected_values); return this._join(checkedValues, this.selectedValues);
}, },
//生成树方法 //生成树方法
@ -2191,7 +2192,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
delete this.options.keyword; delete this.options.keyword;
BI.extend(this.options.paras, config); BI.extend(this.options.paras, config);
//取消选中时使用 //取消选中时使用
this.selected_values = BI.deepClone(this.options.paras.selected_values) || {}; this.selectedValues = BI.deepClone(this.options.paras.selectedValues) || {};
var setting = this._configSetting(); var setting = this._configSetting();
this._initTree(setting); this._initTree(setting);
} }
@ -2221,7 +2222,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
this.tip.setLoading(); this.tip.setLoading();
o.itemsCreator(op, function (d) { o.itemsCreator(op, function (d) {
var hasNext = !!d.hasNext, nodes = d.items || []; var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.last_search_value = d.last_search_value; o.paras.lastSearchValue = d.lastSearchValue;
if (self._stop === true) { if (self._stop === true) {
return; return;
} }
@ -2238,35 +2239,35 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
_selectTreeNode: function (treeId, treeNode) { _selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options; var self = this, o = this.options;
var parent_values = 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 = parent_values.concat([name]); // var values = parentValues.concat([name]);
if (treeNode.checked === true) { if (treeNode.checked === true) {
BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); BI.SyncTree.superclass._selectTreeNode.apply(self, arguments);
} else { } else {
o.itemsCreator(BI.extend({}, o.paras, { o.itemsCreator(BI.extend({}, o.paras, {
type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA, type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA,
selected_values: this.selected_values, selectedValues: this.selectedValues,
not_selected_value: name, notSelectedValue: name,
parent_values: parent_values parentValues: parentValues
}), function (new_values) { }), function (new_values) {
if (BI.isEqual(self.selected_values, new_values)) { if (BI.isEqual(self.selectedValues, new_values)) {
var tNode = treeNode; var tNode = treeNode;
var pNode = self._getTree(new_values, parent_values); var pNode = self._getTree(new_values, parentValues);
if (pNode[name]) { if (pNode[name]) {
delete pNode[name]; delete pNode[name];
} }
while (tNode != null && BI.isEmpty(pNode)) { while (tNode != null && BI.isEmpty(pNode)) {
parent_values = parent_values.slice(0, parent_values.length - 1); parentValues = parentValues.slice(0, parentValues.length - 1);
tNode = tNode.getParentNode(); tNode = tNode.getParentNode();
if (tNode != null) { if (tNode != null) {
pNode = self._getTree(new_values, parent_values); pNode = self._getTree(new_values, parentValues);
name = self._getNodeValue(tNode); name = self._getNodeValue(tNode);
delete pNode[name]; delete pNode[name];
} }
} }
} }
self.selected_values = new_values; self.selectedValues = new_values;
BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); BI.SyncTree.superclass._selectTreeNode.apply(self, arguments);
}); });
} }
@ -2319,7 +2320,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
return; return;
} }
var hasNext = !!d.hasNext, nodes = d.items || []; var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.last_search_value = d.last_search_value; o.paras.lastSearchValue = d.lastSearchValue;
if (nodes.length > 0) { if (nodes.length > 0) {
callback(self._dealWidthNodes(nodes)); callback(self._dealWidthNodes(nodes));
} }
@ -2350,7 +2351,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
var result = BI.PartTree.superclass.getValue.apply(this, arguments); var result = BI.PartTree.superclass.getValue.apply(this, arguments);
o.itemsCreator({ o.itemsCreator({
type: BI.TreeView.REQ_TYPE_ADJUST_DATA, type: BI.TreeView.REQ_TYPE_ADJUST_DATA,
selected_values: result selectedValues: result
}, function (res) { }, function (res) {
result = res; result = res;
}); });
@ -2362,10 +2363,10 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
var o = this.options; var o = this.options;
delete o.paras.keyword; delete o.paras.keyword;
BI.extend(o.paras, config); BI.extend(o.paras, config);
delete o.paras.last_search_value; delete o.paras.lastSearchValue;
//取消选中时使用 //取消选中时使用
this.selected_values = BI.deepClone(o.paras.selected_values) || {}; this.selectedValues = BI.deepClone(o.paras.selectedValues) || {};
//delete this.options.paras.selected_values; //delete this.options.paras.selectedValues;
var setting = this._configSetting(); var setting = this._configSetting();
this._initTree(setting, o.paras.keyword); this._initTree(setting, o.paras.keyword);
} }
@ -29340,7 +29341,7 @@ BI.GridTable = BI.inherit(BI.Widget, {
var trh = otrh + this._scrollBarSize; var trh = otrh + this._scrollBarSize;
var blw = oblw + this._scrollBarSize; var blw = oblw + this._scrollBarSize;
var blh = oblh + this._scrollBarSize; var blh = oblh + this._scrollBarSize;
var brw = obrw+ this._scrollBarSize; var brw = obrw + this._scrollBarSize;
var brh = obrh + this._scrollBarSize; var brh = obrh + this._scrollBarSize;
var digest = function (el) { var digest = function (el) {
@ -29376,11 +29377,11 @@ BI.GridTable = BI.inherit(BI.Widget, {
this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.topLeftGrid.setEstimatedRowSize(o.headerRowSize); this.topLeftGrid.setEstimatedRowSize(o.headerRowSize);
this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); this.topRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.topRightGrid.setEstimatedRowSize(o.headerRowSize); this.topRightGrid.setEstimatedRowSize(o.headerRowSize);
this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.bottomLeftGrid.setEstimatedRowSize(o.rowSize); this.bottomLeftGrid.setEstimatedRowSize(o.rowSize);
this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
var items = this.contextLayout.attr("items"); var items = this.contextLayout.attr("items");
@ -29614,11 +29615,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.topLeftGrid.setEstimatedRowSize(o.headerRowSize); this.topLeftGrid.setEstimatedRowSize(o.headerRowSize);
this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); this.topRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.topRightGrid.setEstimatedRowSize(o.headerRowSize); this.topRightGrid.setEstimatedRowSize(o.headerRowSize);
this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.bottomLeftGrid.setEstimatedRowSize(o.rowSize); this.bottomLeftGrid.setEstimatedRowSize(o.rowSize);
this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
var items = this.contextLayout.attr("items"); var items = this.contextLayout.attr("items");

185
bi/widget.js

@ -9365,7 +9365,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
items: opts.items, items: opts.items,
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
op = BI.extend(op || {}, { op = BI.extend(op || {}, {
selected_values: self.storeValue.value selectedValues: self.storeValue.value
}); });
if (self.storeValue.type === BI.Selection.Multi) { if (self.storeValue.type === BI.Selection.Multi) {
callback({ callback({
@ -9928,7 +9928,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
var startValue = self._startValue; var startValue = self._startValue;
self.storeValue && (op = BI.extend(op || {}, { self.storeValue && (op = BI.extend(op || {}, {
selected_values: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi selectedValues: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi
? self.storeValue.value.concat(startValue) : self.storeValue.value ? self.storeValue.value.concat(startValue) : self.storeValue.value
})); }));
opts.itemsCreator(op, function (ob) { opts.itemsCreator(op, function (ob) {
@ -10340,7 +10340,7 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
}, },
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
self.storeValue && (op = BI.extend(op || {}, { self.storeValue && (op = BI.extend(op || {}, {
selected_values: self.storeValue.value selectedValues: self.storeValue.value
})); }));
opts.itemsCreator(op, function (ob) { opts.itemsCreator(op, function (ob) {
var keyword = ob.keyword = opts.keywordGetter(); var keyword = ob.keyword = opts.keywordGetter();
@ -10810,13 +10810,13 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
ob.value || (ob.value = []); ob.value || (ob.value = []);
if (ob.type === BI.Selection.All) { if (ob.type === BI.Selection.All) {
if (BI.size(ob.assist) === 1) { if (BI.size(ob.assist) === 1) {
this.editor.setState(o.valueFormatter(ob.assist[0] + "") || ob.assist[0] + ""); this.editor.setState(o.valueFormatter(ob.assist[0] + "") || (ob.assist[0] + ""));
} else { } else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.All); this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.All);
} }
} else { } else {
if (BI.size(ob.value) === 1) { if (BI.size(ob.value) === 1) {
this.editor.setState(o.valueFormatter(ob.value[0] + "" || ob.value[0] + "")); this.editor.setState(o.valueFormatter(ob.value[0] + "") || (ob.value[0] + ""));
} else { } else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.None); this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.None);
} }
@ -11288,7 +11288,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
var self = this, opts = this.options; var self = this, opts = this.options;
this.selected_values = {}; this.selectedValues = {};
var continueSelect = BI.createWidget({ var continueSelect = BI.createWidget({
type: 'bi.text_button', type: 'bi.text_button',
@ -11325,7 +11325,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
type: "bi.display_tree", type: "bi.display_tree",
cls: "bi-multi-tree-display", cls: "bi-multi-tree-display",
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_SELECTED_DATA; op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback); opts.itemsCreator(op, callback);
} }
}); });
@ -11650,7 +11650,7 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
var self = this, opts = this.options; var self = this, opts = this.options;
this.selected_values = {}; this.selectedValues = {};
this.tree = BI.createWidget({ this.tree = BI.createWidget({
type: "bi.sync_tree", type: "bi.sync_tree",
@ -15913,7 +15913,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
}, },
_populate: function () { _populate: function () {
this.header.populate(); this.headerContainer.empty();
this._createHeader();
this._layout(); this._layout();
this._calculateChildrenToRender(); this._calculateChildrenToRender();
}, },
@ -17001,8 +17002,8 @@ BI.AllValueChooserCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw); var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded); items = search.matched.concat(search.finded);
}); });
if (options.selected_values) {//过滤 if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selected_values, true); var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) { items = BI.filter(items, function (i, ob) {
return !filter[ob.value]; return !filter[ob.value];
}); });
@ -17129,10 +17130,10 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
case BI.TreeView.REQ_TYPE_ADJUST_DATA: case BI.TreeView.REQ_TYPE_ADJUST_DATA:
self._reqAdjustTreeNode(options, callback); self._reqAdjustTreeNode(options, callback);
break; break;
case BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA: case BI.TreeView.REQ_TYPE_SELECT_DATA:
self._reqSelectedTreeNode(options, callback); self._reqSelectedTreeNode(options, callback);
break; break;
case BI.TreeView.REQ_TYPE_SELECTED_DATA: case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:
self._reqDisplayTreeNode(options, callback); self._reqDisplayTreeNode(options, callback);
break; break;
default : default :
@ -17145,27 +17146,27 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqDisplayTreeNode: function (op, callback) { _reqDisplayTreeNode: function (op, callback) {
var self = this; var self = this;
var result = []; var result = [];
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
if (selected_values == null || BI.isEmpty(selected_values)) { if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({}); callback({});
return; return;
} }
doCheck(0, [], selected_values); doCheck(0, [], selectedValues);
callback({ callback({
items: result items: result
}); });
function doCheck(floor, parent_values, selected) { function doCheck(floor, parentValues, selected) {
if (floor >= self.floors) { if (floor >= self.floors) {
return; return;
} }
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
var children = self._getChildren(parent_values); var children = self._getChildren(parentValues);
BI.each(children, function (i, child) { BI.each(children, function (i, child) {
var newParents = BI.clone(parent_values); var newParents = BI.clone(parentValues);
newParents.push(child.value); newParents.push(child.value);
var llen = self._getChildCount(newParents); var llen = self._getChildCount(newParents);
createOneJson(child, llen); createOneJson(child, llen);
@ -17175,19 +17176,19 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
} }
BI.each(selected, function (k) { BI.each(selected, function (k) {
var node = self._getNode(k); var node = self._getNode(k);
var newParents = BI.clone(parent_values); var newParents = BI.clone(parentValues);
newParents.push(node.value); newParents.push(node.value);
createOneJson(node, getCount(selected[k], newParents)); createOneJson(node, getCount(selected[k], newParents));
doCheck(floor + 1, newParents, selected[k]); doCheck(floor + 1, newParents, selected[k]);
}) })
} }
function getCount(jo, parent_values) { function getCount(jo, parentValues) {
if (jo == null) { if (jo == null) {
return 0; return 0;
} }
if (BI.isEmpty(jo)) { if (BI.isEmpty(jo)) {
return self._getChildCount(parent_values); return self._getChildCount(parentValues);
} }
return BI.size(jo); return BI.size(jo);
@ -17206,30 +17207,30 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqSelectedTreeNode: function (op, callback) { _reqSelectedTreeNode: function (op, callback) {
var self = this; var self = this;
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
var not_selected_value = op.not_selected_value || {}; var notSelectedValue = op.notSelectedValue || {};
var keyword = op.keyword || ""; var keyword = op.keyword || "";
var parent_values = op.parent_values || []; var parentValues = op.parentValues || [];
if (selected_values == null || BI.isEmpty(selected_values)) { if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({}); callback({});
return; return;
} }
dealWithSelectedValues(selected_values); dealWithSelectedValues(selectedValues);
callback(selected_values); callback(selectedValues);
function dealWithSelectedValues(selected_values) { function dealWithSelectedValues(selectedValues) {
var p = BI.clone(parent_values); var p = BI.clone(parentValues);
p.push(not_selected_value); p.push(notSelectedValue);
if (isChild(selected_values, p)) { if (isChild(selectedValues, p)) {
var result = []; var result = [];
var finded = search(parent_values.length + 1, parent_values, not_selected_value, result); var finded = search(parentValues.length + 1, parentValues, notSelectedValue, result);
if (finded === true) { if (finded === true) {
var next = selected_values; var next = selectedValues;
BI.each(p, function (i, v) { BI.each(p, function (i, v) {
var t = next[v]; var t = next[v];
if (t == null) { if (t == null) {
@ -17237,7 +17238,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var split = p.slice(0, i); var split = p.slice(0, i);
var expanded = self._getChildren(split); var expanded = self._getChildren(split);
BI.each(expanded, function (m, child) { BI.each(expanded, function (m, child) {
if (i === p.length - 1 && child.value === not_selected_value) { if (i === p.length - 1 && child.value === notSelectedValue) {
return true; return true;
} }
next[child.value] = {}; next[child.value] = {};
@ -17254,7 +17255,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
if (result.length > 0) { if (result.length > 0) {
BI.each(result, function (i, strs) { BI.each(result, function (i, strs) {
self._buildTree(selected_values, strs); self._buildTree(selectedValues, strs);
}) })
} }
} }
@ -17294,8 +17295,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return can; return can;
} }
function isChild(selected_values, parents) { function isChild(selectedValues, parents) {
var t = selected_values; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
if (!BI.has(t, v)) { if (!BI.has(t, v)) {
@ -17313,16 +17314,16 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqAdjustTreeNode: function (op, callback) { _reqAdjustTreeNode: function (op, callback) {
var self = this; var self = this;
var result = []; var result = [];
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
if (selected_values == null || BI.isEmpty(selected_values)) { if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({}); callback({});
return; return;
} }
BI.each(selected_values, function (k, v) { BI.each(selectedValues, function (k, v) {
result.push([k]); result.push([k]);
}); });
dealWithSelectedValues(selected_values, []); dealWithSelectedValues(selectedValues, []);
var jo = {}; var jo = {};
BI.each(result, function (i, strs) { BI.each(result, function (i, strs) {
@ -17359,23 +17360,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var self = this; var self = this;
var result = []; var result = [];
var keyword = op.keyword || ""; var keyword = op.keyword || "";
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
var last_search_value = op.last_search_value || ""; var lastSearchValue = op.lastSearchValue || "";
var output = search(); var output = search();
BI.nextTick(function () { BI.nextTick(function () {
callback({ callback({
hasNext: output.length > self._const.perPage, hasNext: output.length > self._const.perPage,
items: result, items: result,
last_search_value: BI.last(output) lastSearchValue: BI.last(output)
}) })
}); });
function search() { function search() {
var children = self._getChildren([]); var children = self._getChildren([]);
var start = children.length; var start = children.length;
if (last_search_value !== "") { if (lastSearchValue !== "") {
for (var j = 0, len = start; j < len; j++) { for (var j = 0, len = start; j < len; j++) {
if (children[j].value === last_search_value) { if (children[j].value === lastSearchValue) {
start = j + 1; start = j + 1;
break; break;
} }
@ -17400,22 +17401,22 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return output; return output;
} }
function nodeSearch(deep, parent_values, current, isAllSelect, result) { function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(current, keyword)) { if (self._isMatch(current, keyword)) {
var checked = isAllSelect || isSelected(parent_values, current); var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parent_values, current, false, checked, !isAllSelect && isHalf(parent_values, current), true, result); createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
return [true, checked]; return [true, checked];
} }
if (deep >= self.floors) { if (deep >= self.floors) {
return [false, false]; return [false, false];
} }
var newParents = BI.clone(parent_values); var newParents = BI.clone(parentValues);
newParents.push(current); newParents.push(current);
var children = self._getChildren(newParents); var children = self._getChildren(newParents);
var can = false, checked = false; var can = false, checked = false;
var isCurAllSelected = isAllSelect || isAllSelected(parent_values, current); var isCurAllSelected = isAllSelect || isAllSelected(parentValues, current);
BI.each(children, function (i, child) { BI.each(children, function (i, child) {
var state = nodeSearch(deep + 1, newParents, child.value, isCurAllSelected, result); var state = nodeSearch(deep + 1, newParents, child.value, isCurAllSelected, result);
if (state[1] === true) { if (state[1] === true) {
@ -17426,13 +17427,13 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
} }
}); });
if (can === true) { if (can === true) {
checked = isCurAllSelected || (isSelected(parent_values, current) && checked); checked = isCurAllSelected || (isSelected(parentValues, current) && checked);
createOneJson(parent_values, current, true, checked, false, false, result); createOneJson(parentValues, current, true, checked, false, false, result);
} }
return [can, checked]; return [can, checked];
} }
function createOneJson(parent_values, value, isOpen, checked, half, flag, result) { function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self.map[value]; var node = self.map[value];
result.push({ result.push({
id: node.id, id: node.id,
@ -17440,7 +17441,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
text: node.text, text: node.text,
value: node.value, value: node.value,
title: node.title, title: node.title,
isParent: parent_values.length + 1 < self.floors, isParent: parentValues.length + 1 < self.floors,
open: isOpen, open: isOpen,
checked: checked, checked: checked,
halfCheck: half, halfCheck: half,
@ -17448,8 +17449,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
} }
function isHalf(parent_values, value) { function isHalf(parentValues, value) {
var find = findSelectedObj(parent_values); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
} }
@ -17462,8 +17463,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
} }
function isAllSelected(parent_values, value) { function isAllSelected(parentValues, value) {
var find = findSelectedObj(parent_values); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
} }
@ -17476,8 +17477,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
} }
function isSelected(parent_values, value) { function isSelected(parentValues, value) {
var find = findSelectedObj(parent_values); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return false; return false;
} }
@ -17488,12 +17489,12 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
} }
function findSelectedObj(parent_values) { function findSelectedObj(parentValues) {
var find = selected_values; var find = selectedValues;
if (find == null) { if (find == null) {
return null; return null;
} }
BI.every(parent_values, function (i, v) { BI.every(parentValues, function (i, v) {
find = find[v]; find = find[v];
if (find == null) { if (find == null) {
return false; return false;
@ -17508,23 +17509,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var self = this; var self = this;
var result = []; var result = [];
var times = op.times; var times = op.times;
var check_state = op.check_state || {}; var checkState = op.checkState || {};
var parent_values = op.parent_values || []; var parentValues = op.parentValues || [];
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
var valueMap = {}; var valueMap = {};
if (judgeState(parent_values, selected_values, check_state)) { if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parent_values, selected_values); valueMap = dealWidthSelectedValue(parentValues, selectedValues);
} }
var nodes = this._getChildren(parent_values); var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) { for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var state = getCheckState(nodes[i].value, parent_values, valueMap, check_state); var state = getCheckState(nodes[i].value, parentValues, valueMap, checkState);
result.push({ result.push({
id: nodes[i].id, id: nodes[i].id,
pId: nodes[i].pId, pId: nodes[i].pId,
value: nodes[i].value, value: nodes[i].value,
text: nodes[i].text, text: nodes[i].text,
times: 1, times: 1,
isParent: parent_values.length + 1 < this.floors, isParent: parentValues.length + 1 < this.floors,
checked: state[0], checked: state[0],
halfCheck: state[1] halfCheck: state[1]
}) })
@ -17536,20 +17537,20 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
}); });
function judgeState(parent_values, selected_value, check_state) { function judgeState(parentValues, selected_value, checkState) {
var checked = check_state.checked, half = check_state.half; var checked = checkState.checked, half = checkState.half;
if (parent_values.length > 0 && !checked) { if (parentValues.length > 0 && !checked) {
return false; return false;
} }
return (parent_values.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
} }
function dealWidthSelectedValue(parent_values, selected_values) { function dealWidthSelectedValue(parentValues, selectedValues) {
var valueMap = {}; var valueMap = {};
BI.each(parent_values, function (i, v) { BI.each(parentValues, function (i, v) {
selected_values = selected_values[v]; selectedValues = selectedValues[v];
}); });
BI.each(selected_values, function (value, obj) { BI.each(selectedValues, function (value, obj) {
if (BI.isNull(obj)) { if (BI.isNull(obj)) {
valueMap[value] = [0, 0]; valueMap[value] = [0, 0];
return; return;
@ -17569,14 +17570,14 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return valueMap; return valueMap;
} }
function getCheckState(current, parent_values, valueMap, check_state) { function getCheckState(current, parentValues, valueMap, checkState) {
var checked = check_state.checked, half = check_state.half; var checked = checkState.checked, half = checkState.half;
var hasChild = parent_values.length + 1 < self.floors; var hasChild = parentValues.length + 1 < self.floors;
var tempCheck = false, halfCheck = false; var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) { if (BI.has(valueMap, current)) {
//可能是半选 //可能是半选
if (valueMap[current][0] === 1) { if (valueMap[current][0] === 1) {
var values = BI.clone(parent_values); var values = BI.clone(parentValues);
values.push(current); values.push(current);
if (hasChild && self._getChildCount(values) != valueMap[current][1]) { if (hasChild && self._getChildCount(values) != valueMap[current][1]) {
halfCheck = true; halfCheck = true;
@ -17615,9 +17616,9 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return this.tree.search(v, "value"); return this.tree.search(v, "value");
}, },
_getChildren: function (parent_values) { _getChildren: function (parentValues) {
if (parent_values.length > 0) { if (parentValues.length > 0) {
var value = BI.last(parent_values); var value = BI.last(parentValues);
var parent = this.tree.search(value, "value"); var parent = this.tree.search(value, "value");
} else { } else {
var parent = this.tree.getRoot(); var parent = this.tree.getRoot();
@ -17625,8 +17626,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return parent.getChildren(); return parent.getChildren();
}, },
_getChildCount: function (parent_values) { _getChildCount: function (parentValues) {
return this._getChildren(parent_values).length; return this._getChildren(parentValues).length;
}, },
setValue: function (v) { setValue: function (v) {
@ -17728,8 +17729,8 @@ BI.ValueChooserCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw); var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded); items = search.matched.concat(search.finded);
}); });
if (options.selected_values) {//过滤 if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selected_values, true); var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) { items = BI.filter(items, function (i, ob) {
return !filter[ob.value]; return !filter[ob.value];
}); });

4
demo/dist/demo.js vendored

@ -4703,8 +4703,8 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw); var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded); items = search.matched.concat(search.finded);
}); });
if (options.selected_values) {//过滤 if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selected_values, true); var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) { items = BI.filter(items, function (i, ob) {
return !filter[ob.value]; return !filter[ob.value];
}); });

4
demo/js/widget/demo.multiselectcombo.js

@ -44,8 +44,8 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw); var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded); items = search.matched.concat(search.finded);
}); });
if (options.selected_values) {//过滤 if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selected_values, true); var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) { items = BI.filter(items, function (i, ob) {
return !filter[ob.value]; return !filter[ob.value];
}); });

89
docs/base.js

@ -767,12 +767,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
}); });
break; break;
default: default:
if (o.stopEvent || o.stopPropagation) {
hand.mousedown(function (e) { hand.mousedown(function (e) {
ev(e); ev(e);
}); });
hand.mouseup(function (e) { hand.mouseup(function (e) {
ev(e); ev(e);
}); });
}
hand.click(clk); hand.click(clk);
break; break;
} }
@ -1596,8 +1598,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
treeNode.times = treeNode.times || 1; treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id var param = "id=" + treeNode.id
+ "&times=" + (treeNode.times++) + "&times=" + (treeNode.times++)
+ "&parent_values= " + window.encodeURIComponent(BI.jsonEncode(parentNode)) + "&parentValues= " + window.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&check_state=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus())); + "&checkState=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param; return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param;
} }
@ -1728,7 +1730,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
this._buildTree(map, path); this._buildTree(map, path);
return; return;
} }
var storeValues = BI.deepClone(this.options.paras.selected_values); var storeValues = BI.deepClone(this.options.paras.selectedValues);
var treeNode = this._getTree(storeValues, path); var treeNode = this._getTree(storeValues, path);
this._addTreeNode(map, parent, this._getNodeValue(node), treeNode); this._addTreeNode(map, parent, this._getNodeValue(node), treeNode);
}, },
@ -1844,8 +1846,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
self.nodes = $.fn.zTree.init(tree.element, setting, nodes); self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
}; };
var op = BI.extend({}, o.paras, { var op = BI.extend({}, o.paras, {
times: 1, times: 1
type: BI.TreeView.REQ_TYPE_INIT_DATA
}); });
o.itemsCreator(op, function (res) { o.itemsCreator(op, function (res) {
@ -1938,8 +1939,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
}, },
setSelectedValue: function (value) { setSelectedValue: function (value) {
this.options.paras.selected_values = value || {}; this.options.paras.selectedValues = value || {};
this.selected_values = BI.deepClone(value) || {}; this.selectedValues = BI.deepClone(value) || {};
}, },
updateValue: function (values, param) { updateValue: function (values, param) {
@ -1979,10 +1980,10 @@ BI.TreeView = BI.inherit(BI.Pane, {
} }
}); });
BI.extend(BI.TreeView, { BI.extend(BI.TreeView, {
REQ_TYPE_INIT_DATA: 0, REQ_TYPE_INIT_DATA: 1,
REQ_TYPE_ADJUST_DATA: 1, REQ_TYPE_ADJUST_DATA: 2,
REQ_TYPE_CALCULATE_SELECT_DATA: 2, REQ_TYPE_SELECT_DATA: 3,
REQ_TYPE_SELECTED_DATA: 3 REQ_TYPE_GET_SELECTED_DATA: 4
}); });
BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE"; BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE";
@ -2090,21 +2091,21 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
_selectTreeNode: function (treeId, treeNode) { _selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options; var self = this, o = this.options;
var parent_values = 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 = parent_values.concat([name]); // var values = parentValues.concat([name]);
if (treeNode.checked === true) { if (treeNode.checked === true) {
} else { } else {
var tNode = treeNode; var tNode = treeNode;
var pNode = this._getTree(this.selected_values, parent_values); var pNode = this._getTree(this.selectedValues, parentValues);
if (BI.isNotNull(pNode[name])) { if (BI.isNotNull(pNode[name])) {
delete pNode[name]; delete pNode[name];
} }
while (tNode != null && BI.isEmpty(pNode)) { while (tNode != null && BI.isEmpty(pNode)) {
parent_values = parent_values.slice(0, parent_values.length - 1); parentValues = parentValues.slice(0, parentValues.length - 1);
tNode = tNode.getParentNode(); tNode = tNode.getParentNode();
if (tNode != null) { if (tNode != null) {
pNode = this._getTree(this.selected_values, parent_values); pNode = this._getTree(this.selectedValues, parentValues);
name = this._getNodeValue(tNode); name = this._getNodeValue(tNode);
delete pNode[name]; delete pNode[name];
} }
@ -2120,8 +2121,8 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
var op = BI.extend({}, o.paras, { var op = BI.extend({}, o.paras, {
"id": treeNode.id, "id": treeNode.id,
"times": 1, "times": 1,
"parent_values": parentValues.concat(this._getNodeValue(treeNode)), "parentValues": parentValues.concat(this._getNodeValue(treeNode)),
"check_state": treeNode.getCheckStatus() "checkState": treeNode.getCheckStatus()
}); });
var complete = function (d) { var complete = function (d) {
var nodes = d.items || []; var nodes = d.items || [];
@ -2169,7 +2170,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
}, },
hasChecked: function () { hasChecked: function () {
return !BI.isEmpty(this.selected_values) || BI.SyncTree.superclass.hasChecked.apply(this, arguments); return !BI.isEmpty(this.selectedValues) || BI.SyncTree.superclass.hasChecked.apply(this, arguments);
}, },
getValue: function () { getValue: function () {
@ -2178,12 +2179,12 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
} }
var checkedValues = this._getSelectedValues(); var checkedValues = this._getSelectedValues();
if (BI.isEmpty(checkedValues)) { if (BI.isEmpty(checkedValues)) {
return this.selected_values; return this.selectedValues;
} }
if (BI.isEmpty(this.selected_values)) { if (BI.isEmpty(this.selectedValues)) {
return checkedValues; return checkedValues;
} }
return this._join(checkedValues, this.selected_values); return this._join(checkedValues, this.selectedValues);
}, },
//生成树方法 //生成树方法
@ -2191,7 +2192,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
delete this.options.keyword; delete this.options.keyword;
BI.extend(this.options.paras, config); BI.extend(this.options.paras, config);
//取消选中时使用 //取消选中时使用
this.selected_values = BI.deepClone(this.options.paras.selected_values) || {}; this.selectedValues = BI.deepClone(this.options.paras.selectedValues) || {};
var setting = this._configSetting(); var setting = this._configSetting();
this._initTree(setting); this._initTree(setting);
} }
@ -2221,7 +2222,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
this.tip.setLoading(); this.tip.setLoading();
o.itemsCreator(op, function (d) { o.itemsCreator(op, function (d) {
var hasNext = !!d.hasNext, nodes = d.items || []; var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.last_search_value = d.last_search_value; o.paras.lastSearchValue = d.lastSearchValue;
if (self._stop === true) { if (self._stop === true) {
return; return;
} }
@ -2238,35 +2239,35 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
_selectTreeNode: function (treeId, treeNode) { _selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options; var self = this, o = this.options;
var parent_values = 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 = parent_values.concat([name]); // var values = parentValues.concat([name]);
if (treeNode.checked === true) { if (treeNode.checked === true) {
BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); BI.SyncTree.superclass._selectTreeNode.apply(self, arguments);
} else { } else {
o.itemsCreator(BI.extend({}, o.paras, { o.itemsCreator(BI.extend({}, o.paras, {
type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA, type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA,
selected_values: this.selected_values, selectedValues: this.selectedValues,
not_selected_value: name, notSelectedValue: name,
parent_values: parent_values parentValues: parentValues
}), function (new_values) { }), function (new_values) {
if (BI.isEqual(self.selected_values, new_values)) { if (BI.isEqual(self.selectedValues, new_values)) {
var tNode = treeNode; var tNode = treeNode;
var pNode = self._getTree(new_values, parent_values); var pNode = self._getTree(new_values, parentValues);
if (pNode[name]) { if (pNode[name]) {
delete pNode[name]; delete pNode[name];
} }
while (tNode != null && BI.isEmpty(pNode)) { while (tNode != null && BI.isEmpty(pNode)) {
parent_values = parent_values.slice(0, parent_values.length - 1); parentValues = parentValues.slice(0, parentValues.length - 1);
tNode = tNode.getParentNode(); tNode = tNode.getParentNode();
if (tNode != null) { if (tNode != null) {
pNode = self._getTree(new_values, parent_values); pNode = self._getTree(new_values, parentValues);
name = self._getNodeValue(tNode); name = self._getNodeValue(tNode);
delete pNode[name]; delete pNode[name];
} }
} }
} }
self.selected_values = new_values; self.selectedValues = new_values;
BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); BI.SyncTree.superclass._selectTreeNode.apply(self, arguments);
}); });
} }
@ -2319,7 +2320,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
return; return;
} }
var hasNext = !!d.hasNext, nodes = d.items || []; var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.last_search_value = d.last_search_value; o.paras.lastSearchValue = d.lastSearchValue;
if (nodes.length > 0) { if (nodes.length > 0) {
callback(self._dealWidthNodes(nodes)); callback(self._dealWidthNodes(nodes));
} }
@ -2350,7 +2351,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
var result = BI.PartTree.superclass.getValue.apply(this, arguments); var result = BI.PartTree.superclass.getValue.apply(this, arguments);
o.itemsCreator({ o.itemsCreator({
type: BI.TreeView.REQ_TYPE_ADJUST_DATA, type: BI.TreeView.REQ_TYPE_ADJUST_DATA,
selected_values: result selectedValues: result
}, function (res) { }, function (res) {
result = res; result = res;
}); });
@ -2362,10 +2363,10 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
var o = this.options; var o = this.options;
delete o.paras.keyword; delete o.paras.keyword;
BI.extend(o.paras, config); BI.extend(o.paras, config);
delete o.paras.last_search_value; delete o.paras.lastSearchValue;
//取消选中时使用 //取消选中时使用
this.selected_values = BI.deepClone(o.paras.selected_values) || {}; this.selectedValues = BI.deepClone(o.paras.selectedValues) || {};
//delete this.options.paras.selected_values; //delete this.options.paras.selectedValues;
var setting = this._configSetting(); var setting = this._configSetting();
this._initTree(setting, o.paras.keyword); this._initTree(setting, o.paras.keyword);
} }
@ -29340,7 +29341,7 @@ BI.GridTable = BI.inherit(BI.Widget, {
var trh = otrh + this._scrollBarSize; var trh = otrh + this._scrollBarSize;
var blw = oblw + this._scrollBarSize; var blw = oblw + this._scrollBarSize;
var blh = oblh + this._scrollBarSize; var blh = oblh + this._scrollBarSize;
var brw = obrw+ this._scrollBarSize; var brw = obrw + this._scrollBarSize;
var brh = obrh + this._scrollBarSize; var brh = obrh + this._scrollBarSize;
var digest = function (el) { var digest = function (el) {
@ -29376,11 +29377,11 @@ BI.GridTable = BI.inherit(BI.Widget, {
this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.topLeftGrid.setEstimatedRowSize(o.headerRowSize); this.topLeftGrid.setEstimatedRowSize(o.headerRowSize);
this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); this.topRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.topRightGrid.setEstimatedRowSize(o.headerRowSize); this.topRightGrid.setEstimatedRowSize(o.headerRowSize);
this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.bottomLeftGrid.setEstimatedRowSize(o.rowSize); this.bottomLeftGrid.setEstimatedRowSize(o.rowSize);
this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
var items = this.contextLayout.attr("items"); var items = this.contextLayout.attr("items");
@ -29614,11 +29615,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.topLeftGrid.setEstimatedRowSize(o.headerRowSize); this.topLeftGrid.setEstimatedRowSize(o.headerRowSize);
this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); this.topRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.topRightGrid.setEstimatedRowSize(o.headerRowSize); this.topRightGrid.setEstimatedRowSize(o.headerRowSize);
this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.bottomLeftGrid.setEstimatedRowSize(o.rowSize); this.bottomLeftGrid.setEstimatedRowSize(o.rowSize);
this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
var items = this.contextLayout.attr("items"); var items = this.contextLayout.attr("items");

4
docs/demo.js

@ -5434,8 +5434,8 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw); var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded); items = search.matched.concat(search.finded);
}); });
if (options.selected_values) {//过滤 if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selected_values, true); var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) { items = BI.filter(items, function (i, ob) {
return !filter[ob.value]; return !filter[ob.value];
}); });

185
docs/widget.js

@ -9365,7 +9365,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
items: opts.items, items: opts.items,
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
op = BI.extend(op || {}, { op = BI.extend(op || {}, {
selected_values: self.storeValue.value selectedValues: self.storeValue.value
}); });
if (self.storeValue.type === BI.Selection.Multi) { if (self.storeValue.type === BI.Selection.Multi) {
callback({ callback({
@ -9928,7 +9928,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
var startValue = self._startValue; var startValue = self._startValue;
self.storeValue && (op = BI.extend(op || {}, { self.storeValue && (op = BI.extend(op || {}, {
selected_values: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi selectedValues: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi
? self.storeValue.value.concat(startValue) : self.storeValue.value ? self.storeValue.value.concat(startValue) : self.storeValue.value
})); }));
opts.itemsCreator(op, function (ob) { opts.itemsCreator(op, function (ob) {
@ -10340,7 +10340,7 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
}, },
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
self.storeValue && (op = BI.extend(op || {}, { self.storeValue && (op = BI.extend(op || {}, {
selected_values: self.storeValue.value selectedValues: self.storeValue.value
})); }));
opts.itemsCreator(op, function (ob) { opts.itemsCreator(op, function (ob) {
var keyword = ob.keyword = opts.keywordGetter(); var keyword = ob.keyword = opts.keywordGetter();
@ -10810,13 +10810,13 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
ob.value || (ob.value = []); ob.value || (ob.value = []);
if (ob.type === BI.Selection.All) { if (ob.type === BI.Selection.All) {
if (BI.size(ob.assist) === 1) { if (BI.size(ob.assist) === 1) {
this.editor.setState(o.valueFormatter(ob.assist[0] + "") || ob.assist[0] + ""); this.editor.setState(o.valueFormatter(ob.assist[0] + "") || (ob.assist[0] + ""));
} else { } else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.All); this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.All);
} }
} else { } else {
if (BI.size(ob.value) === 1) { if (BI.size(ob.value) === 1) {
this.editor.setState(o.valueFormatter(ob.value[0] + "" || ob.value[0] + "")); this.editor.setState(o.valueFormatter(ob.value[0] + "") || (ob.value[0] + ""));
} else { } else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.None); this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.None);
} }
@ -11288,7 +11288,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
var self = this, opts = this.options; var self = this, opts = this.options;
this.selected_values = {}; this.selectedValues = {};
var continueSelect = BI.createWidget({ var continueSelect = BI.createWidget({
type: 'bi.text_button', type: 'bi.text_button',
@ -11325,7 +11325,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
type: "bi.display_tree", type: "bi.display_tree",
cls: "bi-multi-tree-display", cls: "bi-multi-tree-display",
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_SELECTED_DATA; op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback); opts.itemsCreator(op, callback);
} }
}); });
@ -11650,7 +11650,7 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
var self = this, opts = this.options; var self = this, opts = this.options;
this.selected_values = {}; this.selectedValues = {};
this.tree = BI.createWidget({ this.tree = BI.createWidget({
type: "bi.sync_tree", type: "bi.sync_tree",
@ -15913,7 +15913,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
}, },
_populate: function () { _populate: function () {
this.header.populate(); this.headerContainer.empty();
this._createHeader();
this._layout(); this._layout();
this._calculateChildrenToRender(); this._calculateChildrenToRender();
}, },
@ -17001,8 +17002,8 @@ BI.AllValueChooserCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw); var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded); items = search.matched.concat(search.finded);
}); });
if (options.selected_values) {//过滤 if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selected_values, true); var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) { items = BI.filter(items, function (i, ob) {
return !filter[ob.value]; return !filter[ob.value];
}); });
@ -17129,10 +17130,10 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
case BI.TreeView.REQ_TYPE_ADJUST_DATA: case BI.TreeView.REQ_TYPE_ADJUST_DATA:
self._reqAdjustTreeNode(options, callback); self._reqAdjustTreeNode(options, callback);
break; break;
case BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA: case BI.TreeView.REQ_TYPE_SELECT_DATA:
self._reqSelectedTreeNode(options, callback); self._reqSelectedTreeNode(options, callback);
break; break;
case BI.TreeView.REQ_TYPE_SELECTED_DATA: case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:
self._reqDisplayTreeNode(options, callback); self._reqDisplayTreeNode(options, callback);
break; break;
default : default :
@ -17145,27 +17146,27 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqDisplayTreeNode: function (op, callback) { _reqDisplayTreeNode: function (op, callback) {
var self = this; var self = this;
var result = []; var result = [];
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
if (selected_values == null || BI.isEmpty(selected_values)) { if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({}); callback({});
return; return;
} }
doCheck(0, [], selected_values); doCheck(0, [], selectedValues);
callback({ callback({
items: result items: result
}); });
function doCheck(floor, parent_values, selected) { function doCheck(floor, parentValues, selected) {
if (floor >= self.floors) { if (floor >= self.floors) {
return; return;
} }
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
var children = self._getChildren(parent_values); var children = self._getChildren(parentValues);
BI.each(children, function (i, child) { BI.each(children, function (i, child) {
var newParents = BI.clone(parent_values); var newParents = BI.clone(parentValues);
newParents.push(child.value); newParents.push(child.value);
var llen = self._getChildCount(newParents); var llen = self._getChildCount(newParents);
createOneJson(child, llen); createOneJson(child, llen);
@ -17175,19 +17176,19 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
} }
BI.each(selected, function (k) { BI.each(selected, function (k) {
var node = self._getNode(k); var node = self._getNode(k);
var newParents = BI.clone(parent_values); var newParents = BI.clone(parentValues);
newParents.push(node.value); newParents.push(node.value);
createOneJson(node, getCount(selected[k], newParents)); createOneJson(node, getCount(selected[k], newParents));
doCheck(floor + 1, newParents, selected[k]); doCheck(floor + 1, newParents, selected[k]);
}) })
} }
function getCount(jo, parent_values) { function getCount(jo, parentValues) {
if (jo == null) { if (jo == null) {
return 0; return 0;
} }
if (BI.isEmpty(jo)) { if (BI.isEmpty(jo)) {
return self._getChildCount(parent_values); return self._getChildCount(parentValues);
} }
return BI.size(jo); return BI.size(jo);
@ -17206,30 +17207,30 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqSelectedTreeNode: function (op, callback) { _reqSelectedTreeNode: function (op, callback) {
var self = this; var self = this;
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
var not_selected_value = op.not_selected_value || {}; var notSelectedValue = op.notSelectedValue || {};
var keyword = op.keyword || ""; var keyword = op.keyword || "";
var parent_values = op.parent_values || []; var parentValues = op.parentValues || [];
if (selected_values == null || BI.isEmpty(selected_values)) { if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({}); callback({});
return; return;
} }
dealWithSelectedValues(selected_values); dealWithSelectedValues(selectedValues);
callback(selected_values); callback(selectedValues);
function dealWithSelectedValues(selected_values) { function dealWithSelectedValues(selectedValues) {
var p = BI.clone(parent_values); var p = BI.clone(parentValues);
p.push(not_selected_value); p.push(notSelectedValue);
if (isChild(selected_values, p)) { if (isChild(selectedValues, p)) {
var result = []; var result = [];
var finded = search(parent_values.length + 1, parent_values, not_selected_value, result); var finded = search(parentValues.length + 1, parentValues, notSelectedValue, result);
if (finded === true) { if (finded === true) {
var next = selected_values; var next = selectedValues;
BI.each(p, function (i, v) { BI.each(p, function (i, v) {
var t = next[v]; var t = next[v];
if (t == null) { if (t == null) {
@ -17237,7 +17238,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var split = p.slice(0, i); var split = p.slice(0, i);
var expanded = self._getChildren(split); var expanded = self._getChildren(split);
BI.each(expanded, function (m, child) { BI.each(expanded, function (m, child) {
if (i === p.length - 1 && child.value === not_selected_value) { if (i === p.length - 1 && child.value === notSelectedValue) {
return true; return true;
} }
next[child.value] = {}; next[child.value] = {};
@ -17254,7 +17255,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
if (result.length > 0) { if (result.length > 0) {
BI.each(result, function (i, strs) { BI.each(result, function (i, strs) {
self._buildTree(selected_values, strs); self._buildTree(selectedValues, strs);
}) })
} }
} }
@ -17294,8 +17295,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return can; return can;
} }
function isChild(selected_values, parents) { function isChild(selectedValues, parents) {
var t = selected_values; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
if (!BI.has(t, v)) { if (!BI.has(t, v)) {
@ -17313,16 +17314,16 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqAdjustTreeNode: function (op, callback) { _reqAdjustTreeNode: function (op, callback) {
var self = this; var self = this;
var result = []; var result = [];
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
if (selected_values == null || BI.isEmpty(selected_values)) { if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({}); callback({});
return; return;
} }
BI.each(selected_values, function (k, v) { BI.each(selectedValues, function (k, v) {
result.push([k]); result.push([k]);
}); });
dealWithSelectedValues(selected_values, []); dealWithSelectedValues(selectedValues, []);
var jo = {}; var jo = {};
BI.each(result, function (i, strs) { BI.each(result, function (i, strs) {
@ -17359,23 +17360,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var self = this; var self = this;
var result = []; var result = [];
var keyword = op.keyword || ""; var keyword = op.keyword || "";
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
var last_search_value = op.last_search_value || ""; var lastSearchValue = op.lastSearchValue || "";
var output = search(); var output = search();
BI.nextTick(function () { BI.nextTick(function () {
callback({ callback({
hasNext: output.length > self._const.perPage, hasNext: output.length > self._const.perPage,
items: result, items: result,
last_search_value: BI.last(output) lastSearchValue: BI.last(output)
}) })
}); });
function search() { function search() {
var children = self._getChildren([]); var children = self._getChildren([]);
var start = children.length; var start = children.length;
if (last_search_value !== "") { if (lastSearchValue !== "") {
for (var j = 0, len = start; j < len; j++) { for (var j = 0, len = start; j < len; j++) {
if (children[j].value === last_search_value) { if (children[j].value === lastSearchValue) {
start = j + 1; start = j + 1;
break; break;
} }
@ -17400,22 +17401,22 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return output; return output;
} }
function nodeSearch(deep, parent_values, current, isAllSelect, result) { function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(current, keyword)) { if (self._isMatch(current, keyword)) {
var checked = isAllSelect || isSelected(parent_values, current); var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parent_values, current, false, checked, !isAllSelect && isHalf(parent_values, current), true, result); createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
return [true, checked]; return [true, checked];
} }
if (deep >= self.floors) { if (deep >= self.floors) {
return [false, false]; return [false, false];
} }
var newParents = BI.clone(parent_values); var newParents = BI.clone(parentValues);
newParents.push(current); newParents.push(current);
var children = self._getChildren(newParents); var children = self._getChildren(newParents);
var can = false, checked = false; var can = false, checked = false;
var isCurAllSelected = isAllSelect || isAllSelected(parent_values, current); var isCurAllSelected = isAllSelect || isAllSelected(parentValues, current);
BI.each(children, function (i, child) { BI.each(children, function (i, child) {
var state = nodeSearch(deep + 1, newParents, child.value, isCurAllSelected, result); var state = nodeSearch(deep + 1, newParents, child.value, isCurAllSelected, result);
if (state[1] === true) { if (state[1] === true) {
@ -17426,13 +17427,13 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
} }
}); });
if (can === true) { if (can === true) {
checked = isCurAllSelected || (isSelected(parent_values, current) && checked); checked = isCurAllSelected || (isSelected(parentValues, current) && checked);
createOneJson(parent_values, current, true, checked, false, false, result); createOneJson(parentValues, current, true, checked, false, false, result);
} }
return [can, checked]; return [can, checked];
} }
function createOneJson(parent_values, value, isOpen, checked, half, flag, result) { function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self.map[value]; var node = self.map[value];
result.push({ result.push({
id: node.id, id: node.id,
@ -17440,7 +17441,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
text: node.text, text: node.text,
value: node.value, value: node.value,
title: node.title, title: node.title,
isParent: parent_values.length + 1 < self.floors, isParent: parentValues.length + 1 < self.floors,
open: isOpen, open: isOpen,
checked: checked, checked: checked,
halfCheck: half, halfCheck: half,
@ -17448,8 +17449,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
} }
function isHalf(parent_values, value) { function isHalf(parentValues, value) {
var find = findSelectedObj(parent_values); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
} }
@ -17462,8 +17463,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
} }
function isAllSelected(parent_values, value) { function isAllSelected(parentValues, value) {
var find = findSelectedObj(parent_values); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
} }
@ -17476,8 +17477,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
} }
function isSelected(parent_values, value) { function isSelected(parentValues, value) {
var find = findSelectedObj(parent_values); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return false; return false;
} }
@ -17488,12 +17489,12 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
} }
function findSelectedObj(parent_values) { function findSelectedObj(parentValues) {
var find = selected_values; var find = selectedValues;
if (find == null) { if (find == null) {
return null; return null;
} }
BI.every(parent_values, function (i, v) { BI.every(parentValues, function (i, v) {
find = find[v]; find = find[v];
if (find == null) { if (find == null) {
return false; return false;
@ -17508,23 +17509,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var self = this; var self = this;
var result = []; var result = [];
var times = op.times; var times = op.times;
var check_state = op.check_state || {}; var checkState = op.checkState || {};
var parent_values = op.parent_values || []; var parentValues = op.parentValues || [];
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
var valueMap = {}; var valueMap = {};
if (judgeState(parent_values, selected_values, check_state)) { if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parent_values, selected_values); valueMap = dealWidthSelectedValue(parentValues, selectedValues);
} }
var nodes = this._getChildren(parent_values); var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) { for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var state = getCheckState(nodes[i].value, parent_values, valueMap, check_state); var state = getCheckState(nodes[i].value, parentValues, valueMap, checkState);
result.push({ result.push({
id: nodes[i].id, id: nodes[i].id,
pId: nodes[i].pId, pId: nodes[i].pId,
value: nodes[i].value, value: nodes[i].value,
text: nodes[i].text, text: nodes[i].text,
times: 1, times: 1,
isParent: parent_values.length + 1 < this.floors, isParent: parentValues.length + 1 < this.floors,
checked: state[0], checked: state[0],
halfCheck: state[1] halfCheck: state[1]
}) })
@ -17536,20 +17537,20 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
}); });
function judgeState(parent_values, selected_value, check_state) { function judgeState(parentValues, selected_value, checkState) {
var checked = check_state.checked, half = check_state.half; var checked = checkState.checked, half = checkState.half;
if (parent_values.length > 0 && !checked) { if (parentValues.length > 0 && !checked) {
return false; return false;
} }
return (parent_values.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
} }
function dealWidthSelectedValue(parent_values, selected_values) { function dealWidthSelectedValue(parentValues, selectedValues) {
var valueMap = {}; var valueMap = {};
BI.each(parent_values, function (i, v) { BI.each(parentValues, function (i, v) {
selected_values = selected_values[v]; selectedValues = selectedValues[v];
}); });
BI.each(selected_values, function (value, obj) { BI.each(selectedValues, function (value, obj) {
if (BI.isNull(obj)) { if (BI.isNull(obj)) {
valueMap[value] = [0, 0]; valueMap[value] = [0, 0];
return; return;
@ -17569,14 +17570,14 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return valueMap; return valueMap;
} }
function getCheckState(current, parent_values, valueMap, check_state) { function getCheckState(current, parentValues, valueMap, checkState) {
var checked = check_state.checked, half = check_state.half; var checked = checkState.checked, half = checkState.half;
var hasChild = parent_values.length + 1 < self.floors; var hasChild = parentValues.length + 1 < self.floors;
var tempCheck = false, halfCheck = false; var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) { if (BI.has(valueMap, current)) {
//可能是半选 //可能是半选
if (valueMap[current][0] === 1) { if (valueMap[current][0] === 1) {
var values = BI.clone(parent_values); var values = BI.clone(parentValues);
values.push(current); values.push(current);
if (hasChild && self._getChildCount(values) != valueMap[current][1]) { if (hasChild && self._getChildCount(values) != valueMap[current][1]) {
halfCheck = true; halfCheck = true;
@ -17615,9 +17616,9 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return this.tree.search(v, "value"); return this.tree.search(v, "value");
}, },
_getChildren: function (parent_values) { _getChildren: function (parentValues) {
if (parent_values.length > 0) { if (parentValues.length > 0) {
var value = BI.last(parent_values); var value = BI.last(parentValues);
var parent = this.tree.search(value, "value"); var parent = this.tree.search(value, "value");
} else { } else {
var parent = this.tree.getRoot(); var parent = this.tree.getRoot();
@ -17625,8 +17626,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return parent.getChildren(); return parent.getChildren();
}, },
_getChildCount: function (parent_values) { _getChildCount: function (parentValues) {
return this._getChildren(parent_values).length; return this._getChildren(parentValues).length;
}, },
setValue: function (v) { setValue: function (v) {
@ -17728,8 +17729,8 @@ BI.ValueChooserCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw); var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded); items = search.matched.concat(search.finded);
}); });
if (options.selected_values) {//过滤 if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selected_values, true); var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) { items = BI.filter(items, function (i, ob) {
return !filter[ob.value]; return !filter[ob.value];
}); });

2
src/base/single/button/button.basic.js

@ -184,12 +184,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
}); });
break; break;
default: default:
if (o.stopEvent || o.stopPropagation) {
hand.mousedown(function (e) { hand.mousedown(function (e) {
ev(e); ev(e);
}); });
hand.mouseup(function (e) { hand.mouseup(function (e) {
ev(e); ev(e);
}); });
}
hand.click(clk); hand.click(clk);
break; break;
} }

6
src/base/table/table.grid.js

@ -294,7 +294,7 @@ BI.GridTable = BI.inherit(BI.Widget, {
var trh = otrh + this._scrollBarSize; var trh = otrh + this._scrollBarSize;
var blw = oblw + this._scrollBarSize; var blw = oblw + this._scrollBarSize;
var blh = oblh + this._scrollBarSize; var blh = oblh + this._scrollBarSize;
var brw = obrw+ this._scrollBarSize; var brw = obrw + this._scrollBarSize;
var brh = obrh + this._scrollBarSize; var brh = obrh + this._scrollBarSize;
var digest = function (el) { var digest = function (el) {
@ -330,11 +330,11 @@ BI.GridTable = BI.inherit(BI.Widget, {
this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.topLeftGrid.setEstimatedRowSize(o.headerRowSize); this.topLeftGrid.setEstimatedRowSize(o.headerRowSize);
this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); this.topRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.topRightGrid.setEstimatedRowSize(o.headerRowSize); this.topRightGrid.setEstimatedRowSize(o.headerRowSize);
this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.bottomLeftGrid.setEstimatedRowSize(o.rowSize); this.bottomLeftGrid.setEstimatedRowSize(o.rowSize);
this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
var items = this.contextLayout.attr("items"); var items = this.contextLayout.attr("items");

4
src/base/table/table.grid.quick.js

@ -115,11 +115,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.topLeftGrid.setEstimatedRowSize(o.headerRowSize); this.topLeftGrid.setEstimatedRowSize(o.headerRowSize);
this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); this.topRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.topRightGrid.setEstimatedRowSize(o.headerRowSize); this.topRightGrid.setEstimatedRowSize(o.headerRowSize);
this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.bottomLeftGrid.setEstimatedRowSize(o.rowSize); this.bottomLeftGrid.setEstimatedRowSize(o.rowSize);
this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
var items = this.contextLayout.attr("items"); var items = this.contextLayout.attr("items");

32
src/base/tree/parttree.js

@ -22,7 +22,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
this.tip.setLoading(); this.tip.setLoading();
o.itemsCreator(op, function (d) { o.itemsCreator(op, function (d) {
var hasNext = !!d.hasNext, nodes = d.items || []; var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.last_search_value = d.last_search_value; o.paras.lastSearchValue = d.lastSearchValue;
if (self._stop === true) { if (self._stop === true) {
return; return;
} }
@ -39,35 +39,35 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
_selectTreeNode: function (treeId, treeNode) { _selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options; var self = this, o = this.options;
var parent_values = 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 = parent_values.concat([name]); // var values = parentValues.concat([name]);
if (treeNode.checked === true) { if (treeNode.checked === true) {
BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); BI.SyncTree.superclass._selectTreeNode.apply(self, arguments);
} else { } else {
o.itemsCreator(BI.extend({}, o.paras, { o.itemsCreator(BI.extend({}, o.paras, {
type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA, type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA,
selected_values: this.selected_values, selectedValues: this.selectedValues,
not_selected_value: name, notSelectedValue: name,
parent_values: parent_values parentValues: parentValues
}), function (new_values) { }), function (new_values) {
if (BI.isEqual(self.selected_values, new_values)) { if (BI.isEqual(self.selectedValues, new_values)) {
var tNode = treeNode; var tNode = treeNode;
var pNode = self._getTree(new_values, parent_values); var pNode = self._getTree(new_values, parentValues);
if (pNode[name]) { if (pNode[name]) {
delete pNode[name]; delete pNode[name];
} }
while (tNode != null && BI.isEmpty(pNode)) { while (tNode != null && BI.isEmpty(pNode)) {
parent_values = parent_values.slice(0, parent_values.length - 1); parentValues = parentValues.slice(0, parentValues.length - 1);
tNode = tNode.getParentNode(); tNode = tNode.getParentNode();
if (tNode != null) { if (tNode != null) {
pNode = self._getTree(new_values, parent_values); pNode = self._getTree(new_values, parentValues);
name = self._getNodeValue(tNode); name = self._getNodeValue(tNode);
delete pNode[name]; delete pNode[name];
} }
} }
} }
self.selected_values = new_values; self.selectedValues = new_values;
BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); BI.SyncTree.superclass._selectTreeNode.apply(self, arguments);
}); });
} }
@ -120,7 +120,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
return; return;
} }
var hasNext = !!d.hasNext, nodes = d.items || []; var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.last_search_value = d.last_search_value; o.paras.lastSearchValue = d.lastSearchValue;
if (nodes.length > 0) { if (nodes.length > 0) {
callback(self._dealWidthNodes(nodes)); callback(self._dealWidthNodes(nodes));
} }
@ -151,7 +151,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
var result = BI.PartTree.superclass.getValue.apply(this, arguments); var result = BI.PartTree.superclass.getValue.apply(this, arguments);
o.itemsCreator({ o.itemsCreator({
type: BI.TreeView.REQ_TYPE_ADJUST_DATA, type: BI.TreeView.REQ_TYPE_ADJUST_DATA,
selected_values: result selectedValues: result
}, function (res) { }, function (res) {
result = res; result = res;
}); });
@ -163,10 +163,10 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
var o = this.options; var o = this.options;
delete o.paras.keyword; delete o.paras.keyword;
BI.extend(o.paras, config); BI.extend(o.paras, config);
delete o.paras.last_search_value; delete o.paras.lastSearchValue;
//取消选中时使用 //取消选中时使用
this.selected_values = BI.deepClone(o.paras.selected_values) || {}; this.selectedValues = BI.deepClone(o.paras.selectedValues) || {};
//delete this.options.paras.selected_values; //delete this.options.paras.selectedValues;
var setting = this._configSetting(); var setting = this._configSetting();
this._initTree(setting, o.paras.keyword); this._initTree(setting, o.paras.keyword);
} }

24
src/base/tree/synctree.js

@ -99,21 +99,21 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
_selectTreeNode: function (treeId, treeNode) { _selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options; var self = this, o = this.options;
var parent_values = 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 = parent_values.concat([name]); // var values = parentValues.concat([name]);
if (treeNode.checked === true) { if (treeNode.checked === true) {
} else { } else {
var tNode = treeNode; var tNode = treeNode;
var pNode = this._getTree(this.selected_values, parent_values); var pNode = this._getTree(this.selectedValues, parentValues);
if (BI.isNotNull(pNode[name])) { if (BI.isNotNull(pNode[name])) {
delete pNode[name]; delete pNode[name];
} }
while (tNode != null && BI.isEmpty(pNode)) { while (tNode != null && BI.isEmpty(pNode)) {
parent_values = parent_values.slice(0, parent_values.length - 1); parentValues = parentValues.slice(0, parentValues.length - 1);
tNode = tNode.getParentNode(); tNode = tNode.getParentNode();
if (tNode != null) { if (tNode != null) {
pNode = this._getTree(this.selected_values, parent_values); pNode = this._getTree(this.selectedValues, parentValues);
name = this._getNodeValue(tNode); name = this._getNodeValue(tNode);
delete pNode[name]; delete pNode[name];
} }
@ -129,8 +129,8 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
var op = BI.extend({}, o.paras, { var op = BI.extend({}, o.paras, {
"id": treeNode.id, "id": treeNode.id,
"times": 1, "times": 1,
"parent_values": parentValues.concat(this._getNodeValue(treeNode)), "parentValues": parentValues.concat(this._getNodeValue(treeNode)),
"check_state": treeNode.getCheckStatus() "checkState": treeNode.getCheckStatus()
}); });
var complete = function (d) { var complete = function (d) {
var nodes = d.items || []; var nodes = d.items || [];
@ -178,7 +178,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
}, },
hasChecked: function () { hasChecked: function () {
return !BI.isEmpty(this.selected_values) || BI.SyncTree.superclass.hasChecked.apply(this, arguments); return !BI.isEmpty(this.selectedValues) || BI.SyncTree.superclass.hasChecked.apply(this, arguments);
}, },
getValue: function () { getValue: function () {
@ -187,12 +187,12 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
} }
var checkedValues = this._getSelectedValues(); var checkedValues = this._getSelectedValues();
if (BI.isEmpty(checkedValues)) { if (BI.isEmpty(checkedValues)) {
return this.selected_values; return this.selectedValues;
} }
if (BI.isEmpty(this.selected_values)) { if (BI.isEmpty(this.selectedValues)) {
return checkedValues; return checkedValues;
} }
return this._join(checkedValues, this.selected_values); return this._join(checkedValues, this.selectedValues);
}, },
//生成树方法 //生成树方法
@ -200,7 +200,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
delete this.options.keyword; delete this.options.keyword;
BI.extend(this.options.paras, config); BI.extend(this.options.paras, config);
//取消选中时使用 //取消选中时使用
this.selected_values = BI.deepClone(this.options.paras.selected_values) || {}; this.selectedValues = BI.deepClone(this.options.paras.selectedValues) || {};
var setting = this._configSetting(); var setting = this._configSetting();
this._initTree(setting); this._initTree(setting);
} }

21
src/base/tree/treeview.js

@ -109,8 +109,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
treeNode.times = treeNode.times || 1; treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id var param = "id=" + treeNode.id
+ "&times=" + (treeNode.times++) + "&times=" + (treeNode.times++)
+ "&parent_values= " + window.encodeURIComponent(BI.jsonEncode(parentNode)) + "&parentValues= " + window.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&check_state=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus())); + "&checkState=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param; return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param;
} }
@ -241,7 +241,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
this._buildTree(map, path); this._buildTree(map, path);
return; return;
} }
var storeValues = BI.deepClone(this.options.paras.selected_values); var storeValues = BI.deepClone(this.options.paras.selectedValues);
var treeNode = this._getTree(storeValues, path); var treeNode = this._getTree(storeValues, path);
this._addTreeNode(map, parent, this._getNodeValue(node), treeNode); this._addTreeNode(map, parent, this._getNodeValue(node), treeNode);
}, },
@ -357,8 +357,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
self.nodes = $.fn.zTree.init(tree.element, setting, nodes); self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
}; };
var op = BI.extend({}, o.paras, { var op = BI.extend({}, o.paras, {
times: 1, times: 1
type: BI.TreeView.REQ_TYPE_INIT_DATA
}); });
o.itemsCreator(op, function (res) { o.itemsCreator(op, function (res) {
@ -451,8 +450,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
}, },
setSelectedValue: function (value) { setSelectedValue: function (value) {
this.options.paras.selected_values = value || {}; this.options.paras.selectedValues = value || {};
this.selected_values = BI.deepClone(value) || {}; this.selectedValues = BI.deepClone(value) || {};
}, },
updateValue: function (values, param) { updateValue: function (values, param) {
@ -492,10 +491,10 @@ BI.TreeView = BI.inherit(BI.Pane, {
} }
}); });
BI.extend(BI.TreeView, { BI.extend(BI.TreeView, {
REQ_TYPE_INIT_DATA: 0, REQ_TYPE_INIT_DATA: 1,
REQ_TYPE_ADJUST_DATA: 1, REQ_TYPE_ADJUST_DATA: 2,
REQ_TYPE_CALCULATE_SELECT_DATA: 2, REQ_TYPE_SELECT_DATA: 3,
REQ_TYPE_SELECTED_DATA: 3 REQ_TYPE_GET_SELECTED_DATA: 4
}); });
BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE"; BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE";

4
src/component/allvaluechooser/combo.allvaluechooser.js

@ -72,8 +72,8 @@ BI.AllValueChooserCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw); var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded); items = search.matched.concat(search.finded);
}); });
if (options.selected_values) {//过滤 if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selected_values, true); var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) { items = BI.filter(items, function (i, ob) {
return !filter[ob.value]; return !filter[ob.value];
}); });

158
src/component/treevaluechooser/combo.treevaluechooser.js

@ -83,10 +83,10 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
case BI.TreeView.REQ_TYPE_ADJUST_DATA: case BI.TreeView.REQ_TYPE_ADJUST_DATA:
self._reqAdjustTreeNode(options, callback); self._reqAdjustTreeNode(options, callback);
break; break;
case BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA: case BI.TreeView.REQ_TYPE_SELECT_DATA:
self._reqSelectedTreeNode(options, callback); self._reqSelectedTreeNode(options, callback);
break; break;
case BI.TreeView.REQ_TYPE_SELECTED_DATA: case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:
self._reqDisplayTreeNode(options, callback); self._reqDisplayTreeNode(options, callback);
break; break;
default : default :
@ -99,27 +99,27 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqDisplayTreeNode: function (op, callback) { _reqDisplayTreeNode: function (op, callback) {
var self = this; var self = this;
var result = []; var result = [];
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
if (selected_values == null || BI.isEmpty(selected_values)) { if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({}); callback({});
return; return;
} }
doCheck(0, [], selected_values); doCheck(0, [], selectedValues);
callback({ callback({
items: result items: result
}); });
function doCheck(floor, parent_values, selected) { function doCheck(floor, parentValues, selected) {
if (floor >= self.floors) { if (floor >= self.floors) {
return; return;
} }
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
var children = self._getChildren(parent_values); var children = self._getChildren(parentValues);
BI.each(children, function (i, child) { BI.each(children, function (i, child) {
var newParents = BI.clone(parent_values); var newParents = BI.clone(parentValues);
newParents.push(child.value); newParents.push(child.value);
var llen = self._getChildCount(newParents); var llen = self._getChildCount(newParents);
createOneJson(child, llen); createOneJson(child, llen);
@ -129,19 +129,19 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
} }
BI.each(selected, function (k) { BI.each(selected, function (k) {
var node = self._getNode(k); var node = self._getNode(k);
var newParents = BI.clone(parent_values); var newParents = BI.clone(parentValues);
newParents.push(node.value); newParents.push(node.value);
createOneJson(node, getCount(selected[k], newParents)); createOneJson(node, getCount(selected[k], newParents));
doCheck(floor + 1, newParents, selected[k]); doCheck(floor + 1, newParents, selected[k]);
}) })
} }
function getCount(jo, parent_values) { function getCount(jo, parentValues) {
if (jo == null) { if (jo == null) {
return 0; return 0;
} }
if (BI.isEmpty(jo)) { if (BI.isEmpty(jo)) {
return self._getChildCount(parent_values); return self._getChildCount(parentValues);
} }
return BI.size(jo); return BI.size(jo);
@ -160,30 +160,30 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqSelectedTreeNode: function (op, callback) { _reqSelectedTreeNode: function (op, callback) {
var self = this; var self = this;
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
var not_selected_value = op.not_selected_value || {}; var notSelectedValue = op.notSelectedValue || {};
var keyword = op.keyword || ""; var keyword = op.keyword || "";
var parent_values = op.parent_values || []; var parentValues = op.parentValues || [];
if (selected_values == null || BI.isEmpty(selected_values)) { if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({}); callback({});
return; return;
} }
dealWithSelectedValues(selected_values); dealWithSelectedValues(selectedValues);
callback(selected_values); callback(selectedValues);
function dealWithSelectedValues(selected_values) { function dealWithSelectedValues(selectedValues) {
var p = BI.clone(parent_values); var p = BI.clone(parentValues);
p.push(not_selected_value); p.push(notSelectedValue);
if (isChild(selected_values, p)) { if (isChild(selectedValues, p)) {
var result = []; var result = [];
var finded = search(parent_values.length + 1, parent_values, not_selected_value, result); var finded = search(parentValues.length + 1, parentValues, notSelectedValue, result);
if (finded === true) { if (finded === true) {
var next = selected_values; var next = selectedValues;
BI.each(p, function (i, v) { BI.each(p, function (i, v) {
var t = next[v]; var t = next[v];
if (t == null) { if (t == null) {
@ -191,7 +191,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var split = p.slice(0, i); var split = p.slice(0, i);
var expanded = self._getChildren(split); var expanded = self._getChildren(split);
BI.each(expanded, function (m, child) { BI.each(expanded, function (m, child) {
if (i === p.length - 1 && child.value === not_selected_value) { if (i === p.length - 1 && child.value === notSelectedValue) {
return true; return true;
} }
next[child.value] = {}; next[child.value] = {};
@ -208,7 +208,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
if (result.length > 0) { if (result.length > 0) {
BI.each(result, function (i, strs) { BI.each(result, function (i, strs) {
self._buildTree(selected_values, strs); self._buildTree(selectedValues, strs);
}) })
} }
} }
@ -248,8 +248,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return can; return can;
} }
function isChild(selected_values, parents) { function isChild(selectedValues, parents) {
var t = selected_values; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
if (!BI.has(t, v)) { if (!BI.has(t, v)) {
@ -267,16 +267,16 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqAdjustTreeNode: function (op, callback) { _reqAdjustTreeNode: function (op, callback) {
var self = this; var self = this;
var result = []; var result = [];
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
if (selected_values == null || BI.isEmpty(selected_values)) { if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({}); callback({});
return; return;
} }
BI.each(selected_values, function (k, v) { BI.each(selectedValues, function (k, v) {
result.push([k]); result.push([k]);
}); });
dealWithSelectedValues(selected_values, []); dealWithSelectedValues(selectedValues, []);
var jo = {}; var jo = {};
BI.each(result, function (i, strs) { BI.each(result, function (i, strs) {
@ -313,23 +313,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var self = this; var self = this;
var result = []; var result = [];
var keyword = op.keyword || ""; var keyword = op.keyword || "";
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
var last_search_value = op.last_search_value || ""; var lastSearchValue = op.lastSearchValue || "";
var output = search(); var output = search();
BI.nextTick(function () { BI.nextTick(function () {
callback({ callback({
hasNext: output.length > self._const.perPage, hasNext: output.length > self._const.perPage,
items: result, items: result,
last_search_value: BI.last(output) lastSearchValue: BI.last(output)
}) })
}); });
function search() { function search() {
var children = self._getChildren([]); var children = self._getChildren([]);
var start = children.length; var start = children.length;
if (last_search_value !== "") { if (lastSearchValue !== "") {
for (var j = 0, len = start; j < len; j++) { for (var j = 0, len = start; j < len; j++) {
if (children[j].value === last_search_value) { if (children[j].value === lastSearchValue) {
start = j + 1; start = j + 1;
break; break;
} }
@ -354,22 +354,22 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return output; return output;
} }
function nodeSearch(deep, parent_values, current, isAllSelect, result) { function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(current, keyword)) { if (self._isMatch(current, keyword)) {
var checked = isAllSelect || isSelected(parent_values, current); var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parent_values, current, false, checked, !isAllSelect && isHalf(parent_values, current), true, result); createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
return [true, checked]; return [true, checked];
} }
if (deep >= self.floors) { if (deep >= self.floors) {
return [false, false]; return [false, false];
} }
var newParents = BI.clone(parent_values); var newParents = BI.clone(parentValues);
newParents.push(current); newParents.push(current);
var children = self._getChildren(newParents); var children = self._getChildren(newParents);
var can = false, checked = false; var can = false, checked = false;
var isCurAllSelected = isAllSelect || isAllSelected(parent_values, current); var isCurAllSelected = isAllSelect || isAllSelected(parentValues, current);
BI.each(children, function (i, child) { BI.each(children, function (i, child) {
var state = nodeSearch(deep + 1, newParents, child.value, isCurAllSelected, result); var state = nodeSearch(deep + 1, newParents, child.value, isCurAllSelected, result);
if (state[1] === true) { if (state[1] === true) {
@ -380,13 +380,13 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
} }
}); });
if (can === true) { if (can === true) {
checked = isCurAllSelected || (isSelected(parent_values, current) && checked); checked = isCurAllSelected || (isSelected(parentValues, current) && checked);
createOneJson(parent_values, current, true, checked, false, false, result); createOneJson(parentValues, current, true, checked, false, false, result);
} }
return [can, checked]; return [can, checked];
} }
function createOneJson(parent_values, value, isOpen, checked, half, flag, result) { function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self.map[value]; var node = self.map[value];
result.push({ result.push({
id: node.id, id: node.id,
@ -394,7 +394,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
text: node.text, text: node.text,
value: node.value, value: node.value,
title: node.title, title: node.title,
isParent: parent_values.length + 1 < self.floors, isParent: parentValues.length + 1 < self.floors,
open: isOpen, open: isOpen,
checked: checked, checked: checked,
halfCheck: half, halfCheck: half,
@ -402,8 +402,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
} }
function isHalf(parent_values, value) { function isHalf(parentValues, value) {
var find = findSelectedObj(parent_values); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
} }
@ -416,8 +416,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
} }
function isAllSelected(parent_values, value) { function isAllSelected(parentValues, value) {
var find = findSelectedObj(parent_values); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
} }
@ -430,8 +430,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
} }
function isSelected(parent_values, value) { function isSelected(parentValues, value) {
var find = findSelectedObj(parent_values); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return false; return false;
} }
@ -442,12 +442,12 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
} }
function findSelectedObj(parent_values) { function findSelectedObj(parentValues) {
var find = selected_values; var find = selectedValues;
if (find == null) { if (find == null) {
return null; return null;
} }
BI.every(parent_values, function (i, v) { BI.every(parentValues, function (i, v) {
find = find[v]; find = find[v];
if (find == null) { if (find == null) {
return false; return false;
@ -462,23 +462,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var self = this; var self = this;
var result = []; var result = [];
var times = op.times; var times = op.times;
var check_state = op.check_state || {}; var checkState = op.checkState || {};
var parent_values = op.parent_values || []; var parentValues = op.parentValues || [];
var selected_values = op.selected_values; var selectedValues = op.selectedValues;
var valueMap = {}; var valueMap = {};
if (judgeState(parent_values, selected_values, check_state)) { if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parent_values, selected_values); valueMap = dealWidthSelectedValue(parentValues, selectedValues);
} }
var nodes = this._getChildren(parent_values); var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) { for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var state = getCheckState(nodes[i].value, parent_values, valueMap, check_state); var state = getCheckState(nodes[i].value, parentValues, valueMap, checkState);
result.push({ result.push({
id: nodes[i].id, id: nodes[i].id,
pId: nodes[i].pId, pId: nodes[i].pId,
value: nodes[i].value, value: nodes[i].value,
text: nodes[i].text, text: nodes[i].text,
times: 1, times: 1,
isParent: parent_values.length + 1 < this.floors, isParent: parentValues.length + 1 < this.floors,
checked: state[0], checked: state[0],
halfCheck: state[1] halfCheck: state[1]
}) })
@ -490,20 +490,20 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}); });
}); });
function judgeState(parent_values, selected_value, check_state) { function judgeState(parentValues, selected_value, checkState) {
var checked = check_state.checked, half = check_state.half; var checked = checkState.checked, half = checkState.half;
if (parent_values.length > 0 && !checked) { if (parentValues.length > 0 && !checked) {
return false; return false;
} }
return (parent_values.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
} }
function dealWidthSelectedValue(parent_values, selected_values) { function dealWidthSelectedValue(parentValues, selectedValues) {
var valueMap = {}; var valueMap = {};
BI.each(parent_values, function (i, v) { BI.each(parentValues, function (i, v) {
selected_values = selected_values[v]; selectedValues = selectedValues[v];
}); });
BI.each(selected_values, function (value, obj) { BI.each(selectedValues, function (value, obj) {
if (BI.isNull(obj)) { if (BI.isNull(obj)) {
valueMap[value] = [0, 0]; valueMap[value] = [0, 0];
return; return;
@ -523,14 +523,14 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return valueMap; return valueMap;
} }
function getCheckState(current, parent_values, valueMap, check_state) { function getCheckState(current, parentValues, valueMap, checkState) {
var checked = check_state.checked, half = check_state.half; var checked = checkState.checked, half = checkState.half;
var hasChild = parent_values.length + 1 < self.floors; var hasChild = parentValues.length + 1 < self.floors;
var tempCheck = false, halfCheck = false; var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) { if (BI.has(valueMap, current)) {
//可能是半选 //可能是半选
if (valueMap[current][0] === 1) { if (valueMap[current][0] === 1) {
var values = BI.clone(parent_values); var values = BI.clone(parentValues);
values.push(current); values.push(current);
if (hasChild && self._getChildCount(values) != valueMap[current][1]) { if (hasChild && self._getChildCount(values) != valueMap[current][1]) {
halfCheck = true; halfCheck = true;
@ -569,9 +569,9 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return this.tree.search(v, "value"); return this.tree.search(v, "value");
}, },
_getChildren: function (parent_values) { _getChildren: function (parentValues) {
if (parent_values.length > 0) { if (parentValues.length > 0) {
var value = BI.last(parent_values); var value = BI.last(parentValues);
var parent = this.tree.search(value, "value"); var parent = this.tree.search(value, "value");
} else { } else {
var parent = this.tree.getRoot(); var parent = this.tree.getRoot();
@ -579,8 +579,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return parent.getChildren(); return parent.getChildren();
}, },
_getChildCount: function (parent_values) { _getChildCount: function (parentValues) {
return this._getChildren(parent_values).length; return this._getChildren(parentValues).length;
}, },
setValue: function (v) { setValue: function (v) {

4
src/component/valuechooser/combo.valuechooser.js

@ -84,8 +84,8 @@ BI.ValueChooserCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw); var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded); items = search.matched.concat(search.finded);
}); });
if (options.selected_values) {//过滤 if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selected_values, true); var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) { items = BI.filter(items, function (i, ob) {
return !filter[ob.value]; return !filter[ob.value];
}); });

2
src/widget/multiselect/check/multiselect.check.pane.js

@ -32,7 +32,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
items: opts.items, items: opts.items,
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
op = BI.extend(op || {}, { op = BI.extend(op || {}, {
selected_values: self.storeValue.value selectedValues: self.storeValue.value
}); });
if (self.storeValue.type === BI.Selection.Multi) { if (self.storeValue.type === BI.Selection.Multi) {
callback({ callback({

2
src/widget/multiselect/multiselect.loader.js

@ -56,7 +56,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
var startValue = self._startValue; var startValue = self._startValue;
self.storeValue && (op = BI.extend(op || {}, { self.storeValue && (op = BI.extend(op || {}, {
selected_values: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi selectedValues: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi
? self.storeValue.value.concat(startValue) : self.storeValue.value ? self.storeValue.value.concat(startValue) : self.storeValue.value
})); }));
opts.itemsCreator(op, function (ob) { opts.itemsCreator(op, function (ob) {

2
src/widget/multiselect/search/multiselect.search.loader.js

@ -51,7 +51,7 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
}, },
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
self.storeValue && (op = BI.extend(op || {}, { self.storeValue && (op = BI.extend(op || {}, {
selected_values: self.storeValue.value selectedValues: self.storeValue.value
})); }));
opts.itemsCreator(op, function (ob) { opts.itemsCreator(op, function (ob) {
var keyword = ob.keyword = opts.keywordGetter(); var keyword = ob.keyword = opts.keywordGetter();

4
src/widget/multiselect/trigger/searcher.multiselect.js

@ -104,13 +104,13 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
ob.value || (ob.value = []); ob.value || (ob.value = []);
if (ob.type === BI.Selection.All) { if (ob.type === BI.Selection.All) {
if (BI.size(ob.assist) === 1) { if (BI.size(ob.assist) === 1) {
this.editor.setState(o.valueFormatter(ob.assist[0] + "") || ob.assist[0] + ""); this.editor.setState(o.valueFormatter(ob.assist[0] + "") || (ob.assist[0] + ""));
} else { } else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.All); this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.All);
} }
} else { } else {
if (BI.size(ob.value) === 1) { if (BI.size(ob.value) === 1) {
this.editor.setState(o.valueFormatter(ob.value[0] + "" || ob.value[0] + "")); this.editor.setState(o.valueFormatter(ob.value[0] + "") || (ob.value[0] + ""));
} else { } else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.None); this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.None);
} }

4
src/widget/multitree/check/multi.tree.check.pane.js

@ -23,7 +23,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
var self = this, opts = this.options; var self = this, opts = this.options;
this.selected_values = {}; this.selectedValues = {};
var continueSelect = BI.createWidget({ var continueSelect = BI.createWidget({
type: 'bi.text_button', type: 'bi.text_button',
@ -60,7 +60,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
type: "bi.display_tree", type: "bi.display_tree",
cls: "bi-multi-tree-display", cls: "bi-multi-tree-display",
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_SELECTED_DATA; op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback); opts.itemsCreator(op, callback);
} }
}); });

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

@ -20,7 +20,7 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
var self = this, opts = this.options; var self = this, opts = this.options;
this.selected_values = {}; this.selectedValues = {};
this.tree = BI.createWidget({ this.tree = BI.createWidget({
type: "bi.sync_tree", type: "bi.sync_tree",

3
src/widget/sequencetable/listnumber.sequencetable.js

@ -180,7 +180,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
}, },
_populate: function () { _populate: function () {
this.header.populate(); this.headerContainer.empty();
this._createHeader();
this._layout(); this._layout();
this._calculateChildrenToRender(); this._calculateChildrenToRender();
}, },

Loading…
Cancel
Save