新增单位水头损失计算属性分级
This commit is contained in:
@@ -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] || "";
|
||||
|
||||
Reference in New Issue
Block a user