显示 {(currentPage - 1) * pageSize + 1} - {Math.min(currentPage * pageSize, totalRecords)} 条,共 {totalRecords} 条
{#each Array.from({ length: Math.min(5, totalPages) }, (_, i) => {
// 计算显示的页码范围
let start = Math.max(1, currentPage - 2);
let end = Math.min(totalPages, start + 4);
start = Math.max(1, end - 4);
return start + i;
}).filter(p => p <= totalPages) as page}
{/each}