refactor(energy): 电能整体页面对齐氢能:每日 / 总览 子 tab 切换
ci/woodpecker/push/woodpecker Pipeline was successful

- ElectricView 改为受控组件接收 sub prop(与 HydrogenView 对齐)
- EnergyModule sticky 头部统一显示 sub-tabs:氢能、电能都给 每日 / 总览
  ETC 仍不显示子 tab(建设中页)
- 共享 sub state 抽 helper:activeTab 切换时自动用对应的 sub
- 龙王路停车场充电站信息条移入 ElectricOverview 顶部(同氢能"数据自...")

进入电能默认显示「每日」(与氢能一致),切换「总览」看 KPI + 柱图

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
kkfluous
2026-04-30 15:22:02 +08:00
co-authored by Claude Opus 4.7
parent c3b463d9ca
commit fe70ec389b
3 changed files with 25 additions and 19 deletions
+8 -10
View File
@@ -1,14 +1,12 @@
import ElectricOverview from './ElectricOverview';
import ElectricDaily from './ElectricDaily';
export default function ElectricView() {
return (
<>
<div className="bg-white rounded-xl border border-slate-100 px-3 py-1.5 text-[11px] text-slate-400">
2025-01-01
</div>
<ElectricOverview />
<ElectricDaily />
</>
);
export type ElectricSubTab = 'daily' | 'overview';
interface Props {
sub: ElectricSubTab;
}
export default function ElectricView({ sub }: Props) {
return sub === 'overview' ? <ElectricOverview /> : <ElectricDaily />;
}