新增单位水头损失计算属性分级

This commit is contained in:
JIANG
2025-12-30 18:00:33 +08:00
parent fb35bcdf44
commit 142a9b888d
3 changed files with 43 additions and 7 deletions
+10 -1
View File
@@ -566,6 +566,7 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
data.set(featureId, {
id: featureId,
diameter: props.diameter || 0,
length: props.length || 0,
path: lineCoordsWGS84, // 使用重建后的坐标
position: midPoint,
angle: lineAngle,
@@ -833,13 +834,21 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
let idPart = showPipeId ? d.id : "";
let propPart = "";
if (showPipeTextLayer && d[pipeText] !== undefined) {
const value = Math.abs(d[pipeText] as number).toFixed(3);
let value;
if (pipeText === "unit_headloss") {
value = (
(d["unit_headloss"] / (d["length"] / 1000)) as number
).toFixed(3);
} else {
value = Math.abs(d[pipeText] as number).toFixed(3);
}
// 根据属性类型添加符号前缀
const prefix =
{
flow: "F:",
velocity: "V:",
headloss: "HL:",
unit_headloss: "UHL:",
diameter: "D:",
friction: "FR:",
}[pipeText] || "";