From 2a10c5ae31a844716f1b2c035940f0336a3fff96 Mon Sep 17 00:00:00 2001 From: kkfluous Date: Wed, 1 Apr 2026 21:36:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E7=A7=BB=E5=8A=A8=E7=AB=AF=E9=80=82=E5=B1=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Shell main 添加 min-w-0 overflow-x-hidden 防止 flex 子元素溢出 - trend API 排除当天数据 (stat_date < CURDATE()),只返回前7天 - StatisticsView 移除移动端 overflow-hidden,改为仅 landscape 模式 - 图表和列表卡片在移动端正确显示全宽内容 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/Shell.tsx | 2 +- src/modules/mileage/StatisticsView.tsx | 6 +++--- src/server/routes/mileage.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Shell.tsx b/src/components/Shell.tsx index 5951931..889f87b 100644 --- a/src/components/Shell.tsx +++ b/src/components/Shell.tsx @@ -58,7 +58,7 @@ export function Shell({ modules }: { modules: ModuleConfig[] }) { {/* 内容区 */} -
+
{ActiveComponent && }
diff --git a/src/modules/mileage/StatisticsView.tsx b/src/modules/mileage/StatisticsView.tsx index 04d7972..095aba5 100644 --- a/src/modules/mileage/StatisticsView.tsx +++ b/src/modules/mileage/StatisticsView.tsx @@ -75,9 +75,9 @@ export default function StatisticsView() { ))} -
+
{/* Left Side: Trend Chart / Dashboard Sidebar */} -
+
{/* KPI Cards in Landscape */}
@@ -180,7 +180,7 @@ export default function StatisticsView() {
{/* Right Side: Summary Section */} -
+
diff --git a/src/server/routes/mileage.ts b/src/server/routes/mileage.ts index ef58383..0cb1df5 100644 --- a/src/server/routes/mileage.ts +++ b/src/server/routes/mileage.ts @@ -202,7 +202,7 @@ app.get('/trend', async (c) => { let sql = ` SELECT DATE_FORMAT(stat_date, '%m-%d') as date, SUM(daily_km) as mileage FROM v_vehicle_daily_stats - WHERE stat_date >= DATE_SUB(CURDATE(), INTERVAL ? DAY) + WHERE stat_date >= DATE_SUB(CURDATE(), INTERVAL ? DAY) AND stat_date < CURDATE() `; const params: any[] = [days];