|
|
@ -1,39 +1,57 @@ |
|
|
|
import React from 'react' |
|
|
|
import React, { useEffect, useState } from 'react'; |
|
|
|
import { connect } from 'react-redux'; |
|
|
|
import { Carousel } from 'antd' |
|
|
|
import AutoRollComponent from '../build/AutoRollComponent' |
|
|
|
import Module from '../../public/module' |
|
|
|
import LeftItem from './LeftItem' |
|
|
|
import {getjiandmanage,getjiandetail} from '../../../actions/example' |
|
|
|
import './style.less' |
|
|
|
const Guanli = () => { |
|
|
|
const datas = new Array(35) |
|
|
|
const itemlist = [1,2,3] |
|
|
|
const Guanli = (props) => { |
|
|
|
const {dispatch} = props |
|
|
|
const [leftDatas,setleftDatas] = useState([]) |
|
|
|
const [rightDatas,setrightDatas] = useState([]) |
|
|
|
const requestleftDatas = async()=>{ |
|
|
|
const res = await dispatch(getjiandmanage()) |
|
|
|
setleftDatas(res.payload.data) |
|
|
|
// console.log(res,'哈哈哈')
|
|
|
|
} |
|
|
|
const requestRightDatas = async()=>{ |
|
|
|
const res = await dispatch(getjiandetail()) |
|
|
|
setrightDatas(res.payload.data) |
|
|
|
console.log(res,'嘿嘿嘿') |
|
|
|
} |
|
|
|
useEffect(()=>{ |
|
|
|
requestleftDatas(); |
|
|
|
requestRightDatas() |
|
|
|
},[]) |
|
|
|
|
|
|
|
const renderContent = () => { |
|
|
|
datas.fill({ |
|
|
|
chepaihao:'苏LD1112121', |
|
|
|
caoxian:'30%', |
|
|
|
chufa:'200元', |
|
|
|
riqi:'2022年5月4日' |
|
|
|
},1,35) |
|
|
|
console.log(datas,'数组') |
|
|
|
return <div style={{height:"100%"}}> |
|
|
|
{datas?.map(({ chepaihao, caoxian, chufa,riqi }, index) => { |
|
|
|
{rightDatas && rightDatas.length!==0?rightDatas.overSpeedList.map(({ id, licensePlate, overrunRate,fine,processingTime }, index) => { |
|
|
|
return <div key={index} className='guanli-right-item'> |
|
|
|
<span>{chepaihao}</span> |
|
|
|
<span>{caoxian}</span> |
|
|
|
<span>{chufa}</span> |
|
|
|
<span>{riqi}</span> |
|
|
|
<span>{licensePlate}</span> |
|
|
|
<span>{overrunRate}%</span> |
|
|
|
<span>{fine}</span> |
|
|
|
<span>{processingTime}</span> |
|
|
|
</div> |
|
|
|
})} |
|
|
|
}):""} |
|
|
|
</div> |
|
|
|
} |
|
|
|
const renderLeftContent = ()=>{ |
|
|
|
|
|
|
|
return leftDatas && leftDatas.length!==0?leftDatas.map((item,index)=> |
|
|
|
<LeftItem key={index} datas={item}></LeftItem> |
|
|
|
):"" |
|
|
|
|
|
|
|
} |
|
|
|
// renderContent()
|
|
|
|
return ( |
|
|
|
<div className='guanli'> |
|
|
|
<div className='guanli-left'> |
|
|
|
<Module style={{height:"100%"}} title="检测点治超处理占比" customize={true}> |
|
|
|
{itemlist.map((item,index)=> |
|
|
|
<LeftItem key={index}></LeftItem> |
|
|
|
)} |
|
|
|
<AutoRollComponent content={renderLeftContent()} |
|
|
|
containerStyle={{ position: "relative", height: "90%", }} |
|
|
|
divHeight={"100%"} divId={"chart-overview-left"} /> |
|
|
|
</Module> |
|
|
|
</div> |
|
|
|
<div className='guanli-right'> |
|
|
@ -41,7 +59,7 @@ const Guanli = () => { |
|
|
|
<div className = "guanli-right-top"> |
|
|
|
<img src="/assets/images/quanju/zhicaolog.png"></img> |
|
|
|
<span>已处理</span> |
|
|
|
<span>187</span> |
|
|
|
<span>{rightDatas.processed||0}</span> |
|
|
|
<span>件</span> |
|
|
|
</div> |
|
|
|
<div className='guanli-right-title'> |
|
|
@ -58,4 +76,24 @@ const Guanli = () => { |
|
|
|
</div> |
|
|
|
) |
|
|
|
} |
|
|
|
export default Guanli |
|
|
|
function mapStateToProps(state) { |
|
|
|
const { auth, depMessage } = state; |
|
|
|
const pakData = (dep) => { |
|
|
|
return dep.map((d) => { |
|
|
|
return { |
|
|
|
title: d.name, |
|
|
|
value: d.id, |
|
|
|
// children: d.type >= 2 ? [] : pakData(d.subordinate)
|
|
|
|
children: pakData(d.subordinate) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
let depData = pakData(depMessage.data || []) |
|
|
|
return { |
|
|
|
user: auth.user, |
|
|
|
depMessage: depMessage.data || [], |
|
|
|
depLoading: depMessage.isRequesting, |
|
|
|
depData, |
|
|
|
}; |
|
|
|
} |
|
|
|
export default connect(mapStateToProps)(Guanli); |