From 004a8e4a6bad7850202fbf47bb5b4d19249c3a5e Mon Sep 17 00:00:00 2001 From: chpark Date: Fri, 8 May 2026 14:15:38 +0900 Subject: [PATCH] =?UTF-8?q?feat(dashboard):=20=EC=B9=B4=EB=93=9C=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=20=E2=86=92=20=ED=95=B4=EB=8B=B9=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=EB=A1=9C=20=EC=A6=89=EC=8B=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 관리자: 승인 대기 → /m/admin/orders?status=REQUESTED, 오늘/이번달 → /m/admin/orders, 미수금 → /m/admin/payments - 사용자: 대기중 → /m/orders?status=REQUESTED, 진행중 → ?status=APPROVED, 미수금/누적 → /m/orders - orders 페이지가 ?status= 쿼리로 초기 필터 자동 적용 Co-Authored-By: Claude Opus 4.7 (1M context) --- src/app/(main)/m/admin/orders/page.tsx | 5 ++++- src/app/(main)/m/dashboard/page.tsx | 29 +++++++++++++++----------- src/app/(main)/m/orders/page.tsx | 5 ++++- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/app/(main)/m/admin/orders/page.tsx b/src/app/(main)/m/admin/orders/page.tsx index f678ee6..8a5536f 100644 --- a/src/app/(main)/m/admin/orders/page.tsx +++ b/src/app/(main)/m/admin/orders/page.tsx @@ -51,7 +51,10 @@ const STATUS_COLOR: Record = { export default function AdminOrdersPage() { const [orders, setOrders] = useState([]); - const [status, setStatus] = useState(""); + const [status, setStatus] = useState(() => { + if (typeof window === "undefined") return ""; + return new URLSearchParams(window.location.search).get("status") ?? ""; + }); const [selected, setSelected] = useState>(new Set()); const [activeId, setActiveId] = useState(""); const [detail, setDetail] = useState<{ order: DetailOrder; items: DetailLine[]; supplier: Supplier } | null>(null); diff --git a/src/app/(main)/m/dashboard/page.tsx b/src/app/(main)/m/dashboard/page.tsx index 02d02c3..e1c2f22 100644 --- a/src/app/(main)/m/dashboard/page.tsx +++ b/src/app/(main)/m/dashboard/page.tsx @@ -51,10 +51,10 @@ export default function MomoDashboard() {

발주 현황과 매출을 한눈에 확인하세요.

- - - - + + + +
새 발주 요청 @@ -88,10 +88,10 @@ export default function MomoDashboard() {

전체 발주 · 매출 · 재고 현황입니다.

- } /> - } /> - } /> - } /> + } href="/m/admin/orders?status=REQUESTED" /> + } href="/m/admin/orders" /> + } href="/m/admin/orders" /> + } href="/m/admin/payments" />
@@ -139,15 +139,15 @@ export default function MomoDashboard() { ); } -function Card({ title, value, suffix, prefix, tone, icon }: { title: string; value: number | string; suffix?: string; prefix?: string; tone: "amber" | "blue" | "emerald" | "rose"; icon?: React.ReactNode }) { +function Card({ title, value, suffix, prefix, tone, icon, href }: { title: string; value: number | string; suffix?: string; prefix?: string; tone: "amber" | "blue" | "emerald" | "rose"; icon?: React.ReactNode; href?: string }) { const toneCls = { amber: "from-amber-50 to-amber-100 text-amber-800 border-amber-200", blue: "from-blue-50 to-blue-100 text-blue-800 border-blue-200", emerald: "from-emerald-50 to-emerald-100 text-emerald-800 border-emerald-200", rose: "from-rose-50 to-rose-100 text-rose-800 border-rose-200", }[tone]; - return ( -
+ const inner = ( + <>
{title}
{icon} @@ -155,8 +155,13 @@ function Card({ title, value, suffix, prefix, tone, icon }: { title: string; val
{prefix}{value}{suffix && {suffix}}
-
+ ); + const className = `rounded-xl border bg-gradient-to-br ${toneCls} p-5 ${href ? "cursor-pointer hover:-translate-y-0.5 hover:shadow-md transition" : ""}`; + if (href) { + return {inner}; + } + return
{inner}
; } function Section({ title, children, linkHref, linkLabel }: { title: string; children: React.ReactNode; linkHref?: string; linkLabel?: string }) { diff --git a/src/app/(main)/m/orders/page.tsx b/src/app/(main)/m/orders/page.tsx index c752a63..059ab97 100644 --- a/src/app/(main)/m/orders/page.tsx +++ b/src/app/(main)/m/orders/page.tsx @@ -45,7 +45,10 @@ const STATUS_COLOR: Record = { export default function MyOrdersPage() { const [orders, setOrders] = useState([]); - const [status, setStatus] = useState(""); + const [status, setStatus] = useState(() => { + if (typeof window === "undefined") return ""; + return new URLSearchParams(window.location.search).get("status") ?? ""; + }); const [detail, setDetail] = useState<{ order: Order & { CEO_NAME?: string; BIZ_NO?: string; PHONE?: string; ADDRESS?: string; EMAIL?: string; MEMO?: string }; items: DetailLine[]; supplier: Supplier } | null>(null); const load = async () => {