"use client" import {useState} from "react" import {Button, Card, Col, Row, Select, Slider, Space, Switch, Tag} from "antd" import {FullscreenOutlined, ReloadOutlined} from "@ant-design/icons" import dynamic from "next/dynamic" const GasNetworkMap = dynamic(() => import("./gas-network-map"), { ssr: false, loading: () =>
加载地图中...
, }) const { Option } = Select // 模拟实时监测数据点 const mockMonitoringPoints = [ { id: "MP001", name: "解放路监���点", position: [39.9042, 116.4074], type: "pressure", value: 0.42, unit: "MPa", status: "normal", lastUpdate: "2024-01-15 14:30:25", }, { id: "MP002", name: "人民路监测点", position: [39.9052, 116.4084], type: "flow", value: 2850, unit: "m³/h", status: "normal", lastUpdate: "2024-01-15 14:30:20", }, { id: "MP003", name: "建设路监测点", position: [39.9032, 116.4064], type: "temperature", value: 18.5, unit: "°C", status: "normal", lastUpdate: "2024-01-15 14:30:15", }, { id: "MP004", name: "泄漏检测点", position: [39.9062, 116.4094], type: "leakage", value: 0.02, unit: "ppm", status: "warning", lastUpdate: "2024-01-15 14:30:30", }, ] export default function MonitoringVisualization() { const [layerVisibility, setLayerVisibility] = useState({ pipeline: true, pressure: true, flow: true, temperature: true, leakage: true, devices: true, }) const [selectedTimeRange, setSelectedTimeRange] = useState("realtime") const [dataRefreshInterval, setDataRefreshInterval] = useState(5) const [isFullscreen, setIsFullscreen] = useState(false) const handleLayerToggle = (layer: string, visible: boolean) => { setLayerVisibility((prev) => ({ ...prev, [layer]: visible, })) } const handleRefresh = () => { // 刷新数据逻辑 console.log("刷新监测数据") } const getStatusColor = (status: string) => { switch (status) { case "normal": return "#52c41a" case "warning": return "#faad14" case "danger": return "#f5222d" default: return "#1890ff" } } const getTypeLabel = (type: string) => { const typeMap = { pressure: "压力", flow: "流量", temperature: "温度", leakage: "泄漏", } return typeMap[type as keyof typeof typeMap] || type } return (
{/* 控制面板 */}
handleLayerToggle("pipeline", checked)} size="small" /> 管网管线
handleLayerToggle("pressure", checked)} size="small" /> 压力监测
handleLayerToggle("flow", checked)} size="small" /> 流量监测
handleLayerToggle("temperature", checked)} size="small" /> 温度监测
handleLayerToggle("leakage", checked)} size="small" /> 泄漏检测
handleLayerToggle("devices", checked)} size="small" /> 监测设备
{dataRefreshInterval}秒
正常: 3
预警: 1
异常: 0
{/* 地图展示 */}
{mockMonitoringPoints.map((point) => (
{point.name} {point.status === "normal" ? "正常" : point.status === "warning" ? "预警" : "异常"}
类型: {getTypeLabel(point.type)}
当前值: {point.value} {point.unit}
更新时间: {point.lastUpdate}
))}
监测点总数: 342
在线设备: 298
离线设备: 12
维护中: 32
数据更新率: 98.5%
) }