Browse Source

Merge pull request #189 in FUI/fineui from ~GUY/fineui:master to master

* commit '34233b23595b59355bd421389731381f33aa9583':
  update
  update
  update
es6
guy 7 years ago
parent
commit
ae6fd581c6
  1. 26
      bi/base.js
  2. 26
      dist/base.js
  3. 26
      dist/bundle.js
  4. 52
      dist/bundle.min.js
  5. 26
      dist/fix/fix.js
  6. 19
      src/base/grid/grid.js
  7. 2
      src/base/layer/layer.floatbox.js
  8. 5
      src/base/table/table.grid.js

26
bi/base.js

@ -14978,12 +14978,15 @@ BI.GridView = BI.inherit(BI.Widget, {
if (items && items !== this.options.items) { if (items && items !== this.options.items) {
this.options.items = items; this.options.items = items;
} }
if (o.items.length > 0) { if (BI.isNumber(o.columnCount)) {
this.columnCount = o.columnCount;
} else if (o.items.length > 0) {
this.columnCount = o.items[0].length; this.columnCount = o.items[0].length;
this.rowCount = o.items.length; }
if (BI.isNumber(o.rowCount)) {
this.rowCount = o.rowCount;
} else { } else {
this.rowCount = 0; this.rowCount = o.items.length;
this.columnCount = 0;
} }
this.container.setWidth(this.columnCount * o.estimatedColumnSize); this.container.setWidth(this.columnCount * o.estimatedColumnSize);
this.container.setHeight(this.rowCount * o.estimatedRowSize); this.container.setHeight(this.rowCount * o.estimatedRowSize);
@ -15022,6 +15025,14 @@ BI.GridView = BI.inherit(BI.Widget, {
this.element.scrollTop(this.options.scrollTop); this.element.scrollTop(this.options.scrollTop);
}, },
setColumnCount: function (columnCount) {
this.options.columnCount = columnCount
},
setRowCount: function (rowCount) {
this.options.rowCount = rowCount
},
setOverflowX: function (b) { setOverflowX: function (b) {
var self = this; var self = this;
if (this.options.overflowX !== !!b) { if (this.options.overflowX !== !!b) {
@ -15132,6 +15143,8 @@ BI.FloatBox = BI.inherit(BI.Widget, {
if (ui.position.top < 0) { if (ui.position.top < 0) {
ui.position.top = 0; ui.position.top = 0;
} }
//BI-12134 没有什么特别好的方法
BI.Resizers._resize();
} }
}); });
this._south = BI.createWidget(); this._south = BI.createWidget();
@ -31304,6 +31317,11 @@ BI.GridTable = BI.inherit(BI.Widget, {
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0); this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
this.topLeftGrid.setColumnCount(freezeColLength);
this.topRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
this.bottomLeftGrid.setColumnCount(freezeColLength);
this.bottomRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
var items = this.contextLayout.attr("items"); var items = this.contextLayout.attr("items");
items[1].left = regionSize; items[1].left = regionSize;
items[2].top = this._getFreezeHeaderHeight(); items[2].top = this._getFreezeHeaderHeight();

26
dist/base.js vendored

@ -14978,12 +14978,15 @@ BI.GridView = BI.inherit(BI.Widget, {
if (items && items !== this.options.items) { if (items && items !== this.options.items) {
this.options.items = items; this.options.items = items;
} }
if (o.items.length > 0) { if (BI.isNumber(o.columnCount)) {
this.columnCount = o.columnCount;
} else if (o.items.length > 0) {
this.columnCount = o.items[0].length; this.columnCount = o.items[0].length;
this.rowCount = o.items.length; }
if (BI.isNumber(o.rowCount)) {
this.rowCount = o.rowCount;
} else { } else {
this.rowCount = 0; this.rowCount = o.items.length;
this.columnCount = 0;
} }
this.container.setWidth(this.columnCount * o.estimatedColumnSize); this.container.setWidth(this.columnCount * o.estimatedColumnSize);
this.container.setHeight(this.rowCount * o.estimatedRowSize); this.container.setHeight(this.rowCount * o.estimatedRowSize);
@ -15022,6 +15025,14 @@ BI.GridView = BI.inherit(BI.Widget, {
this.element.scrollTop(this.options.scrollTop); this.element.scrollTop(this.options.scrollTop);
}, },
setColumnCount: function (columnCount) {
this.options.columnCount = columnCount
},
setRowCount: function (rowCount) {
this.options.rowCount = rowCount
},
setOverflowX: function (b) { setOverflowX: function (b) {
var self = this; var self = this;
if (this.options.overflowX !== !!b) { if (this.options.overflowX !== !!b) {
@ -15132,6 +15143,8 @@ BI.FloatBox = BI.inherit(BI.Widget, {
if (ui.position.top < 0) { if (ui.position.top < 0) {
ui.position.top = 0; ui.position.top = 0;
} }
//BI-12134 没有什么特别好的方法
BI.Resizers._resize();
} }
}); });
this._south = BI.createWidget(); this._south = BI.createWidget();
@ -31304,6 +31317,11 @@ BI.GridTable = BI.inherit(BI.Widget, {
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0); this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
this.topLeftGrid.setColumnCount(freezeColLength);
this.topRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
this.bottomLeftGrid.setColumnCount(freezeColLength);
this.bottomRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
var items = this.contextLayout.attr("items"); var items = this.contextLayout.attr("items");
items[1].left = regionSize; items[1].left = regionSize;
items[2].top = this._getFreezeHeaderHeight(); items[2].top = this._getFreezeHeaderHeight();

26
dist/bundle.js vendored

@ -40825,12 +40825,15 @@ BI.GridView = BI.inherit(BI.Widget, {
if (items && items !== this.options.items) { if (items && items !== this.options.items) {
this.options.items = items; this.options.items = items;
} }
if (o.items.length > 0) { if (BI.isNumber(o.columnCount)) {
this.columnCount = o.columnCount;
} else if (o.items.length > 0) {
this.columnCount = o.items[0].length; this.columnCount = o.items[0].length;
this.rowCount = o.items.length; }
if (BI.isNumber(o.rowCount)) {
this.rowCount = o.rowCount;
} else { } else {
this.rowCount = 0; this.rowCount = o.items.length;
this.columnCount = 0;
} }
this.container.setWidth(this.columnCount * o.estimatedColumnSize); this.container.setWidth(this.columnCount * o.estimatedColumnSize);
this.container.setHeight(this.rowCount * o.estimatedRowSize); this.container.setHeight(this.rowCount * o.estimatedRowSize);
@ -40869,6 +40872,14 @@ BI.GridView = BI.inherit(BI.Widget, {
this.element.scrollTop(this.options.scrollTop); this.element.scrollTop(this.options.scrollTop);
}, },
setColumnCount: function (columnCount) {
this.options.columnCount = columnCount
},
setRowCount: function (rowCount) {
this.options.rowCount = rowCount
},
setOverflowX: function (b) { setOverflowX: function (b) {
var self = this; var self = this;
if (this.options.overflowX !== !!b) { if (this.options.overflowX !== !!b) {
@ -40979,6 +40990,8 @@ BI.FloatBox = BI.inherit(BI.Widget, {
if (ui.position.top < 0) { if (ui.position.top < 0) {
ui.position.top = 0; ui.position.top = 0;
} }
//BI-12134 没有什么特别好的方法
BI.Resizers._resize();
} }
}); });
this._south = BI.createWidget(); this._south = BI.createWidget();
@ -57151,6 +57164,11 @@ BI.GridTable = BI.inherit(BI.Widget, {
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0); this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
this.topLeftGrid.setColumnCount(freezeColLength);
this.topRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
this.bottomLeftGrid.setColumnCount(freezeColLength);
this.bottomRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
var items = this.contextLayout.attr("items"); var items = this.contextLayout.attr("items");
items[1].left = regionSize; items[1].left = regionSize;
items[2].top = this._getFreezeHeaderHeight(); items[2].top = this._getFreezeHeaderHeight();

52
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

26
dist/fix/fix.js vendored

@ -944,6 +944,24 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}; };
} }
function initWatch(vm, watch) {
vm._watchers || (vm._watchers = []);
for (var key in watch) {
var handler = watch[key];
if (_.isArray(handler)) {
for (var i = 0; i < handler.length; i++) {
vm._watchers.push(createWatcher(vm, key, handler[i]));
}
} else {
vm._watchers.push(createWatcher(vm, key, handler));
}
}
}
function createWatcher(vm, keyOrFn, handler, options) {
return Fix.watch(vm.model, keyOrFn, _.bind(handler, vm), options);
}
function initMethods(vm, methods) { function initMethods(vm, methods) {
for (var key in methods) { for (var key in methods) {
vm[key] = methods[key] == null ? noop : _.bind(methods[key], vm.$$model ? vm.model : vm); vm[key] = methods[key] == null ? noop : _.bind(methods[key], vm.$$model ? vm.model : vm);
@ -1034,6 +1052,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
this.$$model && (this.model.__ob__ = this.$$model.__ob__); this.$$model && (this.model.__ob__ = this.$$model.__ob__);
state && initState(this, state); state && initState(this, state);
initComputed(this, this.computed); initComputed(this, this.computed);
initWatch(this, this.watch);
initMethods(this, this.actions); initMethods(this, this.actions);
this._init(); this._init();
if (this.$$model) { if (this.$$model) {
@ -1047,6 +1066,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
for (var _key3 in this._computedWatchers) { for (var _key3 in this._computedWatchers) {
this._computedWatchers[_key3].teardown(); this._computedWatchers[_key3].teardown();
} }
_.each(this._watchers, function (unwatches) {
unwatches = _.isArray(unwatches) ? unwatches : [unwatches];
_.each(unwatches, function (unwatch) {
unwatch();
});
});
this._watchers && (this._watchers = []);
}; };
return VM; return VM;

19
src/base/grid/grid.js

@ -230,12 +230,15 @@ BI.GridView = BI.inherit(BI.Widget, {
if (items && items !== this.options.items) { if (items && items !== this.options.items) {
this.options.items = items; this.options.items = items;
} }
if (o.items.length > 0) { if (BI.isNumber(o.columnCount)) {
this.columnCount = o.columnCount;
} else if (o.items.length > 0) {
this.columnCount = o.items[0].length; this.columnCount = o.items[0].length;
this.rowCount = o.items.length; }
if (BI.isNumber(o.rowCount)) {
this.rowCount = o.rowCount;
} else { } else {
this.rowCount = 0; this.rowCount = o.items.length;
this.columnCount = 0;
} }
this.container.setWidth(this.columnCount * o.estimatedColumnSize); this.container.setWidth(this.columnCount * o.estimatedColumnSize);
this.container.setHeight(this.rowCount * o.estimatedRowSize); this.container.setHeight(this.rowCount * o.estimatedRowSize);
@ -274,6 +277,14 @@ BI.GridView = BI.inherit(BI.Widget, {
this.element.scrollTop(this.options.scrollTop); this.element.scrollTop(this.options.scrollTop);
}, },
setColumnCount: function (columnCount) {
this.options.columnCount = columnCount
},
setRowCount: function (rowCount) {
this.options.rowCount = rowCount
},
setOverflowX: function (b) { setOverflowX: function (b) {
var self = this; var self = this;
if (this.options.overflowX !== !!b) { if (this.options.overflowX !== !!b) {

2
src/base/layer/layer.floatbox.js

@ -35,6 +35,8 @@ BI.FloatBox = BI.inherit(BI.Widget, {
if (ui.position.top < 0) { if (ui.position.top < 0) {
ui.position.top = 0; ui.position.top = 0;
} }
//BI-12134 没有什么特别好的方法
BI.Resizers._resize();
} }
}); });
this._south = BI.createWidget(); this._south = BI.createWidget();

5
src/base/table/table.grid.js

@ -355,6 +355,11 @@ BI.GridTable = BI.inherit(BI.Widget, {
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0); this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
this.topLeftGrid.setColumnCount(freezeColLength);
this.topRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
this.bottomLeftGrid.setColumnCount(freezeColLength);
this.bottomRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
var items = this.contextLayout.attr("items"); var items = this.contextLayout.attr("items");
items[1].left = regionSize; items[1].left = regionSize;
items[2].top = this._getFreezeHeaderHeight(); items[2].top = this._getFreezeHeaderHeight();

Loading…
Cancel
Save