#
luxiaotao1123
2024-02-15 5eacf724e0b10c92a17db0fa4f3681082d0d97a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React from 'react';
import { Input, Button, Space } from 'antd';
 
const Filter = (props) => {
    return (
        <div style={{ padding: 8 }}>
            <Input
                style={{ width: 188, marginBottom: 8, display: 'block' }}
                value={props.selectedKeys[0]}
                onChange={e => {
                    props.setSelectedKeys(e.target.value ? [e.target.value] : [])
                }}
            />
            <Space>
                <Button
                    type="primary"
                    onClick={() => {
                        props.confirm();
                        props.setSearchParam(prevState => ({
                            ...prevState,
                            [props.name]: props.selectedKeys[0]
                        }));
                        props.actionRef.current?.reload();
                    }}
                    size="small"
                    style={{ width: 90 }}
                >
                    确定
                </Button>
                <Button
                    onClick={() => props.clearFilters && props.clearFilters()}
                    size="small"
                    style={{ width: 90 }}
                >
                    重置
                </Button>
            </Space>
        </div>
    );
}
 
export default Filter;