|
|
|
|
@ -9,8 +9,6 @@ const { RangePicker } = DatePicker;
|
|
|
|
|
|
|
|
|
|
const ReportTask = () => {
|
|
|
|
|
const [status, setStatus] = useState();
|
|
|
|
|
const [template, setTemplate] = useState();
|
|
|
|
|
const [type, setType] = useState();
|
|
|
|
|
const [period, setPeriod] = useState(null);
|
|
|
|
|
const [createdAt, setCreatedAt] = useState(null);
|
|
|
|
|
const [page, setPage] = useState(6);
|
|
|
|
|
@ -18,10 +16,16 @@ const ReportTask = () => {
|
|
|
|
|
const [detailItem, setDetailItem] = useState(null);
|
|
|
|
|
|
|
|
|
|
const statusMeta = {
|
|
|
|
|
审核失败: { color: 'orange', text: '审核失败' },
|
|
|
|
|
待提交: { color: 'gold', text: '待提交' },
|
|
|
|
|
已提交: { color: 'green', text: '已提交' },
|
|
|
|
|
校验失败: { color: 'red', text: '校验失败' },
|
|
|
|
|
审核失败: { dot: '#f85c3d', text: '审核失败' },
|
|
|
|
|
待提交: { dot: '#f8c349', text: '待提交' },
|
|
|
|
|
已提交: { dot: '#48c774', text: '已提交' },
|
|
|
|
|
校验失败: { dot: '#e14c49', text: '校验失败' },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const actionMeta = {
|
|
|
|
|
提交: { color: '#ffac46' },
|
|
|
|
|
催办: { color: '#e14c49' },
|
|
|
|
|
下载: { color: '#8c8c8c' },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const dataSource = useMemo(
|
|
|
|
|
@ -70,25 +74,32 @@ const ReportTask = () => {
|
|
|
|
|
[],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const renderHeader = (label) => (
|
|
|
|
|
<span className="table-header-title">
|
|
|
|
|
{label}
|
|
|
|
|
<SearchOutlined className="header-search-icon" />
|
|
|
|
|
</span>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const columns = [
|
|
|
|
|
{
|
|
|
|
|
title: '序号',
|
|
|
|
|
title: renderHeader('序号'),
|
|
|
|
|
dataIndex: 'id',
|
|
|
|
|
width: 70,
|
|
|
|
|
align: 'center',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '任务名称',
|
|
|
|
|
title: renderHeader('任务名称'),
|
|
|
|
|
dataIndex: 'name',
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '报送模板',
|
|
|
|
|
title: renderHeader('报送模板'),
|
|
|
|
|
dataIndex: 'template',
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '类型',
|
|
|
|
|
title: renderHeader('类型'),
|
|
|
|
|
dataIndex: 'type',
|
|
|
|
|
width: 90,
|
|
|
|
|
align: 'center',
|
|
|
|
|
@ -97,44 +108,45 @@ const ReportTask = () => {
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '上次报送时间',
|
|
|
|
|
title: renderHeader('上次报送时间'),
|
|
|
|
|
dataIndex: 'lastReport',
|
|
|
|
|
width: 140,
|
|
|
|
|
align: 'center',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '下次报送时间',
|
|
|
|
|
title: renderHeader('下次报送时间'),
|
|
|
|
|
dataIndex: 'nextReport',
|
|
|
|
|
width: 140,
|
|
|
|
|
align: 'center',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '状态',
|
|
|
|
|
title: renderHeader('状态'),
|
|
|
|
|
dataIndex: 'status',
|
|
|
|
|
width: 120,
|
|
|
|
|
align: 'center',
|
|
|
|
|
render: (value) => {
|
|
|
|
|
const meta = statusMeta[value] || {};
|
|
|
|
|
return (
|
|
|
|
|
<Tag color={meta.color} className="status-tag">
|
|
|
|
|
<span className="status-dot" />
|
|
|
|
|
{meta.text}
|
|
|
|
|
<Tag className="status-tag">
|
|
|
|
|
<span className="status-dot" style={{ background: meta.dot }} />
|
|
|
|
|
<span className="status-text">{meta.text}</span>
|
|
|
|
|
</Tag>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '操作',
|
|
|
|
|
title: renderHeader('操作'),
|
|
|
|
|
dataIndex: 'action',
|
|
|
|
|
width: 160,
|
|
|
|
|
align: 'center',
|
|
|
|
|
render: (action, record) => {
|
|
|
|
|
const isUrge = action === '催办';
|
|
|
|
|
const meta = actionMeta[action] || {};
|
|
|
|
|
return (
|
|
|
|
|
<div className="action-links">
|
|
|
|
|
<Button
|
|
|
|
|
type="link"
|
|
|
|
|
size="small"
|
|
|
|
|
className="link-detail"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setDetailItem(record);
|
|
|
|
|
setDetailVisible(true);
|
|
|
|
|
@ -142,7 +154,7 @@ const ReportTask = () => {
|
|
|
|
|
>
|
|
|
|
|
详情
|
|
|
|
|
</Button>
|
|
|
|
|
<Button type="link" size="small" danger={isUrge}>
|
|
|
|
|
<Button type="link" size="small" className="link-action" style={{ color: meta.color }}>
|
|
|
|
|
{action}
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
@ -152,7 +164,7 @@ const ReportTask = () => {
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const handleSearch = () => {
|
|
|
|
|
console.log('查找', { status, template, type, period, createdAt });
|
|
|
|
|
console.log('查找', { status, period, createdAt });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleCreate = () => {
|
|
|
|
|
@ -187,37 +199,7 @@ const ReportTask = () => {
|
|
|
|
|
<Option value="校验失败">校验失败</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="filter-item">
|
|
|
|
|
<span className="filter-label">报送模板</span>
|
|
|
|
|
<Select
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
allowClear
|
|
|
|
|
value={template}
|
|
|
|
|
onChange={setTemplate}
|
|
|
|
|
className="filter-control"
|
|
|
|
|
>
|
|
|
|
|
<Option value="污染物排放台账">污染物排放台账</Option>
|
|
|
|
|
<Option value="危险废物管理台账">危险废物管理台账</Option>
|
|
|
|
|
<Option value="运行记录">运行记录</Option>
|
|
|
|
|
<Option value="排污许可证">排污许可证</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="filter-item">
|
|
|
|
|
<span className="filter-label">类型</span>
|
|
|
|
|
<Select
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
allowClear
|
|
|
|
|
value={type}
|
|
|
|
|
onChange={setType}
|
|
|
|
|
className="filter-control"
|
|
|
|
|
>
|
|
|
|
|
<Option value="月度">月度</Option>
|
|
|
|
|
<Option value="年度">年度</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="filter-item">
|
|
|
|
|
<span className="filter-label">报送周期</span>
|
|
|
|
|
<RangePicker
|
|
|
|
|
@ -246,10 +228,24 @@ const ReportTask = () => {
|
|
|
|
|
|
|
|
|
|
<div className="table-wrapper">
|
|
|
|
|
<Table
|
|
|
|
|
bordered
|
|
|
|
|
columns={columns}
|
|
|
|
|
dataSource={dataSource}
|
|
|
|
|
rowKey="id"
|
|
|
|
|
pagination={{ current: page, pageSize: 5, total: 85, onChange: setPage }}
|
|
|
|
|
className="report-task-table"
|
|
|
|
|
size="middle"
|
|
|
|
|
tableLayout="fixed"
|
|
|
|
|
pagination={{
|
|
|
|
|
current: page,
|
|
|
|
|
pageSize: 5,
|
|
|
|
|
total: 85,
|
|
|
|
|
showSizeChanger: true,
|
|
|
|
|
pageSizeOptions: ['5', '10', '20'],
|
|
|
|
|
showQuickJumper: false,
|
|
|
|
|
showTotal: (total) => `共 ${total} 条`,
|
|
|
|
|
onChange: setPage,
|
|
|
|
|
}}
|
|
|
|
|
rowClassName={() => 'report-task-row'}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|