feat: extend agent-driven map workbench

This commit is contained in:
2026-07-20 19:57:35 +08:00
parent 86e9b08235
commit 7fbd8a5618
63 changed files with 4506 additions and 457 deletions
+3 -5
View File
@@ -3,12 +3,10 @@ import type { DetailFeature } from "../types";
import { formatValue } from "../utils/format-value";
import { SOURCE_LAYERS, type WaterNetworkSourceId } from "./sources";
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
export function getFeatureId(feature: MapGeoJSONFeature) {
const layer = getWaterNetworkSourceId(feature);
const raw = layer === "scada"
? feature.properties?.scada_id ?? (typeof feature.id === "string" && UUID_PATTERN.test(feature.id) ? feature.id : undefined)
? feature.properties?.sensor_id ?? feature.id
: feature.id ?? feature.properties?.id;
return raw === undefined || raw === null ? "" : String(raw);
@@ -72,8 +70,8 @@ function getFeaturePresentation(
};
case "scada":
return {
title: String(properties.name || `SCADA 测点 ${displayId}`),
subtitle: `${formatValue(properties.kind)} · 设备 ${formatValue(properties.external_id)}`
title: String(properties.sensor_name || `综合监测点 ${displayId}`),
subtitle: `综合监测点 · SWMM 节点 ${formatValue(properties.swmm_node)}`
};
}
}