feat(admin): 仪表盘重构、代理线路修复与后台体验优化
Some checks failed
lotteryadmin CI / build (push) Has been cancelled
Some checks failed
lotteryadmin CI / build (push) Has been cancelled
- 各角色仪表盘:KPI 可点击跳转、快捷入口、去重冗余区块,代理/站点降级 analytics - 代理线路:创建玩家权限、侧栏搜索、深链 URL、档案保存与删除预检等修复 - 统一密码最短 6 位;代理模块表格/侧栏背景色一致(admin-table-inset) - 报表、钱包、对账、开奖、结算、配置等模块结构与 i18n 同步更新
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { RotateCcw, Wrench } from "lucide-react";
|
||||
import { ExternalLink, RotateCcw, Wrench } from "lucide-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { AdminRowActionsMenu } from "@/components/admin/admin-row-actions-menu";
|
||||
@@ -19,6 +19,7 @@ type ReconcileItemActionsProps = {
|
||||
row: AdminReconcileItemRow;
|
||||
canWriteWallet: boolean;
|
||||
busy: boolean;
|
||||
compact?: boolean;
|
||||
onCompleteCredit: (transferNo: string) => void;
|
||||
onReverse: (transferNo: string) => void;
|
||||
onManualProcess: (transferNo: string) => void;
|
||||
@@ -28,6 +29,7 @@ export function ReconcileItemActions({
|
||||
row,
|
||||
canWriteWallet,
|
||||
busy,
|
||||
compact = false,
|
||||
onCompleteCredit,
|
||||
onReverse,
|
||||
onManualProcess,
|
||||
@@ -45,36 +47,60 @@ export function ReconcileItemActions({
|
||||
can_manually_process: row.can_manually_process,
|
||||
};
|
||||
|
||||
const hasWalletAction = transferNo !== "" && transferOrderHasReconcileAction(actionRow, canWriteWallet);
|
||||
|
||||
const menuActions = [
|
||||
{
|
||||
key: "complete",
|
||||
label: t("completeCredit", { ns: "wallet" }),
|
||||
hidden: !canCompleteTransferInCredit(actionRow, canWriteWallet),
|
||||
onClick: () => onCompleteCredit(transferNo),
|
||||
},
|
||||
{
|
||||
key: "manual",
|
||||
label: t("markCaseClosed", { ns: "wallet" }),
|
||||
icon: Wrench,
|
||||
hidden: !canManuallyProcessTransferOrder(actionRow, canWriteWallet),
|
||||
onClick: () => onManualProcess(transferNo),
|
||||
},
|
||||
{
|
||||
key: "reverse",
|
||||
label: t("reverse", { ns: "wallet" }),
|
||||
icon: RotateCcw,
|
||||
destructive: true,
|
||||
hidden: !canReverseTransferOrder(actionRow, canWriteWallet),
|
||||
onClick: () => onReverse(transferNo),
|
||||
},
|
||||
{
|
||||
key: "transfer",
|
||||
label: t("openTransferOrder"),
|
||||
icon: ExternalLink,
|
||||
hidden: transferNo === "",
|
||||
onClick: () => {
|
||||
window.location.href = `/admin/wallet/transfer-orders?transfer_no=${encodeURIComponent(transferNo)}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
key: "txn",
|
||||
label: t("openWalletTxn"),
|
||||
icon: ExternalLink,
|
||||
hidden: !row.side_b_ref,
|
||||
onClick: () => {
|
||||
window.location.href = `/admin/wallet/transactions?txn_no=${encodeURIComponent(row.side_b_ref ?? "")}`;
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
if (compact) {
|
||||
if (!hasWalletAction && !transferNo && !row.side_b_ref) {
|
||||
return <span>—</span>;
|
||||
}
|
||||
return <AdminRowActionsMenu busy={busy} actions={menuActions} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{transferNo !== "" && transferOrderHasReconcileAction(actionRow, canWriteWallet) ? (
|
||||
<AdminRowActionsMenu
|
||||
busy={busy}
|
||||
actions={[
|
||||
{
|
||||
key: "complete",
|
||||
label: t("completeCredit", { ns: "wallet" }),
|
||||
hidden: !canCompleteTransferInCredit(actionRow, canWriteWallet),
|
||||
onClick: () => onCompleteCredit(transferNo),
|
||||
},
|
||||
{
|
||||
key: "manual",
|
||||
label: t("markCaseClosed", { ns: "wallet" }),
|
||||
icon: Wrench,
|
||||
hidden: !canManuallyProcessTransferOrder(actionRow, canWriteWallet),
|
||||
onClick: () => onManualProcess(transferNo),
|
||||
},
|
||||
{
|
||||
key: "reverse",
|
||||
label: t("reverse", { ns: "wallet" }),
|
||||
icon: RotateCcw,
|
||||
destructive: true,
|
||||
hidden: !canReverseTransferOrder(actionRow, canWriteWallet),
|
||||
onClick: () => onReverse(transferNo),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
) : null}
|
||||
{hasWalletAction ? <AdminRowActionsMenu busy={busy} actions={menuActions.filter((a) => a.key !== "transfer" && a.key !== "txn")} /> : null}
|
||||
{transferNo !== "" ? (
|
||||
<Link
|
||||
href={`/admin/wallet/transfer-orders?transfer_no=${encodeURIComponent(transferNo)}`}
|
||||
@@ -94,4 +120,4 @@ export function ReconcileItemActions({
|
||||
{!transferNo && !row.side_b_ref ? <span>—</span> : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user