更新遗传算法默认参数;更新漏损流量单位为m3/h
This commit is contained in:
@@ -24,6 +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";
|
||||
|
||||
interface Props {
|
||||
onViewResult: (result: LeakageResultDetail) => void;
|
||||
@@ -207,7 +208,10 @@ const SchemeQuery: React.FC<Props> = ({ onViewResult }) => {
|
||||
<Typography variant="caption" className="font-medium text-gray-900">
|
||||
{(() => {
|
||||
const value = Number((scheme.scheme_detail as any)?.result_summary?.max_leakage);
|
||||
return Number.isFinite(value) ? `${value.toFixed(3)} m3/s` : "-";
|
||||
const maxLeakageM3h = toM3h(value, "m3/s");
|
||||
return Number.isFinite(maxLeakageM3h)
|
||||
? `${maxLeakageM3h.toFixed(3)} ${DMA_FLOW_DISPLAY_UNIT}`
|
||||
: "-";
|
||||
})()}
|
||||
</Typography>
|
||||
</Box>
|
||||
@@ -218,8 +222,13 @@ const SchemeQuery: React.FC<Props> = ({ onViewResult }) => {
|
||||
<Typography variant="caption" className="font-medium text-gray-900">
|
||||
{(() => {
|
||||
const value = Number((scheme.scheme_detail as any)?.algorithm_params?.q_sum);
|
||||
const unit = String((scheme.scheme_detail as any)?.algorithm_params?.q_sum_unit || "m3/s");
|
||||
return Number.isFinite(value) ? `${value.toFixed(3)} ${unit}` : "-";
|
||||
const unit = String(
|
||||
(scheme.scheme_detail as any)?.algorithm_params?.q_sum_unit || "m3/s",
|
||||
);
|
||||
const qSumM3h = toM3h(value, unit);
|
||||
return Number.isFinite(qSumM3h)
|
||||
? `${qSumM3h.toFixed(3)} ${DMA_FLOW_DISPLAY_UNIT}`
|
||||
: "-";
|
||||
})()}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user