@@ -140,3 +163,11 @@ export function FeatureInsightPanel({ feature, onClose }: FeatureInsightPanelPro
);
}
+
+function getScadaPresentation(rawTypeId: unknown) {
+ const typeId = Number(rawTypeId);
+ if (typeId === 72) return { iconPath: SCADA_ICON_PATHS.waterQuality, sectionClassName: "border-teal-200 bg-teal-50/70", labelClassName: "text-teal-800" };
+ if (typeId === 58) return { iconPath: SCADA_ICON_PATHS.radarLevel, sectionClassName: "border-blue-200 bg-blue-50/70", labelClassName: "text-blue-800" };
+ if (typeId === 45) return { iconPath: SCADA_ICON_PATHS.ultrasonicFlow, sectionClassName: "border-orange-200 bg-orange-50/70", labelClassName: "text-orange-800" };
+ return { iconPath: SCADA_ICON_PATHS.unknown, sectionClassName: "border-slate-200 bg-slate-50", labelClassName: "text-slate-800" };
+}
diff --git a/features/workbench/components/feature-popover.tsx b/features/workbench/components/feature-popover.tsx
index 567930b..99273e5 100644
--- a/features/workbench/components/feature-popover.tsx
+++ b/features/workbench/components/feature-popover.tsx
@@ -3,19 +3,22 @@
import {
Check,
Copy,
+ Database,
+ MapPin,
+ Radio,
X
} from "lucide-react";
+import Image from "next/image";
import type { ComponentType } from "react";
import { useEffect, useRef, useState } from "react";
-import {
- MAP_ICON_CELL_RADIUS_CLASS_NAME,
- MAP_MAJOR_PANEL_RADIUS_CLASS_NAME
-} from "@/features/map/core/components/map-control-styles";
+import { MAP_MAJOR_PANEL_RADIUS_CLASS_NAME } from "@/features/map/core/components/map-control-styles";
import { showMapNotice } from "@/features/map/core/components/notice";
import { cn } from "@/lib/utils";
+import { SCADA_ICON_PATHS } from "../map/scada";
import type { WaterNetworkSourceId } from "../map/sources";
import type { DetailFeature } from "../types";
import {
+ formatFeaturePropertyValue,
getFeaturePanelModel,
type FeaturePanelBadgeTone
} from "../utils/feature-properties";
@@ -35,13 +38,20 @@ type FeaturePopoverProps = {
const FEATURE_LAYER_META: Record<
WaterNetworkSourceId,
- { icon: ComponentType
; label: string }
+ {
+ icon: ComponentType;
+ label: string;
+ headerClassName: string;
+ labelClassName: string;
+ iconClassName: string;
+ }
> = {
- conduits: { icon: ConduitFeatureIcon, label: "管渠" },
- junctions: { icon: JunctionFeatureIcon, label: "检查井" },
- orifices: { icon: OrificeFeatureIcon, label: "孔口" },
- outfalls: { icon: OutfallFeatureIcon, label: "排放口" },
- pumps: { icon: PumpFeatureIcon, label: "泵" }
+ conduits: { icon: ConduitFeatureIcon, label: "管渠", headerClassName: "bg-teal-50", labelClassName: "text-teal-700", iconClassName: "bg-teal-700 text-white ring-teal-900/10" },
+ junctions: { icon: JunctionFeatureIcon, label: "检查井", headerClassName: "bg-sky-50", labelClassName: "text-sky-700", iconClassName: "bg-sky-700 text-white ring-sky-900/10" },
+ orifices: { icon: OrificeFeatureIcon, label: "孔口", headerClassName: "bg-slate-100", labelClassName: "text-slate-700", iconClassName: "bg-slate-600 text-white ring-slate-900/10" },
+ outfalls: { icon: OutfallFeatureIcon, label: "排放口", headerClassName: "bg-blue-50", labelClassName: "text-blue-800", iconClassName: "bg-slate-700 text-white ring-slate-900/10" },
+ pumps: { icon: PumpFeatureIcon, label: "泵", headerClassName: "bg-cyan-50", labelClassName: "text-cyan-800", iconClassName: "bg-cyan-800 text-white ring-cyan-950/10" },
+ scada: { icon: JunctionFeatureIcon, label: "SCADA 测点", headerClassName: "bg-blue-50", labelClassName: "text-blue-700", iconClassName: "bg-blue-700 text-white ring-blue-900/10" }
};
const BADGE_CLASS_NAMES: Record = {
@@ -103,106 +113,81 @@ export function FeaturePopover({ feature, onClose }: FeaturePopoverProps) {
}
};
+ if (feature.layer === "scada") {
+ return (
+ void handleCopyId()}
+ onClose={onClose}
+ />
+ );
+ }
+
return (