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

@@ -4,6 +4,8 @@ import {
ListAccountsResponse,
BatchDeleteBody,
BatchUpdateBody,
BatchExportBody,
BatchExportResponse,
StatsOverview,
ScriptUploadItem
} from './types';
@@ -16,12 +18,12 @@ const getApiBaseUrl = () => {
}
// 在浏览器环境中,没有配置则使用当前域名
if (typeof window !== 'undefined') {
return `${window.location.protocol}//${window.location.hostname}:3006`;
}
// if (typeof window !== 'undefined') {
// return `${window.location.protocol}//${window.location.hostname}:3006`;
// }
// 服务端渲染时的默认值
return 'http://localhost:3006';
return 'http://170.205.39.58:13007';
};
class ApiClient {
@@ -71,6 +73,14 @@ class ApiClient {
});
}
// 批量导出账户
async batchExportAccounts(body: BatchExportBody): Promise<ApiResponse<BatchExportResponse>> {
return this.request<BatchExportResponse>('/web/v1/accounts/export', {
method: 'POST',
body: JSON.stringify(body),
});
}
// 获取统计概览
async getStatsOverview(): Promise<ApiResponse<StatsOverview>> {
return this.request<StatsOverview>('/web/v1/stats/overview');