You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
132 lines
3.1 KiB
132 lines
3.1 KiB
9 years ago
|
---
|
||
8 years ago
|
order: 3
|
||
8 years ago
|
title:
|
||
|
zh-CN: 高级搜索
|
||
|
en-US: Advanced search
|
||
9 years ago
|
---
|
||
9 years ago
|
|
||
8 years ago
|
## zh-CN
|
||
|
|
||
9 years ago
|
三列栅格式的表单排列方式,常用于数据表格的高级搜索。
|
||
|
|
||
|
有部分定制的样式代码,由于输入标签长度不确定,需要根据具体情况自行调整。
|
||
|
|
||
8 years ago
|
## en-US
|
||
|
|
||
8 years ago
|
Three columns layout is often used for advanced searching of data table.
|
||
8 years ago
|
|
||
8 years ago
|
Because the width of label is not fixed, you may need to adjust it by customizing its style.
|
||
8 years ago
|
|
||
8 years ago
|
|
||
9 years ago
|
````jsx
|
||
9 years ago
|
import { Form, Input, Row, Col, Button, DatePicker } from 'antd';
|
||
9 years ago
|
const FormItem = Form.Item;
|
||
|
|
||
8 years ago
|
const formItemLayout = {
|
||
|
labelCol: { span: 10 },
|
||
|
wrapperCol: { span: 14 },
|
||
|
};
|
||
|
|
||
9 years ago
|
ReactDOM.render(
|
||
9 years ago
|
<Form horizontal className="ant-advanced-search-form">
|
||
|
<Row gutter={16}>
|
||
|
<Col sm={8}>
|
||
|
<FormItem
|
||
8 years ago
|
{...formItemLayout}
|
||
8 years ago
|
label="Search name"
|
||
9 years ago
|
>
|
||
8 years ago
|
<Input placeholder="Please input the search name" size="default" />
|
||
9 years ago
|
</FormItem>
|
||
|
<FormItem
|
||
8 years ago
|
{...formItemLayout}
|
||
8 years ago
|
label="Long search name"
|
||
9 years ago
|
>
|
||
9 years ago
|
<DatePicker size="default" />
|
||
|
</FormItem>
|
||
|
<FormItem
|
||
8 years ago
|
{...formItemLayout}
|
||
8 years ago
|
label="Search name"
|
||
9 years ago
|
>
|
||
8 years ago
|
<Input placeholder="Please input the search name" size="default" />
|
||
9 years ago
|
</FormItem>
|
||
|
</Col>
|
||
|
<Col sm={8}>
|
||
|
<FormItem
|
||
8 years ago
|
{...formItemLayout}
|
||
8 years ago
|
label="Search name"
|
||
9 years ago
|
>
|
||
8 years ago
|
<Input placeholder="Please input the search name" size="default" />
|
||
9 years ago
|
</FormItem>
|
||
|
<FormItem
|
||
8 years ago
|
{...formItemLayout}
|
||
8 years ago
|
label="Long search name"
|
||
9 years ago
|
>
|
||
9 years ago
|
<DatePicker size="default" />
|
||
|
</FormItem>
|
||
|
<FormItem
|
||
8 years ago
|
{...formItemLayout}
|
||
8 years ago
|
label="Search name"
|
||
9 years ago
|
>
|
||
8 years ago
|
<Input placeholder="Please input the search name" size="default" />
|
||
9 years ago
|
</FormItem>
|
||
|
</Col>
|
||
|
<Col sm={8}>
|
||
|
<FormItem
|
||
8 years ago
|
{...formItemLayout}
|
||
8 years ago
|
label="Search name"
|
||
9 years ago
|
>
|
||
8 years ago
|
<Input placeholder="Please input the search name" size="default" />
|
||
9 years ago
|
</FormItem>
|
||
|
<FormItem
|
||
8 years ago
|
{...formItemLayout}
|
||
8 years ago
|
label="Long search name"
|
||
9 years ago
|
>
|
||
9 years ago
|
<DatePicker size="default" />
|
||
|
</FormItem>
|
||
|
<FormItem
|
||
8 years ago
|
{...formItemLayout}
|
||
8 years ago
|
label="Search name"
|
||
9 years ago
|
>
|
||
8 years ago
|
<Input placeholder="Please input the search name" size="default" />
|
||
9 years ago
|
</FormItem>
|
||
|
</Col>
|
||
|
</Row>
|
||
|
<Row>
|
||
8 years ago
|
<Col span={24} style={{ textAlign: 'right' }}>
|
||
8 years ago
|
<Button type="primary" htmlType="submit">Search</Button>
|
||
|
<Button>Clear</Button>
|
||
9 years ago
|
</Col>
|
||
|
</Row>
|
||
8 years ago
|
</Form>,
|
||
|
mountNode
|
||
|
);
|
||
9 years ago
|
````
|
||
|
|
||
|
````css
|
||
8 years ago
|
/* custom style */
|
||
9 years ago
|
|
||
9 years ago
|
.ant-advanced-search-form {
|
||
9 years ago
|
padding: 16px 8px;
|
||
9 years ago
|
background: #f8f8f8;
|
||
9 years ago
|
border: 1px solid #d9d9d9;
|
||
|
border-radius: 6px;
|
||
|
}
|
||
|
|
||
8 years ago
|
/* because the label length is variable, you may need to adjust the left edge to have the form centered */
|
||
8 years ago
|
|
||
9 years ago
|
.ant-advanced-search-form > .ant-row {
|
||
9 years ago
|
position: relative;
|
||
|
left: -6px;
|
||
9 years ago
|
}
|
||
|
|
||
9 years ago
|
.ant-advanced-search-form .ant-btn + .ant-btn {
|
||
9 years ago
|
margin-left: 8px;
|
||
|
}
|
||
|
````
|
||
|
|
||
|
<style>
|
||
8 years ago
|
#components-form-demo-advanced-search .ant-form-horizontal {
|
||
9 years ago
|
max-width: none;
|
||
|
}
|
||
|
</style>
|