- {/* 第一块:标题 + 下拉选择框 + 导出按钮 */}
+ {/* 第一行:标题 + 搜索栏 + 下拉选择框 */}
-
- {/* 第二块:图片内容 */}
+ {/* 第二行:三个小块 */}
-
-
📊
-
数据图表
+
+
+
+
+ {/* 第一个块:姓名和单位 */}
+
+
+ {/* 第二个块:电话 */}
+
+
+ {/* 第三个块:身份证 */}
+
+
+ 1304************10
+
+
+ {/* 第四个块:职位标签 */}
+
+
+ {/* 第五个块:证书状态 */}
+
+
+ {/* 第六个块:操作按钮 */}
+
+
+
+
+
+
diff --git a/src/pages/business_basic/module/ResponsibilityImplementation.less b/src/pages/business_basic/module/ResponsibilityImplementation.less
index 91ffca9..c6d7b35 100644
--- a/src/pages/business_basic/module/ResponsibilityImplementation.less
+++ b/src/pages/business_basic/module/ResponsibilityImplementation.less
@@ -34,12 +34,12 @@
margin-bottom: 10px;
gap: 10px;
- .containerOneLeft{
+ .containerOneLeft {
background-color: white;
width: calc(50% - 5px);
display: flex;
flex-direction: column;
- padding: 15px;
+ padding: 5px 15px;
border: 1px solid #f0f0f0;
border-radius: 4px;
@@ -47,7 +47,7 @@
display: flex;
justify-content: space-between;
align-items: center;
- margin-bottom: 15px;
+ // margin-bottom: 15px;
.titleLeft {
display: flex;
@@ -73,12 +73,13 @@
display: flex;
align-items: center;
gap: 4px;
+ height: 28px;
border: 1px solid #DFE4F6;
border-radius: 4px;
color: #2E4CD4;
font-weight: 500;
font-size: 12px;
- padding: 4px 8px;
+ padding: 0px 8px;
background: transparent;
cursor: pointer;
transition: all 0.2s;
@@ -89,7 +90,8 @@
}
.btnIcon {
- font-size: 12px;
+ width: 12px;
+ height: 12px;
}
}
}
@@ -100,36 +102,58 @@
display: flex;
align-items: center;
justify-content: center;
- background-color: #fafafa;
- border: 1px dashed #d9d9d9;
- border-radius: 4px;
.imagePlaceholder {
display: flex;
flex-direction: column;
align-items: center;
- gap: 8px;
- color: #999999;
- .imageIcon {
- font-size: 32px;
- opacity: 0.6;
+ .imageIcon1 {
+ transform: scale(0.9) translateY(-5px); // 稍微向上移动
+ object-fit: contain;
+ }
+
+
+ .imageRow {
+ display: flex;
+ justify-content: space-between;
+ // width: 100%;
+ margin-bottom: 10px;
+ // padding-bottom: 20px;
+ // gap: 12px;
+
+ .imageIcon2 {
+ height: 55%;
+ transform: scale(0.7) translateY(-25%) translateX(20%); // 稍微向上移动
+ object-fit: contain;
+ background-color: #EFF5FE;
+ // padding-bottom: 20px;
+ }
+
+ .imageIcon3 {
+ height: 40%;
+ transform: scale(0.65) translateY(-32%) translateX(4%); // 向上移动10px
+ object-fit: contain;
+ padding-bottom: 20px;
+ // background-color: #EFF5FE;
+
+ }
}
.imageText {
- font-size: 14px;
+ font-size: 12px;
font-weight: 400;
}
}
}
}
- .containerOneRight{
+ .containerOneRight {
background-color: white;
width: calc(50% - 5px);
display: flex;
flex-direction: column;
- padding: 15px;
+ padding: 5px 15px;
border: 1px solid #f0f0f0;
border-radius: 4px;
@@ -137,7 +161,7 @@
display: flex;
justify-content: space-between;
align-items: center;
- margin-bottom: 15px;
+ margin-bottom: 10px;
.rightTopLeft {
display: flex;
@@ -161,18 +185,56 @@
}
.rightTopRight {
- .exportBtn {
- background-color: #2E4CD4 !important;
- border-color: #2E4CD4 !important;
- color: #fff !important;
- font-size: 14px !important;
- font-weight: 500 !important;
- height: 32px;
- padding: 0 16px;
+ .searchGroup {
+ display: flex;
+ gap: 8px;
+ align-items: center;
- &:hover {
- background-color: #1e3bb8 !important;
- border-color: #1e3bb8 !important;
+ .searchInput {
+ width: 200px;
+ height: 32px;
+
+ :global(.ant-input) {
+ height: 32px;
+ border-radius: 4px;
+ border: 1px solid #d9d9d9;
+ font-size: 14px;
+
+ &:focus {
+ border-color: #2E4CD4;
+ box-shadow: 0 0 0 2px rgba(46, 76, 212, 0.2);
+ }
+ }
+
+ :global(.ant-input-suffix) {
+ color: #999999;
+ font-size: 14px;
+ }
+ }
+
+ .organizationSelect {
+ width: 120px;
+ height: 32px;
+
+ :global(.ant-select-selector) {
+ height: 32px !important;
+ border-radius: 4px !important;
+ border: 1px solid #d9d9d9 !important;
+
+ &:hover {
+ border-color: #2E4CD4 !important;
+ }
+
+ &:focus {
+ border-color: #2E4CD4 !important;
+ box-shadow: 0 0 0 2px rgba(46, 76, 212, 0.2) !important;
+ }
+ }
+
+ :global(.ant-select-selection-item) {
+ line-height: 30px !important;
+ font-size: 14px !important;
+ }
}
}
}
@@ -180,42 +242,191 @@
.rightBottomSection {
flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
+ padding: 5px 15px;
+ width: 100%;
+ height: 100%;
- .imagePlaceholder {
+ .threeBlocksContainer {
display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
+ gap: 20px;
width: 100%;
height: 100%;
- background-color: #f5f5f5;
- border: 2px dashed #d9d9d9;
- border-radius: 4px;
- .imageIcon {
- font-size: 48px;
- margin-bottom: 10px;
- }
+ .blockItem {
+ width: 100%;
+ height: 100%;
+ flex: 1;
+ display: flex;
+ justify-content: center;
+ background: url('@/assets/business_basic/background1.png') no-repeat center center;
+ background-size: 100% auto;
- .imageText {
- font-size: 14px;
- color: #999999;
+ .blockContent {
+ // background-color: pink;
+ font-size: 12px;
+ color: #666666;
+ font-weight: 400;
+ width: 100%;
+ height: 100%;
+ }
+
+ // 新的6个横向块样式
+ .backgroundContainer {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ .infoBlock {
+ width: 100%;
+ display: flex;
+ justify-content: flex-start;
+ white-space: nowrap;
+ .nameText {
+ font-size: 12px;
+ font-weight: 500;
+ color: #333333;
+ margin-left: 10px;
+ margin-right: 10px;
+ margin-top: 15px;
+ }
+
+
+ .unitText {
+ font-size: 10px;
+ font-weight: 400;
+ color: #666666;
+ margin-top: 18px;
+ }
+
+ .infoIcon {
+ font-size: 10px;
+ color: #666666;
+ margin-left: 10px;
+ margin-right: 10px;
+ }
+
+ .infoText {
+ font-size: 10px;
+ font-weight: 400;
+ color: #666666;
+
+ }
+
+ }
+
+ .tagContainer {
+ display: flex;
+ gap: 8px;
+ align-items: center;
+ }
+
+ .tagBlue1 {
+ background-color: #D5E5FF;
+ color: #1269FF;
+ font-size: 10px;
+ font-weight: 400;
+ padding: 4px 8px;
+ border-radius: 4px;
+ white-space: nowrap;
+ margin-left: 10px;
+ }
+ .tagBlue2 {
+ background-color: #D5E5FF;
+ color: #1269FF;
+ font-size: 10px;
+ font-weight: 400;
+ padding: 4px 8px;
+ border-radius: 4px;
+ white-space: nowrap;
+
+ }
+ .tagBlue3 {
+ background-color: #D5E5FF;
+ color: #1269FF;
+ font-size: 10px;
+ font-weight: 400;
+ padding: 4px 8px;
+ border-radius: 4px;
+ white-space: nowrap;
+ margin-left: 10px;
+
+ }
+
+ .tagYellow {
+ background-color: #FFF8E2;
+ color: #FFC403;
+ font-size: 10px;
+ font-weight: 400;
+ padding: 4px 8px;
+ border-radius: 4px;
+ white-space: nowrap;
+ }
+
+ .actionBlock {
+ width: 100%;
+ height: 50%;
+ background-color: #BDD6FDCC;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .buttonContainer {
+ display: flex;
+ gap: 15px;
+ align-items: center;
+ justify-content: center;
+ width: 100%;
+
+ .editBtn {
+ height: 80%;
+ background-color: #1269FF;
+ color: #fff;
+ font-size: 10px;
+ font-weight: 400;
+ border: none;
+ border-radius: 2px;
+ cursor: pointer;
+ padding: 2px 15px;
+
+ &:hover {
+ background-color: #0f5ae0;
+ }
+ }
+
+ .deleteBtn {
+ height: 80%;
+ background-color: #FF5F60;
+ color: #fff;
+ font-size: 10px;
+ font-weight: 400;
+ border: none;
+ border-radius: 2px;
+ cursor: pointer;
+ padding: 2px 15px;
+
+ &:hover {
+ background-color: #ff4a4b;
+ }
+ }
+ }
+
+
+ }
}
}
}
}
}
-
- .containerTwo{
+
+ .containerTwo {
flex: 1;
background-color: white;
display: flex;
flex-direction: column;
- padding: 15px;
+ padding: 5px 15px;
border: 1px solid #f0f0f0;
border-radius: 4px;
@@ -266,7 +477,7 @@
gap: 8px;
:global(.ant-btn) {
- height: 32px;
+ height: 28px;
padding: 0 16px;
border-radius: 4px;
font-size: 14px;
@@ -324,7 +535,8 @@
}
-.rightTopSelect{
+.rightTopSelect {
+
// 下拉框本身的样式
:global(.ant-select-selector) {
background-color: #f8f9fa !important;
@@ -332,17 +544,17 @@
border-radius: 6px !important;
height: 32px !important;
min-height: 32px !important;
-
+
&:hover {
border-color: #2E4CD4 !important;
}
-
+
&:focus {
border-color: #2E4CD4 !important;
box-shadow: 0 0 0 2px rgba(46, 76, 212, 0.2) !important;
}
}
-
+
// 下拉框内的文字样式
:global(.ant-select-selection-item) {
color: #333333 !important;
@@ -350,13 +562,13 @@
font-weight: 500 !important;
line-height: 30px !important;
}
-
+
// 下拉箭头样式
:global(.ant-select-arrow) {
color: #666666 !important;
font-size: 12px !important;
}
-
+
// 下拉菜单容器样式
:global(.ant-select-dropdown) {
background-color: #ffffff !important;
@@ -365,7 +577,7 @@
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
padding: 4px 0 !important;
}
-
+
// 下拉选项样式
:global(.ant-select-item) {
color: #333333 !important;
@@ -373,19 +585,19 @@
padding: 8px 12px !important;
border-radius: 4px !important;
margin: 2px 8px !important;
-
+
&:hover {
background-color: #f0f2ff !important;
color: #2E4CD4 !important;
}
-
+
&.ant-select-item-option-selected {
background-color: #e6f7ff !important;
color: #2E4CD4 !important;
font-weight: 600 !important;
}
}
-
+
// 选中状态的样式
:global(.ant-select-focused .ant-select-selector) {
border-color: #2E4CD4 !important;
@@ -399,12 +611,12 @@
align-items: center;
gap: 8px;
padding: 4px 0;
-
+
.optionIcon {
font-size: 16px;
color: #2E4CD4;
}
-
+
.optionText {
font-size: 14px;
color: #333333;
diff --git a/src/pages/business_basic/module/RiskAssessment.js b/src/pages/business_basic/module/RiskAssessment.js
index 1895bfa..ad4430f 100644
--- a/src/pages/business_basic/module/RiskAssessment.js
+++ b/src/pages/business_basic/module/RiskAssessment.js
@@ -1,425 +1,720 @@
-import React, { useState, useEffect } from 'react';
-import { Card, Table, Button, Modal, Form, Input, Select, message, Space, Tag, Rate, Progress } from 'antd';
-import { PlusOutlined, EditOutlined, DeleteOutlined, EyeOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
-import './RiskAssessment.less';
-const { Option } = Select;
+import React, { useEffect, useRef, useState } from 'react';
+import { Card, Result, Select, Button } from 'antd';
+import { CheckCircleOutlined } from '@ant-design/icons';
+import * as echarts from 'echarts';
+import StandardTable from '@/components/StandardTable';
+import styles from './RiskAssessment.less';
+// import './RiskAssessment.less';
-const RiskAssessment = () => {
- const [form] = Form.useForm();
- const [dataSource, setDataSource] = useState([]);
- const [loading, setLoading] = useState(false);
- const [modalVisible, setModalVisible] = useState(false);
- const [editingRecord, setEditingRecord] = useState(null);
- const [pagination, setPagination] = useState({
- current: 1,
- pageSize: 10,
- total: 0,
- });
+import img1 from '@/assets/safe_majorHazard/online_monitoring/img1.png';
+import img2 from '@/assets/safe_majorHazard/online_monitoring/img2.png';
+import img3 from '@/assets/safe_majorHazard/online_monitoring/img3.png';
+import map1 from '@/assets/safe_majorHazard/online_monitoring/map.png';
+import risk1 from '@/assets/safe_majorHazard/online_monitoring/risk1.png';
+import risk2 from '@/assets/safe_majorHazard/online_monitoring/risk2.png';
+import risk3 from '@/assets/safe_majorHazard/online_monitoring/risk3.png';
- // 模拟数据
- const mockData = [
- {
- id: 1,
- riskName: '化学品泄漏风险',
- riskType: '环境风险',
- riskLevel: '高',
- probability: 4,
- impact: 5,
- riskScore: 20,
- assessor: '张三',
- assessDate: '2024-01-15',
- status: '待处理',
- description: '生产过程中化学品可能发生泄漏,造成环境污染',
- controlMeasures: '加强设备维护,安装泄漏检测装置',
- },
- {
- id: 2,
- riskName: '设备故障风险',
- riskType: '设备风险',
- riskLevel: '中',
- probability: 3,
- impact: 3,
- riskScore: 9,
- assessor: '李四',
- assessDate: '2024-01-10',
- status: '已处理',
- description: '关键设备可能发生故障,影响生产安全',
- controlMeasures: '定期维护保养,建立备件库存',
- },
- {
- id: 3,
- riskName: '人员操作风险',
- riskType: '人员风险',
- riskLevel: '低',
- probability: 2,
- impact: 2,
- riskScore: 4,
- assessor: '王五',
- assessDate: '2024-01-08',
- status: '监控中',
- description: '操作人员误操作可能导致安全事故',
- controlMeasures: '加强培训,完善操作规程',
- },
- ];
- useEffect(() => {
- fetchData();
- }, [pagination.current, pagination.pageSize]);
+const RiskAssessment = () => {
+ const chartRef = useRef(null);
+ const [selectedRowKeys, setSelectedRowKeys] = useState([]);
+ const [selectedRows, setSelectedRows] = useState([]);
+ const [loading, setLoading] = useState(false);
+ const [dataSource, setDataSource] = useState([]);
+ const [pagination, setPagination] = useState({
+ current: 1,
+ pageSize: 5,
+ total: 0,
+ });
- const fetchData = async () => {
- setLoading(true);
- try {
- // 模拟API调用
- setTimeout(() => {
- setDataSource(mockData);
- setPagination(prev => ({ ...prev, total: mockData.length }));
- setLoading(false);
- }, 500);
- } catch (error) {
- message.error('获取数据失败');
- setLoading(false);
- }
- };
+ useEffect(() => {
+ if (chartRef.current) {
+ const chart = echarts.init(chartRef.current);
+
+ // 强制初始化时调整大小
+ setTimeout(() => {
+ if (chart && !chart.isDisposed()) {
+ chart.resize();
+ }
+ }, 100);
- const handleAdd = () => {
- setEditingRecord(null);
- form.resetFields();
- setModalVisible(true);
- };
+ const option = {
+ color: ['#FF2526', '#FF8800', '#FFC403', '#65E5F9'],
- const handleEdit = (record) => {
- setEditingRecord(record);
- form.setFieldsValue(record);
- setModalVisible(true);
- };
+ legend: {
+ data: ['重大风险', '较高风险', '一般风险', '低风险'],
+ top: "-3px",
+ left: "center",
+ itemGap: 40, // 图例间距
+ textStyle: {
+ fontSize: 10
+ }
+ },
+ grid: {
+ left: '2%',
+ right: '4%',
+ bottom: '2%',
+ top: '12%',
+ containLabel: true
+ },
+ xAxis: {
+ type: 'category',
+ boundaryGap: false,
+ data: ['9/22', '9/23', '9/24', '9/25', '9/26', '9/27', '9/28'],
+ axisLabel: {
+ fontSize: 10
+ }
+ },
+ yAxis: {
+ type: 'value',
+ min: 0,
+ max: 30,
+ axisLabel: {
+ formatter: '{value}',
+ fontSize: 10
+ }
+ },
+ series: [
+ {
+ name: '重大风险',
+ type: 'line',
+ smooth: true,
+ lineStyle: {
+ width: 1.5,
+ color: '#FF2526'
+ },
+ areaStyle: {
+ color: {
+ type: 'linear',
+ x: 0,
+ y: 0,
+ x2: 0,
+ y2: 1,
+ colorStops: [
+ { offset: 0, color: 'rgba(38, 12, 12, 0.4)' },
+ { offset: 1, color: 'rgba(255, 37, 38, 0)' }
+ ]
+ }
+ },
+ symbol: 'none',
+ data: [8, 15, 12, 22, 18, 26, 20]
+ },
+ {
+ name: '较高风险',
+ type: 'line',
+ smooth: true,
+ lineStyle: {
+ width: 1.5,
+ color: '#FF8800'
+ },
+ areaStyle: {
+ color: {
+ type: 'linear',
+ x: 0,
+ y: 0,
+ x2: 0,
+ y2: 1,
+ colorStops: [
+ { offset: 0, color: 'rgba(255, 136, 0, 0.4)' },
+ { offset: 1, color: 'rgba(255, 136, 0, 0)' }
+ ]
+ }
+ },
+ symbol: 'none',
+ data: [5, 8, 6, 12, 10, 15, 13]
+ },
+ {
+ name: '一般风险',
+ type: 'line',
+ smooth: true,
+ lineStyle: {
+ width: 1.5,
+ color: '#FFC403'
+ },
+ areaStyle: {
+ color: {
+ type: 'linear',
+ x: 0,
+ y: 0,
+ x2: 0,
+ y2: 1,
+ colorStops: [
+ { offset: 0, color: 'rgba(255, 196, 3, 0.4)' },
+ { offset: 1, color: 'rgba(255, 196, 3, 0)' }
+ ]
+ }
+ },
+ symbol: 'none',
+ data: [12, 18, 15, 25, 22, 24, 26]
+ },
+ {
+ name: '低风险',
+ type: 'line',
+ smooth: true,
+ lineStyle: {
+ width: 1.5,
+ color: '#65E5F9'
+ },
+ areaStyle: {
+ color: {
+ type: 'linear',
+ x: 0,
+ y: 0,
+ x2: 0,
+ y2: 1,
+ colorStops: [
+ { offset: 0, color: 'rgba(101, 229, 249, 0.4)' },
+ { offset: 1, color: 'rgba(101, 229, 249, 0)' }
+ ]
+ }
+ },
+ symbol: 'none',
+ data: [3, 5, 7, 9, 6, 8, 4]
+ }
+ ]
+ };
- const handleDelete = (record) => {
- Modal.confirm({
- title: '确认删除',
- content: `确定要删除风险评估"${record.riskName}"吗?`,
- onOk: () => {
- setDataSource(dataSource.filter(item => item.id !== record.id));
- message.success('删除成功');
- },
- });
- };
+ chart.setOption(option);
- const handleView = (record) => {
- Modal.info({
- title: '查看风险评估详情',
- content: (
-
-
风险名称:{record.riskName}
-
风险类型:{record.riskType}
-
风险等级:
-
- {record.riskLevel}
-
-
-
发生概率:
-
- ({record.probability}/5)
-
-
影响程度:
-
- ({record.impact}/5)
-
-
风险评分:{record.riskScore}
-
评估人:{record.assessor}
-
评估日期:{record.assessDate}
-
处理状态:
-
- {record.status}
-
-
-
风险描述:{record.description}
-
控制措施:{record.controlMeasures}
-
- ),
- width: 700,
- });
- };
+ // 响应式调整 - 使用多种方式监听容器尺寸变化
+ let resizeTimer = null;
+ const handleResize = () => {
+ // 防抖处理,避免频繁调用resize
+ if (resizeTimer) {
+ clearTimeout(resizeTimer);
+ }
+ resizeTimer = setTimeout(() => {
+ if (chart && !chart.isDisposed()) {
+ chart.resize();
+ }
+ }, 50); // 减少延迟时间
+ };
+
+ // 监听窗口大小变化
+ window.addEventListener('resize', handleResize);
+
+ // 监听容器尺寸变化(解决菜单栏伸缩时的自适应问题)
+ let resizeObserver = null;
+ if (window.ResizeObserver) {
+ resizeObserver = new ResizeObserver((entries) => {
+ for (let entry of entries) {
+ // 使用requestAnimationFrame确保在下一帧执行
+ requestAnimationFrame(() => {
+ handleResize();
+ });
+ }
+ });
+ resizeObserver.observe(chartRef.current);
+ }
- const handleSubmit = async (values) => {
- try {
- const riskScore = values.probability * values.impact;
- const riskLevel = riskScore >= 16 ? '高' : riskScore >= 9 ? '中' : '低';
-
- const formData = {
- ...values,
- riskScore,
- riskLevel,
- };
+ // 额外监听父容器的尺寸变化
+ const parentContainer = chartRef.current?.parentElement;
+ let parentObserver = null;
+ if (parentContainer && window.ResizeObserver) {
+ parentObserver = new ResizeObserver((entries) => {
+ for (let entry of entries) {
+ requestAnimationFrame(() => {
+ handleResize();
+ });
+ }
+ });
+ parentObserver.observe(parentContainer);
+ }
- if (editingRecord) {
- // 编辑
- setDataSource(dataSource.map(item =>
- item.id === editingRecord.id ? { ...item, ...formData } : item
- ));
- message.success('编辑成功');
- } else {
- // 新增
- const newRecord = {
- id: Date.now(),
- ...formData,
- assessor: '当前用户',
- assessDate: new Date().toISOString().split('T')[0],
- status: '待处理',
- };
- setDataSource([...dataSource, newRecord]);
- message.success('添加成功');
- }
- setModalVisible(false);
- form.resetFields();
- } catch (error) {
- message.error('操作失败');
- }
- };
+ // 使用MutationObserver监听DOM结构变化(菜单展开收起时)
+ const mutationObserver = new MutationObserver((mutations) => {
+ mutations.forEach((mutation) => {
+ if (mutation.type === 'attributes' &&
+ (mutation.attributeName === 'class' || mutation.attributeName === 'style')) {
+ // 延迟执行,确保DOM更新完成
+ setTimeout(() => {
+ handleResize();
+ }, 200);
+ }
+ });
+ });
- const getRiskLevelColor = (level) => {
- switch (level) {
- case '高': return 'red';
- case '中': return 'orange';
- case '低': return 'green';
- default: return 'default';
- }
- };
+ // 监听整个页面的class和style变化
+ mutationObserver.observe(document.body, {
+ attributes: true,
+ attributeFilter: ['class', 'style'],
+ subtree: true
+ });
- const getStatusColor = (status) => {
- switch (status) {
- case '已处理': return 'green';
- case '待处理': return 'red';
- case '监控中': return 'blue';
- default: return 'default';
- }
- };
+ return () => {
+ window.removeEventListener('resize', handleResize);
+ if (resizeObserver) {
+ resizeObserver.disconnect();
+ }
+ if (parentObserver) {
+ parentObserver.disconnect();
+ }
+ if (mutationObserver) {
+ mutationObserver.disconnect();
+ }
+ if (resizeTimer) {
+ clearTimeout(resizeTimer);
+ }
+ if (chart && !chart.isDisposed()) {
+ chart.dispose();
+ }
+ };
+ }
+ }, []);
- const columns = [
- {
- title: '风险名称',
- dataIndex: 'riskName',
- key: 'riskName',
- width: 150,
- },
- {
- title: '风险类型',
- dataIndex: 'riskType',
- key: 'riskType',
- width: 120,
- },
- {
- title: '风险等级',
- dataIndex: 'riskLevel',
- key: 'riskLevel',
- width: 100,
- render: (level) => (
-
- {level}
-
- ),
- },
- {
- title: '风险评分',
- dataIndex: 'riskScore',
- key: 'riskScore',
- width: 100,
- render: (score) => (
-
-
- ),
- },
- {
- title: '发生概率',
- dataIndex: 'probability',
- key: 'probability',
- width: 120,
- render: (probability) => (
-
-
- ({probability}/5)
-
- ),
- },
- {
- title: '影响程度',
- dataIndex: 'impact',
- key: 'impact',
- width: 120,
- render: (impact) => (
-
-
- ({impact}/5)
-
- ),
- },
- {
- title: '处理状态',
- dataIndex: 'status',
- key: 'status',
- width: 100,
- render: (status) => (
-
- {status}
-
- ),
- },
- {
- title: '评估人',
- dataIndex: 'assessor',
- key: 'assessor',
- width: 100,
- },
- {
- title: '评估日期',
- dataIndex: 'assessDate',
- key: 'assessDate',
- width: 120,
- },
- {
- title: '操作',
- key: 'action',
- width: 200,
- render: (_, record) => (
-
- }
- onClick={() => handleView(record)}
- >
- 查看
-
- }
- onClick={() => handleEdit(record)}
- >
- 编辑
-
- }
- onClick={() => handleDelete(record)}
- >
- 删除
-
-
- ),
- },
- ];
+ // 表格列定义
+ const columns = [
+ {
+ title: '编号',
+ dataIndex: 'id',
+ key: 'id',
+ width: 80,
+ render: (text, record, index) => {
+ const page = pagination.current || 1;
+ const pageSize = pagination.pageSize || 5;
+ const number = (page - 1) * pageSize + index + 1;
+ return `0${number}`.slice(-2);
+ }
+ },
+ {
+ title: '设备编号',
+ dataIndex: 'deviceId',
+ key: 'deviceId',
+ width: 120,
+ },
+ {
+ title: '风险等级',
+ dataIndex: 'riskLevel',
+ key: 'riskLevel',
+ width: 100,
+ render: (text) => {
+ const colorMap = {
+ '高': '#FF4D4F',
+ '中': '#FAAD14',
+ '低': '#52C41A'
+ };
+ return
{text};
+ }
+ },
+ {
+ title: '预警时间',
+ dataIndex: 'warningTime',
+ key: 'warningTime',
+ width: 150,
+ },
+ {
+ title: '主要原因',
+ dataIndex: 'mainReason',
+ key: 'mainReason',
+ width: 200,
+ },
+ {
+ title: '处理状态',
+ dataIndex: 'status',
+ key: 'status',
+ width: 100,
+ render: (text) => {
+ const statusMap = {
+ '未处理': { color: '#FF4D4F', bg: '#FFF2F0' },
+ '处理中': { color: '#FAAD14', bg: '#FFFBE6' },
+ '已处理': { color: '#52C41A', bg: '#F6FFED' }
+ };
+ const status = statusMap[text] || { color: '#333', bg: '#F5F5F5' };
+ return (
+
+ {text}
+
+ );
+ }
+ },
+ {
+ title: '操作',
+ key: 'action',
+ width: 120,
+ render: (_, record) => (
+
+
+
+
+ ),
+ },
+ ];
- return (
-
-
} onClick={handleAdd}>
- 新增评估
-
- }
- >
-
- `第 ${range[0]}-${range[1]} 条/共 ${total} 条`,
- onChange: (page, pageSize) => {
- setPagination(prev => ({
- ...prev,
- current: page,
- pageSize: pageSize || prev.pageSize,
- }));
- },
- }}
- />
-
+ // 模拟数据
+ const mockData = [
+ {
+ key: '1',
+ id: '001',
+ deviceId: 'DEV-001',
+ riskLevel: '高',
+ warningTime: '2024-01-15 08:30:25',
+ mainReason: '设备温度异常升高',
+ status: '未处理',
+ },
+ {
+ key: '2',
+ id: '002',
+ deviceId: 'DEV-002',
+ riskLevel: '中',
+ warningTime: '2024-01-15 09:15:10',
+ mainReason: '压力波动超出正常范围',
+ status: '处理中',
+ },
+ {
+ key: '3',
+ id: '003',
+ deviceId: 'DEV-003',
+ riskLevel: '高',
+ warningTime: '2024-01-15 10:45:30',
+ mainReason: '液位传感器故障',
+ status: '已处理',
+ },
+ {
+ key: '4',
+ id: '004',
+ deviceId: 'DEV-004',
+ riskLevel: '高',
+ warningTime: '2024-01-15 11:20:45',
+ mainReason: '检测到气体泄漏',
+ status: '未处理',
+ },
+ {
+ key: '5',
+ id: '005',
+ deviceId: 'DEV-005',
+ riskLevel: '低',
+ warningTime: '2024-01-15 12:10:20',
+ mainReason: '设备振动异常',
+ status: '已处理',
+ },
+ {
+ key: '6',
+ id: '006',
+ deviceId: 'DEV-006',
+ riskLevel: '中',
+ warningTime: '2024-01-15 13:25:15',
+ mainReason: '流量传感器读数异常',
+ status: '未处理',
+ },
+ {
+ key: '7',
+ id: '007',
+ deviceId: 'DEV-007',
+ riskLevel: '高',
+ warningTime: '2024-01-15 14:10:30',
+ mainReason: '储罐压力超限',
+ status: '处理中',
+ },
+ {
+ key: '8',
+ id: '008',
+ deviceId: 'DEV-008',
+ riskLevel: '中',
+ warningTime: '2024-01-15 15:45:20',
+ mainReason: '管道温度异常',
+ status: '已处理',
+ },
+ {
+ key: '9',
+ id: '009',
+ deviceId: 'DEV-009',
+ riskLevel: '高',
+ warningTime: '2024-01-15 16:30:45',
+ mainReason: '阀门控制系统故障',
+ status: '未处理',
+ },
+ {
+ key: '10',
+ id: '010',
+ deviceId: 'DEV-010',
+ riskLevel: '低',
+ warningTime: '2024-01-15 17:15:10',
+ mainReason: '轻微泄漏检测',
+ status: '已处理',
+ },
+ {
+ key: '11',
+ id: '011',
+ deviceId: 'DEV-011',
+ riskLevel: '高',
+ warningTime: '2024-01-15 18:20:35',
+ mainReason: '安全阀异常开启',
+ status: '处理中',
+ },
+ {
+ key: '12',
+ id: '012',
+ deviceId: 'DEV-012',
+ riskLevel: '中',
+ warningTime: '2024-01-15 19:05:50',
+ mainReason: '液位计读数不稳定',
+ status: '未处理',
+ },
+ ];
+
+ // 初始化数据
+ useEffect(() => {
+ setPagination(prev => ({ ...prev, total: mockData.length }));
+ }, []);
+
+ // 根据分页获取当前页数据
+ const getCurrentPageData = () => {
+ const { current, pageSize } = pagination;
+ const startIndex = (current - 1) * pageSize;
+ const endIndex = startIndex + pageSize;
+ return mockData.slice(startIndex, endIndex);
+ };
+
+ // 表格选择变化
+ const onSelectChange = (newSelectedRowKeys, newSelectedRows) => {
+ setSelectedRowKeys(newSelectedRowKeys);
+ setSelectedRows(newSelectedRows);
+ };
+
+ // 分页变化处理
+ const handleTableChange = (pagination) => {
+ setPagination(prev => ({
+ ...prev,
+ current: pagination.current,
+ pageSize: pagination.pageSize,
+ }));
+ };
+
+ return (
+
+ {/* 第一个div - 高度20% */}
+
+
+
+ {/* 块1 */}
+
+
+
总危险源数量
+
65
+
+ ↑
+ 较昨日 +2
+
+
+
+

+
+
+
+ {/* 块2 */}
+
+
+
高风险设备
+
65
+
+ ↑
+ 较昨日 +2
+
+
+
+

+
+
+
+ {/* 块3 */}
+
+
+
今日预警次数
+
65
+
+ ↑
+ 较昨日 +2
+
+
+
+

+
+
-
{
- setModalVisible(false);
- form.resetFields();
- }}
- onOk={() => form.submit()}
- width={700}
- >
-
-
-
+ {/* 块4 */}
+
+
+
未处理预警
+
65
+
+ ↑
+ 较昨日 +2
+
+
+
+

+
+
-
-
-
+ {/* 块5 */}
+
+
+
已处理预警
+
65
+
+
+ 已完成
+
+
+
+

+
+
+
+
+
-
-
-
+
+
+
+
+
+ {/* 风险等级图例 */}
+
+
+
+

+
+
+
-
-
-
+
+
-
-
-
+ {/* 第三个div - 占满剩余位置 */}
+
+
+
+ {/* 第一行块 - 蓝色方块加标题 */}
+
+
+ {/* 第二行块 - 图片 */}
+
+ {/*

*/}
+
+
+ {/* 第三行块 */}
+
+
+ {/* 第四行块 */}
+
+
+ {/* 第五行块 */}
+
+
+
+
+ {/* 表格 */}
+
-
-
-
-
-
-
- );
-};
+ {/* 表格 */}
+
+
+ `共 ${total} 条`,
+ }}
+ scroll={{ x: 1200 }}
+ />
+
+
+
+
+
+ );
+};
-export default RiskAssessment;
+export default RiskAssessment;
\ No newline at end of file
diff --git a/src/pages/business_basic/module/RiskAssessment.less b/src/pages/business_basic/module/RiskAssessment.less
index ea268cc..ab8ffe0 100644
--- a/src/pages/business_basic/module/RiskAssessment.less
+++ b/src/pages/business_basic/module/RiskAssessment.less
@@ -1,241 +1,418 @@
-.risk-assessment {
- padding: 20px;
-
- .ant-card {
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- border-radius: 6px;
-
- .ant-card-head {
- border-bottom: 1px solid #f0f0f0;
-
- .ant-card-head-title {
- font-size: 16px;
- font-weight: 600;
- color: #262626;
- }
- }
+.Rcontainer {
+ padding: 8px 6px 0px 6px;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
- .ant-card-body {
- padding: 20px;
- }
- }
-
- .ant-table {
- .ant-table-thead > tr > th {
- background-color: #fafafa;
- font-weight: 600;
- color: #262626;
- border-bottom: 1px solid #f0f0f0;
- }
+ // 第一个div - 高度20%
+ .RcontainerTop {
+ height: 16%;
+ // background-color: #fff;
+ border-radius: 4px;
+ display: flex;
+ flex-direction: column;
- .ant-table-tbody > tr > td {
- border-bottom: 1px solid #f0f0f0;
- }
+ .sectionContent {
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ // padding: 15px;
- .ant-table-tbody > tr:hover > td {
- background-color: #f5f5f5;
- }
- }
-
- .ant-btn {
- border-radius: 4px;
-
- &.ant-btn-primary {
- background-color: #1890ff;
- border-color: #1890ff;
-
- &:hover {
- background-color: #40a9ff;
- border-color: #40a9ff;
- }
- }
+ .blocksContainer {
+ flex: 1;
+ display: flex;
+ gap: 10px;
+ height: 100%;
- &.ant-btn-link {
- padding: 4px 8px;
- height: auto;
-
- &:hover {
- background-color: #f5f5f5;
- }
- }
- }
-
- .ant-tag {
- border-radius: 4px;
- font-size: 12px;
- padding: 2px 8px;
- }
-
- .ant-rate {
- font-size: 14px;
-
- .ant-rate-star {
- margin-right: 2px;
- }
- }
+ .blockItem {
+ flex: 1;
+ height: 100%;
+ display: flex;
+ background: linear-gradient(170.5deg, #EBEFF4 6.87%, #FFFFFF 92.55%);
+ border-radius: 4px;
+ border: 2px solid #FFFFFF;
- .ant-progress {
- .ant-progress-bg {
- border-radius: 2px;
- }
-
- &.ant-progress-small {
- .ant-progress-text {
- font-size: 10px;
- }
- }
- }
-
- .ant-modal {
- .ant-modal-header {
- border-bottom: 1px solid #f0f0f0;
-
- .ant-modal-title {
- font-size: 16px;
- font-weight: 600;
- color: #262626;
- }
- }
+ .blockLeft {
+ width: 60%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ padding: 15px;
+ padding-left: 20px;
+ gap: 8px;
- .ant-modal-body {
- padding: 24px;
- }
+ .blockTitle {
+ font-family: PingFang SC;
+ font-weight: 400;
+ font-size: 12px;
+ color: #666666;
+ line-height: 1.2;
+ }
- .ant-form-item-label > label {
- font-weight: 500;
- color: #262626;
- }
+ .blockNumber {
+ font-family: PingFang SC;
+ font-weight: 700;
+ font-size: 24px;
+ color: #333333;
+ line-height: 1.2;
+ }
- .ant-input,
- .ant-select-selector {
- border-radius: 4px;
- border: 1px solid #d9d9d9;
-
- &:hover {
- border-color: #40a9ff;
- }
-
- &:focus,
- &.ant-select-focused .ant-select-selector {
- border-color: #40a9ff;
- box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
- }
- }
- }
-
- .ant-pagination {
- margin-top: 16px;
- text-align: right;
-
- .ant-pagination-total-text {
- color: #8c8c8c;
- margin-right: 16px;
- }
- }
-
- // 风险等级颜色
- .risk-level-high {
- color: #ff4d4f;
- font-weight: 600;
- }
-
- .risk-level-medium {
- color: #faad14;
- font-weight: 600;
- }
-
- .risk-level-low {
- color: #52c41a;
- font-weight: 600;
- }
-
- // 状态指示器
- .status-indicator {
- display: inline-flex;
- align-items: center;
- gap: 4px;
-
- &.processed {
- color: #52c41a;
- }
-
- &.pending {
- color: #ff4d4f;
- }
-
- &.monitoring {
- color: #1890ff;
- }
- }
+ .blockChange {
+ font-family: PingFang SC;
+ font-weight: 400;
+ font-size: 12px;
+ color: #1269FF;
+ line-height: 1.2;
+ display: flex;
+ align-items: center;
+ gap: 4px;
- // 评分显示
- .score-display {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 4px;
-
- .score-value {
- font-weight: 600;
- font-size: 14px;
- }
-
- .score-label {
- font-size: 12px;
- color: #8c8c8c;
- }
- }
+ .arrow {
+ font-size: 14px;
+ font-weight: bold;
+ }
- // 概率和影响程度显示
- .rate-display {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 4px;
-
- .rate-stars {
- display: flex;
- align-items: center;
- gap: 2px;
+ .checkIcon {
+ font-size: 16px;
+ color: #1269FF;
+ }
+ }
+ }
+
+ .blockRight {
+ flex: 1;
+ height: 100%;
+ background-color: transparent;
+ border-radius: 0 4px 4px 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ .blockImage {
+ // width: 80%;
+ height: 130%;
+ // height: 80%;
+ object-fit: contain;
+ margin-right: -10px;
+ }
+ }
+ }
+ }
+ }
}
-
- .rate-text {
- font-size: 12px;
- color: #8c8c8c;
+
+ // 第二个div - 高度30%
+ .RcontainerMiddle {
+ height: 30%;
+ border-radius: 4px;
+ display: flex;
+ flex-direction: column;
+
+ .sectionContent {
+ height: 100%;
+ display: flex;
+ display: flex;
+ gap: 10px;
+ height: 100%;
+
+
+
+ .middleBlock1 {
+ flex: 1;
+ height: 100%;
+ background: linear-gradient(170.5deg, #EBEFF4 6.87%, #FFFFFF 53.01%);
+
+ border: 2px solid #fff;
+ border-radius: 4px;
+ position: relative;
+ padding: 0px 10px 10px 2px;
+ font-family: PingFang SC;
+ font-size: 14px;
+ color: #333333;
+
+ .block1Header {
+ position: absolute;
+ top: 5px;
+ left: 10px;
+ right: 10px;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ z-index: 10;
+
+ .block1Title {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ font-weight: 500;
+ font-size: 14px;
+ color: #333333;
+
+ .titleIcon {
+ width: 3px;
+ height: 14px;
+ background-color: #2E4CD4;
+ }
+ }
+
+ .block1Select {
+ width: 100px;
+
+ :global(.ant-select-selector) {
+ height: 28px !important;
+ font-size: 12px !important;
+ }
+
+ :global(.ant-select-selection-item) {
+ line-height: 26px !important;
+ font-size: 12px !important;
+ }
+ }
+ }
+
+ .riskLegend {
+ position: absolute;
+ Top: 18px;
+ left: 50%;
+ transform: translateX(-50%);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 10px;
+ z-index: 10;
+
+ .legendItem {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+
+ .legendDot {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ }
+
+ .legendText {
+ font-size: 12px;
+ color: #333;
+ font-weight: 400;
+ }
+ }
+ }
+
+ .block1Chart {
+ width: 100%;
+ height: 100%;
+ margin-top: 20px;
+
+ .mapImage {
+ margin-top: 7%;
+ width: 90%;
+ height: 77%;
+ object-fit: cover;
+ border-radius: 4px;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ }
+ }
+ }
+
+ .middleBlock2 {
+ flex: 1;
+ height: 100%;
+ // background: linear-gradient(170.5deg, #EBEFF4 6.87%, #FFFFFF 53.01%);
+ // border: 2px solid #fff;
+ background-color: #fff;
+ // border-radius: 4px;
+ display: flex;
+ flex-direction: column;
+ font-family: PingFang SC;
+ font-size: 14px;
+ color: #333333;
+ padding: 5px 10px 5px 10px;
+
+ .middleBlock2Title {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ // margin-bottom: 10px;
+
+ .titleLeft {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ font-weight: 500;
+ font-size: 14px;
+ color: #333333;
+
+ .titleIcon {
+ width: 3px;
+ height: 14px;
+ background-color: #2E4CD4;
+ }
+ }
+
+ .titleRight {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ font-size: 12px;
+ color: #666;
+ }
+ }
+
+ .middleBlock2Chart {
+ width: 100%;
+ height: 100%;
+ // min-height: 200px;
+ }
+ }
+
+ }
}
- }
-
- // 风险矩阵样式
- .risk-matrix {
- display: grid;
- grid-template-columns: repeat(5, 1fr);
- gap: 8px;
- margin: 16px 0;
-
- .matrix-cell {
- padding: 8px;
- text-align: center;
- border: 1px solid #d9d9d9;
- border-radius: 4px;
- font-size: 12px;
-
- &.high-risk {
- background-color: #fff2f0;
- border-color: #ff4d4f;
- color: #ff4d4f;
- }
-
- &.medium-risk {
- background-color: #fffbe6;
- border-color: #faad14;
- color: #faad14;
- }
-
- &.low-risk {
- background-color: #f6ffed;
- border-color: #52c41a;
- color: #52c41a;
- }
+
+ // 第三个div - 占满剩余位置
+ .RcontainerBottom {
+ flex: 1; // 占满剩余空间
+ display: flex;
+ flex-direction: column;
+
+ .sectionContent {
+ display: flex;
+ flex-direction: row;
+ gap: 10px;
+ padding: 0;
+
+ .leftBlock {
+ width: 30%;
+ height: 100%;
+ background: url('@/assets/safe_majorHazard/online_monitoring/risk3.png') no-repeat center center;
+ background-size: cover;
+ padding: 0;
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ padding: 15px;
+
+ .leftBlockTitle {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ font-family: PingFang SC;
+ font-weight: 500;
+ font-size: 14px;
+ color: #333333;
+
+ .titleIcon {
+ width: 3px;
+ height: 16px;
+ background-color: #2E4CD4;
+ }
+ }
+
+ .leftBlockImage {
+ height: 40%;
+ width: 100%;
+ border-radius: 4px;
+ overflow: hidden;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 80%;
+ }
+
+ .leftBlockItem {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ padding: 10px;
+ // background-color: #f5f5f5;
+ border-radius: 4px;
+ font-family: PingFang SC;
+
+ .itemTitle {
+ font-size: 12px;
+ color: #666666;
+ margin-bottom: 5px;
+ }
+
+ .itemValue {
+ font-size: 14px;
+ color: #333333;
+ font-weight: 500;
+ }
+ }
+ }
+
+ .rightBlock {
+ width: 68%;
+ height: 100%;
+ background-color: #fff;
+ padding: 0;
+ display: flex;
+ flex-direction: column;
+
+ .tableHeader {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 8px 15px 5px 15px;
+
+ .tableTitle {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ font-family: PingFang SC;
+ font-weight: 500;
+ font-size: 14px;
+ color: #333333;
+
+ .titleIcon {
+ width: 3px;
+ height: 16px;
+ background-color: #2E4CD4;
+ }
+ }
+ }
+
+ .tableContainer {
+ flex: 1;
+ overflow: hidden;
+
+ :global(.ant-table) {
+ font-size: 12px;
+ }
+
+ :global(.ant-table-thead > tr > th) {
+ background-color: #f5f5fa;
+ font-weight: 500;
+ font-size: 14px;
+ color: #333333;
+ border-bottom: 1px solid #f0f0f0;
+ padding: 8px 12px;
+ text-align: center;
+ }
+
+ :global(.ant-table-tbody > tr > td) {
+ padding: 8px 12px;
+ border-bottom: 1px solid #f0f0f0;
+ text-align: center;
+ }
+
+ :global(.ant-table-tbody > tr:hover > td) {
+ background-color: #f5f5f5;
+ }
+
+ :global(.ant-pagination) {
+ margin-top: 16px;
+ text-align: right;
+ }
+ }
+ }
+ }
}
- }
-}
+}
\ No newline at end of file