// 通用分页 var curPage = 1; // 当前页码 var totalCount, pageSize, totalPage; // 总记录数,每页显示数,总页数 totalPage = Math.floor(totalCount / pageSize) + 1; var likeSearch = '', typeSearch = ''; function getData(page, module) { $.ajax({ url : basePath + 'WFP?module=' + module + '&action=list', type : 'POST', data : { begin : (page - 1) * 20 + 1, limit : 20, likeSearch : likeSearch, typeSearch : typeSearch }, success : function(json) { $("#tableContent").empty(); $("#tableContent").height($("#tableContent").height()); $("#sectionMain").children().hide(); var obj = JSON.parse(json); total = obj.totalCount; pageSize = obj.limit; $.each(obj.data, function(index) { createTableContent(obj.data[index], module); }); // 分页 html = ''; var lastPage = Math.ceil(total / pageSize); if (page > 1) html += '