hdw
2018-12-04 28dc7fc1a014617c6db614a8801c91e97290cd08
gx_tieta/WebRoot/pages/js/mylayui.js
@@ -58,4 +58,58 @@
    RegExp.$1.length==1? o[k] :
    ("00"+ o[k]).substr((""+ o[k]).length));
    return format;
};
};
// 页面中分页信息对象
var TblPage = function() {
   this.size = 10;
   this.curr = 1;
   this.all = 0;
   this.num = 1;
};
// 初始化分页信息对象
TblPage.prototype.init = function() {
   this.size = 10;
   this.curr = 1;
   this.all = 0;
   this._setNum();
};
// 设置分页信息对象
TblPage.prototype.set = function(curr, all, size) {
   this.size = size;
   this.curr = curr;
   this.all = all;
   this._setNum();
};
TblPage.prototype.getPage = function() {
   var temp = {
      pageSize: this.size
      ,pageCurr: this.curr
      ,pageAll: this.all
   };
   return temp;
};
// 设置分页信息的当前页
TblPage.prototype.setCurr = function(curr) {
   this.curr = curr;
};
//设置分页信息的每页显示的条数
TblPage.prototype.setSize = function(size) {
   this.size = size;
   this._setNum();
};
//设置分页信息的总条数
TblPage.prototype.setAll = function(all) {
   this.all = all;
   this._setNum();
};
// 设置共有多少页
TblPage.prototype._setNum = function() {
   this.num = Math.ceil(this.all/this.size);
}