Browse Source

chore: 更新dist

es6
iapyang 5 years ago
parent
commit
dced41bdf2
  1. 110
      dist/2.0/fineui.ie.js
  2. 38
      dist/2.0/fineui.ie.min.js
  3. 110
      dist/2.0/fineui.js
  4. 2
      dist/2.0/fineui.min.css
  5. 38
      dist/2.0/fineui.min.js
  6. 1
      dist/base.js
  7. 110
      dist/bundle.ie.js
  8. 38
      dist/bundle.ie.min.js
  9. 110
      dist/bundle.js
  10. 2
      dist/bundle.min.css
  11. 38
      dist/bundle.min.js
  12. 4
      dist/case.js
  13. 110
      dist/fineui.ie.js
  14. 36
      dist/fineui.ie.min.js
  15. 110
      dist/fineui.js
  16. 2
      dist/fineui.min.css
  17. 36
      dist/fineui.min.js
  18. 110
      dist/fineui_without_jquery_polyfill.js
  19. 2
      dist/utils.min.js
  20. 105
      dist/widget.js

110
dist/2.0/fineui.ie.js vendored

@ -38311,7 +38311,6 @@ BI.Single = BI.inherit(BI.Widget, {
}
}, 500);
});
this.element.on("mouseleave.title" + this.getName(), function (e) {
self._e = null;
@ -60022,7 +60021,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_First_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-prev" + pagerIconCls.preCls
cls: "bi-border bi-border-radius all-pager-prev bi-list-item-select2 " + pagerIconCls.preCls
},
next: {
type: "bi.icon_button",
@ -60031,7 +60030,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_Last_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-next" + pagerIconCls.nextCls
cls: "bi-border bi-border-radius all-pager-next bi-list-item-select2 " + pagerIconCls.nextCls
},
hasPrev: o.hasPrev,
@ -69010,7 +69009,8 @@ BI.shortcut("bi.multilayer_select_tree_popup", BI.MultiLayerSelectTreePopup);/**
*/
BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -69018,6 +69018,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -70022,7 +70023,8 @@ BI.shortcut("bi.multilayer_single_tree_popup", BI.MultiLayerSingleTreePopup);/**
*/
BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -70030,6 +70032,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -77336,7 +77339,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-number-interval" + (BI.isIE() && BI.getIEVersion() < 10) ? " hack" : "",
extraCls: "bi-number-interval" + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
height: 24,
validation: "valid",
closeMin: true,
@ -87123,7 +87126,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this, arguments), {
items: null,
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
open: false
});
},
@ -87631,7 +87635,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var checkState = op.checkState || {};
@ -87639,7 +87643,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
var selectedValues = op.selectedValues || {};
var valueMap = {};
// if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parentValues, selectedValues);
valueMap = dealWithSelectedValue(parentValues, selectedValues);
// }
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
@ -87652,7 +87656,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1]
halfCheck: state[1],
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var valueMap = dealWithSelectedValue(node.parentValues, selectedValues);
var state = getCheckState(node.value, node.parentValues, valueMap, checkState);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1],
open: self.options.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -87674,7 +87702,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
}
function dealWidthSelectedValue(parentValues, selectedValues) {
function dealWithSelectedValue(parentValues, selectedValues) {
var valueMap = {};
BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {};
@ -87694,12 +87722,14 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
nextNames[t] = true;
}
});
// valueMap的数组第一个参数为不选: 0, 半选: 1, 全选:2, 第二个参数为改节点下选中的子节点个数(子节点全选或者不存在)
valueMap[value] = [1, BI.size(nextNames)];
});
return valueMap;
}
function getCheckState(current, parentValues, valueMap, checkState) {
// 节点本身的checked和half优先级最高
var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) {
@ -87717,8 +87747,10 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}
var check;
if (!checked && !halfCheck && !tempCheck) {
// 当节点自身是不选的,且通过selectedValues没有得到全选, 则check状态取决于valueMap
check = BI.has(valueMap, current);
} else {
// 不是上面那种情况就先看在节点没有带有明确半选的时候,通过节点自身的checked和valueMap的状态能都得到选中信息
check = ((tempCheck || checked) && !half) || BI.has(valueMap, current);
}
return [check, halfCheck];
@ -87823,6 +87855,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return parent.getChildren();
},
_getAllChildren: function(parentValues) {
var children = this._getChildren(parentValues);
var nodes = [].concat(children);
BI.each(nodes, function (idx, node) {
node.parentValues = parentValues;
});
var queue = BI.map(children, function (idx, node) {
return {
parentValues: parentValues,
value: node.value
};
});
while (BI.isNotEmptyArray(queue)) {
var node = queue.shift();
var pValues = (node.parentValues).concat(node.value);
var childNodes = this._getChildren(pValues);
BI.each(childNodes, function (idx, node) {
node.parentValues = pValues;
});
queue = queue.concat(childNodes);
nodes = nodes.concat(childNodes);
}
return nodes;
},
_getChildCount: function (parentValues) {
return this._getChildren(parentValues).length;
}
@ -88028,12 +88085,12 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues || [];
var valueMap = dealWidthSelectedValue(selectedValues);
var valueMap = dealWithSelectedValue(selectedValues);
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var checked = BI.has(valueMap, nodes[i].value);
@ -88045,7 +88102,30 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: checked,
halfCheck: false
halfCheck: false,
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var checked = BI.has(valueMap, node.value);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: checked,
halfCheck: false,
open: o.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -88059,7 +88139,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
});
});
function dealWidthSelectedValue(selectedValues) {
function dealWithSelectedValue(selectedValues) {
var valueMap = {};
BI.each(selectedValues, function (idx, v) {
valueMap[BI.last(v)] = [2, 0];

38
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

110
dist/2.0/fineui.js vendored

@ -38715,7 +38715,6 @@ BI.Single = BI.inherit(BI.Widget, {
}
}, 500);
});
this.element.on("mouseleave.title" + this.getName(), function (e) {
self._e = null;
@ -60426,7 +60425,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_First_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-prev" + pagerIconCls.preCls
cls: "bi-border bi-border-radius all-pager-prev bi-list-item-select2 " + pagerIconCls.preCls
},
next: {
type: "bi.icon_button",
@ -60435,7 +60434,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_Last_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-next" + pagerIconCls.nextCls
cls: "bi-border bi-border-radius all-pager-next bi-list-item-select2 " + pagerIconCls.nextCls
},
hasPrev: o.hasPrev,
@ -69414,7 +69413,8 @@ BI.shortcut("bi.multilayer_select_tree_popup", BI.MultiLayerSelectTreePopup);/**
*/
BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -69422,6 +69422,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -70426,7 +70427,8 @@ BI.shortcut("bi.multilayer_single_tree_popup", BI.MultiLayerSingleTreePopup);/**
*/
BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -70434,6 +70436,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -77740,7 +77743,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-number-interval" + (BI.isIE() && BI.getIEVersion() < 10) ? " hack" : "",
extraCls: "bi-number-interval" + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
height: 24,
validation: "valid",
closeMin: true,
@ -87527,7 +87530,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this, arguments), {
items: null,
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
open: false
});
},
@ -88035,7 +88039,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var checkState = op.checkState || {};
@ -88043,7 +88047,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
var selectedValues = op.selectedValues || {};
var valueMap = {};
// if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parentValues, selectedValues);
valueMap = dealWithSelectedValue(parentValues, selectedValues);
// }
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
@ -88056,7 +88060,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1]
halfCheck: state[1],
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var valueMap = dealWithSelectedValue(node.parentValues, selectedValues);
var state = getCheckState(node.value, node.parentValues, valueMap, checkState);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1],
open: self.options.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -88078,7 +88106,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
}
function dealWidthSelectedValue(parentValues, selectedValues) {
function dealWithSelectedValue(parentValues, selectedValues) {
var valueMap = {};
BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {};
@ -88098,12 +88126,14 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
nextNames[t] = true;
}
});
// valueMap的数组第一个参数为不选: 0, 半选: 1, 全选:2, 第二个参数为改节点下选中的子节点个数(子节点全选或者不存在)
valueMap[value] = [1, BI.size(nextNames)];
});
return valueMap;
}
function getCheckState(current, parentValues, valueMap, checkState) {
// 节点本身的checked和half优先级最高
var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) {
@ -88121,8 +88151,10 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}
var check;
if (!checked && !halfCheck && !tempCheck) {
// 当节点自身是不选的,且通过selectedValues没有得到全选, 则check状态取决于valueMap
check = BI.has(valueMap, current);
} else {
// 不是上面那种情况就先看在节点没有带有明确半选的时候,通过节点自身的checked和valueMap的状态能都得到选中信息
check = ((tempCheck || checked) && !half) || BI.has(valueMap, current);
}
return [check, halfCheck];
@ -88227,6 +88259,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return parent.getChildren();
},
_getAllChildren: function(parentValues) {
var children = this._getChildren(parentValues);
var nodes = [].concat(children);
BI.each(nodes, function (idx, node) {
node.parentValues = parentValues;
});
var queue = BI.map(children, function (idx, node) {
return {
parentValues: parentValues,
value: node.value
};
});
while (BI.isNotEmptyArray(queue)) {
var node = queue.shift();
var pValues = (node.parentValues).concat(node.value);
var childNodes = this._getChildren(pValues);
BI.each(childNodes, function (idx, node) {
node.parentValues = pValues;
});
queue = queue.concat(childNodes);
nodes = nodes.concat(childNodes);
}
return nodes;
},
_getChildCount: function (parentValues) {
return this._getChildren(parentValues).length;
}
@ -88432,12 +88489,12 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues || [];
var valueMap = dealWidthSelectedValue(selectedValues);
var valueMap = dealWithSelectedValue(selectedValues);
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var checked = BI.has(valueMap, nodes[i].value);
@ -88449,7 +88506,30 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: checked,
halfCheck: false
halfCheck: false,
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var checked = BI.has(valueMap, node.value);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: checked,
halfCheck: false,
open: o.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -88463,7 +88543,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
});
});
function dealWidthSelectedValue(selectedValues) {
function dealWithSelectedValue(selectedValues) {
var valueMap = {};
BI.each(selectedValues, function (idx, v) {
valueMap[BI.last(v)] = [2, 0];

2
dist/2.0/fineui.min.css vendored

File diff suppressed because one or more lines are too long

38
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

1
dist/base.js vendored

@ -444,7 +444,6 @@ BI.Single = BI.inherit(BI.Widget, {
}
}, 500);
});
this.element.on("mouseleave.title" + this.getName(), function (e) {
self._e = null;

110
dist/bundle.ie.js vendored

@ -38311,7 +38311,6 @@ BI.Single = BI.inherit(BI.Widget, {
}
}, 500);
});
this.element.on("mouseleave.title" + this.getName(), function (e) {
self._e = null;
@ -60022,7 +60021,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_First_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-prev" + pagerIconCls.preCls
cls: "bi-border bi-border-radius all-pager-prev bi-list-item-select2 " + pagerIconCls.preCls
},
next: {
type: "bi.icon_button",
@ -60031,7 +60030,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_Last_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-next" + pagerIconCls.nextCls
cls: "bi-border bi-border-radius all-pager-next bi-list-item-select2 " + pagerIconCls.nextCls
},
hasPrev: o.hasPrev,
@ -69010,7 +69009,8 @@ BI.shortcut("bi.multilayer_select_tree_popup", BI.MultiLayerSelectTreePopup);/**
*/
BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -69018,6 +69018,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -70022,7 +70023,8 @@ BI.shortcut("bi.multilayer_single_tree_popup", BI.MultiLayerSingleTreePopup);/**
*/
BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -70030,6 +70032,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -77336,7 +77339,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-number-interval" + (BI.isIE() && BI.getIEVersion() < 10) ? " hack" : "",
extraCls: "bi-number-interval" + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
height: 24,
validation: "valid",
closeMin: true,
@ -87123,7 +87126,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this, arguments), {
items: null,
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
open: false
});
},
@ -87631,7 +87635,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var checkState = op.checkState || {};
@ -87639,7 +87643,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
var selectedValues = op.selectedValues || {};
var valueMap = {};
// if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parentValues, selectedValues);
valueMap = dealWithSelectedValue(parentValues, selectedValues);
// }
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
@ -87652,7 +87656,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1]
halfCheck: state[1],
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var valueMap = dealWithSelectedValue(node.parentValues, selectedValues);
var state = getCheckState(node.value, node.parentValues, valueMap, checkState);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1],
open: self.options.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -87674,7 +87702,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
}
function dealWidthSelectedValue(parentValues, selectedValues) {
function dealWithSelectedValue(parentValues, selectedValues) {
var valueMap = {};
BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {};
@ -87694,12 +87722,14 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
nextNames[t] = true;
}
});
// valueMap的数组第一个参数为不选: 0, 半选: 1, 全选:2, 第二个参数为改节点下选中的子节点个数(子节点全选或者不存在)
valueMap[value] = [1, BI.size(nextNames)];
});
return valueMap;
}
function getCheckState(current, parentValues, valueMap, checkState) {
// 节点本身的checked和half优先级最高
var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) {
@ -87717,8 +87747,10 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}
var check;
if (!checked && !halfCheck && !tempCheck) {
// 当节点自身是不选的,且通过selectedValues没有得到全选, 则check状态取决于valueMap
check = BI.has(valueMap, current);
} else {
// 不是上面那种情况就先看在节点没有带有明确半选的时候,通过节点自身的checked和valueMap的状态能都得到选中信息
check = ((tempCheck || checked) && !half) || BI.has(valueMap, current);
}
return [check, halfCheck];
@ -87823,6 +87855,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return parent.getChildren();
},
_getAllChildren: function(parentValues) {
var children = this._getChildren(parentValues);
var nodes = [].concat(children);
BI.each(nodes, function (idx, node) {
node.parentValues = parentValues;
});
var queue = BI.map(children, function (idx, node) {
return {
parentValues: parentValues,
value: node.value
};
});
while (BI.isNotEmptyArray(queue)) {
var node = queue.shift();
var pValues = (node.parentValues).concat(node.value);
var childNodes = this._getChildren(pValues);
BI.each(childNodes, function (idx, node) {
node.parentValues = pValues;
});
queue = queue.concat(childNodes);
nodes = nodes.concat(childNodes);
}
return nodes;
},
_getChildCount: function (parentValues) {
return this._getChildren(parentValues).length;
}
@ -88028,12 +88085,12 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues || [];
var valueMap = dealWidthSelectedValue(selectedValues);
var valueMap = dealWithSelectedValue(selectedValues);
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var checked = BI.has(valueMap, nodes[i].value);
@ -88045,7 +88102,30 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: checked,
halfCheck: false
halfCheck: false,
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var checked = BI.has(valueMap, node.value);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: checked,
halfCheck: false,
open: o.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -88059,7 +88139,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
});
});
function dealWidthSelectedValue(selectedValues) {
function dealWithSelectedValue(selectedValues) {
var valueMap = {};
BI.each(selectedValues, function (idx, v) {
valueMap[BI.last(v)] = [2, 0];

38
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

110
dist/bundle.js vendored

@ -38715,7 +38715,6 @@ BI.Single = BI.inherit(BI.Widget, {
}
}, 500);
});
this.element.on("mouseleave.title" + this.getName(), function (e) {
self._e = null;
@ -60426,7 +60425,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_First_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-prev" + pagerIconCls.preCls
cls: "bi-border bi-border-radius all-pager-prev bi-list-item-select2 " + pagerIconCls.preCls
},
next: {
type: "bi.icon_button",
@ -60435,7 +60434,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_Last_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-next" + pagerIconCls.nextCls
cls: "bi-border bi-border-radius all-pager-next bi-list-item-select2 " + pagerIconCls.nextCls
},
hasPrev: o.hasPrev,
@ -69414,7 +69413,8 @@ BI.shortcut("bi.multilayer_select_tree_popup", BI.MultiLayerSelectTreePopup);/**
*/
BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -69422,6 +69422,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -70426,7 +70427,8 @@ BI.shortcut("bi.multilayer_single_tree_popup", BI.MultiLayerSingleTreePopup);/**
*/
BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -70434,6 +70436,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -77740,7 +77743,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-number-interval" + (BI.isIE() && BI.getIEVersion() < 10) ? " hack" : "",
extraCls: "bi-number-interval" + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
height: 24,
validation: "valid",
closeMin: true,
@ -87527,7 +87530,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this, arguments), {
items: null,
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
open: false
});
},
@ -88035,7 +88039,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var checkState = op.checkState || {};
@ -88043,7 +88047,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
var selectedValues = op.selectedValues || {};
var valueMap = {};
// if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parentValues, selectedValues);
valueMap = dealWithSelectedValue(parentValues, selectedValues);
// }
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
@ -88056,7 +88060,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1]
halfCheck: state[1],
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var valueMap = dealWithSelectedValue(node.parentValues, selectedValues);
var state = getCheckState(node.value, node.parentValues, valueMap, checkState);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1],
open: self.options.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -88078,7 +88106,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
}
function dealWidthSelectedValue(parentValues, selectedValues) {
function dealWithSelectedValue(parentValues, selectedValues) {
var valueMap = {};
BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {};
@ -88098,12 +88126,14 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
nextNames[t] = true;
}
});
// valueMap的数组第一个参数为不选: 0, 半选: 1, 全选:2, 第二个参数为改节点下选中的子节点个数(子节点全选或者不存在)
valueMap[value] = [1, BI.size(nextNames)];
});
return valueMap;
}
function getCheckState(current, parentValues, valueMap, checkState) {
// 节点本身的checked和half优先级最高
var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) {
@ -88121,8 +88151,10 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}
var check;
if (!checked && !halfCheck && !tempCheck) {
// 当节点自身是不选的,且通过selectedValues没有得到全选, 则check状态取决于valueMap
check = BI.has(valueMap, current);
} else {
// 不是上面那种情况就先看在节点没有带有明确半选的时候,通过节点自身的checked和valueMap的状态能都得到选中信息
check = ((tempCheck || checked) && !half) || BI.has(valueMap, current);
}
return [check, halfCheck];
@ -88227,6 +88259,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return parent.getChildren();
},
_getAllChildren: function(parentValues) {
var children = this._getChildren(parentValues);
var nodes = [].concat(children);
BI.each(nodes, function (idx, node) {
node.parentValues = parentValues;
});
var queue = BI.map(children, function (idx, node) {
return {
parentValues: parentValues,
value: node.value
};
});
while (BI.isNotEmptyArray(queue)) {
var node = queue.shift();
var pValues = (node.parentValues).concat(node.value);
var childNodes = this._getChildren(pValues);
BI.each(childNodes, function (idx, node) {
node.parentValues = pValues;
});
queue = queue.concat(childNodes);
nodes = nodes.concat(childNodes);
}
return nodes;
},
_getChildCount: function (parentValues) {
return this._getChildren(parentValues).length;
}
@ -88432,12 +88489,12 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues || [];
var valueMap = dealWidthSelectedValue(selectedValues);
var valueMap = dealWithSelectedValue(selectedValues);
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var checked = BI.has(valueMap, nodes[i].value);
@ -88449,7 +88506,30 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: checked,
halfCheck: false
halfCheck: false,
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var checked = BI.has(valueMap, node.value);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: checked,
halfCheck: false,
open: o.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -88463,7 +88543,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
});
});
function dealWidthSelectedValue(selectedValues) {
function dealWithSelectedValue(selectedValues) {
var valueMap = {};
BI.each(selectedValues, function (idx, v) {
valueMap[BI.last(v)] = [2, 0];

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

38
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

4
dist/case.js vendored

@ -7999,7 +7999,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_First_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-prev" + pagerIconCls.preCls
cls: "bi-border bi-border-radius all-pager-prev bi-list-item-select2 " + pagerIconCls.preCls
},
next: {
type: "bi.icon_button",
@ -8008,7 +8008,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_Last_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-next" + pagerIconCls.nextCls
cls: "bi-border bi-border-radius all-pager-next bi-list-item-select2 " + pagerIconCls.nextCls
},
hasPrev: o.hasPrev,

110
dist/fineui.ie.js vendored

@ -38556,7 +38556,6 @@ BI.Single = BI.inherit(BI.Widget, {
}
}, 500);
});
this.element.on("mouseleave.title" + this.getName(), function (e) {
self._e = null;
@ -60267,7 +60266,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_First_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-prev" + pagerIconCls.preCls
cls: "bi-border bi-border-radius all-pager-prev bi-list-item-select2 " + pagerIconCls.preCls
},
next: {
type: "bi.icon_button",
@ -60276,7 +60275,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_Last_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-next" + pagerIconCls.nextCls
cls: "bi-border bi-border-radius all-pager-next bi-list-item-select2 " + pagerIconCls.nextCls
},
hasPrev: o.hasPrev,
@ -69255,7 +69254,8 @@ BI.shortcut("bi.multilayer_select_tree_popup", BI.MultiLayerSelectTreePopup);/**
*/
BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -69263,6 +69263,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -70267,7 +70268,8 @@ BI.shortcut("bi.multilayer_single_tree_popup", BI.MultiLayerSingleTreePopup);/**
*/
BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -70275,6 +70277,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -77581,7 +77584,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-number-interval" + (BI.isIE() && BI.getIEVersion() < 10) ? " hack" : "",
extraCls: "bi-number-interval" + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
height: 24,
validation: "valid",
closeMin: true,
@ -87368,7 +87371,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this, arguments), {
items: null,
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
open: false
});
},
@ -87876,7 +87880,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var checkState = op.checkState || {};
@ -87884,7 +87888,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
var selectedValues = op.selectedValues || {};
var valueMap = {};
// if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parentValues, selectedValues);
valueMap = dealWithSelectedValue(parentValues, selectedValues);
// }
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
@ -87897,7 +87901,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1]
halfCheck: state[1],
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var valueMap = dealWithSelectedValue(node.parentValues, selectedValues);
var state = getCheckState(node.value, node.parentValues, valueMap, checkState);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1],
open: self.options.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -87919,7 +87947,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
}
function dealWidthSelectedValue(parentValues, selectedValues) {
function dealWithSelectedValue(parentValues, selectedValues) {
var valueMap = {};
BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {};
@ -87939,12 +87967,14 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
nextNames[t] = true;
}
});
// valueMap的数组第一个参数为不选: 0, 半选: 1, 全选:2, 第二个参数为改节点下选中的子节点个数(子节点全选或者不存在)
valueMap[value] = [1, BI.size(nextNames)];
});
return valueMap;
}
function getCheckState(current, parentValues, valueMap, checkState) {
// 节点本身的checked和half优先级最高
var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) {
@ -87962,8 +87992,10 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}
var check;
if (!checked && !halfCheck && !tempCheck) {
// 当节点自身是不选的,且通过selectedValues没有得到全选, 则check状态取决于valueMap
check = BI.has(valueMap, current);
} else {
// 不是上面那种情况就先看在节点没有带有明确半选的时候,通过节点自身的checked和valueMap的状态能都得到选中信息
check = ((tempCheck || checked) && !half) || BI.has(valueMap, current);
}
return [check, halfCheck];
@ -88068,6 +88100,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return parent.getChildren();
},
_getAllChildren: function(parentValues) {
var children = this._getChildren(parentValues);
var nodes = [].concat(children);
BI.each(nodes, function (idx, node) {
node.parentValues = parentValues;
});
var queue = BI.map(children, function (idx, node) {
return {
parentValues: parentValues,
value: node.value
};
});
while (BI.isNotEmptyArray(queue)) {
var node = queue.shift();
var pValues = (node.parentValues).concat(node.value);
var childNodes = this._getChildren(pValues);
BI.each(childNodes, function (idx, node) {
node.parentValues = pValues;
});
queue = queue.concat(childNodes);
nodes = nodes.concat(childNodes);
}
return nodes;
},
_getChildCount: function (parentValues) {
return this._getChildren(parentValues).length;
}
@ -88273,12 +88330,12 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues || [];
var valueMap = dealWidthSelectedValue(selectedValues);
var valueMap = dealWithSelectedValue(selectedValues);
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var checked = BI.has(valueMap, nodes[i].value);
@ -88290,7 +88347,30 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: checked,
halfCheck: false
halfCheck: false,
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var checked = BI.has(valueMap, node.value);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: checked,
halfCheck: false,
open: o.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -88304,7 +88384,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
});
});
function dealWidthSelectedValue(selectedValues) {
function dealWithSelectedValue(selectedValues) {
var valueMap = {};
BI.each(selectedValues, function (idx, v) {
valueMap[BI.last(v)] = [2, 0];

36
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

110
dist/fineui.js vendored

@ -38960,7 +38960,6 @@ BI.Single = BI.inherit(BI.Widget, {
}
}, 500);
});
this.element.on("mouseleave.title" + this.getName(), function (e) {
self._e = null;
@ -60671,7 +60670,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_First_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-prev" + pagerIconCls.preCls
cls: "bi-border bi-border-radius all-pager-prev bi-list-item-select2 " + pagerIconCls.preCls
},
next: {
type: "bi.icon_button",
@ -60680,7 +60679,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_Last_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-next" + pagerIconCls.nextCls
cls: "bi-border bi-border-radius all-pager-next bi-list-item-select2 " + pagerIconCls.nextCls
},
hasPrev: o.hasPrev,
@ -69659,7 +69658,8 @@ BI.shortcut("bi.multilayer_select_tree_popup", BI.MultiLayerSelectTreePopup);/**
*/
BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -69667,6 +69667,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -70671,7 +70672,8 @@ BI.shortcut("bi.multilayer_single_tree_popup", BI.MultiLayerSingleTreePopup);/**
*/
BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -70679,6 +70681,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -77985,7 +77988,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-number-interval" + (BI.isIE() && BI.getIEVersion() < 10) ? " hack" : "",
extraCls: "bi-number-interval" + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
height: 24,
validation: "valid",
closeMin: true,
@ -87772,7 +87775,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this, arguments), {
items: null,
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
open: false
});
},
@ -88280,7 +88284,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var checkState = op.checkState || {};
@ -88288,7 +88292,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
var selectedValues = op.selectedValues || {};
var valueMap = {};
// if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parentValues, selectedValues);
valueMap = dealWithSelectedValue(parentValues, selectedValues);
// }
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
@ -88301,7 +88305,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1]
halfCheck: state[1],
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var valueMap = dealWithSelectedValue(node.parentValues, selectedValues);
var state = getCheckState(node.value, node.parentValues, valueMap, checkState);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1],
open: self.options.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -88323,7 +88351,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
}
function dealWidthSelectedValue(parentValues, selectedValues) {
function dealWithSelectedValue(parentValues, selectedValues) {
var valueMap = {};
BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {};
@ -88343,12 +88371,14 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
nextNames[t] = true;
}
});
// valueMap的数组第一个参数为不选: 0, 半选: 1, 全选:2, 第二个参数为改节点下选中的子节点个数(子节点全选或者不存在)
valueMap[value] = [1, BI.size(nextNames)];
});
return valueMap;
}
function getCheckState(current, parentValues, valueMap, checkState) {
// 节点本身的checked和half优先级最高
var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) {
@ -88366,8 +88396,10 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}
var check;
if (!checked && !halfCheck && !tempCheck) {
// 当节点自身是不选的,且通过selectedValues没有得到全选, 则check状态取决于valueMap
check = BI.has(valueMap, current);
} else {
// 不是上面那种情况就先看在节点没有带有明确半选的时候,通过节点自身的checked和valueMap的状态能都得到选中信息
check = ((tempCheck || checked) && !half) || BI.has(valueMap, current);
}
return [check, halfCheck];
@ -88472,6 +88504,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return parent.getChildren();
},
_getAllChildren: function(parentValues) {
var children = this._getChildren(parentValues);
var nodes = [].concat(children);
BI.each(nodes, function (idx, node) {
node.parentValues = parentValues;
});
var queue = BI.map(children, function (idx, node) {
return {
parentValues: parentValues,
value: node.value
};
});
while (BI.isNotEmptyArray(queue)) {
var node = queue.shift();
var pValues = (node.parentValues).concat(node.value);
var childNodes = this._getChildren(pValues);
BI.each(childNodes, function (idx, node) {
node.parentValues = pValues;
});
queue = queue.concat(childNodes);
nodes = nodes.concat(childNodes);
}
return nodes;
},
_getChildCount: function (parentValues) {
return this._getChildren(parentValues).length;
}
@ -88677,12 +88734,12 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues || [];
var valueMap = dealWidthSelectedValue(selectedValues);
var valueMap = dealWithSelectedValue(selectedValues);
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var checked = BI.has(valueMap, nodes[i].value);
@ -88694,7 +88751,30 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: checked,
halfCheck: false
halfCheck: false,
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var checked = BI.has(valueMap, node.value);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: checked,
halfCheck: false,
open: o.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -88708,7 +88788,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
});
});
function dealWidthSelectedValue(selectedValues) {
function dealWithSelectedValue(selectedValues) {
var valueMap = {};
BI.each(selectedValues, function (idx, v) {
valueMap[BI.last(v)] = [2, 0];

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

36
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

110
dist/fineui_without_jquery_polyfill.js vendored

@ -27334,7 +27334,6 @@ BI.Single = BI.inherit(BI.Widget, {
}
}, 500);
});
this.element.on("mouseleave.title" + this.getName(), function (e) {
self._e = null;
@ -43249,7 +43248,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_First_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-prev" + pagerIconCls.preCls
cls: "bi-border bi-border-radius all-pager-prev bi-list-item-select2 " + pagerIconCls.preCls
},
next: {
type: "bi.icon_button",
@ -43258,7 +43257,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
warningTitle: BI.i18nText("BI-Current_Is_Last_Page"),
height: 22,
width: 22,
cls: "bi-border all-pager-next" + pagerIconCls.nextCls
cls: "bi-border bi-border-radius all-pager-next bi-list-item-select2 " + pagerIconCls.nextCls
},
hasPrev: o.hasPrev,
@ -51961,7 +51960,8 @@ BI.shortcut("bi.multilayer_select_tree_popup", BI.MultiLayerSelectTreePopup);/**
*/
BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -51969,6 +51969,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -52973,7 +52974,8 @@ BI.shortcut("bi.multilayer_single_tree_popup", BI.MultiLayerSingleTreePopup);/**
*/
BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -52981,6 +52983,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -60287,7 +60290,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-number-interval" + (BI.isIE() && BI.getIEVersion() < 10) ? " hack" : "",
extraCls: "bi-number-interval" + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
height: 24,
validation: "valid",
closeMin: true,
@ -70074,7 +70077,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this, arguments), {
items: null,
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
open: false
});
},
@ -70582,7 +70586,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var checkState = op.checkState || {};
@ -70590,7 +70594,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
var selectedValues = op.selectedValues || {};
var valueMap = {};
// if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parentValues, selectedValues);
valueMap = dealWithSelectedValue(parentValues, selectedValues);
// }
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
@ -70603,7 +70607,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1]
halfCheck: state[1],
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var valueMap = dealWithSelectedValue(node.parentValues, selectedValues);
var state = getCheckState(node.value, node.parentValues, valueMap, checkState);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1],
open: self.options.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -70625,7 +70653,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
}
function dealWidthSelectedValue(parentValues, selectedValues) {
function dealWithSelectedValue(parentValues, selectedValues) {
var valueMap = {};
BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {};
@ -70645,12 +70673,14 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
nextNames[t] = true;
}
});
// valueMap的数组第一个参数为不选: 0, 半选: 1, 全选:2, 第二个参数为改节点下选中的子节点个数(子节点全选或者不存在)
valueMap[value] = [1, BI.size(nextNames)];
});
return valueMap;
}
function getCheckState(current, parentValues, valueMap, checkState) {
// 节点本身的checked和half优先级最高
var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) {
@ -70668,8 +70698,10 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}
var check;
if (!checked && !halfCheck && !tempCheck) {
// 当节点自身是不选的,且通过selectedValues没有得到全选, 则check状态取决于valueMap
check = BI.has(valueMap, current);
} else {
// 不是上面那种情况就先看在节点没有带有明确半选的时候,通过节点自身的checked和valueMap的状态能都得到选中信息
check = ((tempCheck || checked) && !half) || BI.has(valueMap, current);
}
return [check, halfCheck];
@ -70774,6 +70806,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return parent.getChildren();
},
_getAllChildren: function(parentValues) {
var children = this._getChildren(parentValues);
var nodes = [].concat(children);
BI.each(nodes, function (idx, node) {
node.parentValues = parentValues;
});
var queue = BI.map(children, function (idx, node) {
return {
parentValues: parentValues,
value: node.value
};
});
while (BI.isNotEmptyArray(queue)) {
var node = queue.shift();
var pValues = (node.parentValues).concat(node.value);
var childNodes = this._getChildren(pValues);
BI.each(childNodes, function (idx, node) {
node.parentValues = pValues;
});
queue = queue.concat(childNodes);
nodes = nodes.concat(childNodes);
}
return nodes;
},
_getChildCount: function (parentValues) {
return this._getChildren(parentValues).length;
}
@ -70979,12 +71036,12 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues || [];
var valueMap = dealWidthSelectedValue(selectedValues);
var valueMap = dealWithSelectedValue(selectedValues);
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var checked = BI.has(valueMap, nodes[i].value);
@ -70996,7 +71053,30 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: checked,
halfCheck: false
halfCheck: false,
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var checked = BI.has(valueMap, node.value);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: checked,
halfCheck: false,
open: o.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -71010,7 +71090,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
});
});
function dealWidthSelectedValue(selectedValues) {
function dealWithSelectedValue(selectedValues) {
var valueMap = {};
BI.each(selectedValues, function (idx, v) {
valueMap[BI.last(v)] = [2, 0];

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

105
dist/widget.js vendored

@ -7074,7 +7074,8 @@ BI.shortcut("bi.multilayer_select_tree_popup", BI.MultiLayerSelectTreePopup);/**
*/
BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -7082,6 +7083,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -8086,7 +8088,8 @@ BI.shortcut("bi.multilayer_single_tree_popup", BI.MultiLayerSingleTreePopup);/**
*/
BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
props: {
props: function() {
return {
extraCls: "bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow",
height: 24,
valueFormatter: function (v) {
@ -8094,6 +8097,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
};
},
render: function () {
@ -15400,7 +15404,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-number-interval" + (BI.isIE() && BI.getIEVersion() < 10) ? " hack" : "",
extraCls: "bi-number-interval" + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
height: 24,
validation: "valid",
closeMin: true,
@ -25187,7 +25191,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this, arguments), {
items: null,
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
open: false
});
},
@ -25695,7 +25700,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var checkState = op.checkState || {};
@ -25703,7 +25708,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
var selectedValues = op.selectedValues || {};
var valueMap = {};
// if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parentValues, selectedValues);
valueMap = dealWithSelectedValue(parentValues, selectedValues);
// }
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
@ -25716,7 +25721,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1]
halfCheck: state[1],
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var valueMap = dealWithSelectedValue(node.parentValues, selectedValues);
var state = getCheckState(node.value, node.parentValues, valueMap, checkState);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1],
open: self.options.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -25738,7 +25767,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
}
function dealWidthSelectedValue(parentValues, selectedValues) {
function dealWithSelectedValue(parentValues, selectedValues) {
var valueMap = {};
BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {};
@ -25758,12 +25787,14 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
nextNames[t] = true;
}
});
// valueMap的数组第一个参数为不选: 0, 半选: 1, 全选:2, 第二个参数为改节点下选中的子节点个数(子节点全选或者不存在)
valueMap[value] = [1, BI.size(nextNames)];
});
return valueMap;
}
function getCheckState(current, parentValues, valueMap, checkState) {
// 节点本身的checked和half优先级最高
var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) {
@ -25781,8 +25812,10 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}
var check;
if (!checked && !halfCheck && !tempCheck) {
// 当节点自身是不选的,且通过selectedValues没有得到全选, 则check状态取决于valueMap
check = BI.has(valueMap, current);
} else {
// 不是上面那种情况就先看在节点没有带有明确半选的时候,通过节点自身的checked和valueMap的状态能都得到选中信息
check = ((tempCheck || checked) && !half) || BI.has(valueMap, current);
}
return [check, halfCheck];
@ -25887,6 +25920,31 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return parent.getChildren();
},
_getAllChildren: function(parentValues) {
var children = this._getChildren(parentValues);
var nodes = [].concat(children);
BI.each(nodes, function (idx, node) {
node.parentValues = parentValues;
});
var queue = BI.map(children, function (idx, node) {
return {
parentValues: parentValues,
value: node.value
};
});
while (BI.isNotEmptyArray(queue)) {
var node = queue.shift();
var pValues = (node.parentValues).concat(node.value);
var childNodes = this._getChildren(pValues);
BI.each(childNodes, function (idx, node) {
node.parentValues = pValues;
});
queue = queue.concat(childNodes);
nodes = nodes.concat(childNodes);
}
return nodes;
},
_getChildCount: function (parentValues) {
return this._getChildren(parentValues).length;
}
@ -26092,12 +26150,12 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
},
_reqTreeNode: function (op, callback) {
var self = this;
var self = this, o = this.options;
var result = [];
var times = op.times;
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues || [];
var valueMap = dealWidthSelectedValue(selectedValues);
var valueMap = dealWithSelectedValue(selectedValues);
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var checked = BI.has(valueMap, nodes[i].value);
@ -26109,7 +26167,30 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: checked,
halfCheck: false
halfCheck: false,
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var checked = BI.has(valueMap, node.value);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: checked,
halfCheck: false,
open: o.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
@ -26123,7 +26204,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
});
});
function dealWidthSelectedValue(selectedValues) {
function dealWithSelectedValue(selectedValues) {
var valueMap = {};
BI.each(selectedValues, function (idx, v) {
valueMap[BI.last(v)] = [2, 0];

Loading…
Cancel
Save