feat: 重构开奖模块导航与面包屑,优化期号详情与列表展示
This commit is contained in:
@@ -62,7 +62,7 @@ export const adminShellNavItems: AdminNavItem[] = [
|
||||
},
|
||||
{
|
||||
segment: "draws",
|
||||
label: "开奖",
|
||||
label: "期号列表",
|
||||
href: "/admin/draws",
|
||||
requiredAny: ["prd.draw_result.manage", "prd.draw_result.view"],
|
||||
},
|
||||
|
||||
@@ -67,55 +67,61 @@ export function DrawDetailConsole({ drawId }: { drawId: string }) {
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle className="text-lg">当期状态</CardTitle>
|
||||
<Card className="overflow-hidden">
|
||||
<CardHeader className="border-b bg-muted/30 pb-4">
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<CardTitle className="text-xl">{data.draw_no}</CardTitle>
|
||||
<p className="mt-1 text-sm text-muted-foreground">开奖详情</p>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<DrawStatusBadge status={data.status} label={data.status} />
|
||||
<DrawStatusBadge status={data.hall_preview_status} label={`大厅预览 ${data.hall_preview_status}`} />
|
||||
</div>
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<span className="font-mono text-base font-semibold">{data.draw_no}</span>
|
||||
<DrawStatusBadge status={data.status} label={`DB · ${data.status}`} />
|
||||
<DrawStatusBadge
|
||||
status={data.hall_preview_status}
|
||||
label={`大厅预览 · ${data.hall_preview_status}`}
|
||||
/>
|
||||
<CardContent className="grid gap-6 p-6 lg:grid-cols-[minmax(0,1.2fr)_minmax(0,0.8fr)]">
|
||||
<div className="space-y-4">
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
<Field label="业务日">{data.business_date}</Field>
|
||||
<Field label="流水序号">{data.sequence_no}</Field>
|
||||
<Field label="开始时间">{formatDt(data.start_time)}</Field>
|
||||
<Field label="封盘时间">{formatDt(data.close_time)}</Field>
|
||||
<Field label="计划开奖">{formatDt(data.draw_time)}</Field>
|
||||
<Field label="冷静期结束">{formatDt(data.cooling_end_time)}</Field>
|
||||
</div>
|
||||
<Separator />
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
<Field label="结果来源">{data.result_source ?? "—"}</Field>
|
||||
<Field label="当前结果版本">{data.current_result_version}</Field>
|
||||
<Field label="结算版本">{data.settle_version}</Field>
|
||||
<Field label="是否重开">{data.is_reopened ? "是" : "否"}</Field>
|
||||
</div>
|
||||
</div>
|
||||
<Separator />
|
||||
<div className="grid gap-4">
|
||||
<Field label="业务日">{data.business_date}</Field>
|
||||
<Field label="流水序号">{data.sequence_no}</Field>
|
||||
<Field label="开始时间">{formatDt(data.start_time)}</Field>
|
||||
<Field label="封盘时间">{formatDt(data.close_time)}</Field>
|
||||
<Field label="计划开奖">{formatDt(data.draw_time)}</Field>
|
||||
<Field label="冷静期结束">{formatDt(data.cooling_end_time)}</Field>
|
||||
<Field label="结果来源">{data.result_source ?? "—"}</Field>
|
||||
<Field label="当前结果版本">{data.current_result_version}</Field>
|
||||
<Field label="结算版本">{data.settle_version}</Field>
|
||||
<Field label="是否重开">{data.is_reopened ? "是" : "否"}</Field>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle className="text-base">批次统计</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="flex flex-col gap-4">
|
||||
<div className="flex flex-wrap gap-6 text-sm">
|
||||
<span>总批次:{data.result_batch_counts.total}</span>
|
||||
<span className="text-amber-600 dark:text-amber-400">
|
||||
待审核:{data.result_batch_counts.pending_review}
|
||||
</span>
|
||||
<span className="text-emerald-600 dark:text-emerald-400">
|
||||
已发布:{data.result_batch_counts.published}
|
||||
</span>
|
||||
<div className="rounded-xl border bg-muted/20 p-4">
|
||||
<p className="text-sm font-medium text-muted-foreground">批次统计</p>
|
||||
<div className="mt-3 grid gap-3 text-sm">
|
||||
<div className="flex items-center justify-between rounded-lg bg-background px-3 py-2">
|
||||
<span>总批次</span>
|
||||
<span className="font-semibold">{data.result_batch_counts.total}</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between rounded-lg bg-background px-3 py-2 text-amber-600 dark:text-amber-400">
|
||||
<span>待审核</span>
|
||||
<span className="font-semibold">{data.result_batch_counts.pending_review}</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between rounded-lg bg-background px-3 py-2 text-emerald-600 dark:text-emerald-400">
|
||||
<span>已发布</span>
|
||||
<span className="font-semibold">{data.result_batch_counts.published}</span>
|
||||
</div>
|
||||
</div>
|
||||
<Link
|
||||
href={`/admin/draws/${drawId}/finance`}
|
||||
className={cn(buttonVariants({ variant: "outline", size: "sm" }), "mt-4 w-full")}
|
||||
>
|
||||
查看期号收支
|
||||
</Link>
|
||||
</div>
|
||||
<Link
|
||||
href={`/admin/draws/${drawId}/finance`}
|
||||
className={cn(buttonVariants({ variant: "outline", size: "sm" }), "w-fit")}
|
||||
>
|
||||
期号收支(客服/财务)
|
||||
</Link>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
@@ -117,28 +117,22 @@ export function DrawsIndexConsole() {
|
||||
<CardContent className="space-y-4">
|
||||
{/* Grid:桌面端标签一行 / 控件一行,避免 flex+items-end 与各列实际高度不一致;移动端单列自上而下 */}
|
||||
<div
|
||||
className="
|
||||
grid max-w-full gap-x-6 gap-y-3
|
||||
[grid-template-areas:'dl'_'di'_'sl'_'si'_'act']
|
||||
sm:grid-cols-[minmax(0,12rem)_minmax(0,11rem)_auto]
|
||||
sm:gap-y-1.5
|
||||
sm:[grid-template-areas:'dl_sl_ah'_'di_si_act']
|
||||
"
|
||||
className="grid max-w-full gap-x-6 gap-y-3 sm:grid-cols-[minmax(0,12rem)_minmax(0,11rem)_auto] sm:gap-y-1.5"
|
||||
>
|
||||
<Label htmlFor="draw-filter-no" className="[grid-area:dl]">
|
||||
<Label htmlFor="draw-filter-no">
|
||||
期号
|
||||
</Label>
|
||||
<Input
|
||||
id="draw-filter-no"
|
||||
placeholder="模糊匹配期号"
|
||||
value={draftDrawNo}
|
||||
className="[grid-area:di] w-full min-w-0 sm:w-full"
|
||||
className="w-full min-w-0 sm:w-full"
|
||||
onChange={(e) => setDraftDrawNo(e.target.value)}
|
||||
/>
|
||||
<Label htmlFor="draw-filter-status" className="[grid-area:sl]">
|
||||
<Label htmlFor="draw-filter-status">
|
||||
状态
|
||||
</Label>
|
||||
<div className="[grid-area:si] min-w-0">
|
||||
<div className="min-w-0">
|
||||
<Select
|
||||
modal={false}
|
||||
value={
|
||||
@@ -164,13 +158,6 @@ export function DrawsIndexConsole() {
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<span
|
||||
className="[grid-area:ah] hidden select-none text-sm font-medium leading-none sm:block"
|
||||
aria-hidden
|
||||
>
|
||||
{/* 占位:与 Label 行同高,使按钮与输入控件同行对齐 */}
|
||||
|
||||
</span>
|
||||
<div className="[grid-area:act] flex flex-wrap gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
@@ -180,7 +167,7 @@ export function DrawsIndexConsole() {
|
||||
setPage(1);
|
||||
}}
|
||||
>
|
||||
查询
|
||||
查询期号
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
@@ -193,7 +180,7 @@ export function DrawsIndexConsole() {
|
||||
setPage(1);
|
||||
}}
|
||||
>
|
||||
重置筛选
|
||||
重置
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -240,7 +227,7 @@ export function DrawsIndexConsole() {
|
||||
href={`/admin/draws/${row.id}`}
|
||||
className={cn(buttonVariants({ variant: "outline", size: "sm" }))}
|
||||
>
|
||||
详情
|
||||
查看详情
|
||||
</Link>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export const drawsModuleMeta = {
|
||||
segment: "draws",
|
||||
title: "开奖",
|
||||
title: "期号列表",
|
||||
description: "",
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user