当前位置:政策
抱歉,没有找到相关结果。建议:
1. 请您检查输入是否错误
2. 请您尝试简化输入词
3. 请您尝试用相似词或常见词
共' + this.total + '条记录
'
}
if (this.afterRefreshFn) {
this.afterRefreshFn.call(this);
}
};
KPagination.prototype.setTotalPage = function (totalPage) {
this.totalPage = parseInt(totalPage);
this.refresh();
};
KPagination.prototype.setTotalCount = function (totalCount) {
this.total = parseInt(totalCount);
this.refresh();
};
KPagination.prototype.setCurrentPage = function (currentPage) {
this.currentPage = parseInt(currentPage);
this.refresh();
};
/**
* 构建分页数组
* @returns {Array}
*/
KPagination.prototype.build = function () {
var arr = [],
i = 1,
start = 1,
end = this.totalPage;
if (this.showPrev) {
// 代表前一页
arr.push('p-' + Math.max(1, Math.min(this.currentPage - 1, this.totalPage)));
}
if (this.totalPage <= this.offset) {
// 总页码数在显示的数量范围内
while (i <= this.totalPage) {
arr.push(i);
i++;
}
} else if (this.currentPage < this.offset - this.offsetHalf + 1) {
while (i <= this.offset) {
arr.push(i);
i++;
}
} else if(this.currentPage < this.offset) {
start = this.currentPage - this.offsetHalf;
end = this.currentPage + this.offsetHalf;
for(i = start;i<=end;i++){
arr.push(i);
}
} else if (this.currentPage > this.totalPage - (this.offset - this.offsetHalf)) {
for (i = this.totalPage - this.offset + 1; i <= this.totalPage; i++) {
arr.push(i);
}
} else {
start = Math.max(this.currentPage - this.offsetHalf, 1);
end = Math.min(this.currentPage + this.offsetHalf, this.totalPage);
for (i = start; i <= end; i++) {
arr.push(i);
}
}
if (this.showNext) {
arr.push('n-' + Math.max(1, Math.min(this.currentPage + 1, this.totalPage)));
}
return arr;
};
KPagination.prototype.generateHtml = function (numArr) {
var arr = [], cls;
for (var i = 0; i < numArr.length; i++) {
if (numArr[i] === '.') {
arr.push(' ');
} else if (typeof numArr[i] === 'string') {
cls = 'whj_border whj_padding whj_bgc whj_hover'
var str = numArr[i];
var tmp = str.split('-');
var tmpNum = tmp[1];
if (tmpNum == this.currentPage) {
cls = 'whj_border whj_padding whj_bgc whj_hoverDisable';
}
if (tmp[0] === 'p') {
// 上一页
arr.push('上一页
');
} else if (tmp[0] === 'n') {
// 下一页
arr.push('下一页
');
}
} else {
cls = 'whj_border whj_padding whj_bgc whj_hover';
if (this.currentPage == numArr[i]) {
cls = ' whj_border whj_padding whj_bgc whj_checked';
}
arr.push('' + numArr[i] + '
');
}
}
if(this.showFirstLast) {
arr.unshift('首页
');
arr.push('尾页
');
}
return arr.join('');
};
return KPagination;
});
政府信息公开平台_中国政府网
https://www.gov.cn