From d1acdafa7ee25077547ac002e336d73fa5a00a85 Mon Sep 17 00:00:00 2001 From: kkfluous Date: Wed, 29 Apr 2026 09:04:26 +0800 Subject: [PATCH] refactor(energy): merge electric overview into a single page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop the 每日/总览 sub-tabs on 电能 — only 龙王路充电站 in scope, so the overview is light (3 KPI cards + 1 bar chart) and combining saves a click for daily ops. ElectricView now renders ElectricOverview + ElectricDaily back-to-back below the hint card. 氢能 keeps its sub-tabs (richer overview with Top5 + region chart). Co-Authored-By: Claude Opus 4.7 (1M context) --- src/modules/energy/ElectricView.tsx | 30 ++--------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/src/modules/energy/ElectricView.tsx b/src/modules/energy/ElectricView.tsx index e3732c0..1592243 100644 --- a/src/modules/energy/ElectricView.tsx +++ b/src/modules/energy/ElectricView.tsx @@ -1,40 +1,14 @@ -import { useState } from 'react'; -import { LayoutDashboard, CalendarDays } from 'lucide-react'; import ElectricOverview from './ElectricOverview'; import ElectricDaily from './ElectricDaily'; -type SubTab = 'daily' | 'overview'; - -const SUB_TABS: Array<{ id: SubTab; label: string; icon: typeof LayoutDashboard }> = [ - { id: 'daily', label: '每日', icon: CalendarDays }, - { id: 'overview', label: '总览', icon: LayoutDashboard }, -]; - export default function ElectricView() { - const [sub, setSub] = useState('daily'); return ( <> -
- {SUB_TABS.map(({ id, label, icon: Icon }) => { - const active = sub === id; - return ( - - ); - })} -
龙王路停车场充电站,期初 2025-01-01,手工导入每日更新
- {sub === 'overview' ? : } + + ); }