feat(admin): 仪表盘重构、代理线路修复与后台体验优化
Some checks failed
lotteryadmin CI / build (push) Has been cancelled

- 各角色仪表盘:KPI 可点击跳转、快捷入口、去重冗余区块,代理/站点降级 analytics
- 代理线路:创建玩家权限、侧栏搜索、深链 URL、档案保存与删除预检等修复
- 统一密码最短 6 位;代理模块表格/侧栏背景色一致(admin-table-inset)
- 报表、钱包、对账、开奖、结算、配置等模块结构与 i18n 同步更新
This commit is contained in:
2026-06-26 14:39:22 +08:00
parent 7d075ceb62
commit 0d984b00f0
126 changed files with 7423 additions and 7084 deletions

View File

@@ -0,0 +1,141 @@
import type { LucideIcon } from "lucide-react";
import {
CalendarDays,
FileSpreadsheet,
ListFilter,
ShieldAlert,
ShieldCheck,
Ticket,
Users,
WalletCards,
} from "lucide-react";
import {
PRD_AUDIT_VIEW,
PRD_REPORT_VIEW,
PRD_RISK_ACCESS_ANY,
PRD_WALLET_TRANSFER_ACCESS_ANY,
} from "@/lib/admin-prd";
export type ReportCategory = "profit" | "wallet" | "risk" | "audit";
export const REPORT_CATEGORY_ORDER: readonly ReportCategory[] = [
"profit",
"wallet",
"risk",
"audit",
] as const;
export type FilterKind =
| "draw"
| "date"
| "player_period"
| "draw_number"
| "play"
| "play_period"
| "operator_period";
export type FieldKey = "drawNo" | "number" | "player" | "play" | "operator" | "period";
export type ReportKey =
| "draw_profit"
| "daily_profit"
| "player_win_loss"
| "player_transfer"
| "hot_number_risk"
| "play_dimension"
| "sold_out_number"
| "admin_audit";
export type ReportDefinition = {
key: ReportKey;
category: ReportCategory;
icon: LucideIcon;
filterKind: FilterKind;
fields: FieldKey[];
connected: boolean;
requiredAny: readonly string[];
};
const PRD_REPORTS_VIEW_ACCESS_ANY = [PRD_REPORT_VIEW] as const;
export const REPORT_DEFINITIONS: ReportDefinition[] = [
{
key: "draw_profit",
category: "profit",
icon: Ticket,
filterKind: "draw",
fields: ["drawNo"],
connected: true,
requiredAny: PRD_REPORTS_VIEW_ACCESS_ANY,
},
{
key: "daily_profit",
category: "profit",
icon: CalendarDays,
filterKind: "date",
fields: ["period"],
connected: true,
requiredAny: PRD_REPORTS_VIEW_ACCESS_ANY,
},
{
key: "player_win_loss",
category: "profit",
icon: Users,
filterKind: "player_period",
fields: ["player", "period"],
connected: true,
requiredAny: PRD_REPORTS_VIEW_ACCESS_ANY,
},
{
key: "play_dimension",
category: "profit",
icon: ListFilter,
filterKind: "play_period",
fields: ["play", "period"],
connected: true,
requiredAny: PRD_REPORTS_VIEW_ACCESS_ANY,
},
{
key: "player_transfer",
category: "wallet",
icon: WalletCards,
filterKind: "player_period",
fields: ["player", "period"],
connected: true,
requiredAny: PRD_WALLET_TRANSFER_ACCESS_ANY,
},
{
key: "hot_number_risk",
category: "risk",
icon: ShieldAlert,
filterKind: "draw_number",
fields: ["drawNo", "number"],
connected: true,
requiredAny: PRD_RISK_ACCESS_ANY,
},
{
key: "sold_out_number",
category: "risk",
icon: ShieldCheck,
filterKind: "draw",
fields: ["drawNo"],
connected: true,
requiredAny: PRD_RISK_ACCESS_ANY,
},
{
key: "admin_audit",
category: "audit",
icon: FileSpreadsheet,
filterKind: "operator_period",
fields: ["operator", "period"],
connected: true,
requiredAny: [PRD_AUDIT_VIEW],
},
];
export const CATEGORY_SHORTCUT_HREF: Partial<Record<ReportCategory, string>> = {
wallet: "/admin/wallet/transfer-orders",
risk: "/admin/risk",
audit: "/admin/audit-logs",
};