|
|
|
@ -1,6 +1,8 @@
|
|
|
|
import React, { useState, useEffect, useRef } from 'react';
|
|
|
|
import React, { useState, useEffect, useRef } from 'react';
|
|
|
|
import { Button } from "antd";
|
|
|
|
import { Button, DatePicker } from "antd";
|
|
|
|
import { ClockCircleOutlined, EnvironmentOutlined, UserOutlined } from '@ant-design/icons';
|
|
|
|
import { ClockCircleOutlined, EnvironmentOutlined, UserOutlined, CalendarOutlined } from '@ant-design/icons';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { RangePicker } = DatePicker;
|
|
|
|
import * as echarts from 'echarts';
|
|
|
|
import * as echarts from 'echarts';
|
|
|
|
import styles from './EmergencyDrill.less';
|
|
|
|
import styles from './EmergencyDrill.less';
|
|
|
|
import { Import } from '../business_hiddentrouble/component/hiddenDangerInspection/hiddenDangerInspection';
|
|
|
|
import { Import } from '../business_hiddentrouble/component/hiddenDangerInspection/hiddenDangerInspection';
|
|
|
|
@ -9,15 +11,17 @@ import iconDrill1 from '../../assets/business_Emergency/iconDrill1.svg';
|
|
|
|
import iconDrill2 from '../../assets/business_Emergency/iconDrill2.jpg';
|
|
|
|
import iconDrill2 from '../../assets/business_Emergency/iconDrill2.jpg';
|
|
|
|
import iconDrill3 from '../../assets/business_Emergency/iconDrill3.svg';
|
|
|
|
import iconDrill3 from '../../assets/business_Emergency/iconDrill3.svg';
|
|
|
|
import iconDrill4 from '../../assets/business_Emergency/iconDrill4.svg';
|
|
|
|
import iconDrill4 from '../../assets/business_Emergency/iconDrill4.svg';
|
|
|
|
|
|
|
|
import iconDrill5 from '../../assets/business_Emergency/iconDrill5.svg';
|
|
|
|
|
|
|
|
import iconDrill6 from '../../assets/business_Emergency/iconDrill6.svg';
|
|
|
|
|
|
|
|
import iconDrill7 from '../../assets/business_Emergency/iconDrill7.svg';
|
|
|
|
|
|
|
|
|
|
|
|
const EmergencyDrill = () => {
|
|
|
|
const EmergencyDrill = () => {
|
|
|
|
const [timeType, setTimeType] = useState('month');
|
|
|
|
const [timeType, setTimeType] = useState('month');
|
|
|
|
const chartRef = useRef(null);
|
|
|
|
const chartRef = useRef(null);
|
|
|
|
const chartInstanceRef = useRef(null);
|
|
|
|
const chartInstanceRef = useRef(null);
|
|
|
|
|
|
|
|
|
|
|
|
// 第三块状态
|
|
|
|
// 第三块状态
|
|
|
|
const [startDate, setStartDate] = useState('2024-08-23 00:00');
|
|
|
|
const [dateRange, setDateRange] = useState(null);
|
|
|
|
const [endDate, setEndDate] = useState('2024-08-23 00:00');
|
|
|
|
|
|
|
|
const [companyName, setCompanyName] = useState('');
|
|
|
|
const [companyName, setCompanyName] = useState('');
|
|
|
|
const [unitName, setUnitName] = useState('');
|
|
|
|
const [unitName, setUnitName] = useState('');
|
|
|
|
const [pagination, setPagination] = useState({
|
|
|
|
const [pagination, setPagination] = useState({
|
|
|
|
@ -113,6 +117,15 @@ const EmergencyDrill = () => {
|
|
|
|
|
|
|
|
|
|
|
|
chartInstanceRef.current.setOption(option);
|
|
|
|
chartInstanceRef.current.setOption(option);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 使用 ResizeObserver 监听容器尺寸变化
|
|
|
|
|
|
|
|
const resizeObserver = new ResizeObserver(() => {
|
|
|
|
|
|
|
|
chartInstanceRef.current?.resize();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (chartRef.current) {
|
|
|
|
|
|
|
|
resizeObserver.observe(chartRef.current);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 窗口大小变化时重新渲染
|
|
|
|
// 窗口大小变化时重新渲染
|
|
|
|
const handleResize = () => {
|
|
|
|
const handleResize = () => {
|
|
|
|
chartInstanceRef.current?.resize();
|
|
|
|
chartInstanceRef.current?.resize();
|
|
|
|
@ -120,6 +133,7 @@ const EmergencyDrill = () => {
|
|
|
|
window.addEventListener('resize', handleResize);
|
|
|
|
window.addEventListener('resize', handleResize);
|
|
|
|
|
|
|
|
|
|
|
|
return () => {
|
|
|
|
return () => {
|
|
|
|
|
|
|
|
resizeObserver.disconnect();
|
|
|
|
window.removeEventListener('resize', handleResize);
|
|
|
|
window.removeEventListener('resize', handleResize);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}, [timeType]);
|
|
|
|
}, [timeType]);
|
|
|
|
@ -276,6 +290,15 @@ const EmergencyDrill = () => {
|
|
|
|
|
|
|
|
|
|
|
|
chartInstanceRef2.current.setOption(option);
|
|
|
|
chartInstanceRef2.current.setOption(option);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 使用 ResizeObserver 监听容器尺寸变化
|
|
|
|
|
|
|
|
const resizeObserver = new ResizeObserver(() => {
|
|
|
|
|
|
|
|
chartInstanceRef2.current?.resize();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (chartRef2.current) {
|
|
|
|
|
|
|
|
resizeObserver.observe(chartRef2.current);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 窗口大小变化时重新渲染
|
|
|
|
// 窗口大小变化时重新渲染
|
|
|
|
const handleResize = () => {
|
|
|
|
const handleResize = () => {
|
|
|
|
chartInstanceRef2.current?.resize();
|
|
|
|
chartInstanceRef2.current?.resize();
|
|
|
|
@ -283,6 +306,7 @@ const EmergencyDrill = () => {
|
|
|
|
window.addEventListener('resize', handleResize);
|
|
|
|
window.addEventListener('resize', handleResize);
|
|
|
|
|
|
|
|
|
|
|
|
return () => {
|
|
|
|
return () => {
|
|
|
|
|
|
|
|
resizeObserver.disconnect();
|
|
|
|
window.removeEventListener('resize', handleResize);
|
|
|
|
window.removeEventListener('resize', handleResize);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}, []);
|
|
|
|
}, []);
|
|
|
|
@ -292,7 +316,7 @@ const EmergencyDrill = () => {
|
|
|
|
<div className={styles.block1}>
|
|
|
|
<div className={styles.block1}>
|
|
|
|
<div className={styles.block1_item1}>
|
|
|
|
<div className={styles.block1_item1}>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className={styles.item1_row1}>
|
|
|
|
<div className={styles.item1_row1}>
|
|
|
|
<div className={styles.row1_left}>
|
|
|
|
<div className={styles.row1_left}>
|
|
|
|
<div className={styles.colorBlock}></div>
|
|
|
|
<div className={styles.colorBlock}></div>
|
|
|
|
@ -313,7 +337,7 @@ const EmergencyDrill = () => {
|
|
|
|
<img src={iconDrill1} alt="drill icon" className={styles.drillIcon} />
|
|
|
|
<img src={iconDrill1} alt="drill icon" className={styles.drillIcon} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className={styles.item1_row3}>
|
|
|
|
<div className={styles.item1_row3}>
|
|
|
|
<div className={styles.row3_left}>
|
|
|
|
<div className={styles.row3_left}>
|
|
|
|
<div className={styles.row3_title}>化工事故应急预案</div>
|
|
|
|
<div className={styles.row3_title}>化工事故应急预案</div>
|
|
|
|
@ -334,7 +358,7 @@ const EmergencyDrill = () => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className={styles.block1_item2}>
|
|
|
|
<div className={styles.block1_item2}>
|
|
|
|
<div className={styles.item2_row1}>
|
|
|
|
<div className={styles.item2_row1}>
|
|
|
|
<div className={styles.row1_left}>
|
|
|
|
<div className={styles.row1_left}>
|
|
|
|
@ -342,19 +366,19 @@ const EmergencyDrill = () => {
|
|
|
|
<span className={styles.title}>演练数据统计</span>
|
|
|
|
<span className={styles.title}>演练数据统计</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.timeBtnGroup}>
|
|
|
|
<div className={styles.timeBtnGroup}>
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
className={timeType === 'month' ? 'active' : ''}
|
|
|
|
className={timeType === 'month' ? 'active' : ''}
|
|
|
|
onClick={() => setTimeType('month')}
|
|
|
|
onClick={() => setTimeType('month')}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
月
|
|
|
|
月
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
className={timeType === 'season' ? 'active' : ''}
|
|
|
|
className={timeType === 'season' ? 'active' : ''}
|
|
|
|
onClick={() => setTimeType('season')}
|
|
|
|
onClick={() => setTimeType('season')}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
季
|
|
|
|
季
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
className={timeType === 'year' ? 'active' : ''}
|
|
|
|
className={timeType === 'year' ? 'active' : ''}
|
|
|
|
onClick={() => setTimeType('year')}
|
|
|
|
onClick={() => setTimeType('year')}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
@ -366,7 +390,7 @@ const EmergencyDrill = () => {
|
|
|
|
<div ref={chartRef} className={styles.chartContainer}></div>
|
|
|
|
<div ref={chartRef} className={styles.chartContainer}></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className={styles.block1_item3}>
|
|
|
|
<div className={styles.block1_item3}>
|
|
|
|
<div className={styles.item3_header}>
|
|
|
|
<div className={styles.item3_header}>
|
|
|
|
<div className={styles.colorBlock}></div>
|
|
|
|
<div className={styles.colorBlock}></div>
|
|
|
|
@ -376,7 +400,7 @@ const EmergencyDrill = () => {
|
|
|
|
<div ref={chartRef2} className={styles.chartContainer}></div>
|
|
|
|
<div ref={chartRef2} className={styles.chartContainer}></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className={styles.block2}>
|
|
|
|
<div className={styles.block2}>
|
|
|
|
<div className={styles.block2_item1}>
|
|
|
|
<div className={styles.block2_item1}>
|
|
|
|
<div className={styles.block2_item1_header}>
|
|
|
|
<div className={styles.block2_item1_header}>
|
|
|
|
@ -483,13 +507,13 @@ const EmergencyDrill = () => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className={styles.block2_item2}>
|
|
|
|
<div className={styles.block2_item2}>
|
|
|
|
<div className={styles.sectionHeader}>
|
|
|
|
<div className={styles.sectionHeader}>
|
|
|
|
<div className={styles.headerLine}></div>
|
|
|
|
<div className={styles.headerLine}></div>
|
|
|
|
<span className={styles.headerTitle}>现场视频</span>
|
|
|
|
<span className={styles.headerTitle}>现场视频</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className={styles.videoContainer}>
|
|
|
|
<div className={styles.videoContainer}>
|
|
|
|
{[1, 2, 3].map((item, index) => (
|
|
|
|
{[1, 2, 3].map((item, index) => (
|
|
|
|
<div key={index} className={styles.videoCard}>
|
|
|
|
<div key={index} className={styles.videoCard}>
|
|
|
|
@ -512,7 +536,7 @@ const EmergencyDrill = () => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className={styles.block3}>
|
|
|
|
<div className={styles.block3}>
|
|
|
|
{/* 第三块内容区域 */}
|
|
|
|
{/* 第三块内容区域 */}
|
|
|
|
<div className={styles.block3Header}>
|
|
|
|
<div className={styles.block3Header}>
|
|
|
|
@ -523,26 +547,45 @@ const EmergencyDrill = () => {
|
|
|
|
<div className={styles.searchBar}>
|
|
|
|
<div className={styles.searchBar}>
|
|
|
|
<div className={styles.searchLeft}>
|
|
|
|
<div className={styles.searchLeft}>
|
|
|
|
<div className={styles.searchItem}>
|
|
|
|
<div className={styles.searchItem}>
|
|
|
|
<span className={styles.searchLabel}>演练日期</span>
|
|
|
|
<span className={styles.searchLabel}>演练日期:</span>
|
|
|
|
<input
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', border: '1px solid #DDDEE6', borderRadius: '2px' }}>
|
|
|
|
type="text"
|
|
|
|
<div className={styles.datePickerWithIcon}>
|
|
|
|
className={styles.dateInput}
|
|
|
|
<img src={iconDrill5} alt="日期icon" className={styles.dateIcon} />
|
|
|
|
value={startDate}
|
|
|
|
<DatePicker
|
|
|
|
onChange={(e) => setStartDate(e.target.value)}
|
|
|
|
showTime={{ format: 'HH:mm' }}
|
|
|
|
placeholder="请输入演练日期"
|
|
|
|
format="YYYY-MM-DD HH:mm"
|
|
|
|
/>
|
|
|
|
value={dateRange ? dateRange[0] : null}
|
|
|
|
<span className={styles.dateSeparator}>~</span>
|
|
|
|
onChange={(value) => {
|
|
|
|
<input
|
|
|
|
setDateRange([value, dateRange ? dateRange[1] : null]);
|
|
|
|
type="text"
|
|
|
|
}}
|
|
|
|
className={styles.dateInput}
|
|
|
|
placeholder="请输入演练日期"
|
|
|
|
value={endDate}
|
|
|
|
className={styles.datePickerFirst}
|
|
|
|
onChange={(e) => setEndDate(e.target.value)}
|
|
|
|
suffixIcon={null}
|
|
|
|
placeholder="请输入演练日期"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{/* 短线 */}
|
|
|
|
|
|
|
|
<div className={styles.dateSeparator}></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className={styles.datePickerWithIcon}>
|
|
|
|
|
|
|
|
<img src={iconDrill5} alt="日期icon" className={styles.dateIcon} />
|
|
|
|
|
|
|
|
<DatePicker
|
|
|
|
|
|
|
|
showTime={{ format: 'HH:mm' }}
|
|
|
|
|
|
|
|
format="YYYY-MM-DD HH:mm"
|
|
|
|
|
|
|
|
value={dateRange ? dateRange[1] : null}
|
|
|
|
|
|
|
|
onChange={(value) => {
|
|
|
|
|
|
|
|
setDateRange([dateRange ? dateRange[0] : null, value]);
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
placeholder="请输入演练日期"
|
|
|
|
|
|
|
|
className={styles.datePickerFirst}
|
|
|
|
|
|
|
|
suffixIcon={null}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className={styles.searchItem}>
|
|
|
|
<div className={styles.searchItem}>
|
|
|
|
<input
|
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
type="text"
|
|
|
|
className={styles.companyInput}
|
|
|
|
className={styles.companyInput}
|
|
|
|
value={companyName}
|
|
|
|
value={companyName}
|
|
|
|
onChange={(e) => setCompanyName(e.target.value)}
|
|
|
|
onChange={(e) => setCompanyName(e.target.value)}
|
|
|
|
@ -550,7 +593,7 @@ const EmergencyDrill = () => {
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.searchItem}>
|
|
|
|
<div className={styles.searchItem}>
|
|
|
|
<select
|
|
|
|
<select
|
|
|
|
className={styles.unitSelect}
|
|
|
|
className={styles.unitSelect}
|
|
|
|
value={unitName}
|
|
|
|
value={unitName}
|
|
|
|
onChange={(e) => setUnitName(e.target.value)}
|
|
|
|
onChange={(e) => setUnitName(e.target.value)}
|
|
|
|
@ -560,18 +603,18 @@ const EmergencyDrill = () => {
|
|
|
|
<option value="unit2">单位2</option>
|
|
|
|
<option value="unit2">单位2</option>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
type="primary"
|
|
|
|
type="primary"
|
|
|
|
className={styles.searchButton}
|
|
|
|
className={styles.searchButton}
|
|
|
|
icon={<span style={{marginRight: 4}}>🔍</span>}
|
|
|
|
icon={<img src={iconDrill6} alt="查询icon" style={{ width: 14, height: 14 }} />}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
查询
|
|
|
|
查询
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
type="primary"
|
|
|
|
type="primary"
|
|
|
|
className={styles.uploadButton}
|
|
|
|
className={styles.uploadButton}
|
|
|
|
icon={<span style={{marginRight: 4}}>+</span>}
|
|
|
|
icon={<img src={iconDrill7} alt="上传icon" style={{ width: 14, height: 14 }} />}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
上传
|
|
|
|
上传
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
@ -587,7 +630,7 @@ const EmergencyDrill = () => {
|
|
|
|
company: '文登市兴文新材料有限公司',
|
|
|
|
company: '文登市兴文新材料有限公司',
|
|
|
|
drillDate: '2025-10-13 02:59:33',
|
|
|
|
drillDate: '2025-10-13 02:59:33',
|
|
|
|
drillType: '化学品泄漏',
|
|
|
|
drillType: '化学品泄漏',
|
|
|
|
drillLocation: '西辛南区6号(旧办厂区南侧)',
|
|
|
|
drillLocation: '西辛南区6号',
|
|
|
|
participants: 40,
|
|
|
|
participants: 40,
|
|
|
|
score: '83分',
|
|
|
|
score: '83分',
|
|
|
|
status: '进行中',
|
|
|
|
status: '进行中',
|
|
|
|
@ -641,27 +684,27 @@ const EmergencyDrill = () => {
|
|
|
|
title: '演练地点',
|
|
|
|
title: '演练地点',
|
|
|
|
dataIndex: 'drillLocation',
|
|
|
|
dataIndex: 'drillLocation',
|
|
|
|
key: 'drillLocation',
|
|
|
|
key: 'drillLocation',
|
|
|
|
width: 200,
|
|
|
|
width: 160,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: '参加人数',
|
|
|
|
title: '参加人数',
|
|
|
|
dataIndex: 'participants',
|
|
|
|
dataIndex: 'participants',
|
|
|
|
key: 'participants',
|
|
|
|
key: 'participants',
|
|
|
|
width: 100,
|
|
|
|
width: 80,
|
|
|
|
align: 'center',
|
|
|
|
align: 'center',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: '评分',
|
|
|
|
title: '评分',
|
|
|
|
dataIndex: 'score',
|
|
|
|
dataIndex: 'score',
|
|
|
|
key: 'score',
|
|
|
|
key: 'score',
|
|
|
|
width: 100,
|
|
|
|
width: 80,
|
|
|
|
align: 'center',
|
|
|
|
align: 'center',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: '状态',
|
|
|
|
title: '状态',
|
|
|
|
dataIndex: 'status',
|
|
|
|
dataIndex: 'status',
|
|
|
|
key: 'status',
|
|
|
|
key: 'status',
|
|
|
|
width: 100,
|
|
|
|
width: 80,
|
|
|
|
align: 'center',
|
|
|
|
align: 'center',
|
|
|
|
render: (status) => {
|
|
|
|
render: (status) => {
|
|
|
|
let className = styles.statusInProgress;
|
|
|
|
let className = styles.statusInProgress;
|
|
|
|
@ -685,7 +728,7 @@ const EmergencyDrill = () => {
|
|
|
|
<div className={styles.actionButtons}>
|
|
|
|
<div className={styles.actionButtons}>
|
|
|
|
<span className={styles.actionLink}>查看</span>
|
|
|
|
<span className={styles.actionLink}>查看</span>
|
|
|
|
<span className={styles.actionLink}>下载</span>
|
|
|
|
<span className={styles.actionLink}>下载</span>
|
|
|
|
<span className={styles.actionLink} style={{color: '#FF4D4F'}}>删除</span>
|
|
|
|
<span className={styles.actionLink} style={{ color: '#FF4D4F' }}>删除</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|