|
@@ -1,16 +1,62 @@
|
1
|
1
|
import React from 'react';
|
2
|
2
|
import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination } from 'antd';
|
|
3
|
+import { connect } from 'dva';
|
3
|
4
|
import Styles from './style.less';
|
4
|
5
|
|
|
6
|
+
|
5
|
7
|
const { Option } = Select;
|
|
8
|
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
6
|
9
|
const { Meta } = Card;
|
7
|
10
|
|
|
11
|
+// 假数据
|
|
12
|
+const tempData = [
|
|
13
|
+ {
|
|
14
|
+ code: 'S101',
|
|
15
|
+ name: '城开花园',
|
|
16
|
+ price: '111',
|
|
17
|
+ address: '顾戴路1801弄',
|
|
18
|
+ status: '1', // 已发布
|
|
19
|
+ createDate: '2019-08-28 17',
|
|
20
|
+ },
|
|
21
|
+ {
|
|
22
|
+ code: 'S102',
|
|
23
|
+ name: '星河天街',
|
|
24
|
+ price: '111',
|
|
25
|
+ address: '长征路1801弄',
|
|
26
|
+ status: '1', // 已发布
|
|
27
|
+ createDate: '2019-08-29 17',
|
|
28
|
+ },
|
|
29
|
+ {
|
|
30
|
+ code: 'S103',
|
|
31
|
+ name: '喜洋洋别墅',
|
|
32
|
+ price: '111',
|
|
33
|
+ address: '阳杨路1801弄',
|
|
34
|
+ status: '1', // 已发布
|
|
35
|
+ createDate: '2019-08-29 17',
|
|
36
|
+ },
|
|
37
|
+ {
|
|
38
|
+ code: 'S104',
|
|
39
|
+ name: '武大郎洋房',
|
|
40
|
+ price: '111',
|
|
41
|
+ address: '太郎路1801弄',
|
|
42
|
+ status: '1', // 已发布
|
|
43
|
+ createDate: '2019-08-29 17',
|
|
44
|
+ },
|
|
45
|
+]
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+// 网路数据请求
|
|
49
|
+connect(({ getList, loading }) => ({
|
|
50
|
+ getList,
|
|
51
|
+ submitting: loading.effects['building/getList'],
|
|
52
|
+}))
|
8
|
53
|
|
9
|
54
|
// 提交事件
|
10
|
55
|
function handleSubmit(e, props) {
|
11
|
56
|
e.preventDefault();
|
12
|
57
|
props.form.validateFields((err, values) => {
|
13
|
58
|
if (!err) {
|
|
59
|
+ // eslint-disable-next-line no-console
|
14
|
60
|
console.log('提交数据: ', values)
|
15
|
61
|
}
|
16
|
62
|
});
|
|
@@ -18,23 +64,86 @@ function handleSubmit(e, props) {
|
18
|
64
|
|
19
|
65
|
// Change 事件
|
20
|
66
|
function handleSelectChange(props) {
|
|
67
|
+ // eslint-disable-next-line no-console
|
21
|
68
|
console.log(props)
|
22
|
69
|
}
|
23
|
70
|
|
24
|
71
|
// 分页
|
25
|
72
|
function onChange(pageNumber) {
|
|
73
|
+ // eslint-disable-next-line no-console
|
26
|
74
|
console.log('Page: ', pageNumber);
|
27
|
75
|
}
|
28
|
76
|
|
|
77
|
+/**
|
|
78
|
+ *卡片
|
|
79
|
+ *
|
|
80
|
+ * @returns
|
|
81
|
+ */
|
|
82
|
+function CartBody(props) {
|
|
83
|
+ const { data } = props
|
|
84
|
+
|
|
85
|
+ return (
|
|
86
|
+ <Card
|
|
87
|
+ hoverable
|
|
88
|
+ style={{ minWidth: '400px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)' }}
|
|
89
|
+ cover={<img alt="example" src="https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png" style={{ borderRadius: '12px 12px 0 0', width: '100%', height: '14vw' }}></img>}
|
|
90
|
+ bodyStyle={{ padding: '10px 20px' }}
|
|
91
|
+ >
|
|
92
|
+ <p className={Styles.cardText}>
|
|
93
|
+ <span className={Styles.title}>楼盘编号</span>
|
|
94
|
+ <span >:{ data.code }</span>
|
|
95
|
+ <span className={Styles.ediText}>
|
|
96
|
+ 编辑
|
|
97
|
+ <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
|
|
98
|
+ </span>
|
|
99
|
+ </p>
|
|
100
|
+ <p className={Styles.cardText}>
|
|
101
|
+ <span className={Styles.title}>楼盘名称</span>
|
|
102
|
+ <span >:{ data.name }</span>
|
|
103
|
+ </p>
|
|
104
|
+ <p className={Styles.cardItem}>
|
|
105
|
+ <span className={Styles.title}>均价</span>
|
|
106
|
+ <span >
|
|
107
|
+ :约<span style={{ color: '#FF0707', fontSize: '20px' }}> { data.price } </span>元/m
|
|
108
|
+ </span>
|
|
109
|
+ </p>
|
|
110
|
+ <p className={Styles.cardItem}>
|
|
111
|
+ <span className={Styles.title}>项目地址</span>
|
|
112
|
+ <span >:{ data.address }</span>
|
|
113
|
+ </p>
|
|
114
|
+ <p className={Styles.cardItem}>
|
|
115
|
+ <span className={Styles.title}>发布状态</span>
|
|
116
|
+ <span >:{ data.status === '1' ? '已发布' : '未发布' }</span>
|
|
117
|
+ </p>
|
|
118
|
+ <p className={Styles.cardItem}>
|
|
119
|
+ <span className={Styles.title}>录入时间</span>
|
|
120
|
+ <span >:2019-08-28 17</span>
|
|
121
|
+ </p>
|
|
122
|
+ <p style={{ margin: '15px 0', position: 'relative', fontSize: '18px' }}>
|
|
123
|
+ <span style={{ color: '#1990FF' }}>
|
|
124
|
+ 取消发布
|
|
125
|
+ <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
|
|
126
|
+ </span>
|
|
127
|
+ <span style={{
|
|
128
|
+ color: '#FF4A4A', position: 'absolute', right: '0',
|
|
129
|
+ }} >
|
|
130
|
+ 删除
|
|
131
|
+ <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
|
|
132
|
+ </span>
|
|
133
|
+ </p>
|
|
134
|
+ </Card>
|
|
135
|
+ )
|
|
136
|
+}
|
|
137
|
+
|
29
|
138
|
/**
|
30
|
139
|
*
|
31
|
140
|
*
|
32
|
141
|
* @param {*} props
|
33
|
142
|
* @returns
|
34
|
143
|
*/
|
35
|
|
-function header(props) {
|
|
144
|
+function body(props) {
|
36
|
145
|
const { getFieldDecorator } = props.form
|
37
|
|
-
|
|
146
|
+ connect()
|
38
|
147
|
return (
|
39
|
148
|
<>
|
40
|
149
|
<Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
|
|
@@ -104,58 +213,13 @@ function header(props) {
|
104
|
213
|
|
105
|
214
|
{/* 卡片内容,显示楼盘项目 */}
|
106
|
215
|
<Row style={{ padding: ' 0 10px' }}>
|
107
|
|
- <Col span={8}>
|
108
|
|
- <Card
|
109
|
|
- hoverable
|
110
|
|
- style={{ minWidth: '400px', borderRadius: '12px',margin:'10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)', }}
|
111
|
|
- cover={<img alt="example" src="https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png" style={{ borderRadius: '12px 12px 0 0', width: '100%', height: '14vw' }}></img>}
|
112
|
|
- bodyStyle={{ padding: '10px 20px' }}
|
113
|
|
- >
|
114
|
|
- <p className={Styles.cardText}>
|
115
|
|
- <span className={Styles.title}>楼盘编号</span>
|
116
|
|
- <span >:S101</span>
|
117
|
|
- <span className={Styles.ediText}>
|
118
|
|
- 编辑
|
119
|
|
- <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
|
120
|
|
- </span>
|
121
|
|
- </p>
|
122
|
|
- <p className={Styles.cardText}>
|
123
|
|
- <span className={Styles.title}>楼盘名称</span>
|
124
|
|
- <span >:城开花园</span>
|
125
|
|
- </p>
|
126
|
|
- <p className={Styles.cardItem}>
|
127
|
|
- <span className={Styles.title}>均价</span>
|
128
|
|
- <span >
|
129
|
|
- :约<span style={{ color: '#FF0707', fontSize: '20px' }}> 111 </span>元/m
|
130
|
|
- </span>
|
131
|
|
- </p>
|
132
|
|
- <p className={Styles.cardItem}>
|
133
|
|
- <span className={Styles.title}>项目地址</span>
|
134
|
|
- <span >:顾戴路1801弄</span>
|
135
|
|
- </p>
|
136
|
|
- <p className={Styles.cardItem}>
|
137
|
|
- <span className={Styles.title}>发布状态</span>
|
138
|
|
- <span >:已发布</span>
|
139
|
|
- </p>
|
140
|
|
- <p className={Styles.cardItem}>
|
141
|
|
- <span className={Styles.title}>录入时间</span>
|
142
|
|
- <span >:2019-08-28 17</span>
|
143
|
|
- </p>
|
144
|
|
- <p style={{ margin: '15px 0', position: 'relative', fontSize: '18px' }}>
|
145
|
|
- <span style={{ color: '#1990FF' }}>
|
146
|
|
- 取消发布
|
147
|
|
- <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
|
148
|
|
- </span>
|
149
|
|
- <span style={{
|
150
|
|
- color: '#FF4A4A', position: 'absolute',
|
151
|
|
- right: '0'
|
152
|
|
- }} >
|
153
|
|
- 删除
|
154
|
|
- <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
|
155
|
|
- </span>
|
156
|
|
- </p>
|
157
|
|
- </Card>
|
158
|
|
- </Col>
|
|
216
|
+ {
|
|
217
|
+ tempData.map((item, index) => (
|
|
218
|
+ <Col span={8}>
|
|
219
|
+ <CartBody data={item} />
|
|
220
|
+ </Col>
|
|
221
|
+ ))
|
|
222
|
+ }
|
159
|
223
|
</Row>
|
160
|
224
|
{/* 分页 */}
|
161
|
225
|
<div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
|
|
@@ -164,6 +228,6 @@ function header(props) {
|
164
|
228
|
</>
|
165
|
229
|
);
|
166
|
230
|
}
|
167
|
|
-const WrappedHeader = Form.create({ name: 'header' })(header);
|
|
231
|
+const WrappedBody = Form.create({ name: 'body' })(body);
|
168
|
232
|
|
169
|
|
-export default WrappedHeader
|
|
233
|
+export default WrappedBody
|