feat(client): 系统设置角色徽章 → StatusPill + 系统参数 Tab golden

- _RoleBadge(超管/管理员/操作员/只读)硬编码 FCE4EC/E3F2FD/E8F5E9/F5F5F5
  → StatusPill(danger/primary/success/muted + 对应软底,走 token)
- 系统参数 Tab golden ×三主题:锁住外观主题选择器三色板微缩预览 + 参数卡
- 残留 0xFF0F3057 为品牌标识色(--brand-deep,主题无关),保留

analyze 0 error.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
This commit is contained in:
wangjia
2026-06-25 13:43:50 +08:00
parent 80acf4a2c3
commit 2865b76a8e
5 changed files with 34 additions and 24 deletions
@@ -16,6 +16,7 @@ import '../../core/theme/context_tokens.dart';
import '../../core/theme/app_tokens.dart';
import '../../core/theme/app_tokens.g.dart';
import '../../core/theme/theme_controller.dart';
import '../../widgets/kpi_card.dart';
import '../../models/number_rule.dart';
import '../../models/user.dart';
import '../../providers/license_provider.dart';
@@ -1112,30 +1113,14 @@ class _RoleBadge extends StatelessWidget {
@override
Widget build(BuildContext context) {
final Color bg;
final Color fg;
switch (role) {
case '超级管理员':
bg = const Color(0xFFFCE4EC);
fg = context.tokens.danger;
break;
case '管理员':
bg = const Color(0xFFE3F2FD);
fg = context.tokens.primary;
break;
case '操作员':
bg = const Color(0xFFE8F5E9);
fg = context.tokens.success;
break;
default:
bg = const Color(0xFFF5F5F5);
fg = context.tokens.muted;
}
return Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
decoration: BoxDecoration(color: bg, borderRadius: BorderRadius.circular(3)),
child: Text(role, style: TextStyle(color: fg, fontSize: 12, fontWeight: FontWeight.w500)),
);
final t = context.tokens;
final (Color fg, Color bg) = switch (role) {
'超级管理员' => (t.danger, t.dangerBg),
'管理员' => (t.primary, t.infoSoft),
'操作员' => (t.success, t.okSoft),
_ => (t.muted, t.infoSoft),
};
return StatusPill(label: role, color: fg, background: bg);
}
}