Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/1788/head
zouap 3 years ago
parent
commit
575e2bd36f
1 changed files with 15 additions and 15 deletions
  1. +15
    -15
      public/home/search.js

+ 15
- 15
public/home/search.js View File

@@ -54,6 +54,7 @@ var currentSearchSortBy="";
var OnlySearchLabel=false;
var startIndex =1;
var endIndex = 5;
var totalPage = 1;

function initPageInfo(){
currentPage = 1;
@@ -538,29 +539,28 @@ function page(current){
page(currentPage);
}
}


$('#inputpage').on('keypress',function(event){
if(event.keyCode == 13){
goPage();
}
});

function goPage(){
var goNum = $('#goNum').val();
var goNum = $('#inputpage').val();
var pageTotal = $("#totalNum").text();
var pageNum = parseInt(pageTotal/pageSize);
if(pageTotal%pageSize!=0){
pageNum += 1;
}else {
pageNum = pageNum;
}
if (goNum<=0){
alert("请输入大于0的数值");
}
else if(goNum<=pageNum){
page(goNum - 1,pageSize);
else if(goNum<=totalPage){
page(goNum);
}
else{
alert("不能超出总页!");
alert("不能超出总页!");
}
}


function setPage(pageData,pageSize,currentPage){
if (isEmpty(pageData)){
@@ -575,10 +575,10 @@ function page(current){
$('#startPage').addClass("disabled");
$('#lastPage').addClass("disabled");
}
var totalPage=Math.ceil(pageData.Total/pageSize)
totalPage =Math.ceil(pageData.Total/pageSize);
console.log("totalPage=" + totalPage);
var html ="";
for(var i=0;i<5&&(i+currentPage)<totalPage;i++){
for(var i=startIndex-1;i < endIndex&&(i+currentPage)<totalPage;i++){
var page_i = (currentPage + i);
if( i== 0){
html += "<a id=\"page_" + page_i+ "\" class=\"active item\" href=\"page(" + page_i +")\">" + page_i + "</a>";


Loading…
Cancel
Save