|
|
@ -11,6 +11,7 @@ const Guanli = (props) => { |
|
|
|
const {dispatch} = props |
|
|
|
const [leftDatas,setleftDatas] = useState([]) |
|
|
|
const [rightDatas,setrightDatas] = useState([]) |
|
|
|
const [rightitemlist,setrightitemlist] = useState() |
|
|
|
const requestleftDatas = async()=>{ |
|
|
|
const res = await dispatch(getjiandmanage()) |
|
|
|
res.payload.data.sort((a,b)=>{ |
|
|
@ -21,8 +22,19 @@ const Guanli = (props) => { |
|
|
|
} |
|
|
|
const requestRightDatas = async()=>{ |
|
|
|
const res = await dispatch(getjiandetail()) |
|
|
|
// let d = res.payload.data?.overSpeedList.sort((a,b)=>b.processingTime < a.processingTime ?-1:1)
|
|
|
|
|
|
|
|
var pattern = /[\u4e00-\u9fa5]*/; |
|
|
|
let d = res.payload.data?.overSpeedList?.filter((item,index)=>{ |
|
|
|
return escape(item.processingTime).indexOf("%u")<0 |
|
|
|
}) |
|
|
|
// let d2 = d.sort((a,b)=>b.processingTime < a.processingTime ?-1:1)
|
|
|
|
let d2 = d.sort((a, b) => b.processingTime.localeCompare(a.processingTime)) |
|
|
|
setrightDatas(res.payload.data) |
|
|
|
// console.log(res,'嘿嘿嘿')
|
|
|
|
setrightitemlist(d) |
|
|
|
console.log(d,'对比的数据') |
|
|
|
console.log(d2,'完美') |
|
|
|
console.log(res.payload.data,'嘿嘿嘿') |
|
|
|
} |
|
|
|
useEffect(()=>{ |
|
|
|
requestleftDatas(); |
|
|
@ -32,7 +44,7 @@ const Guanli = (props) => { |
|
|
|
// datalist.fill({licensePlate:"赣A44454",overrunRate:"30%",fine:"200元",processingTime:"2020年4月1日"})
|
|
|
|
const renderContent = () => { |
|
|
|
return <div style={{height:"100%"}}> |
|
|
|
{rightDatas && rightDatas.length!==0?rightDatas.overSpeedList.map(({ id, licensePlate, overrunRate,fine,processingTime }, index) => { |
|
|
|
{rightitemlist && rightitemlist.length!==0?rightitemlist?.map(({ id, licensePlate, overrunRate,fine,processingTime }, index) => { |
|
|
|
if(index<30){ |
|
|
|
return <div key={index} className='guanli-right-item'> |
|
|
|
<span>{licensePlate}</span> |
|
|
@ -74,9 +86,9 @@ const Guanli = (props) => { |
|
|
|
<span>车牌号</span> |
|
|
|
<span>超限</span> |
|
|
|
<span>处罚</span> |
|
|
|
<span>日期</span> |
|
|
|
<span>处理日期</span> |
|
|
|
</div> |
|
|
|
{rightDatas && rightDatas.length!==0?<AutoRollComponent content={renderContent()} |
|
|
|
{rightitemlist && rightitemlist.length!==0?<AutoRollComponent content={renderContent()} |
|
|
|
containerStyle={{ position: "relative", height: "90%", }} |
|
|
|
divHeight={"100%"} divId={"chart-overview-deviceList"} />:<NoData style={{height:"70%"}}/>} |
|
|
|
</Module> |
|
|
|