"use client" import {useState} from "react" import dynamic from "next/dynamic" import { Alert, Badge, Button, Card, Col, DatePicker, Form, Input, Modal, Row, Select, Space, Statistic, Table, Tabs, Upload, } from "antd" import {EditOutlined, ExportOutlined, EyeOutlined, SearchOutlined, UploadOutlined} from "@ant-design/icons" import globalMessage from "@/app/_modules/globalMessage"; const MapView = dynamic(() => import("./MapView"), { ssr: false, loading: () =>
地图加载中...
, }) const { Option } = Select const { RangePicker } = DatePicker const { TabPane } = Tabs const { TextArea } = Input export default function AlarmPanel() { const [selectedTab, setSelectedTab] = useState("current-alarms") const [modalVisible, setModalVisible] = useState(false) const [selectedAlarm, setSelectedAlarm] = useState(null) // 模拟报警数据 const alarmData = [ { key: "1", id: "AL001", time: "2024-01-15 14:25:30", device: "LV002", deviceName: "人民路积水点液位计", location: "人民路与南京路交叉口", level: "高", type: "液位超限", currentValue: "0.8m", threshold: "0.5m", status: "未处理", description: "液位持续超过报警阈值,可能存在积水风险", }, { key: "2", id: "AL002", time: "2024-01-15 14:20:15", device: "FL001", deviceName: "主干道流量计", location: "淮海路主干管网", level: "中", type: "流量异常", currentValue: "3.2m³/s", threshold: "3.0m³/s", status: "处理中", description: "流量超过设计值,需要关注管网负荷情况", }, { key: "3", id: "AL003", time: "2024-01-15 14:15:45", device: "PS001", deviceName: "第一泵站", location: "城东泵站", level: "高", type: "设备故障", currentValue: "停机", threshold: "正常运行", status: "已派单", description: "泵站突然停机,疑似电机故障", }, ] const handleAlarmDetail = (record: any) => { setSelectedAlarm(record) setModalVisible(true) } const handleAlarmProcess = (record: any) => { globalMessage.success(`报警 ${record.id} 已开始处理`) } const columns = [ { title: "报警编号", dataIndex: "id", key: "id", width: 100 }, { title: "报警时间", dataIndex: "time", key: "time", width: 150 }, { title: "设备编号", dataIndex: "device", key: "device", width: 100 }, { title: "设备名称", dataIndex: "deviceName", key: "deviceName", width: 150 }, { title: "位置", dataIndex: "location", key: "location", width: 150 }, { title: "报警级别", dataIndex: "level", key: "level", width: 100, render: (level: string) => ( ), }, { title: "报警类型", dataIndex: "type", key: "type", width: 100 }, { title: "当前值", dataIndex: "currentValue", key: "currentValue", width: 100 }, { title: "处理状态", dataIndex: "status", key: "status", width: 100, render: (status: string) => ( ), }, { title: "操作", key: "action", width: 200, render: (_, record) => ( ), }, ] return (
{/* 统计概览 */} {/* 滚动报警提醒 */}
} style={{ width: 150 }} />
{/* 报警详情模态框 */} setModalVisible(false)} width={800} footer={[ , , ]} > {selectedAlarm && (
报警编号: {selectedAlarm.id}
报警时间: {selectedAlarm.time}
设备编号: {selectedAlarm.device}
设备名称: {selectedAlarm.deviceName}
报警级别:{" "}
报警类型: {selectedAlarm.type}
当前值: {selectedAlarm.currentValue}
阈值: {selectedAlarm.threshold}
位置信息: {selectedAlarm.location}
报警描述: {selectedAlarm.description}