guy 8 years ago
parent
commit
3b9045f0fc
  1. 10
      bi/base.js
  2. 31
      bi/widget.js
  3. 10
      docs/base.js
  4. 31
      docs/widget.js
  5. 2
      src/base/table/table.collection.js
  6. 8
      src/base/table/table.grid.js
  7. 6
      src/component/allvaluechooser/combo.allvaluechooser.js
  8. 21
      src/component/treevaluechooser/combo.treevaluechooser.js
  9. 4
      src/component/valuechooser/combo.valuechooser.js

10
bi/base.js

@ -28731,7 +28731,7 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
mounted: function () {
var o = this.options;
if (o.items.length > 0 || o.header.length < 0) {
if (o.items.length > 0 || o.header.length > 0) {
this._digest();
this._populate();
}
@ -29513,7 +29513,7 @@ BI.GridTable = BI.inherit(BI.Widget, {
mounted: function () {
var o = this.options;
if (o.items.length > 0) {
if (o.items.length > 0 || o.header.length > 0) {
this._populate();
}
},
@ -29524,7 +29524,8 @@ BI.GridTable = BI.inherit(BI.Widget, {
_populateScrollbar: function () {
var o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
@ -29609,7 +29610,8 @@ BI.GridTable = BI.inherit(BI.Widget, {
_populateTable: function () {
var self = this, o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {

31
bi/widget.js

@ -17009,7 +17009,7 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
});
BI.YearQuarterCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut('bi.year_quarter_combo', BI.YearQuarterCombo);/**
* 简单的复选下拉框控件, 适用于数据量少的情况
* 简单的复选下拉框控件, 适用于数据量少的情况 与valuechooser的区别是allvaluechooser setValue和getValue返回的是所有值
* 封装了字段处理逻辑
*
* Created by GUY on 2015/10/29.
@ -17088,13 +17088,13 @@ BI.AllValueChooserCombo = BI.inherit(BI.Widget, {
return !filter[ob.value];
});
}
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
if (options.type === BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: items
});
return;
}
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
if (options.type === BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}
@ -17233,24 +17233,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return;
}
doCheck(0, [], selectedValues);
doCheck(0, [], this.tree.getRoot(), selectedValues);
callback({
items: result
});
function doCheck(floor, parentValues, selected) {
function doCheck(floor, parentValues, node, selected) {
if (floor >= self.floors) {
return;
}
if (selected == null || BI.isEmpty(selected)) {
var children = self._getChildren(parentValues);
BI.each(children, function (i, child) {
BI.each(node.getChildren(), function (i, child) {
var newParents = BI.clone(parentValues);
newParents.push(child.value);
var llen = self._getChildCount(newParents);
createOneJson(child, llen);
doCheck(floor + 1, newParents, {});
createOneJson(child, node.id, llen);
doCheck(floor + 1, newParents, child, {});
});
return;
}
@ -17258,8 +17257,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var node = self._getNode(k);
var newParents = BI.clone(parentValues);
newParents.push(node.value);
createOneJson(node, getCount(selected[k], newParents));
doCheck(floor + 1, newParents, selected[k]);
createOneJson(node, BI.last(parentValues), getCount(selected[k], newParents));
doCheck(floor + 1, newParents, node, selected[k]);
})
}
@ -17274,10 +17273,10 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return BI.size(jo);
}
function createOneJson(node, llen) {
function createOneJson(node, pId, llen) {
result.push({
id: node.id,
pId: node.pId,
pId: pId,
text: node.text + (llen > 0 ? ("(" + BI.i18nText("BI-Basic_Altogether") + llen + BI.i18nText("BI-Basic_Count") + ")") : ""),
value: node.value,
open: true
@ -17659,7 +17658,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
if (valueMap[current][0] === 1) {
var values = BI.clone(parentValues);
values.push(current);
if (hasChild && self._getChildCount(values) != valueMap[current][1]) {
if (hasChild && self._getChildCount(values) !== valueMap[current][1]) {
halfCheck = true;
}
} else if (valueMap[current][0] === 2) {
@ -17815,13 +17814,13 @@ BI.ValueChooserCombo = BI.inherit(BI.Widget, {
return !filter[ob.value];
});
}
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
if (options.type === BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: items
});
return;
}
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
if (options.type === BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}

10
docs/base.js

@ -28731,7 +28731,7 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
mounted: function () {
var o = this.options;
if (o.items.length > 0 || o.header.length < 0) {
if (o.items.length > 0 || o.header.length > 0) {
this._digest();
this._populate();
}
@ -29513,7 +29513,7 @@ BI.GridTable = BI.inherit(BI.Widget, {
mounted: function () {
var o = this.options;
if (o.items.length > 0) {
if (o.items.length > 0 || o.header.length > 0) {
this._populate();
}
},
@ -29524,7 +29524,8 @@ BI.GridTable = BI.inherit(BI.Widget, {
_populateScrollbar: function () {
var o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
@ -29609,7 +29610,8 @@ BI.GridTable = BI.inherit(BI.Widget, {
_populateTable: function () {
var self = this, o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {

31
docs/widget.js

@ -17009,7 +17009,7 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
});
BI.YearQuarterCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut('bi.year_quarter_combo', BI.YearQuarterCombo);/**
* 简单的复选下拉框控件, 适用于数据量少的情况
* 简单的复选下拉框控件, 适用于数据量少的情况 与valuechooser的区别是allvaluechooser setValue和getValue返回的是所有值
* 封装了字段处理逻辑
*
* Created by GUY on 2015/10/29.
@ -17088,13 +17088,13 @@ BI.AllValueChooserCombo = BI.inherit(BI.Widget, {
return !filter[ob.value];
});
}
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
if (options.type === BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: items
});
return;
}
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
if (options.type === BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}
@ -17233,24 +17233,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return;
}
doCheck(0, [], selectedValues);
doCheck(0, [], this.tree.getRoot(), selectedValues);
callback({
items: result
});
function doCheck(floor, parentValues, selected) {
function doCheck(floor, parentValues, node, selected) {
if (floor >= self.floors) {
return;
}
if (selected == null || BI.isEmpty(selected)) {
var children = self._getChildren(parentValues);
BI.each(children, function (i, child) {
BI.each(node.getChildren(), function (i, child) {
var newParents = BI.clone(parentValues);
newParents.push(child.value);
var llen = self._getChildCount(newParents);
createOneJson(child, llen);
doCheck(floor + 1, newParents, {});
createOneJson(child, node.id, llen);
doCheck(floor + 1, newParents, child, {});
});
return;
}
@ -17258,8 +17257,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var node = self._getNode(k);
var newParents = BI.clone(parentValues);
newParents.push(node.value);
createOneJson(node, getCount(selected[k], newParents));
doCheck(floor + 1, newParents, selected[k]);
createOneJson(node, BI.last(parentValues), getCount(selected[k], newParents));
doCheck(floor + 1, newParents, node, selected[k]);
})
}
@ -17274,10 +17273,10 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return BI.size(jo);
}
function createOneJson(node, llen) {
function createOneJson(node, pId, llen) {
result.push({
id: node.id,
pId: node.pId,
pId: pId,
text: node.text + (llen > 0 ? ("(" + BI.i18nText("BI-Basic_Altogether") + llen + BI.i18nText("BI-Basic_Count") + ")") : ""),
value: node.value,
open: true
@ -17659,7 +17658,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
if (valueMap[current][0] === 1) {
var values = BI.clone(parentValues);
values.push(current);
if (hasChild && self._getChildCount(values) != valueMap[current][1]) {
if (hasChild && self._getChildCount(values) !== valueMap[current][1]) {
halfCheck = true;
}
} else if (valueMap[current][0] === 2) {
@ -17815,13 +17814,13 @@ BI.ValueChooserCombo = BI.inherit(BI.Widget, {
return !filter[ob.value];
});
}
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
if (options.type === BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: items
});
return;
}
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
if (options.type === BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}

2
src/base/table/table.collection.js

@ -163,7 +163,7 @@ BI.CollectionTable = BI.inherit(BI.Widget, {
mounted: function () {
var o = this.options;
if (o.items.length > 0 || o.header.length < 0) {
if (o.items.length > 0 || o.header.length > 0) {
this._digest();
this._populate();
}

8
src/base/table/table.grid.js

@ -167,7 +167,7 @@ BI.GridTable = BI.inherit(BI.Widget, {
mounted: function () {
var o = this.options;
if (o.items.length > 0) {
if (o.items.length > 0 || o.header.length > 0) {
this._populate();
}
},
@ -178,7 +178,8 @@ BI.GridTable = BI.inherit(BI.Widget, {
_populateScrollbar: function () {
var o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
@ -263,7 +264,8 @@ BI.GridTable = BI.inherit(BI.Widget, {
_populateTable: function () {
var self = this, o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {

6
src/component/allvaluechooser/combo.allvaluechooser.js

@ -1,5 +1,5 @@
/**
* 简单的复选下拉框控件, 适用于数据量少的情况
* 简单的复选下拉框控件, 适用于数据量少的情况 与valuechooser的区别是allvaluechooser setValue和getValue返回的是所有值
* 封装了字段处理逻辑
*
* Created by GUY on 2015/10/29.
@ -78,13 +78,13 @@ BI.AllValueChooserCombo = BI.inherit(BI.Widget, {
return !filter[ob.value];
});
}
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
if (options.type === BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: items
});
return;
}
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
if (options.type === BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}

21
src/component/treevaluechooser/combo.treevaluechooser.js

@ -106,24 +106,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return;
}
doCheck(0, [], selectedValues);
doCheck(0, [], this.tree.getRoot(), selectedValues);
callback({
items: result
});
function doCheck(floor, parentValues, selected) {
function doCheck(floor, parentValues, node, selected) {
if (floor >= self.floors) {
return;
}
if (selected == null || BI.isEmpty(selected)) {
var children = self._getChildren(parentValues);
BI.each(children, function (i, child) {
BI.each(node.getChildren(), function (i, child) {
var newParents = BI.clone(parentValues);
newParents.push(child.value);
var llen = self._getChildCount(newParents);
createOneJson(child, llen);
doCheck(floor + 1, newParents, {});
createOneJson(child, node.id, llen);
doCheck(floor + 1, newParents, child, {});
});
return;
}
@ -131,8 +130,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var node = self._getNode(k);
var newParents = BI.clone(parentValues);
newParents.push(node.value);
createOneJson(node, getCount(selected[k], newParents));
doCheck(floor + 1, newParents, selected[k]);
createOneJson(node, BI.last(parentValues), getCount(selected[k], newParents));
doCheck(floor + 1, newParents, node, selected[k]);
})
}
@ -147,10 +146,10 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return BI.size(jo);
}
function createOneJson(node, llen) {
function createOneJson(node, pId, llen) {
result.push({
id: node.id,
pId: node.pId,
pId: pId,
text: node.text + (llen > 0 ? ("(" + BI.i18nText("BI-Basic_Altogether") + llen + BI.i18nText("BI-Basic_Count") + ")") : ""),
value: node.value,
open: true
@ -532,7 +531,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
if (valueMap[current][0] === 1) {
var values = BI.clone(parentValues);
values.push(current);
if (hasChild && self._getChildCount(values) != valueMap[current][1]) {
if (hasChild && self._getChildCount(values) !== valueMap[current][1]) {
halfCheck = true;
}
} else if (valueMap[current][0] === 2) {

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

@ -90,13 +90,13 @@ BI.ValueChooserCombo = BI.inherit(BI.Widget, {
return !filter[ob.value];
});
}
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
if (options.type === BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: items
});
return;
}
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
if (options.type === BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}

Loading…
Cancel
Save