巴林闲侠
1 year ago
6 changed files with 243 additions and 134 deletions
@ -1,71 +1,151 @@ |
|||
import React, { useState } from 'react' |
|||
import { Carousel } from 'antd'; |
|||
import { Carousel, Input } from 'antd'; |
|||
import Module from '../../public/module' |
|||
import AutoRollComponent from '../build/AutoRollComponent' |
|||
import { useEffect } from 'react'; |
|||
import { connect } from 'react-redux'; |
|||
import { busWillRun } from '../../public/olMap' |
|||
|
|||
const Right = () => { |
|||
const [dataLists, setDataList] = useState([ |
|||
{ |
|||
route: '147', |
|||
plate: '赣APJ090' |
|||
}, { |
|||
route: '166', |
|||
plate: '赣APJ087' |
|||
}, { |
|||
route: '171', |
|||
plate: '赣APJ184' |
|||
}, { |
|||
route: '186', |
|||
plate: '赣APJ241' |
|||
}, { |
|||
route: '199', |
|||
plate: '赣APJ337' |
|||
} |
|||
]) |
|||
const style = { height: "97%", marginTop: "3%" } |
|||
return ( |
|||
<div style={{ position: 'absolute', right: 0, width: "23%", height: "100%", marginRight: "1%", }}> |
|||
<Module style={style} customize={true} title={"车辆视频监控"}> |
|||
<div style={{ width: '90%', height: '96%', margin: '2% 5%', overflow: 'hidden' }}> |
|||
<Carousel |
|||
autoplay |
|||
infinite |
|||
autoplaySpeed={300000} |
|||
vertical={true} |
|||
slidesToShow={4} |
|||
> |
|||
{ |
|||
dataLists.map((data, index) => ( |
|||
<div key={index} style={{ width: '100%', height: '40%' }}> |
|||
<div className='busInformation'> |
|||
<img src='/assets/images/quanju/theBus.png' style={{ width: '15%', display: 'block', float: 'left' }} /> |
|||
<span> |
|||
<h3>所属线路</h3> |
|||
<h4>{data.route}</h4> |
|||
<h3>车辆牌照号</h3> |
|||
<h5>{data.plate}</h5> |
|||
</span> |
|||
</div> |
|||
<div className='busVideo'> |
|||
<div style={{ |
|||
width: '98%', margin: '1% 1%', height: 152, display: 'block', float: 'left', boxShadow: '0px 1px 5px 0px #1C60FE', |
|||
border: '1px solid #1C60FE' |
|||
}}><img src='/assets/images/quanju/fake/gj1.png' style={{ width: '100%', height: '100%' }} /></div> |
|||
<div style={{ |
|||
width: '48%', margin: '1% 1%', height: 100, display: 'block', float: 'left', boxShadow: '0px 1px 5px 0px #1C60FE', |
|||
border: '1px solid #1C60FE' |
|||
}}><img src='/assets/images/quanju/fake/gj2.png' style={{ width: '100%', height: '100%' }} /></div> |
|||
<div style={{ |
|||
width: '48%', margin: '1% 1%', height: 100, display: 'block', float: 'left', boxShadow: '0px 1px 5px 0px #1C60FE', |
|||
border: '1px solid #1C60FE' |
|||
}}><img src='/assets/images/quanju/fake/gj3.png' style={{ width: '100%', height: '100%' }} /></div> |
|||
</div> |
|||
</div> |
|||
)) |
|||
} |
|||
</Carousel> |
|||
</div> |
|||
</Module> |
|||
</div> |
|||
) |
|||
let queryTimeout = null |
|||
const Right = ({ busRunTime }) => { |
|||
const [dataLists, setDataList] = useState([ |
|||
{ |
|||
route: '147', |
|||
plate: '赣APJ090' |
|||
}, { |
|||
route: '166', |
|||
plate: '赣APJ087' |
|||
}, { |
|||
route: '171', |
|||
plate: '赣APJ184' |
|||
}, { |
|||
route: '186', |
|||
plate: '赣APJ241' |
|||
}, { |
|||
route: '199', |
|||
plate: '赣APJ337' |
|||
} |
|||
]) |
|||
const [busRunTimeList, setBusRunTimeList] = useState(busRunTime) |
|||
const [queryStr, setQueryStr] = useState('') |
|||
|
|||
useEffect(() => { |
|||
setBusRunTimeList( |
|||
queryStr ? |
|||
busRunTime.filter(b => { |
|||
return b?.busNoChar?.indexOf(queryStr) > -1 |
|||
}) |
|||
: busRunTime |
|||
) |
|||
}, [queryStr, busRunTime]) |
|||
|
|||
const style = { height: "97%", marginTop: "3%" } |
|||
return ( |
|||
<div style={{ position: 'absolute', right: 0, width: "23%", height: "100%", marginRight: "1%", }}> |
|||
<Module style={style} customize={true} |
|||
// title={"车辆视频监控"}
|
|||
title={"公交运营信息"} |
|||
> |
|||
<div style={{ width: '90%', height: '96%', margin: '2% 5%', overflow: 'hidden' }}> |
|||
<div style={{ border: '1px solid rgba(10, 114, 255, 1)', backgroundColor: 'rgba(10, 114, 255, 0.1)' }}> |
|||
<img src='/assets/images/quanju/search.png' style={{ width: '5%', margin: '0 1.5% 1% 3.5%' }} /> |
|||
<Input |
|||
style={{ |
|||
width: '90%', |
|||
background: 'none', |
|||
backgroundColor: 'none', |
|||
color: 'rgba(216, 240, 255, 0.8)', |
|||
border: 'none', |
|||
boxShadow: 'none', |
|||
}} |
|||
placeholder="请输入车牌号" |
|||
onChange={(e) => { |
|||
if (queryTimeout) { |
|||
clearTimeout(queryTimeout) |
|||
} |
|||
queryTimeout = setTimeout(() => { |
|||
setQueryStr(e.target.value) |
|||
}, 600) |
|||
}} |
|||
/> |
|||
</div> |
|||
|
|||
<Carousel |
|||
autoplay |
|||
infinite |
|||
// autoplaySpeed={300000}
|
|||
autoplaySpeed={1000 * 3} |
|||
vertical={true} |
|||
slidesToShow={4} |
|||
> |
|||
{ |
|||
busRunTimeList.map((b, i) => { |
|||
return ( |
|||
<div key={index} style={{ width: '100%', height: '40%' }}> |
|||
<div className='busInformation'> |
|||
<img src='/assets/images/quanju/theBus.png' style={{ width: '15%', display: 'block', float: 'left' }} /> |
|||
<span> |
|||
<h3>车辆牌照</h3> |
|||
<h5>{d.busNoChar}</h5> |
|||
<h3>调度状态</h3> |
|||
<h4>{busWillRun.find(w => w.value == d.willRun)?.text || '--'}</h4> |
|||
</span> |
|||
<span> |
|||
<h3>发车时间</h3> |
|||
<h4>{d.lastDepTime}</h4> |
|||
</span> |
|||
<span> |
|||
<h3>司机</h3> |
|||
<h5>{d.employeeName}</h5> |
|||
<h3>工号</h3> |
|||
<h4>{d.opNo}</h4> |
|||
</span> |
|||
</div> |
|||
</div> |
|||
) |
|||
}) |
|||
} |
|||
{/* { |
|||
dataLists.map((data, index) => ( |
|||
<div key={index} style={{ width: '100%', height: '40%' }}> |
|||
<div className='busInformation'> |
|||
<img src='/assets/images/quanju/theBus.png' style={{ width: '15%', display: 'block', float: 'left' }} /> |
|||
<span> |
|||
<h3>所属线路</h3> |
|||
<h4>{data.route}</h4> |
|||
<h3>车辆牌照号</h3> |
|||
<h5>{data.plate}</h5> |
|||
</span> |
|||
</div> |
|||
<div className='busVideo'> |
|||
<div style={{ |
|||
width: '98%', margin: '1% 1%', height: 152, display: 'block', float: 'left', boxShadow: '0px 1px 5px 0px #1C60FE', |
|||
border: '1px solid #1C60FE' |
|||
}}><img src='/assets/images/quanju/fake/gj1.png' style={{ width: '100%', height: '100%' }} /></div> |
|||
<div style={{ |
|||
width: '48%', margin: '1% 1%', height: 100, display: 'block', float: 'left', boxShadow: '0px 1px 5px 0px #1C60FE', |
|||
border: '1px solid #1C60FE' |
|||
}}><img src='/assets/images/quanju/fake/gj2.png' style={{ width: '100%', height: '100%' }} /></div> |
|||
<div style={{ |
|||
width: '48%', margin: '1% 1%', height: 100, display: 'block', float: 'left', boxShadow: '0px 1px 5px 0px #1C60FE', |
|||
border: '1px solid #1C60FE' |
|||
}}><img src='/assets/images/quanju/fake/gj3.png' style={{ width: '100%', height: '100%' }} /></div> |
|||
</div> |
|||
</div> |
|||
)) |
|||
} */} |
|||
</Carousel> |
|||
</div> |
|||
</Module> |
|||
</div> |
|||
) |
|||
} |
|||
export default Right |
|||
|
|||
function mapStateToProps (state) { |
|||
const { busRunTime, } = state; |
|||
return { |
|||
busRunTime: busRunTime.data || [], |
|||
}; |
|||
} |
|||
|
|||
export default connect(mapStateToProps)(Right); |
Loading…
Reference in new issue