feat(groups): add rate multipliers management modal

Add a dedicated modal in group management for viewing, adding, editing,
and deleting per-user rate multipliers within a group.

Backend:
- GET /admin/groups/:id/rate-multipliers - list entries with user details
- PUT /admin/groups/:id/rate-multipliers - batch sync (full replace)
- DELETE /admin/groups/:id/rate-multipliers - clear all entries
- Repository: GetByGroupID, SyncGroupRateMultipliers methods on
  user_group_rate_multipliers table (same table as user-side rates)

Frontend:
- New GroupRateMultipliersModal component with:
  - User search and add with email autocomplete
  - Editable rate column with local edit mode (cancel/save)
  - Batch adjust: multiply all rates by a factor
  - Clear all (local operation, requires save to persist)
  - Pagination (10/20/50 per page)
  - Platform icon with brand colors in group info bar
  - Unsaved changes indicator with revert option
- Unit tests for all three backend endpoints
This commit is contained in:
erio
2026-03-12 23:37:36 +08:00
parent 826090e099
commit d648811233
13 changed files with 989 additions and 3 deletions

View File

@@ -1372,7 +1372,11 @@ export default {
accounts: 'Accounts',
status: 'Status',
actions: 'Actions',
billingType: 'Billing Type'
billingType: 'Billing Type',
userName: 'Username',
userEmail: 'Email',
userNotes: 'Notes',
userStatus: 'Status'
},
rateAndAccounts: '{rate}x rate · {count} accounts',
accountsCount: '{count} accounts',
@@ -1411,6 +1415,26 @@ export default {
failedToUpdate: 'Failed to update group',
failedToDelete: 'Failed to delete group',
nameRequired: 'Please enter group name',
rateMultipliers: 'Rate Multipliers',
rateMultipliersTitle: 'Group Rate Multipliers',
addUserRate: 'Add User Rate Multiplier',
searchUserPlaceholder: 'Search user email...',
noRateMultipliers: 'No user rate multipliers configured',
rateUpdated: 'Rate multiplier updated',
rateDeleted: 'Rate multiplier removed',
rateAdded: 'Rate multiplier added',
clearAll: 'Clear All',
confirmClearAll: 'Are you sure you want to clear all rate multiplier settings for this group? This cannot be undone.',
rateCleared: 'All rate multipliers cleared',
batchAdjust: 'Batch Adjust Rates',
multiplierFactor: 'Factor',
applyMultiplier: 'Apply',
rateAdjusted: 'Rates adjusted successfully',
rateSaved: 'Rate multipliers saved',
finalRate: 'Final Rate',
unsavedChanges: 'Unsaved changes',
revertChanges: 'Revert',
userInfo: 'User Info',
platforms: {
all: 'All Platforms',
anthropic: 'Anthropic',

View File

@@ -1428,7 +1428,11 @@ export default {
accounts: '账号数',
status: '状态',
actions: '操作',
billingType: '计费类型'
billingType: '计费类型',
userName: '用户名',
userEmail: '邮箱',
userNotes: '备注',
userStatus: '状态'
},
form: {
name: '名称',
@@ -1510,6 +1514,26 @@ export default {
failedToCreate: '创建分组失败',
failedToUpdate: '更新分组失败',
nameRequired: '请输入分组名称',
rateMultipliers: '专属倍率',
rateMultipliersTitle: '分组专属倍率管理',
addUserRate: '添加用户专属倍率',
searchUserPlaceholder: '搜索用户邮箱...',
noRateMultipliers: '暂无用户设置了专属倍率',
rateUpdated: '专属倍率已更新',
rateDeleted: '专属倍率已删除',
rateAdded: '专属倍率已添加',
clearAll: '全部清空',
confirmClearAll: '确定要清空该分组所有用户的专属倍率设置吗?此操作不可撤销。',
rateCleared: '已清空所有专属倍率',
batchAdjust: '批量调整倍率',
multiplierFactor: '乘数',
applyMultiplier: '应用',
rateAdjusted: '倍率已批量调整',
rateSaved: '专属倍率已保存',
finalRate: '最终倍率',
unsavedChanges: '有未保存的修改',
revertChanges: '撤销修改',
userInfo: '用户信息',
subscription: {
title: '订阅设置',
type: '计费类型',