diff --git a/config/routes.js b/config/routes.js index 23201b1..07820dd 100644 --- a/config/routes.js +++ b/config/routes.js @@ -37,6 +37,12 @@ export default [ name: 'safeMajorHazard', component: './safe_majorHazard/SafeMajorHazardList', }, + // 风险分级管控 + { + path: '/topnavbar00/hrefficiency/riskclassification', + name: 'riskclassification', + component: './risk_classification/RiskClassificationControl', + }, // 系统管理 { path: '/topnavbar00/hrefficiency/system', diff --git a/src/assets/img/riskclassification.svg b/src/assets/img/riskclassification.svg new file mode 100644 index 0000000..e71bf0c --- /dev/null +++ b/src/assets/img/riskclassification.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/nav_system_content/SystemContentList.js b/src/pages/nav_system_content/SystemContentList.js index bd298ed..0aa5ae4 100644 --- a/src/pages/nav_system_content/SystemContentList.js +++ b/src/pages/nav_system_content/SystemContentList.js @@ -12,6 +12,7 @@ import menuTitle from '@/assets/img/智能管控平台.svg' import menuTitle1 from '@/assets/img/智能管控平台-1.svg' import fireHydrant from '@/assets/img/fireHydrant.svg' import fireHydrant1 from '@/assets/img/fireHydrant1.svg' +import riskClassification from '@/assets/img/riskclassification.svg' import trouble from '@/assets/img/trouble.svg' import book from '@/assets/img/book.svg' import danger from '@/assets/img/danger.svg' @@ -104,6 +105,12 @@ const SystemContentList = (props) => { "key": "/topnavbar00/hrefficiency/safeMajorHazard", "label": "重大危险源管理" }, + { + "path": "/topnavbar00/hrefficiency/riskclassification", + icon: 风险分级管控, + "key": "/topnavbar00/hrefficiency/riskclassification", + "label": "风险分级管控" + }, { "path": "/topnavbar00/hrefficiency/hiddentrouble", icon: 工时仪表盘, @@ -377,6 +384,10 @@ const SystemContentList = (props) => { else if (item.key === '/topnavbar00/hrefficiency/safetraining' && typeof bookLight !== 'undefined') { iconSrc = bookLight; } + // 风险分级管控 菜单图标 激活态使用 riskclassification + else if (item.key === '/topnavbar00/hrefficiency/riskclassification' && typeof riskClassification !== 'undefined') { + iconSrc = riskClassification; + } // 人员定位激活态使用personnelPosition2 else if (item.key === '/topnavbar00/hrefficiency/personnellocation' && typeof personnelPosition2 !== 'undefined') { iconSrc = personnelPosition2; diff --git a/src/pages/risk_classification/RiskClassificationControl.js b/src/pages/risk_classification/RiskClassificationControl.js new file mode 100644 index 0000000..4a92118 --- /dev/null +++ b/src/pages/risk_classification/RiskClassificationControl.js @@ -0,0 +1,527 @@ +import React, { useState, useEffect } from 'react'; +import { Card, Row, Col, Select, Table, Pagination, Statistic, Badge } from 'antd'; +import { CaretRightOutlined } from '@ant-design/icons'; +import ReactECharts from 'echarts-for-react'; +import './RiskClassificationControl.less'; + +const { Option } = Select; + +// 模拟风险等级数据 +const riskLevelData = [ + { level: '极高风险', count: 35, color: '#ff4d4f', icon: '🔴' }, + { level: '高风险', count: 12, color: '#fa8c16', icon: '🟠' }, + { level: '中风险', count: 60, color: '#faad14', icon: '🟡' }, + { level: '低风险', count: 42, color: '#40a9ff', icon: '🔵' }, +]; + +// 模拟风险评估分析数据 +const riskAnalysisData = { + xAxis: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], + 极高风险: [12, 15, 10, 8, 14, 16, 9, 13, 11, 15, 14, 12], + 高风险: [8, 10, 12, 15, 14, 10, 8, 12, 14, 10, 8, 12], + 中风险: [18, 20, 22, 25, 24, 20, 18, 22, 24, 20, 18, 22], + 低风险: [15, 18, 20, 16, 14, 18, 20, 16, 14, 18, 20, 16], +}; + +// 模拟风险清单数据 +const riskListData = [ + { + key: '1', + riskName: '化学品储存区窜雾风险', + riskType: '设备设施', + riskLevel: '极高风险', + assessmentMethod: 'LEC分析', + area: '生产罐区1', + department: '设备部', + responsiblePerson: '张明', + monitoringFrequency: '每日', + status: '整改', + updateTime: '2025-03-01', + }, + { + key: '2', + riskName: '化学品储存区泄漏风险', + riskType: '设备设施', + riskLevel: '高风险', + assessmentMethod: 'LEC分析', + area: '生产罐区1', + department: '设备部', + responsiblePerson: '张明', + monitoringFrequency: '每日', + status: '预警', + updateTime: '2025-03-01', + }, + { + key: '3', + riskName: '化学品储存区腐蚀风险', + riskType: '设备设施', + riskLevel: '中风险', + assessmentMethod: 'LEC分析', + area: '生产罐区1', + department: '设备部', + responsiblePerson: '张明', + monitoringFrequency: '每日', + status: '预警', + updateTime: '2025-03-01', + }, + { + key: '4', + riskName: '化学品储存区温湿度异常', + riskType: '设备设施', + riskLevel: '低风险', + assessmentMethod: 'LEC分析', + area: '生产罐区1', + department: '设备部', + responsiblePerson: '张明', + monitoringFrequency: '每日', + status: '正常', + updateTime: '2025-03-01', + }, + { + key: '5', + riskName: '化学品储存区通风不良', + riskType: '设备设施', + riskLevel: '低风险', + assessmentMethod: 'LEC分析', + area: '生产罐区1', + department: '设备部', + responsiblePerson: '张明', + monitoringFrequency: '每日', + status: '正常', + updateTime: '2025-03-01', + }, +]; + +// 获取风险等级对应的标签样式 +const getRiskLevelTag = (level) => { + switch (level) { + case '极高风险': + return ; + case '高风险': + return ; + case '中风险': + return ; + case '低风险': + return ; + default: + return level; + } +}; + +// 获取状态对应的标签样式 +const getStatusTag = (status) => { + switch (status) { + case '整改': + return ; + case '预警': + return ; + case '正常': + return ; + default: + return status; + } +}; + +const RiskClassificationControl = () => { + const [selectedMonth, setSelectedMonth] = useState('月'); + const [selectedRiskLevel, setSelectedRiskLevel] = useState('全部风险等级'); + const [currentPage, setCurrentPage] = useState(1); + const [pageSize, setPageSize] = useState(5); + + // 风险评估分析图表配置 + const analysisChartOption = { + tooltip: { + trigger: 'axis', + }, + legend: { + data: ['极高风险', '高风险', '中风险', '低风险'], + bottom: 0, + }, + grid: { + left: '3%', + right: '3%', + bottom: '15%', + top: '3%', + containLabel: true, + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: riskAnalysisData.xAxis, + }, + yAxis: { + type: 'value', + min: 0, + }, + series: [ + { + name: '极高风险', + type: 'line', + data: riskAnalysisData.极高风险, + smooth: false, + symbolSize: 6, + itemStyle: { + color: '#ff4d4f', + }, + }, + { + name: '高风险', + type: 'line', + data: riskAnalysisData.高风险, + smooth: false, + symbolSize: 6, + itemStyle: { + color: '#fa8c16', + }, + }, + { + name: '中风险', + type: 'line', + data: riskAnalysisData.中风险, + smooth: false, + symbolSize: 6, + itemStyle: { + color: '#faad14', + }, + }, + { + name: '低风险', + type: 'line', + data: riskAnalysisData.低风险, + smooth: false, + symbolSize: 6, + itemStyle: { + color: '#40a9ff', + }, + }, + ], + // 移除了graphic配置,将使用React组件方式展示风险等级说明 + }; + + // 风险四色图配置 + const colorChartOption = { + tooltip: { + trigger: 'item', + formatter: '{a}
{b}: {c} ({d}%)', + }, + legend: { + orient: 'vertical', + right: 10, + top: 'center', + data: ['低风险', '中风险', '高风险', '极高风险'], + }, + series: [ + { + name: '风险类型', + type: 'pie', + radius: ['40%', '70%'], + center: ['35%', '50%'], + avoidLabelOverlap: false, + itemStyle: { + borderRadius: 10, + borderColor: '#fff', + borderWidth: 2, + }, + label: { + show: false, + position: 'center', + }, + emphasis: { + label: { + show: true, + fontSize: 20, + fontWeight: 'bold', + }, + }, + labelLine: { + show: false, + }, + data: [ + { value: 42, name: '低风险', itemStyle: { color: '#40a9ff' } }, + { value: 60, name: '中风险', itemStyle: { color: '#faad14' } }, + { value: 12, name: '高风险', itemStyle: { color: '#fa8c16' } }, + { value: 35, name: '极高风险', itemStyle: { color: '#ff4d4f' } }, + ], + }, + ], + }; + + // 风险清单表格列配置 + const columns = [ + { + title: '风险名称', + dataIndex: 'riskName', + key: 'riskName', + }, + { + title: '风险类别', + dataIndex: 'riskType', + key: 'riskType', + }, + { + title: '风险等级', + dataIndex: 'riskLevel', + key: 'riskLevel', + render: (level) => getRiskLevelTag(level), + }, + { + title: '评估方法', + dataIndex: 'assessmentMethod', + key: 'assessmentMethod', + }, + { + title: '所在区域', + dataIndex: 'area', + key: 'area', + }, + { + title: '责任部门', + dataIndex: 'department', + key: 'department', + }, + { + title: '责任人', + dataIndex: 'responsiblePerson', + key: 'responsiblePerson', + }, + { + title: '管控频次', + dataIndex: 'monitoringFrequency', + key: 'monitoringFrequency', + }, + { + title: '管控状态', + dataIndex: 'status', + key: 'status', + render: (status) => getStatusTag(status), + }, + { + title: '更新时间', + dataIndex: 'updateTime', + key: 'updateTime', + }, + { + title: '操作', + key: 'action', + render: () => ( + + 查看详情 + + ), + }, + ]; + + return ( +
+ {/* 风险等级统计 - 整体渐变背景 */} + + + +
+ {/* 左侧标题 */} +
+ 风险等级 +
+ + {/* 右侧四个分散的分数 */} +
+ {riskLevelData.map((item, index) => ( +
+
+ {item.icon} + {item.level} +
+ +
+ ))} +
+
+
+ +
+ + {/* 风险评估分析和风险四色图 */} + + + + + + + + + }> + + {/* 风险评估分析图表在左边 */} + +
+ +
+ + {/* 风险等级说明在右边 */} + +
+ {/*
风险等级说明
*/} +
+ {[ + { level: '极高风险', months: '4月、7月、10月、12月', color: '#ff4d4f', bgColor: '#fff0f0', borderColor: '#ff4d4f' }, + { level: '高风险', months: '', color: '#fa8c16', bgColor: '#fff7e6', borderColor: '#fa8c16' }, + { level: '中风险', months: '', color: '#faad14', bgColor: '#fffbe6', borderColor: '#faad14' }, + { level: '低风险', months: '', color: '#40a9ff', bgColor: '#e6f7ff', borderColor: '#40a9ff' } + ].map((item, index) => ( +
+
+
+ {item.level} +
+ {item.months && ( +
{item.months}
+ )} +
+ ))} +
+
+ +
+
+ + + + + + + + }> +
+ +
+
+ +
+ + {/* 风险清单 */} + + + + + + + + }> + +
+ setPageSize(size)} + showSizeChanger + showQuickJumper + showTotal={(total) => `共 ${total} 条`} + /> +
+ + + ); +}; + +export default RiskClassificationControl; \ No newline at end of file diff --git a/src/pages/risk_classification/RiskClassificationControl.less b/src/pages/risk_classification/RiskClassificationControl.less new file mode 100644 index 0000000..d422c36 --- /dev/null +++ b/src/pages/risk_classification/RiskClassificationControl.less @@ -0,0 +1,87 @@ +.risk-classification-container { + padding: 20px; + background: #f5f7fa; + + .ant-card { + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + transition: all 0.3s ease; + + &:hover { + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); + } + } + + .ant-card-head { + background: #ffffff; + border-bottom: 1px solid #f0f0f0; + + .ant-card-head-title { + font-size: 16px; + font-weight: 600; + color: #262626; + } + } + + .ant-statistic-content { + font-size: 28px; + font-weight: 600; + } + + .ant-table { + background: #ffffff; + border-radius: 4px; + + .ant-table-thead > tr > th { + background: #fafafa; + font-weight: 600; + color: #262626; + border-bottom: 1px solid #f0f0f0; + } + + .ant-table-tbody > tr > td { + border-bottom: 1px solid #f0f0f0; + } + + .ant-table-tbody > tr:hover { + background: #fafafa; + } + } + + .ant-pagination { + margin-top: 16px; + } + + .ant-select { + .ant-select-selector { + border-radius: 4px; + } + } + + // 图表容器样式 + .chart-container { + height: 300px; + } + + // 响应式调整 + @media (max-width: 768px) { + padding: 10px; + + .ant-statistic-content { + font-size: 24px; + } + + .chart-container { + height: 250px; + } + } + + @media (max-width: 480px) { + .ant-statistic-content { + font-size: 20px; + } + + .chart-container { + height: 200px; + } + } +} \ No newline at end of file diff --git a/src/pages/topnavbar/TopNavBar.js b/src/pages/topnavbar/TopNavBar.js index 1f5cbfe..c8b4eee 100644 --- a/src/pages/topnavbar/TopNavBar.js +++ b/src/pages/topnavbar/TopNavBar.js @@ -23,6 +23,11 @@ const menuItem = [ key: '/topnavbar00/hrefficiency/safeMajorHazard', // icon: , }, + { + label: '风险分级管控', + key: '/topnavbar00/hrefficiency/riskclassification', + // icon: , + }, { label: '隐患排查', key: '/topnavbar00/hrefficiency/hiddentrouble',