|
@ -3,13 +3,14 @@ import Left from './left' |
|
|
import Right from './right' |
|
|
import Right from './right' |
|
|
import { connect } from 'react-redux' |
|
|
import { connect } from 'react-redux' |
|
|
import { getdaolutongji } from '../../../actions/example' |
|
|
import { getdaolutongji } from '../../../actions/example' |
|
|
import { getHighways } from './action' |
|
|
import { getHighways, getRoadMaintenances } from './action' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Conserve = (props) => { |
|
|
const Conserve = (props) => { |
|
|
|
|
|
|
|
|
const [roadData, setRoadData] = useState() |
|
|
const [roadData, setRoadData] = useState() |
|
|
const [highwaysData, setHighwaysData] = useState() |
|
|
const [highwaysData, setHighwaysData] = useState() |
|
|
|
|
|
const [roadMaintenances, setRoadMaintenances] = useState() |
|
|
|
|
|
|
|
|
const [loading, setLoading] = useState(true) |
|
|
const [loading, setLoading] = useState(true) |
|
|
const { dispatch } = props |
|
|
const { dispatch } = props |
|
@ -21,12 +22,15 @@ const Conserve = (props) => { |
|
|
dispatch(getHighways()).then(res =>{ |
|
|
dispatch(getHighways()).then(res =>{ |
|
|
setHighwaysData(res.payload.data || []) |
|
|
setHighwaysData(res.payload.data || []) |
|
|
}) |
|
|
}) |
|
|
|
|
|
dispatch(getRoadMaintenances()).then(res =>{ |
|
|
|
|
|
setRoadMaintenances(res.payload.data || []) |
|
|
|
|
|
}) |
|
|
}, []) |
|
|
}, []) |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<div style={{ display: 'flex', width: '100%', height: '100%', justifyContent: 'space-between' }}> |
|
|
<div style={{ display: 'flex', width: '100%', height: '100%', justifyContent: 'space-between' }}> |
|
|
<Left roadData={roadData} loading={loading} /> |
|
|
<Left roadData={roadData} loading={loading} /> |
|
|
<Right highwaysData={highwaysData} /> |
|
|
<Right highwaysData={highwaysData} roadMaintenances={roadMaintenances}/> |
|
|
</div> |
|
|
</div> |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|