feat: 实现账户批量导出功能和界面优化

- 新增批量导出功能,支持text模式导出账户数据
- 添加导出弹窗,支持文本全选和文件下载
- 移动刷新按钮到全局位置,统一刷新账户和统计数据
- 在统计卡片中将已导出状态计入可用账户
- 创建自定义确认对话框替换系统confirm弹窗
- 统一按钮尺寸,修复刷新和上传按钮大小不一致
- 添加已导出状态的中文映射和样式

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-24 05:28:45 +08:00
parent 94f229ac1d
commit 7aaeffa498
9 changed files with 338 additions and 52 deletions

View File

@@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button';
import { Checkbox } from '@/components/ui/checkbox';
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import { ChevronLeft, ChevronRight, Eye, Edit, Trash2, RefreshCw } from 'lucide-react';
import { ChevronLeft, ChevronRight, Eye, Edit, Trash2 } from 'lucide-react';
import { Account } from '@/lib/types';
interface AccountTableProps {
@@ -22,7 +22,6 @@ interface AccountTableProps {
onSelectOne: (id: number, checked: boolean) => void;
onPageChange: (page: number) => void;
onPageSizeChange: (pageSize: number) => void;
onRefresh: () => void;
onView?: (account: Account) => void;
onEdit?: (account: Account) => void;
onDelete?: (account: Account) => void;
@@ -37,7 +36,6 @@ export function AccountTable({
onSelectOne,
onPageChange,
onPageSizeChange,
onRefresh,
onView,
onEdit,
onDelete
@@ -50,6 +48,8 @@ export function AccountTable({
return <Badge variant="secondary"></Badge>;
case 'banned':
return <Badge variant="destructive"></Badge>;
case 'exported':
return <Badge variant="outline" className="bg-blue-50 text-blue-700 border-blue-200"></Badge>;
default:
return <Badge variant="outline">{status}</Badge>;
}
@@ -152,20 +152,7 @@ export function AccountTable({
<th className="text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap"></th>
<th className="text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap"></th>
<th className="text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap"></th>
<th className="text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap w-[120px]">
<div className="flex items-center justify-between">
<span></span>
<Button
variant="ghost"
size="sm"
onClick={onRefresh}
disabled={loading}
className="h-6 w-6 p-0"
>
<RefreshCw className={`h-3 w-3 ${loading ? 'animate-spin' : ''}`} />
</Button>
</div>
</th>
<th className="text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap w-[120px]"></th>
</tr>
</thead>
<tbody>