feat(agents, i18n): enhance agent management and settlement features with new translations and UI updates

Added new translations for agent management and settlement features in English, Nepali, and Chinese, improving multi-language support. Updated the agents console to reflect changes in funding modes and player details, enhancing user experience. Refactored the admin permission gate to include new logic for handling bound line agents, ensuring better permission management. Additionally, streamlined the UI for agent-related pages and improved navigation to the settlement center, consolidating related functionalities for better accessibility.
This commit is contained in:
2026-06-04 18:01:05 +08:00
parent c2eac2fafc
commit 65eaeecf8c
139 changed files with 8852 additions and 1435 deletions

View File

@@ -48,6 +48,7 @@ import { adminHasAnyPermission } from "@/lib/admin-permissions";
import { PRD_REPORT_EXPORT, PRD_REPORT_VIEW } from "@/lib/admin-prd";
import { useAdminProfile } from "@/stores/admin-session";
import { adminAgentDisplayLabel } from "@/components/admin/admin-agent-columns";
import { AdminNoResourceState, AdminTableNoResourceRow } from "@/components/admin/admin-no-resource-state";
import { AdminDateRangeField } from "@/components/admin/admin-date-range-field";
import { AdminListPaginationFooter } from "@/components/admin/admin-list-pagination-footer";
import { Button } from "@/components/ui/button";
@@ -92,7 +93,7 @@ import type {
AdminReportRebateCommissionRow,
} from "@/types/api/admin-reports";
export type ReportCategory = "profit" | "wallet" | "risk" | "audit";
export type ReportCategory = "profit" | "wallet" | "risk" | "audit" | "legacy";
type FilterKind = "draw" | "date" | "player_period" | "draw_number" | "play" | "play_period" | "operator_period";
type FieldKey = "drawNo" | "number" | "player" | "play" | "operator" | "period";
type ExportFormat = "csv" | "excel";
@@ -191,7 +192,7 @@ const REPORTS: ReportDefinition[] = [
{ key: "hot_number_risk", category: "risk", icon: ShieldAlert, filterKind: "draw_number", scope: "drawNumber", fields: ["drawNo", "number"], connected: true },
{ key: "play_dimension", category: "profit", icon: ListFilter, filterKind: "play_period", scope: "playPeriod", fields: ["play", "period"], connected: true },
{ key: "sold_out_number", category: "risk", icon: ShieldCheck, filterKind: "draw", scope: "drawNo", fields: ["drawNo"], connected: true },
{ key: "rebate_commission", category: "wallet", icon: CircleDollarSign, filterKind: "play_period", scope: "playPeriod", fields: ["play", "period"], connected: true },
{ key: "rebate_commission", category: "legacy", icon: CircleDollarSign, filterKind: "play_period", scope: "playPeriod", fields: ["play", "period"], connected: true },
{ key: "admin_audit", category: "audit", icon: FileSpreadsheet, filterKind: "operator_period", scope: "operatorPeriod", fields: ["operator", "period"], connected: true },
];
@@ -225,6 +226,8 @@ function categoryTone(category: ReportCategory): string {
return "border-red-200 bg-red-50 text-red-700";
case "audit":
return "border-slate-200 bg-slate-50 text-slate-700";
case "legacy":
return "border-amber-200 bg-amber-50 text-amber-800";
default:
return "border-blue-200 bg-blue-50 text-blue-700";
}
@@ -1248,11 +1251,7 @@ export function ReportsConsole({ initialCategory }: { initialCategory?: ReportCa
}
if (!result || result.rows.length === 0) {
return (
<TableRow>
<TableCell colSpan={8} className="text-muted-foreground">
{t("preview.empty")}
</TableCell>
</TableRow>
<AdminTableNoResourceRow colSpan={8} />
);
}
@@ -1507,6 +1506,15 @@ export function ReportsConsole({ initialCategory }: { initialCategory?: ReportCa
))}
</div>
{selectedReport.key === "rebate_commission" ? (
<div className="rounded-md border border-amber-300 bg-amber-50 px-4 py-3 text-sm text-amber-950">
{t("items.rebate_commission.disclaimer", {
defaultValue:
"本报表为钱包盘「下注立减回水/佣金」口径,不属于信用占成盘账期结算。占成盘请使用「代理 → 代理账单」中的账期报表。",
})}
</div>
) : null}
<Card className="admin-list-card">
<CardHeader className="admin-list-header flex flex-col gap-3 pb-4 sm:flex-row sm:items-center sm:justify-between">
<div>