|
@@ -109,6 +109,12 @@ class buildingDetailStats extends React.Component {
|
109
|
109
|
})
|
110
|
110
|
}
|
111
|
111
|
|
|
112
|
+ //重置搜索
|
|
113
|
+ handleReset = () => {
|
|
114
|
+ daterange = []
|
|
115
|
+ this.props.form.resetFields();
|
|
116
|
+ }
|
|
117
|
+
|
112
|
118
|
render() {
|
113
|
119
|
const columns = [
|
114
|
120
|
{
|
|
@@ -142,26 +148,35 @@ class buildingDetailStats extends React.Component {
|
142
|
148
|
},
|
143
|
149
|
];
|
144
|
150
|
|
|
151
|
+ const { getFieldDecorator } = this.props.form;
|
145
|
152
|
return (
|
146
|
153
|
<div>
|
|
154
|
+ <Form layout="inline">
|
147
|
155
|
<Radio.Group buttonStyle="solid" defaultValue="a">
|
148
|
156
|
<Radio.Button value="c" onClick={() => this.getDataOf(0)}>今日</Radio.Button>
|
149
|
157
|
<Radio.Button value="a" onClick={() => this.getDataOf(7)}>最近7天</Radio.Button>
|
150
|
158
|
<Radio.Button value="b" onClick={() => this.getDataOf(30)}>最近1月</Radio.Button>
|
151
|
159
|
</Radio.Group>
|
152
|
|
- <RangePicker
|
153
|
|
- style={{ paddingLeft: '30px' }}
|
154
|
|
- ranges={{
|
155
|
|
- Today: [moment(), moment()],
|
156
|
|
- 'This Month': [moment().startOf('month'), moment().endOf('month')],
|
157
|
|
- }}
|
158
|
|
- onChange={(_dates, dateStrings) => this.onChangetime(_dates, dateStrings)}
|
159
|
|
- />
|
|
160
|
+ <Form.Item>
|
|
161
|
+ {getFieldDecorator('time', {
|
|
162
|
+ initialValue: [],
|
|
163
|
+ rules: [{ required: true, message: '请上传封面图1' }],
|
|
164
|
+ })(
|
|
165
|
+ <RangePicker
|
|
166
|
+ style={{ paddingLeft: '30px' }}
|
|
167
|
+ ranges={{
|
|
168
|
+ Today: [moment(), moment()],
|
|
169
|
+ 'This Month': [moment().startOf('month'), moment().endOf('month')],
|
|
170
|
+ }}
|
|
171
|
+ onChange={(_dates, dateStrings) => this.onChangetime(_dates, dateStrings)}
|
|
172
|
+ />
|
|
173
|
+ )}
|
|
174
|
+ </Form.Item>
|
160
|
175
|
<Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={() => this.datalist()}>
|
161
|
176
|
查询
|
162
|
177
|
</Button>
|
163
|
|
- <Button type="danger" onClick={() => router.go(-1)} style={{ marginBottom: '18px', marginLeft: '30px' }}>重置</Button>
|
164
|
|
-
|
|
178
|
+ <Button type="danger" onClick={this.handleReset} style={{ marginBottom: '18px', marginLeft: '30px' }}>重置</Button>
|
|
179
|
+ </Form>
|
165
|
180
|
<StatsChartLine title={this.state.buildingName} data={this.state.barData} />
|
166
|
181
|
<Row>
|
167
|
182
|
<Col span={22}>
|
|
@@ -179,5 +194,6 @@ class buildingDetailStats extends React.Component {
|
179
|
194
|
)
|
180
|
195
|
}
|
181
|
196
|
}
|
|
197
|
+const WrappedHeader = Form.create({ name: 'record' })(buildingDetailStats);
|
182
|
198
|
|
183
|
|
-export default buildingDetailStats
|
|
199
|
+export default WrappedHeader
|