统一流量单位为 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
@@ -24,7 +24,7 @@ import { useNotification } from "@refinedev/core";
import { api } from "@/lib/api";
import { NETWORK_NAME, config } from "@config/config";
import { LeakageResultDetail, LeakageSchemeRecord } from "./types";
import { DMA_FLOW_DISPLAY_UNIT, toM3h } from "./utils";
import { FLOW_DISPLAY_UNIT, toM3h } from "./utils";
interface Props {
onViewResult: (result: LeakageResultDetail) => void;
@@ -210,7 +210,7 @@ const SchemeQuery: React.FC<Props> = ({ onViewResult }) => {
const value = Number((scheme.scheme_detail as any)?.result_summary?.max_leakage);
const maxLeakageM3h = toM3h(value, "m3/s");
return Number.isFinite(maxLeakageM3h)
? `${maxLeakageM3h.toFixed(3)} ${DMA_FLOW_DISPLAY_UNIT}`
? `${maxLeakageM3h.toFixed(3)} ${FLOW_DISPLAY_UNIT}`
: "-";
})()}
</Typography>
@@ -227,7 +227,7 @@ const SchemeQuery: React.FC<Props> = ({ onViewResult }) => {
);
const qSumM3h = toM3h(value, unit);
return Number.isFinite(qSumM3h)
? `${qSumM3h.toFixed(3)} ${DMA_FLOW_DISPLAY_UNIT}`
? `${qSumM3h.toFixed(3)} ${FLOW_DISPLAY_UNIT}`
: "-";
})()}
</Typography>