From eef12cb90076ef0b3886dd862b885f2308c029d9 Mon Sep 17 00:00:00 2001 From: IanShaw027 <131567472+IanShaw027@users.noreply.github.com> Date: Mon, 5 Jan 2026 01:00:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor(frontend):=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E5=B7=A5=E5=85=B7=E6=9D=A1?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=92=8C=E6=93=8D=E4=BD=9C=E5=88=97=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 修复内容 ### 1. 统一操作列按钮样式 - 所有操作列按钮统一为"图标+文字"垂直排列样式 - UsersView: 编辑和更多按钮添加文字标签 - 与 AccountsView、GroupsView 等页面保持一致 ### 2. 统一顶部工具条布局(6个管理页面) - 使用 flex + justify-between 布局 - 左侧:模糊搜索框、筛选器(可多行排列) - 右侧:刷新、创建等操作按钮(靠右对齐) - 响应式:宽度不够时右侧按钮自动换行到上一行 ### 3. 修复的页面 - AccountsView: 合并 actions/filters 到单行工具条 - UsersView: 标准左右分栏,操作列添加文字 - GroupsView: 新增搜索框,左右分栏布局 - ProxiesView: 左右分栏,响应式布局 - SubscriptionsView: 新增用户模糊搜索,左右分栏 - UsageView: 补齐所有筛选项,左右分栏 ### 4. 新增功能 - GroupsView: 新增分组名称/描述模糊搜索 - SubscriptionsView: 新增用户模糊搜索功能 - UsageView: 补齐 API Key 搜索筛选 ### 5. 国际化 - 新增相关搜索框的 placeholder 文案(中英文) ## 技术细节 - 使用 flex-wrap-reverse 实现响应式换行 - 左侧筛选区使用 flex-wrap 支持多行 - 右侧按钮区使用 ml-auto + justify-end 保持右对齐 - 移动端使用 w-full sm:w-* 响应式宽度 ## 验证结果 - ✅ TypeScript 类型检查通过 - ✅ 所有页面布局统一 - ✅ 响应式布局正常工作 --- .../admin/account/AccountTableActions.vue | 10 +- .../admin/account/AccountTableFilters.vue | 16 +- .../components/admin/usage/UsageFilters.vue | 368 ++++++++++++++++-- frontend/src/i18n/locales/en.ts | 2 + frontend/src/i18n/locales/zh.ts | 2 + frontend/src/views/admin/AccountsView.vue | 22 +- frontend/src/views/admin/GroupsView.vue | 124 ++++-- frontend/src/views/admin/ProxiesView.vue | 158 ++++---- .../src/views/admin/SubscriptionsView.vue | 286 ++++++++++---- frontend/src/views/admin/UsersView.vue | 103 +++-- 10 files changed, 826 insertions(+), 265 deletions(-) diff --git a/frontend/src/components/admin/account/AccountTableActions.vue b/frontend/src/components/admin/account/AccountTableActions.vue index 9832873e..035c9f83 100644 --- a/frontend/src/components/admin/account/AccountTableActions.vue +++ b/frontend/src/components/admin/account/AccountTableActions.vue @@ -1,11 +1,11 @@ \ No newline at end of file + diff --git a/frontend/src/components/admin/account/AccountTableFilters.vue b/frontend/src/components/admin/account/AccountTableFilters.vue index 7d40c31e..3721acc6 100644 --- a/frontend/src/components/admin/account/AccountTableFilters.vue +++ b/frontend/src/components/admin/account/AccountTableFilters.vue @@ -1,16 +1,16 @@ diff --git a/frontend/src/components/admin/usage/UsageFilters.vue b/frontend/src/components/admin/usage/UsageFilters.vue index c9dd0d94..d6077ec5 100644 --- a/frontend/src/components/admin/usage/UsageFilters.vue +++ b/frontend/src/components/admin/usage/UsageFilters.vue @@ -1,35 +1,353 @@ diff --git a/frontend/src/i18n/locales/en.ts b/frontend/src/i18n/locales/en.ts index 17205d07..ab576cc8 100644 --- a/frontend/src/i18n/locales/en.ts +++ b/frontend/src/i18n/locales/en.ts @@ -760,6 +760,7 @@ export default { groups: { title: 'Group Management', description: 'Manage API key groups and rate multipliers', + searchGroups: 'Search groups...', createGroup: 'Create Group', editGroup: 'Edit Group', deleteGroup: 'Delete Group', @@ -1657,6 +1658,7 @@ export default { description: 'View and manage all user usage records', userFilter: 'User', searchUserPlaceholder: 'Search user by email...', + searchApiKeyPlaceholder: 'Search API key by name...', selectedUser: 'Selected', user: 'User', account: 'Account', diff --git a/frontend/src/i18n/locales/zh.ts b/frontend/src/i18n/locales/zh.ts index 7aa36daa..4d3d00f5 100644 --- a/frontend/src/i18n/locales/zh.ts +++ b/frontend/src/i18n/locales/zh.ts @@ -809,6 +809,7 @@ export default { groups: { title: '分组管理', description: '管理 API 密钥分组和费率配置', + searchGroups: '搜索分组...', createGroup: '创建分组', editGroup: '编辑分组', deleteGroup: '删除分组', @@ -1803,6 +1804,7 @@ export default { description: '查看和管理所有用户的使用记录', userFilter: '用户', searchUserPlaceholder: '按邮箱搜索用户...', + searchApiKeyPlaceholder: '按名称搜索 API 密钥...', selectedUser: '已选择', user: '用户', account: '账户', diff --git a/frontend/src/views/admin/AccountsView.vue b/frontend/src/views/admin/AccountsView.vue index be12ac83..8f5bb920 100644 --- a/frontend/src/views/admin/AccountsView.vue +++ b/frontend/src/views/admin/AccountsView.vue @@ -1,8 +1,26 @@