后端获取的数据转换漏损量单位为 m³/h,优化数据展示
This commit is contained in:
@@ -29,7 +29,7 @@ import VectorSource from "ol/source/Vector";
|
|||||||
import { Stroke, Style, Circle, Fill } from "ol/style";
|
import { Stroke, Style, Circle, Fill } from "ol/style";
|
||||||
import { bbox, featureCollection } from "@turf/turf";
|
import { bbox, featureCollection } from "@turf/turf";
|
||||||
import { BurstCandidate, BurstLocationResult } from "./types";
|
import { BurstCandidate, BurstLocationResult } from "./types";
|
||||||
import { FLOW_DISPLAY_UNIT } from "@utils/units";
|
import { FLOW_DISPLAY_UNIT, toM3h } from "@utils/units";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
result: BurstLocationResult | null;
|
result: BurstLocationResult | null;
|
||||||
@@ -272,7 +272,7 @@ const LocationResults: React.FC<Props> = ({ result }) => {
|
|||||||
/>
|
/>
|
||||||
<MetricCard
|
<MetricCard
|
||||||
label="估计漏损量"
|
label="估计漏损量"
|
||||||
value={`${result.burst_leakage.toFixed(2)} ${FLOW_DISPLAY_UNIT}`}
|
value={`${toM3h(result.burst_leakage, "m³/s").toFixed(2)} ${FLOW_DISPLAY_UNIT}`}
|
||||||
tone="orange"
|
tone="orange"
|
||||||
/>
|
/>
|
||||||
<MetricCard
|
<MetricCard
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import {
|
|||||||
BurstLocationSchemeDetail,
|
BurstLocationSchemeDetail,
|
||||||
BurstSchemeRecord,
|
BurstSchemeRecord,
|
||||||
} from "./types";
|
} from "./types";
|
||||||
import { FLOW_DISPLAY_UNIT } from "@utils/units";
|
import { FLOW_DISPLAY_UNIT, toM3h } from "@utils/units";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
onViewResult: (result: BurstLocationResult) => void;
|
onViewResult: (result: BurstLocationResult) => void;
|
||||||
@@ -302,7 +302,7 @@ const SchemeQuery: React.FC<Props> = ({ onViewResult }) => {
|
|||||||
漏损量:
|
漏损量:
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="caption" className="font-medium text-gray-900">
|
<Typography variant="caption" className="font-medium text-gray-900">
|
||||||
{typeof leakage === "number" ? `${leakage} ${FLOW_DISPLAY_UNIT}` : "-"}
|
{typeof leakage === "number" ? `${toM3h(leakage, "m³/s")} ${FLOW_DISPLAY_UNIT}` : "-"}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Box className="grid grid-cols-[78px_1fr] items-center gap-x-2">
|
<Box className="grid grid-cols-[78px_1fr] items-center gap-x-2">
|
||||||
|
|||||||
Reference in New Issue
Block a user