‘lijianhao’
3 years ago
7 changed files with 94 additions and 54 deletions
@ -1,14 +1,35 @@ |
|||
import React from 'react' |
|||
import React, { useEffect, useState } from 'react' |
|||
import Left from './left' |
|||
import Right from './right' |
|||
import { connect } from 'react-redux' |
|||
import { getdaolutongji } from '../../../actions/example' |
|||
|
|||
const Conserve = () => { |
|||
|
|||
const Conserve = (props) => { |
|||
|
|||
const [roadData, setRoadData] = useState() |
|||
const [loading, setLoading] = useState(true) |
|||
const { dispatch } = props |
|||
useEffect(() => { |
|||
dispatch(getdaolutongji()).then(res => { |
|||
setLoading(false) |
|||
setRoadData(res.payload.data || {}) |
|||
}) |
|||
}, []) |
|||
|
|||
return ( |
|||
<div style={{ display: 'flex', width: '100%', height: '100%', justifyContent: 'space-between' }}> |
|||
<Left /> |
|||
<Right /> |
|||
<Left roadData={roadData} loading={loading} /> |
|||
<Right roadData={roadData} loading={loading} /> |
|||
</div> |
|||
) |
|||
} |
|||
export default Conserve |
|||
function mapStateToProps(state) { |
|||
|
|||
// const { auth } = state;
|
|||
|
|||
return { |
|||
|
|||
} |
|||
} |
|||
export default connect(mapStateToProps)(Conserve) |
Loading…
Reference in new issue