Skip to content

feat(web): 分项能耗 joins 能耗分析 as 用电去向 - #567

Merged
SwayingWindmill merged 3 commits into
mainfrom
feat/energy-page
Oct 16, 2026
Merged

SwayingWindmill merged 3 commits into
mainfrom
feat/energy-page

Conversation

@SwayingWindmill

Copy link
Copy Markdown
Owner

Summary

 能源
   能耗分析   /energy-analysis/consumption?period&metric&view=trend|tou|detail
-  分项能耗   /energy-analysis/breakdown
   用电负荷
<ConsumptionWorkspace>
  header: period (今日/近 7 天/本月/本年) · refresh · export (detail + machines)
  <PeriodChart>                 unchanged: 用电 / 供冷量 / 综合能效 / 估算电费
  <EnergyDestination>           用电去向: Sankey | 设备用电 table (5 cols)   ← features/breakdown
  <Tabs> 分项趋势 <CategoryTrend> · 分时电费 <TouCostDetail> · 明细 <DetailTable>

Both pages read the same period of electricity with the same switch, compare and export; one answered how much and what it cost, the other where it went. useEnergyBreakdown now accepts year (monthly buckets). Subtitles state what each page answers: 能耗分析「用了多少电、用在哪台设备、花了多少钱」, 用电负荷「空调总电表现在的负荷、最高负荷和接下来的预测」.

Evidence

  • typecheck passes; web:shell:test 40, web:model:test 113, web:e2e 56 passed.
  • breakdown.spec.ts folded into consumption.spec.ts: flow caption, machine rows, unallocated, trend chart, two hourly device reads, a monthly split for 本年, unmetered machine; TOU and detail assertions now open their tabs.
  • 1440 px check with Songyaxuan data on the server before merge.

Merge Danger

Door: two-way — frontend only.

Blast Radius: /energy-analysis/breakdown 404s (no redirect); sidebar loses one item.

Both pages read the same period of HVAC electricity with the same period
switch, compare and export; one asked how much and what it cost, the other
where it went, and an operator checking a high day had to pick the period
again on the second page. 能耗分析 now shows the flow and each machine's
energy under the period chart, with the category trend, the TOU cost and
the detail table as tabs. The year view splits by month too; the export
appends the machines. Page subtitles say what 能耗分析 and 用电负荷 each
answer. The breakdown route is removed.
…ded current bars

Every search-only navigation (a tab, a period, a metric, a side sheet)
reset the window to the top, because the router resets scroll on every
navigation; the router now resets it only when the page changes. On the
energy page the flow and the machines' table sat side by side and the
table needed a horizontal scrollbar at 1440 px, so the flow is above it
again. The period chart's current bars are stacked with the running
bucket and lost their rounded top while the comparison bars kept theirs.
@SwayingWindmill
SwayingWindmill merged commit 23a96db into main Oct 16, 2026
8 checks passed
@SwayingWindmill
SwayingWindmill deleted the feat/energy-page branch October 16, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant