diff --git a/frontend/src/pages/admin/AdminDashboard.tsx b/frontend/src/pages/admin/AdminDashboard.tsx index 26f4843..d161adc 100644 --- a/frontend/src/pages/admin/AdminDashboard.tsx +++ b/frontend/src/pages/admin/AdminDashboard.tsx @@ -30,10 +30,11 @@ function rangeToParams(key: DateRangeKey, customRange: [Dayjs, Dayjs] | null) { return { since: since.toISOString() }; } -// ─── 进度条 ─────────────────────────────────────────────── -function ProgressBar({ a, b, c, total, labels }: { +// ─── 进度条(支持3或4段) ───────────────────────────────── +function ProgressBar({ a, b, c, total, labels, d }: { a: number; b: number; c: number; total: number; labels: [string, string, string]; + d?: number; }) { if (total === 0) return
暂无数据
; const pct = (n: number) => Math.round((n / total) * 100); @@ -41,6 +42,7 @@ function ProgressBar({ a, b, c, total, labels }: { { n: a, color: "bg-amber-400", label: labels[0] }, { n: b, color: "bg-blue-500", label: labels[1] }, { n: c, color: "bg-emerald-500", label: labels[2] }, + ...(d !== undefined ? [{ n: d, color: "bg-red-400", label: "已驳回" }] : []), ].filter(s => s.n > 0); return (
@@ -87,10 +89,10 @@ function WipRow({ t }: { t: WipTask }) {
{t.task_name} + {t.product_sn} {t.assignee}
- {t.product_sn} {t.received_at && 接收: {t.received_at}}
@@ -282,7 +284,7 @@ export default function AdminDashboard() {

{stats.tasks_total}

PENDING/WIP 实时 | COMPLETED 按时段

+ total={stats.tasks_total} labels={["待接收", "进行中", "已完成"]} d={stats.tasks_rejected} />
{/* 品质 & 留言 */}