|
@@ -32,8 +32,8 @@ class buildingStats extends React.Component {
|
32
|
32
|
}
|
33
|
33
|
|
34
|
34
|
componentDidMount() {
|
35
|
|
- this.getBarData(moment().subtract(7, 'day').toDate(), new Date())
|
36
|
|
- this.getTableData(moment().subtract(7, 'day').toDate(), new Date(), this.state.buildingId)
|
|
35
|
+ this.getBarData(moment().subtract(6, 'day').toDate(), new Date())
|
|
36
|
+ this.getTableData(moment().subtract(6, 'day').toDate(), new Date(), this.state.buildingId)
|
37
|
37
|
this.setState({ ...this.state, endDate: new Date(), startDate: moment().subtract(7, 'day').toDate() })
|
38
|
38
|
|
39
|
39
|
}
|
|
@@ -73,12 +73,12 @@ class buildingStats extends React.Component {
|
73
|
73
|
|
74
|
74
|
//点击查询
|
75
|
75
|
datalist = () => {
|
76
|
|
- this.getBarData(daterange[0] === undefined ? moment().subtract(7, 'day').toDate() : daterange[0], daterange[1] === undefined ? new Date() : daterange[1])
|
77
|
|
- this.getTableData(daterange[0] === undefined ? moment().subtract(7, 'day').toDate() : daterange[0], daterange[1] === undefined ? new Date() : daterange[1], this.state.buildingId)
|
|
76
|
+ this.getBarData(daterange[0] === undefined ? moment().subtract(6, 'day').toDate() : daterange[0], daterange[1] === undefined ? new Date() : daterange[1])
|
|
77
|
+ this.getTableData(daterange[0] === undefined ? moment().subtract(6, 'day').toDate() : daterange[0], daterange[1] === undefined ? new Date() : daterange[1], this.state.buildingId)
|
78
|
78
|
this.setState({
|
79
|
79
|
...this.state,
|
80
|
80
|
endDate: daterange[1] === undefined ? new Date() : daterange[1],
|
81
|
|
- startDate: daterange[0] === undefined ? moment().subtract(7, 'day').toDate() : daterange[0],
|
|
81
|
+ startDate: daterange[0] === undefined ? moment().subtract(6, 'day').toDate() : daterange[0],
|
82
|
82
|
})
|
83
|
83
|
|
84
|
84
|
}
|
|
@@ -183,7 +183,7 @@ class buildingStats extends React.Component {
|
183
|
183
|
<Form layout="inline">
|
184
|
184
|
<Radio.Group buttonStyle="solid" defaultValue="a">
|
185
|
185
|
<Radio.Button value="c" onClick={() => this.getDataOf(0)}>今日</Radio.Button>
|
186
|
|
- <Radio.Button value="a" onClick={() => this.getDataOf(7)}>最近7天</Radio.Button>
|
|
186
|
+ <Radio.Button value="a" onClick={() => this.getDataOf(6)}>最近7天</Radio.Button>
|
187
|
187
|
<Radio.Button value="b" onClick={() => this.getDataOf(30)}>最近1月</Radio.Button>
|
188
|
188
|
</Radio.Group>
|
189
|
189
|
<Form.Item>
|
|
@@ -202,9 +202,9 @@ class buildingStats extends React.Component {
|
202
|
202
|
)}
|
203
|
203
|
</Form.Item>
|
204
|
204
|
<Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={() => this.datalist()}>
|
205
|
|
- 查询
|
|
205
|
+ 搜索
|
206
|
206
|
</Button>
|
207
|
|
- <Button type="danger" onClick={this.handleReset} style={{ marginBottom: '18px', marginLeft: '30px' }}>重置</Button>
|
|
207
|
+ <Button onClick={this.handleReset} style={{ marginBottom: '18px', marginLeft: '30px' }}>重置</Button>
|
208
|
208
|
</Form>
|
209
|
209
|
<div style={{fontSize:'0.09rem',color:'#999',marginBottom:'0.16rem'}}>最多显示6个项目,其他项目请在下方详细数据中搜索</div>
|
210
|
210
|
<Row>
|