| | |
| | | import React, { useState } from 'react'; |
| | | import PropTypes from 'prop-types'; |
| | | import { Form, Row, Col, Input, DatePicker, Select, Button, TreeSelect } from 'antd'; |
| | | import { DownOutlined } from '@ant-design/icons'; |
| | | import { DownOutlined, SearchOutlined } from '@ant-design/icons'; |
| | | import * as $$ from '../../utils/utility'; |
| | | import './index.less'; |
| | | |
| | |
| | | * rowNum, // 一行放多少个搜索item |
| | | * handleRest, // 重置 |
| | | * handleSearch, // 搜索 |
| | | * exportButton //导出按钮 |
| | | */ |
| | | const NewTableSearch = ({ form, itemData, labelLength = 5, rowNum = 3, handleReset, handleSearch }) => { |
| | | const NewTableSearch = ({ form, itemData, labelLength = 5, rowNum = 3, handleReset, handleSearch, exportButton }) => { |
| | | const [searchMore, setSearchMore] = useState(false); |
| | | |
| | | const span = 24 / rowNum; |
| | |
| | | })} |
| | | <Row style={{ marginTop: '16px' }}> |
| | | <Col span={24} style={{ textAlign: 'left' }}> |
| | | <Button className="public-buttonMargin" onClick={handleReset}> |
| | | 重置 |
| | | </Button> |
| | | <Button type="primary" htmlType="submit" onClick={handleSearch}> |
| | | <Button className="public-buttonMargin" type="primary" htmlType="submit" icon={<SearchOutlined />} onClick={handleSearch}> |
| | | 查询 |
| | | </Button> |
| | | <Button className="public-buttonMargin" type="primary" ghost htmlType="submit" onClick={exportButton}> |
| | | 导出查询结果 |
| | | </Button> |
| | | <Button onClick={handleReset}> |
| | | 重置条件 |
| | | </Button> |
| | | {display && ( |
| | | <span className="tableSearch-searchMore" onClick={() => setSearchMore(!searchMore)}> |
| | |
| | | rowNum: PropTypes.number, |
| | | handleReset: PropTypes.func, |
| | | handleSearch: PropTypes.func, |
| | | exportButton: PropTypes.func, |
| | | }; |
| | | |
| | | export default NewTableSearch; |