统一流量单位为 m³/h,优化相关组件

This commit is contained in:
JIANG
2026-03-07 17:21:01 +08:00
parent 6b68b7d081
commit ddb02cc688
10 changed files with 61 additions and 35 deletions
@@ -13,7 +13,7 @@ import {
} from "@mui/material";
import { FormatListBulleted } from "@mui/icons-material";
import dayjs from "dayjs";
import { DMA_FLOW_DISPLAY_UNIT, getAreaColor, toM3h } from "./utils";
import { FLOW_DISPLAY_UNIT, getAreaColor, toM3h } from "./utils";
import { LeakageResultDetail } from "./types";
interface Props {
@@ -131,7 +131,7 @@ const RecognitionResults: React.FC<Props> = ({ result }) => {
);
const qSumM3h = toM3h(Number(val), unit);
return Number.isFinite(qSumM3h)
? `${qSumM3h.toFixed(3)} ${DMA_FLOW_DISPLAY_UNIT}`
? `${qSumM3h.toFixed(3)} ${FLOW_DISPLAY_UNIT}`
: "-";
})()}
</Typography>
@@ -167,7 +167,7 @@ const RecognitionResults: React.FC<Props> = ({ result }) => {
?.max_leakage;
const maxLeakageM3h = toM3h(Number(maxL), "m3/s");
return Number.isFinite(maxLeakageM3h)
? `${maxLeakageM3h.toFixed(3)} ${DMA_FLOW_DISPLAY_UNIT}`
? `${maxLeakageM3h.toFixed(3)} ${FLOW_DISPLAY_UNIT}`
: "-";
})()}
</Typography>
@@ -215,7 +215,7 @@ const RecognitionResults: React.FC<Props> = ({ result }) => {
align="right"
sx={{ fontWeight: 600, color: "#64748b", py: 1.5, pr: 3 }}
>
({DMA_FLOW_DISPLAY_UNIT})
({FLOW_DISPLAY_UNIT})
</TableCell>
</TableRow>
</TableHead>