Browse Source

BI-26355

表格中存在可预测的风险:
_getItems中使用了this.options.header
如果未更新this.options.header,可能存在item和header不匹配的的情况,因此此时计算的时候使用的是上一个状态的header
es6
MrErHu 6 years ago
parent
commit
c777bc326a
  1. 56
      dist/_fineui.min.js
  2. 15
      dist/base.js
  3. 19
      dist/bundle.js
  4. 24
      dist/bundle.min.js
  5. 19
      dist/fineui.js
  6. 56
      dist/fineui.min.js
  7. 14
      src/base/table/table.grid.js

56
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

15
dist/base.js vendored

@ -31454,13 +31454,19 @@ BI.GridTable = BI.inherit(BI.Widget, {
}, },
populate: function (items, header) { populate: function (items, header) {
if (items && this.options.items !== items) { var headerChanged = this.options.header !== header;
var itemsChanged = this.options.items !== items;
if(header && headerChanged) {
this.options.header = header;
}
if(items && itemsChanged) {
this.options.items = items; this.options.items = items;
}
if (items && itemsChanged) {
this.items = this._getItems(); this.items = this._getItems();
this._restore(); this._restore();
} }
if (header && this.options.header !== header) { if (header && headerChanged) {
this.options.header = header;
this.header = this._getHeader(); this.header = this._getHeader();
this._restore(); this._restore();
} }
@ -31478,7 +31484,8 @@ BI.GridTable = BI.inherit(BI.Widget, {
this._restore(); this._restore();
} }
}); });
BI.shortcut("bi.grid_table", BI.GridTable);/** BI.shortcut("bi.grid_table", BI.GridTable);
/**
* QuickGridTable * QuickGridTable
* *
* Created by GUY on 2016/1/12. * Created by GUY on 2016/1/12.

19
dist/bundle.js vendored

@ -67225,13 +67225,19 @@ BI.GridTable = BI.inherit(BI.Widget, {
}, },
populate: function (items, header) { populate: function (items, header) {
if (items && this.options.items !== items) { var headerChanged = this.options.header !== header;
var itemsChanged = this.options.items !== items;
if(header && headerChanged) {
this.options.header = header;
}
if(items && itemsChanged) {
this.options.items = items; this.options.items = items;
}
if (items && itemsChanged) {
this.items = this._getItems(); this.items = this._getItems();
this._restore(); this._restore();
} }
if (header && this.options.header !== header) { if (header && headerChanged) {
this.options.header = header;
this.header = this._getHeader(); this.header = this._getHeader();
this._restore(); this._restore();
} }
@ -67249,7 +67255,8 @@ BI.GridTable = BI.inherit(BI.Widget, {
this._restore(); this._restore();
} }
}); });
BI.shortcut("bi.grid_table", BI.GridTable);/** BI.shortcut("bi.grid_table", BI.GridTable);
/**
* QuickGridTable * QuickGridTable
* *
* Created by GUY on 2016/1/12. * Created by GUY on 2016/1/12.
@ -113394,12 +113401,12 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
"keys", "allKeys", "values", "pairs", "invert", "keys", "allKeys", "values", "pairs", "invert",
"mapObject", "findKey", "pick", "omit", "tap"], function (name) { "mapObject", "findKey", "pick", "omit", "tap"], function (name) {
var old = BI[name]; var old = BI[name];
BI[name] = function (obj, fn) { BI[name] = function (obj, fn, context) {
return typeof fn === "function" ? old(obj, function (key, value) { return typeof fn === "function" ? old(obj, function (key, value) {
if (!(key in Fix.$$skipArray)) { if (!(key in Fix.$$skipArray)) {
return fn.apply(this, arguments); return fn.apply(this, arguments);
} }
}) : old.apply(this, arguments); }, context) : old.apply(this, arguments);
}; };
}); });
BI.isEmpty = function (ob) { BI.isEmpty = function (ob) {

24
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

19
dist/fineui.js vendored

@ -67474,13 +67474,19 @@ BI.GridTable = BI.inherit(BI.Widget, {
}, },
populate: function (items, header) { populate: function (items, header) {
if (items && this.options.items !== items) { var headerChanged = this.options.header !== header;
var itemsChanged = this.options.items !== items;
if(header && headerChanged) {
this.options.header = header;
}
if(items && itemsChanged) {
this.options.items = items; this.options.items = items;
}
if (items && itemsChanged) {
this.items = this._getItems(); this.items = this._getItems();
this._restore(); this._restore();
} }
if (header && this.options.header !== header) { if (header && headerChanged) {
this.options.header = header;
this.header = this._getHeader(); this.header = this._getHeader();
this._restore(); this._restore();
} }
@ -67498,7 +67504,8 @@ BI.GridTable = BI.inherit(BI.Widget, {
this._restore(); this._restore();
} }
}); });
BI.shortcut("bi.grid_table", BI.GridTable);/** BI.shortcut("bi.grid_table", BI.GridTable);
/**
* QuickGridTable * QuickGridTable
* *
* Created by GUY on 2016/1/12. * Created by GUY on 2016/1/12.
@ -113643,12 +113650,12 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
"keys", "allKeys", "values", "pairs", "invert", "keys", "allKeys", "values", "pairs", "invert",
"mapObject", "findKey", "pick", "omit", "tap"], function (name) { "mapObject", "findKey", "pick", "omit", "tap"], function (name) {
var old = BI[name]; var old = BI[name];
BI[name] = function (obj, fn) { BI[name] = function (obj, fn, context) {
return typeof fn === "function" ? old(obj, function (key, value) { return typeof fn === "function" ? old(obj, function (key, value) {
if (!(key in Fix.$$skipArray)) { if (!(key in Fix.$$skipArray)) {
return fn.apply(this, arguments); return fn.apply(this, arguments);
} }
}) : old.apply(this, arguments); }, context) : old.apply(this, arguments);
}; };
}); });
BI.isEmpty = function (ob) { BI.isEmpty = function (ob) {

56
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

14
src/base/table/table.grid.js

@ -455,13 +455,19 @@ BI.GridTable = BI.inherit(BI.Widget, {
}, },
populate: function (items, header) { populate: function (items, header) {
if (items && this.options.items !== items) { var headerChanged = this.options.header !== header;
var itemsChanged = this.options.items !== items;
if(header && headerChanged) {
this.options.header = header;
}
if(items && itemsChanged) {
this.options.items = items; this.options.items = items;
}
if (items && itemsChanged) {
this.items = this._getItems(); this.items = this._getItems();
this._restore(); this._restore();
} }
if (header && this.options.header !== header) { if (header && headerChanged) {
this.options.header = header;
this.header = this._getHeader(); this.header = this._getHeader();
this._restore(); this._restore();
} }
@ -479,4 +485,4 @@ BI.GridTable = BI.inherit(BI.Widget, {
this._restore(); this._restore();
} }
}); });
BI.shortcut("bi.grid_table", BI.GridTable); BI.shortcut("bi.grid_table", BI.GridTable);

Loading…
Cancel
Save