You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
171 lines
5.2 KiB
JavaScript
171 lines
5.2 KiB
JavaScript
|
22 hours ago
|
import React, { useState } from 'react';
|
||
|
|
import { Input, Button, Select, message } from 'antd';
|
||
|
|
import { SearchOutlined, PlusOutlined } from '@ant-design/icons';
|
||
|
6 days ago
|
import StandardTable from '@/components/StandardTable';
|
||
|
22 hours ago
|
import styles from './czjy.less';
|
||
|
6 days ago
|
|
||
|
|
import iconsc from '@/assets/yjzygl/iconsc.svg';
|
||
|
|
|
||
|
|
const { Option } = Select;
|
||
|
6 days ago
|
|
||
|
22 hours ago
|
const Czjy = () => {
|
||
|
6 days ago
|
const [loading, setLoading] = useState(false);
|
||
|
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||
|
|
const [searchValue, setSearchValue] = useState('');
|
||
|
|
const [pagination, setPagination] = useState({
|
||
|
|
current: 1,
|
||
|
|
pageSize: 10,
|
||
|
22 hours ago
|
total: 0,
|
||
|
6 days ago
|
showSizeChanger: true,
|
||
|
|
showQuickJumper: true,
|
||
|
|
showTotal: (total, range) => `共${total}条`,
|
||
|
|
});
|
||
|
|
|
||
|
22 hours ago
|
// 数据源
|
||
|
|
const [dataSource, setDataSource] = useState([]);
|
||
|
6 days ago
|
|
||
|
|
// 表格列配置
|
||
|
|
const columns = [
|
||
|
|
{
|
||
|
|
title: '编号',
|
||
|
|
dataIndex: 'number',
|
||
|
|
key: 'number',
|
||
|
|
width: 80,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: '操作',
|
||
|
|
key: 'action',
|
||
|
|
width: 120,
|
||
|
|
render: (text, record) => (
|
||
|
|
<div className={styles.actionButtons}>
|
||
|
|
<Button
|
||
|
|
type="link"
|
||
|
|
size="small"
|
||
|
|
onClick={() => handleEdit(record)}
|
||
|
|
>
|
||
|
|
修改
|
||
|
|
</Button>
|
||
|
|
<Button
|
||
|
|
type="link"
|
||
|
|
size="small"
|
||
|
|
danger
|
||
|
|
onClick={() => handleDelete(record)}
|
||
|
|
>
|
||
|
|
删除
|
||
|
|
</Button>
|
||
|
|
</div>
|
||
|
|
),
|
||
|
|
},
|
||
|
|
];
|
||
|
|
|
||
|
|
// 搜索处理
|
||
|
|
const handleSearch = () => {
|
||
|
|
setLoading(true);
|
||
|
|
setTimeout(() => {
|
||
|
|
setLoading(false);
|
||
|
|
message.success('查询完成');
|
||
|
|
}, 1000);
|
||
|
|
};
|
||
|
|
|
||
|
|
// 新增处理
|
||
|
|
const handleAdd = () => {
|
||
|
22 hours ago
|
message.info('新增功能待开发');
|
||
|
6 days ago
|
};
|
||
|
|
|
||
|
|
// 批量删除处理
|
||
|
|
const handleBatchDelete = () => {
|
||
|
|
if (selectedRowKeys.length === 0) {
|
||
|
|
message.warning('请选择要删除的数据');
|
||
|
|
return;
|
||
|
|
}
|
||
|
22 hours ago
|
message.info('删除功能待开发');
|
||
|
6 days ago
|
};
|
||
|
|
|
||
|
|
// 编辑处理
|
||
|
|
const handleEdit = (record) => {
|
||
|
22 hours ago
|
message.info('编辑功能待开发');
|
||
|
6 days ago
|
};
|
||
|
|
|
||
|
|
// 删除处理
|
||
|
|
const handleDelete = (record) => {
|
||
|
22 hours ago
|
message.info('删除功能待开发');
|
||
|
6 days ago
|
};
|
||
|
|
|
||
|
|
// 分页处理
|
||
|
|
const handleTableChange = (pagination) => {
|
||
|
|
setPagination(pagination);
|
||
|
|
};
|
||
|
|
|
||
|
6 days ago
|
return (
|
||
|
|
<div className={styles.container}>
|
||
|
6 days ago
|
{/* 页面标题 */}
|
||
|
|
<div className={styles.header}>
|
||
|
|
<div className={styles.titleBar}></div>
|
||
|
22 hours ago
|
<h2 className={styles.title}>处置救援</h2>
|
||
|
6 days ago
|
</div>
|
||
|
|
|
||
|
|
{/* 搜索和操作区域 */}
|
||
|
|
<div className={styles.searchBar}>
|
||
|
|
<div className={styles.searchLeft}>
|
||
|
|
<Select
|
||
|
22 hours ago
|
placeholder="请选择"
|
||
|
6 days ago
|
value={searchValue}
|
||
|
|
onChange={setSearchValue}
|
||
|
|
style={{width: 180, height: 30, borderRadius: 2}}
|
||
|
|
allowClear
|
||
|
|
>
|
||
|
22 hours ago
|
<Option value="选项1">选项1</Option>
|
||
|
|
<Option value="选项2">选项2</Option>
|
||
|
6 days ago
|
</Select>
|
||
|
|
<Button
|
||
|
|
type="primary"
|
||
|
|
icon={<SearchOutlined />}
|
||
|
|
onClick={handleSearch}
|
||
|
|
loading={loading}
|
||
|
|
className={styles.customButton}
|
||
|
|
>
|
||
|
|
查询
|
||
|
|
</Button>
|
||
|
|
</div>
|
||
|
|
<div className={styles.searchRight}>
|
||
|
|
<Button
|
||
|
|
type="primary"
|
||
|
|
icon={<PlusOutlined />}
|
||
|
|
onClick={handleAdd}
|
||
|
|
className={styles.customButton}
|
||
|
|
>
|
||
|
|
新增
|
||
|
|
</Button>
|
||
|
|
<Button
|
||
|
|
danger
|
||
|
|
style={{width: 70, height: 30, borderRadius: 2, display: 'flex', alignItems: 'center', justifyContent: 'center'}}
|
||
|
|
icon={<img src={iconsc} alt="delete" style={{width: 14, height: 14, marginTop: -2}}/>}
|
||
|
|
onClick={handleBatchDelete}
|
||
|
|
>
|
||
|
|
删除
|
||
|
|
</Button>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
{/* 数据表格 */}
|
||
|
|
<div className={styles.tableContainer}>
|
||
|
|
<StandardTable
|
||
|
|
columns={columns}
|
||
|
|
data={{
|
||
|
|
list: dataSource,
|
||
|
|
pagination: pagination
|
||
|
|
}}
|
||
|
|
rowKey="key"
|
||
|
|
selectedRows={selectedRowKeys}
|
||
|
|
onSelectRow={setSelectedRowKeys}
|
||
|
|
onChange={handleTableChange}
|
||
|
|
loading={loading}
|
||
|
|
/>
|
||
|
6 days ago
|
</div>
|
||
|
|
</div>
|
||
|
|
);
|
||
|
|
};
|
||
|
|
|
||
|
22 hours ago
|
export default Czjy;
|
||
|
|
|