|
@@ -1,13 +1,19 @@
|
1
|
1
|
import React from 'react';
|
2
|
|
-import { Form, Icon, Input, Button, DatePicker, Select } from 'antd';
|
|
2
|
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination } from 'antd';
|
3
|
3
|
import Styles from './style.less';
|
4
|
4
|
|
5
|
5
|
const { Option } = Select;
|
|
6
|
+const { Meta } = Card;
|
|
7
|
+
|
6
|
8
|
|
7
|
9
|
// 提交事件
|
8
|
10
|
function handleSubmit(e, props) {
|
9
|
|
- console.log(props)
|
10
|
11
|
e.preventDefault();
|
|
12
|
+ props.form.validateFields((err, values) => {
|
|
13
|
+ if (!err) {
|
|
14
|
+ console.log('提交数据: ', values)
|
|
15
|
+ }
|
|
16
|
+ });
|
11
|
17
|
}
|
12
|
18
|
|
13
|
19
|
// Change 事件
|
|
@@ -15,69 +21,148 @@ function handleSelectChange(props) {
|
15
|
21
|
console.log(props)
|
16
|
22
|
}
|
17
|
23
|
|
18
|
|
-// 搜索
|
|
24
|
+// 分页
|
|
25
|
+function onChange(pageNumber) {
|
|
26
|
+ console.log('Page: ', pageNumber);
|
|
27
|
+}
|
|
28
|
+
|
|
29
|
+/**
|
|
30
|
+ *
|
|
31
|
+ *
|
|
32
|
+ * @param {*} props
|
|
33
|
+ * @returns
|
|
34
|
+ */
|
19
|
35
|
function header(props) {
|
|
36
|
+ const { getFieldDecorator } = props.form
|
|
37
|
+
|
20
|
38
|
return (
|
21
|
|
- <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
|
22
|
|
- <Form.Item>
|
23
|
|
- {
|
24
|
|
- <Input
|
25
|
|
- prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
26
|
|
- placeholder="楼盘编号"
|
27
|
|
- />
|
28
|
|
- }
|
29
|
|
- </Form.Item>
|
30
|
|
- <Form.Item>
|
31
|
|
- {
|
32
|
|
- <Input
|
33
|
|
- prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
34
|
|
- type="password"
|
35
|
|
- placeholder="楼盘名称"
|
36
|
|
- />
|
37
|
|
- }
|
38
|
|
- </Form.Item>
|
39
|
|
- <Form.Item>{<DatePicker placeholder="开盘时间" />}</Form.Item>
|
40
|
|
- <Form.Item>
|
41
|
|
- {
|
42
|
|
- <Select style={{ width: '180px' }} placeholder="楼盘状态" onChange={handleSelectChange}>
|
43
|
|
- <Option value="1">发布</Option>
|
44
|
|
- <Option value="0">未发布</Option>
|
45
|
|
- </Select>
|
46
|
|
- }
|
47
|
|
- </Form.Item>
|
48
|
|
- <Form.Item>
|
49
|
|
- {
|
50
|
|
- <Select style={{ width: '180px' }} placeholder="销售状态" onChange={handleSelectChange}>
|
51
|
|
- <Option value="1">已销售</Option>
|
52
|
|
- <Option value="0">未销售</Option>
|
53
|
|
- </Select>
|
54
|
|
- }
|
55
|
|
- </Form.Item>
|
56
|
|
- <Form.Item>
|
57
|
|
- {
|
58
|
|
- <Select style={{ width: '180px' }} placeholder="城市" onChange={handleSelectChange}>
|
59
|
|
- <Option value="male">male</Option>
|
60
|
|
- <Option value="female">female</Option>
|
61
|
|
- </Select>
|
62
|
|
- }
|
63
|
|
- </Form.Item>
|
64
|
|
- <Form.Item>
|
65
|
|
- {
|
66
|
|
- <Select style={{ width: '180px' }} placeholder="首页推荐" onChange={handleSelectChange}>
|
67
|
|
- <Option value="1">首页推荐</Option>
|
68
|
|
- <Option value="0">首页未推荐</Option>
|
69
|
|
- </Select>
|
70
|
|
- }
|
71
|
|
- </Form.Item>
|
72
|
|
- <Form.Item>
|
73
|
|
- <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
|
74
|
|
- 搜索
|
75
|
|
- </Button>
|
76
|
|
- </Form.Item>
|
77
|
|
- </Form>
|
|
39
|
+ <>
|
|
40
|
+ <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
|
|
41
|
+ <Form.Item>
|
|
42
|
+ {getFieldDecorator('code')(
|
|
43
|
+ <Input
|
|
44
|
+ prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
|
45
|
+ placeholder="楼盘编号"
|
|
46
|
+ />,
|
|
47
|
+ )}
|
|
48
|
+ </Form.Item>
|
|
49
|
+ <Form.Item>
|
|
50
|
+ {getFieldDecorator('name')(
|
|
51
|
+ <Input
|
|
52
|
+ prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
|
53
|
+ type="password"
|
|
54
|
+ placeholder="楼盘名称"
|
|
55
|
+ />,
|
|
56
|
+ )}
|
|
57
|
+ </Form.Item>
|
|
58
|
+ <Form.Item>
|
|
59
|
+ {getFieldDecorator('startDate')(
|
|
60
|
+ <DatePicker placeholder="开盘时间" />,
|
|
61
|
+ )}
|
|
62
|
+ </Form.Item>
|
|
63
|
+ <Form.Item>
|
|
64
|
+ {getFieldDecorator('buildingStatus')(
|
|
65
|
+ <Select style={{ width: '180px' }} placeholder="楼盘状态" onChange={handleSelectChange}>
|
|
66
|
+ <Option value="1">发布</Option>
|
|
67
|
+ <Option value="0">未发布</Option>
|
|
68
|
+ </Select>,
|
|
69
|
+ )}
|
|
70
|
+ </Form.Item>
|
|
71
|
+ <Form.Item>
|
|
72
|
+ {getFieldDecorator('marketStatus')(
|
|
73
|
+ <Select style={{ width: '180px' }} placeholder="销售状态" onChange={handleSelectChange}>
|
|
74
|
+ <Option value="1">已销售</Option>
|
|
75
|
+ <Option value="0">未销售</Option>
|
|
76
|
+ </Select>,
|
|
77
|
+ )}
|
|
78
|
+ </Form.Item>
|
|
79
|
+ <Form.Item>
|
|
80
|
+ {getFieldDecorator('cityId')(
|
|
81
|
+ <Select style={{ width: '180px' }} placeholder="城市" onChange={handleSelectChange}>
|
|
82
|
+ <Option value="male">male</Option>
|
|
83
|
+ <Option value="female">female</Option>
|
|
84
|
+ </Select>,
|
|
85
|
+ )}
|
|
86
|
+ </Form.Item>
|
|
87
|
+ <Form.Item>
|
|
88
|
+ {getFieldDecorator('isMain')(
|
|
89
|
+ <Select style={{ width: '180px' }} placeholder="首页推荐" onChange={handleSelectChange}>
|
|
90
|
+ <Option value="1">首页推荐</Option>
|
|
91
|
+ <Option value="0">首页未推荐</Option>
|
|
92
|
+ </Select>,
|
|
93
|
+ )}
|
|
94
|
+ </Form.Item>
|
|
95
|
+ <Form.Item>
|
|
96
|
+ <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
|
|
97
|
+ 搜索
|
|
98
|
+ </Button>
|
|
99
|
+ </Form.Item>
|
|
100
|
+ </Form>
|
|
101
|
+ <Button type="primary" className={Styles.addButton}>
|
|
102
|
+ 新增楼盘
|
|
103
|
+ </Button>
|
|
104
|
+
|
|
105
|
+ {/* 卡片内容,显示楼盘项目 */}
|
|
106
|
+ <Card
|
|
107
|
+ hoverable
|
|
108
|
+ style={{ width: '300px', height: '500px' }}
|
|
109
|
+ cover={<img alt="example" width="459" height="303" src="https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png" />}
|
|
110
|
+ bodyStyle={{ padding: '10px' }}
|
|
111
|
+ >
|
|
112
|
+ <Row className={ Styles.cardText }>
|
|
113
|
+ <Col span={7}>楼盘编号:</Col>
|
|
114
|
+ <Col span={12}>S101</Col>
|
|
115
|
+ <Col span={5}>
|
|
116
|
+ <span className={ Styles.ediText }>编辑</span>
|
|
117
|
+ <Icon type="form" />
|
|
118
|
+ </Col>
|
|
119
|
+ </Row>
|
|
120
|
+ <Row>
|
|
121
|
+ <Col span={7}>楼盘名称:</Col>
|
|
122
|
+ <Col span={17}>城开花园</Col>
|
|
123
|
+ </Row>
|
|
124
|
+ <Row>
|
|
125
|
+ <Col span={7}>均 价:</Col>
|
|
126
|
+ <Col span={17}>
|
|
127
|
+ 约<span style={{ color: '#FF0707', fontWeight: 'bold' }}>111</span>元/m
|
|
128
|
+ </Col>
|
|
129
|
+ </Row>
|
|
130
|
+ <Row>
|
|
131
|
+ <Col span={7}>项目地址:</Col>
|
|
132
|
+ <Col span={17}>顾戴路1801弄</Col>
|
|
133
|
+ </Row>
|
|
134
|
+ <Row>
|
|
135
|
+ <Col span={7}>发布状态:</Col>
|
|
136
|
+ <Col span={17}>已发布</Col>
|
|
137
|
+ </Row>
|
|
138
|
+ <Row>
|
|
139
|
+ <Col span={7}>录入时间:</Col>
|
|
140
|
+ <Col span={17}>2019-08-28 17</Col>
|
|
141
|
+ </Row>
|
|
142
|
+ <Row style={{ marginTop: '15px' }}>
|
|
143
|
+ <Col span={7}>
|
|
144
|
+ <span style={{ color: '#1990FF', fontWeight: 'bold' }}>
|
|
145
|
+ 取消发布
|
|
146
|
+ </span>
|
|
147
|
+ <Icon type="close-circle" />
|
|
148
|
+ </Col>
|
|
149
|
+ <Col span={12}></Col>
|
|
150
|
+ <Col span={5}>
|
|
151
|
+ <span style={{ color: '#FF4A4A', fontWeight: 'bold' }}>
|
|
152
|
+ 删除
|
|
153
|
+ </span>
|
|
154
|
+ <Icon type="rest" />
|
|
155
|
+ </Col>
|
|
156
|
+ </Row>
|
|
157
|
+ </Card>
|
|
158
|
+
|
|
159
|
+ {/* 分页 */}
|
|
160
|
+ <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
|
|
161
|
+ <Pagination showQuickJumper defaultCurrent={2} total={500} onChange={onChange} />
|
|
162
|
+ </div>
|
|
163
|
+ </>
|
78
|
164
|
);
|
79
|
165
|
}
|
|
166
|
+const WrappedHeader = Form.create({ name: 'header' })(header);
|
80
|
167
|
|
81
|
|
-const WrappedHorizontalLoginForm = Form.create({ name: 'horizontal_login' })(header);
|
82
|
|
-
|
83
|
|
-export default WrappedHorizontalLoginForm;
|
|
168
|
+export default WrappedHeader
|