"use client" import {Card, Col, DatePicker, Row, Select, Space} from "antd" import EChart from "@/components/echarts" import {useState} from "react" const { RangePicker } = DatePicker const { Option } = Select export default function HazardTreatmentStats() { const [timeRange, setTimeRange] = useState("month") // 隐患类型统计数据 const hazardTypeData = [ { type: "压力异常", count: 45, percentage: 28.8 }, { type: "泄漏隐患", count: 38, percentage: 24.4 }, { type: "设施损坏", count: 35, percentage: 22.4 }, { type: "管道老化", count: 25, percentage: 16.0 }, { type: "其他", count: 13, percentage: 8.3 }, ] // 处理状态统计数据 const statusData = [ { status: "已完成", count: 88, color: "#52c41a" }, { status: "处理中", count: 45, color: "#faad14" }, { status: "待处理", count: 23, color: "#f5222d" }, ] // 月度趋势数据 const trendData = [ { month: "2023-07", 新增: 12, 完成: 8, 处理中: 4 }, { month: "2023-08", 新增: 15, 完成: 12, 处理中: 7 }, { month: "2023-09", 新增: 18, 完成: 15, 处理中: 10 }, { month: "2023-10", 新增: 22, 完成: 18, 处理中: 14 }, { month: "2023-11", 新增: 20, 完成: 22, 处理中: 12 }, { month: "2023-12", 新增: 16, 完成: 20, 处理中: 8 }, { month: "2024-01", 新增: 25, 完成: 16, 处理中: 17 }, ] // 处理效率数据 const efficiencyData = [ { department: "管网维护部", 平均处理天数: 8.5, 完成率: 92 }, { department: "安全监察部", 平均处理天数: 12.3, 完成率: 88 }, { department: "技术服务部", 平均处理天数: 6.8, 完成率: 95 }, { department: "应急抢修部", 平均处理天数: 4.2, 完成率: 98 }, ] const barOption = { title: { text: "隐患类型分布", left: "center" }, tooltip: { trigger: "axis" }, grid: { left: "3%", right: "4%", bottom: "3%", containLabel: true }, xAxis: { type: "value" }, yAxis: { type: "category", data: hazardTypeData.map((item) => item.type), }, series: [ { type: "bar", data: hazardTypeData.map((item) => item.count), itemStyle: { color: (params: any) => { const colors = ["#1890ff", "#52c41a", "#faad14", "#f5222d", "#722ed1"] return colors[params.dataIndex % colors.length] }, }, }, ], } const pieOption = { title: { text: "处理状态分布", left: "center" }, tooltip: { trigger: "item" }, legend: { orient: "vertical", left: "left" }, series: [ { type: "pie", radius: "50%", data: statusData.map((item) => ({ value: item.count, name: item.status, itemStyle: { color: item.color }, })), emphasis: { itemStyle: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: "rgba(0, 0, 0, 0.5)", }, }, }, ], } const lineOption = { title: { text: "隐患处理趋势", left: "center" }, tooltip: { trigger: "axis" }, legend: { data: ["新增", "完成", "处理中"] }, grid: { left: "3%", right: "4%", bottom: "3%", containLabel: true }, xAxis: { type: "category", data: trendData.map((item) => item.month), }, yAxis: { type: "value" }, series: [ { name: "新增", type: "line", data: trendData.map((item) => item.新增), itemStyle: { color: "#1890ff" }, }, { name: "完成", type: "line", data: trendData.map((item) => item.完成), itemStyle: { color: "#52c41a" }, }, { name: "处理中", type: "line", data: trendData.map((item) => item.处理中), itemStyle: { color: "#faad14" }, }, ], } const efficiencyBarOption = { title: { text: "部门处理效率", left: "center" }, tooltip: { trigger: "axis" }, grid: { left: "3%", right: "4%", bottom: "3%", containLabel: true }, xAxis: { type: "category", data: efficiencyData.map((item) => item.department), }, yAxis: { type: "value", name: "平均处理天数" }, series: [ { type: "bar", data: efficiencyData.map((item) => item.平均处理天数), itemStyle: { color: "#722ed1" }, }, ], } return (
{/* 统计概览 */}
156
隐患总数
88
已完成
完成率: 56.4%
45
处理中
占比: 28.8%
23
待处理
占比: 14.7%
{/* 图表展示 */}
{efficiencyData.map((item, index) => (
{item.department}
平均处理: {item.平均处理天数}天
{item.完成率}%
完成率
))}
) }