fix(Pagination): 优化中间页码显示,调整跳转文案格式

- 中间页码:显示当前页前后各1个页码 (如 1...4,5,6...10)
- 跳转文案:从"跳转到 [页]"改为"第 [  ] 页"格式

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zdl
2025-12-15 15:20:16 +08:00
parent a9c21d8478
commit 378df947a9

View File

@@ -60,10 +60,12 @@ const PaginationControl = React.memo(({ currentPage, totalPages, onPageChange })
pageNumbers.push(i); pageNumbers.push(i);
} }
} else { } else {
// 当前页在中间 // 当前页在中间显示当前页前后各1个页码
pageNumbers.push(1); pageNumbers.push(1);
pageNumbers.push('...'); pageNumbers.push('...');
pageNumbers.push(currentPage); pageNumbers.push(currentPage - 1); // 前一页
pageNumbers.push(currentPage); // 当前页
pageNumbers.push(currentPage + 1); // 后一页
pageNumbers.push('...'); pageNumbers.push('...');
pageNumbers.push(totalPages); pageNumbers.push(totalPages);
} }
@@ -180,7 +182,7 @@ const PaginationControl = React.memo(({ currentPage, totalPages, onPageChange })
{/* 输入框跳转 */} {/* 输入框跳转 */}
<HStack spacing={1.5}> <HStack spacing={1.5}>
<Text fontSize="xs" color="gray.600"> <Text fontSize="xs" color="gray.600">
跳转到
</Text> </Text>
<Input <Input
size="xs" size="xs"
@@ -191,10 +193,13 @@ const PaginationControl = React.memo(({ currentPage, totalPages, onPageChange })
value={jumpPage} value={jumpPage}
onChange={(e) => setJumpPage(e.target.value)} onChange={(e) => setJumpPage(e.target.value)}
onKeyPress={handleKeyPress} onKeyPress={handleKeyPress}
placeholder="" placeholder=""
bg={buttonBg} bg={buttonBg}
borderColor={borderColor} borderColor={borderColor}
/> />
<Text fontSize="xs" color="gray.600">
</Text>
<Button <Button
size="xs" size="xs"
colorScheme="blue" colorScheme="blue"