处置救援

main
wangyunfei 15 hours ago
parent 4a9b30d821
commit 186a92a581

@ -1,10 +1,10 @@
import React, { useState, useEffect } from 'react';
import { Input, Button, Select, message, Modal } from 'antd';
import { Input, Button, Select, message, Modal, DatePicker } from 'antd';
import { SearchOutlined, PlusOutlined, DeleteOutlined, EditOutlined } from '@ant-design/icons';
import StandardTable from '@/components/StandardTable';
import styles from './czjy.less';
import iconsc from '@/assets/yjzygl/iconsc.svg';
import iconDrill5 from '@/assets/business_Emergency/iconDrill5.svg';
const { Option } = Select;
@ -12,6 +12,7 @@ const Czjy = () => {
const [loading, setLoading] = useState(false);
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
const [searchValue, setSearchValue] = useState(undefined);
const [dateRange, setDateRange] = useState([null, null]);
const [pagination, setPagination] = useState({
current: 1,
pageSize: 10,
@ -25,177 +26,221 @@ const Czjy = () => {
const [dataSource, setDataSource] = useState([
{
key: '1',
number: '01',
fireName: '消防点一',
waterPointName: '消防池 01',
hydrantCount: 97,
hydrantLocation: '一楼走廊',
range: 97,
waterType: '企业消防水池',
personInCharge: '冯钰涛',
fireImage: '点击查看图片',
remarks: '无',
type: '泄漏',
time: '2025-10-10 17:08:13',
location: '一号仓库',
event: '储罐气体泄漏',
emergencyResource: '---',
hazardSource: '储罐',
protectionTarget: '泄露区域人员',
shelterPlace: '应急路散点',
commandPlan: '泄漏应急指挥方案',
rescuePlan: '救援方案一',
guaranteePlan: '---',
emergencyPlan: '应急预案',
},
{
key: '2',
number: '02',
fireName: '消防点二',
waterPointName: '消防池 02',
hydrantCount: 96,
hydrantLocation: '二楼走廊',
range: 96,
waterType: '企业消防水池',
personInCharge: '周静',
fireImage: '点击查看图片',
remarks: '备注二二',
},
{
key: '3',
number: '03',
fireName: '消防点三',
waterPointName: '消防池 03',
hydrantCount: 91,
hydrantLocation: '三楼图书馆门口',
range: 91,
waterType: '企业消防水池',
personInCharge: '何能',
fireImage: '点击查看图片',
remarks: '备注三三',
},
{
key: '4',
number: '04',
fireName: '消防点四',
waterPointName: '消防池 04',
hydrantCount: 59,
hydrantLocation: '三楼应急通道口',
range: 59,
waterType: '企业消防水池',
personInCharge: '冯新',
fireImage: '点击查看图片',
remarks: '备注四四',
},
{
key: '5',
number: '05',
fireName: '消防点五',
waterPointName: '消防池 05',
hydrantCount: 50,
hydrantLocation: '负一层东侧走廊',
range: 50,
waterType: '企业消防水池',
personInCharge: '赵俊英',
fireImage: '点击查看图片',
remarks: '备注五五',
},
{
key: '6',
number: '06',
fireName: '消防点六',
waterPointName: '消防池 06',
hydrantCount: 48,
hydrantLocation: '四楼c西侧走廊',
range: 48,
waterType: '企业消防水池',
personInCharge: '赵中琏',
fireImage: '点击查看图片',
remarks: '备注六六',
type: '火灾',
time: '2025-10-08 09:21:56',
location: '三楼会议室',
event: '电路老化起火',
emergencyResource: '---',
hazardSource: '挥源',
protectionTarget: '区域内人员及物资',
shelterPlace: '应急路散点',
commandPlan: '火灾应急指挥方案',
rescuePlan: '救援方案二',
guaranteePlan: '---',
emergencyPlan: '应急预案',
},
]);
// 表格列配置
const columns = [
{
title: '编号',
dataIndex: 'number',
key: 'number',
width: 80,
},
{
title: '消防点名称',
dataIndex: 'fireName',
key: 'fireName',
width: 120,
},
{
title: '消防取水点名称',
dataIndex: 'waterPointName',
key: 'waterPointName',
width: 140,
},
{
title: '消防栓数量',
dataIndex: 'hydrantCount',
key: 'hydrantCount',
width: 110,
},
{
title: '消防栓位置',
dataIndex: 'hydrantLocation',
key: 'hydrantLocation',
width: 150,
},
{
title: '射程',
dataIndex: 'range',
key: 'range',
title: '类型',
dataIndex: 'type',
key: 'type',
width: 80,
align: 'center',
},
{
title: '消防栓用水类型',
dataIndex: 'waterType',
key: 'waterType',
width: 140,
},
{
title: '负责人',
dataIndex: 'personInCharge',
key: 'personInCharge',
width: 100,
title: '应急事件',
key: 'emergencyEvent',
children: [
{
title: '时间',
dataIndex: 'time',
key: 'time',
width: 160,
align: 'center',
onHeaderCell: () => ({
style: { borderWidth: '1px 0px 0px 1px' }
}),
onCell: () => ({
style: { borderWidth: '1px 0px 1px 1px' }
})
},
{
title: '地点',
dataIndex: 'location',
key: 'location',
width: 100,
align: 'center',
onHeaderCell: () => ({
style: { borderWidth: '1px 0px 0px 1px' }
}),
onCell: () => ({
style: { borderWidth: '1px 0px 1px 1px' }
})
},
{
title: '事件',
dataIndex: 'event',
key: 'event',
width: 120,
align: 'center',
onHeaderCell: () => ({
style: { borderWidth: '1px 1px 0px 1px' }
}),
onCell: () => ({
style: { borderWidth: '1px 1px 1px 1px' }
})
},
],
},
{
title: '消防点图片',
dataIndex: 'fireImage',
key: 'fireImage',
width: 120,
render: (text) => (
<Button
type="link"
size="small"
onClick={() => message.info('查看图片功能待实现')}
>
{text}
</Button>
),
title: '联动分析',
key: 'linkageAnalysis',
children: [
{
title: '应急资源',
dataIndex: 'emergencyResource',
key: 'emergencyResource',
width: 90,
align: 'center',
onHeaderCell: () => ({
style: { borderWidth: '1px 0px 0px 1px' }
}),
onCell: () => ({
style: { borderWidth: '1px 0px 1px 1px' }
})
},
{
title: '危险源',
dataIndex: 'hazardSource',
key: 'hazardSource',
width: 90,
align: 'center',
onHeaderCell: () => ({
style: { borderWidth: '1px 0px 0px 1px' }
}),
onCell: () => ({
style: { borderWidth: '1px 0px 1px 1px' }
})
},
{
title: '防护目标',
dataIndex: 'protectionTarget',
key: 'protectionTarget',
width: 160,
align: 'center',
onHeaderCell: () => ({
style: { borderWidth: '1px 0px 0px 1px' }
}),
onCell: () => ({
style: { borderWidth: '1px 0px 1px 1px' }
})
},
{
title: '避难场所',
dataIndex: 'shelterPlace',
key: 'shelterPlace',
width: 120,
align: 'center',
onHeaderCell: () => ({
style: { borderWidth: '1px 1px 0px 1px' }
}),
onCell: () => ({
style: { borderWidth: '1px 1px 1px 1px' }
})
},
],
},
{
title: '备注',
dataIndex: 'remarks',
key: 'remarks',
width: 100,
title: '应急预案',
key: 'emergencyPlan',
children: [{
title: '指挥方案',
dataIndex: 'commandPlan',
key: 'commandPlan',
width: 160,
align: 'center',
onHeaderCell: () => ({
style: { borderWidth: '1px 0px 0px 1px' }
}),
onCell: () => ({
style: { borderWidth: '1px 0px 1px 1px' }
})
},
{
title: '救援方案',
dataIndex: 'rescuePlan',
key: 'rescuePlan',
width: 120,
align: 'center',
onHeaderCell: () => ({
style: { borderWidth: '1px 0px 0px 1px' }
}),
onCell: () => ({
style: { borderWidth: '1px 0px 1px 1px' }
})
},
{
title: '保障方案',
dataIndex: 'guaranteePlan',
key: 'guaranteePlan',
width: 100,
align: 'center',
onHeaderCell: () => ({
style: { borderWidth: '1px 1px 0px 1px' }
}),
onCell: () => ({
style: { borderWidth: '1px 1px 1px 1px' }
})
},
]
},
{
title: '操作',
key: 'action',
width: 120,
align: 'center',
onHeaderCell: () => ({
style: { borderWidth: '1px 0px 0px 1px' }
}),
onCell: () => ({
style: { borderWidth: '1px 0px 1px 1px' }
}),
render: (text, record) => (
<div className={styles.actionButtons}>
<Button
type="link"
size="small"
// icon={<EditOutlined />}
onClick={() => handleEdit(record)}
<Button
type="link"
size="small"
onClick={() => handleUpload(record)}
>
修改
上传
</Button>
<Button
type="link"
size="small"
danger
// icon={<DeleteOutlined />}
onClick={() => handleDelete(record)}
<Button
type="link"
size="small"
onClick={() => handleDistribute(record)}
>
删除
分发
</Button>
</div>
),
@ -234,21 +279,14 @@ const Czjy = () => {
});
};
// 编辑处理
const handleEdit = (record) => {
message.info(`编辑 ${record.fireName} 的信息`);
// 上传处理
const handleUpload = (record) => {
message.info(`上传 ${record.type} 事件的相关资料`);
};
// 删除处理
const handleDelete = (record) => {
Modal.confirm({
title: '确认删除',
content: `确定要删除 ${record.fireName} 吗?`,
onOk() {
setDataSource(dataSource.filter(item => item.key !== record.key));
message.success('删除成功');
},
});
// 分发处理
const handleDistribute = (record) => {
message.info(`分发 ${record.type} 事件的应急预案`);
};
// 分页处理
@ -257,39 +295,70 @@ const Czjy = () => {
};
return (
<div className={styles.containerCZYJ}>
<div className={styles.containerCzjy}>
{/* 页面标题 */}
<div className={styles.header}>
<div className={styles.titleBar}></div>
<h2 className={styles.title}>处置救援</h2>
<h2 className={styles.title}>处置经验</h2>
</div>
{/* 搜索和操作区域 */}
<div className={styles.searchBar}>
<div className={styles.searchLeft}>
<div className={styles.searchItem}>
<span className={styles.searchLabel}>事件时间:</span>
<div style={{ display: 'flex', alignItems: 'center', border: '1px solid #DDDEE6', borderRadius: '2px' }}>
<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[0] : null}
onChange={(value) => {
setDateRange([value, dateRange ? dateRange[1] : null]);
}}
placeholder="请输入日期"
className={styles.datePickerFirst}
suffixIcon={null}
/>
</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>
<Select
placeholder="事故类型"
placeholder="事故地点"
value={searchValue}
onChange={setSearchValue}
style={{width: 180}}
style={{ width: 180 }}
className={styles.customSelect}
allowClear
>
<Option value="火灾事故">火灾事故</Option>
<Option value="爆炸事故">爆炸事故</Option>
<Option value="危化品泄漏">危化品泄漏</Option>
<Option value="触电事故">触电事故</Option>
<Option value="高处坠落">高处坠落</Option>
<Option value="其他事故">其他事故</Option>
<Option value="一号仓库">一号仓库</Option>
<Option value="二号仓库">二号仓库</Option>
<Option value="三号仓库">三号仓库</Option>
<Option value="三楼会议室">三楼会议室</Option>
<Option value="生产车间">生产车间</Option>
<Option value="其他">其他</Option>
</Select>
<Input
placeholder="输入报警人"
style={{width: 180}}
className={styles.customInput}
allowClear
/>
<Button
type="primary"
<Button
type="primary"
icon={<SearchOutlined />}
onClick={handleSearch}
loading={loading}
@ -298,16 +367,6 @@ const Czjy = () => {
查询
</Button>
</div>
<div className={styles.searchRight}>
<Button
type="primary"
icon={<PlusOutlined />}
onClick={handleAdd}
className={styles.customButton}
>
新增
</Button>
</div>
</div>
{/* 数据表格 */}

@ -1,4 +1,4 @@
.containerCZYJ {
.containerCzjy {
padding: 20px;
background: #fff;
height:100vh;
@ -32,18 +32,132 @@
margin-bottom: 10px;
padding: 5px;
.searchLeft {
.searchItem {
display: flex;
align-items: center;
gap: 12px;
}
gap: 8px;
.searchLabel {
font-size: 13px;
color: #333333;
white-space: nowrap;
}
.datePickerWithIcon {
display: inline-flex;
align-items: center;
height: 30px;
border: none;
.dateIcon {
display: flex;
align-items: center;
padding: 0 0px 0 14px;
border: none;
}
.datePickerFirst {
height: 28px;
width: 125px;
border: none;
:global {
.ant-picker-input>input::placeholder {
color: #666 !important;
font-size: 13px;
}
}
}
:global {
.ant-picker-focused {
box-shadow: none;
}
}
.datePicker {
flex: 1;
border: none;
background: transparent;
}
}
.dateSeparator {
width: 12px;
height: 1px;
background-color: #999;
flex-shrink: 0;
}
.dateInput {
width: 150px;
height: 32px;
padding: 0 12px;
border: none;
font-size: 13px;
outline: none;
transition: all 0.3s;
&:focus {
border-color: #2E4CD4;
}
&::placeholder {
color: #666;
}
}
.companyInput {
width: 150px;
height: 31px;
padding: 0 8px;
border: 1px solid #D9D9D9;
border-radius: 2px;
font-size: 13px;
outline: none;
transition: all 0.3s;
&:focus {
border-color: #2E4CD4;
}
&::placeholder {
color: #666;
}
}
.unitSelect {
color: #666;
width: 150px;
height: 31px;
padding: 0 6px;
border: 1px solid #D9D9D9;
border-radius: 2px;
font-size: 13px;
outline: none;
background-color: #FFFFFF;
cursor: pointer;
transition: all 0.3s;
&:focus {
border-color: #2E4CD4;
}
option {
padding: 8px;
}
}
}
.searchRight {
.searchLeft {
display: flex;
align-items: center;
gap: 12px;
}
}
// 自定义 Select 样式
@ -67,19 +181,11 @@
.ant-select-selection-placeholder {
color: #666 !important;
font-size: 13px !important;
}
}
}
// 自定义 Input 样式
.customInput {
height: 30px !important;
border-radius: 2px !important;
&::placeholder {
color: #666 !important;
}
}
// 自定义按钮样式
.customButton {
@ -88,6 +194,7 @@
border-radius: 2px !important;
height: 30px !important;
width: 75px;
font-size: 13px !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
@ -134,20 +241,38 @@
// 表格样式优化
.tableContainer {
:global {
// 表格边框合并,避免重复叠加
.ant-table {
border: 1px solid #E2E2E2;
border-radius: 2px;
}
.ant-table-thead > tr > th {
background: #F5F5FA;
font-weight: 500;
color: #333333;
font-size: 14px;
text-align: center;
border-right: 1px solid #E2E2E2;
border-bottom: 1px solid #E2E2E2;
}
// 覆盖 Ant Design 的默认样式,让有 colspan 的表头也显示下边框
.ant-table-thead > tr:not(:last-child) > th[colspan] {
border-bottom: 1px solid #E2E2E2 !important;
}
.ant-table-tbody > tr > td {
color: #666666;
font-size: 13px;
text-align: center;
border-right: 1px solid #E2E2E2;
border-bottom: 1px solid #E2E2E2;
}
.ant-table-tbody > tr:hover > td {
background: #f5f5f5;
}

Loading…
Cancel
Save