diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx index 8a000636..f6b5209d 100644 --- a/frontend/src/pages/Dashboard.tsx +++ b/frontend/src/pages/Dashboard.tsx @@ -10,10 +10,10 @@ const DASHBOARD_PREVIEW_COUNT = 5; const DASHBOARD_HISTORY_PREVIEW_COUNT = 3; const baseStats = [ - { name: "本月新增商机", metricKey: "monthlyOpportunities", icon: TrendingUp, color: "text-emerald-600 dark:text-emerald-400", bg: "bg-emerald-100 dark:bg-emerald-500/20", mobileVariant: "hero" }, - { name: "本月已签单商机金额", metricKey: "monthlyWonOpportunities", icon: BarChart3, color: "text-amber-600 dark:text-amber-400", bg: "bg-amber-100 dark:bg-amber-500/20", mobileVariant: "hero" }, - { name: "已推送OMS项目", metricKey: "pushedOmsProjects", icon: Users, color: "text-blue-600 dark:text-blue-400", bg: "bg-blue-100 dark:bg-blue-500/20", mobileVariant: "compact" }, - { name: "本月新增渠道", metricKey: "monthlyChannels", icon: Building2, color: "text-violet-600 dark:text-violet-400", bg: "bg-violet-100 dark:bg-violet-500/20", mobileVariant: "compact" }, + { name: "本月新增商机", metricKey: "monthlyOpportunities", icon: TrendingUp, color: "text-emerald-600 dark:text-emerald-400", bg: "bg-emerald-100 dark:bg-emerald-500/20" }, + { name: "本月已签单商机金额", metricKey: "monthlyWonOpportunities", icon: BarChart3, color: "text-amber-600 dark:text-amber-400", bg: "bg-amber-100 dark:bg-amber-500/20" }, + { name: "已推送OMS项目", metricKey: "pushedOmsProjects", icon: Users, color: "text-blue-600 dark:text-blue-400", bg: "bg-blue-100 dark:bg-blue-500/20" }, + { name: "本月新增渠道", metricKey: "monthlyChannels", icon: Building2, color: "text-violet-600 dark:text-violet-400", bg: "bg-violet-100 dark:bg-violet-500/20" }, ] as const; const statRoutes: Record<(typeof baseStats)[number]["metricKey"], { pathname: string; state?: { tab: "sales" | "channel" } }> = { @@ -44,11 +44,15 @@ function formatStatDisplay(metricKey: (typeof baseStats)[number]["metricKey"], v }; } -function getMobileStatCardClass(mobileVariant: (typeof baseStats)[number]["mobileVariant"]) { - if (mobileVariant === "hero") { - return "col-span-2 min-h-[116px]"; +function getStatValueClass(valueText: string) { + const length = valueText.length; + if (length >= 8) { + return "text-[17px] min-[380px]:text-[18px] min-[430px]:text-[20px] min-[520px]:text-[28px]"; } - return "col-span-1 min-h-[104px]"; + if (length >= 7) { + return "text-[18px] min-[380px]:text-[20px] min-[430px]:text-[22px] min-[520px]:text-[30px]"; + } + return "text-[20px] min-[380px]:text-[22px] min-[430px]:text-[24px] min-[520px]:text-[34px]"; } export default function Dashboard() { @@ -177,8 +181,7 @@ export default function Dashboard() {
+
{stat.name}
+
{display.value}