|
|
@ -12,6 +12,7 @@ import RightBottom from './Rightbottom' |
|
|
|
import AutoRollComponent from './AutoRollComponent' |
|
|
|
import './style.less' |
|
|
|
import {getdaolutongji,getxuanchuan} from '../../../actions/example' |
|
|
|
import { number } from 'echarts'; |
|
|
|
const Build = (props) => { |
|
|
|
const { dispatch } = props |
|
|
|
let data1 = [ |
|
|
@ -71,18 +72,21 @@ const Build = (props) => { |
|
|
|
return resValue |
|
|
|
} |
|
|
|
let datas = Object.keys(buildingnumber?.townRoad || {}).map((item)=>({name:item,number:buildingnumber.townRoad[item].roadCount,gongli:Number(keepThreeNum(buildingnumber.townRoad[item].mileage))})) |
|
|
|
|
|
|
|
let list = datas.sort((a,b)=>{ |
|
|
|
return b.number - a.number |
|
|
|
}) |
|
|
|
// console.log(list,'红红火')
|
|
|
|
|
|
|
|
//道路等级数据
|
|
|
|
let alldengji = Object.keys(buildingnumber?.roadLevel || {}).map((item)=>({name:item,value:Number(keepThreeNum(buildingnumber.roadLevel[item]))})) |
|
|
|
|
|
|
|
let onlineproject = Object.keys(buildingnumber?.townProject||{}).map((item)=>({name:item,total:buildingnumber.townProject[item]})) |
|
|
|
let sunonlineproject = onlineproject.reduce((x,y)=>x+y.total,0) |
|
|
|
let safetyData = alldengji.filter(item=>item.name!=='null') |
|
|
|
let sundata = data.reduce((x,y)=>x+y.value,0) |
|
|
|
let sunsafetyData = safetyData.reduce((x,y)=>x+y.value,0) |
|
|
|
console.log(safetyData,'好凶猛') |
|
|
|
console.log(data1,'对比') |
|
|
|
let sunonlineproject = onlineproject?.reduce((x,y)=>x+y.total,0) |
|
|
|
let safetyData = alldengji?.filter(item=>item.name!=='null') |
|
|
|
let sundata = data?.reduce((x,y)=>x+y.value,0) |
|
|
|
let sunsafetyData = safetyData?.reduce((x,y)=>x+y.value,0) |
|
|
|
// console.log(safetyData,'好凶猛')
|
|
|
|
// console.log(data1,'对比')
|
|
|
|
// console.log(totalgongli,"好好的")
|
|
|
|
// console.log(keepThreeNum(totalgongli),'jjjjj')
|
|
|
|
useEffect(()=>{ |
|
|
@ -97,7 +101,7 @@ const Build = (props) => { |
|
|
|
// },0,15)
|
|
|
|
const rendercontent = ()=>{ |
|
|
|
return (<div className='build-left-center-content'> |
|
|
|
{datas.map(({name,number,gongli},index)=><div className='build-left-center-item' key={index}> |
|
|
|
{list.map(({name,number,gongli},index)=><div className='build-left-center-item' key={index}> |
|
|
|
<span>{name}</span> |
|
|
|
<span>{number}</span> |
|
|
|
<span>{gongli}</span> |
|
|
@ -130,7 +134,7 @@ const Build = (props) => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</Module> |
|
|
|
<Module title={"各乡镇道路占比统计"} style={{ width: "100%", |
|
|
|
<Module title={"各乡镇道路分布统计"} style={{ width: "100%", |
|
|
|
height:" 33%",marginTop:'3%' |
|
|
|
}} customize = {true}> |
|
|
|
<div className='build-left-center'> |
|
|
@ -162,7 +166,7 @@ const Build = (props) => { |
|
|
|
<Module title={"道路统计"} style={{ width: "100%", |
|
|
|
height:" 30%",marginTop:'3%' |
|
|
|
}} customize = {true}> |
|
|
|
<LeftBottom |
|
|
|
{ data?<LeftBottom |
|
|
|
data={data} |
|
|
|
width='100%' |
|
|
|
height='100%' |
|
|
@ -170,7 +174,7 @@ const Build = (props) => { |
|
|
|
total={keepThreeNum(sundata)} |
|
|
|
// colorList={colorList}
|
|
|
|
// underColorList={underColorList}
|
|
|
|
/> |
|
|
|
/>:<div style={{color:"#fff",textAlign:'center',height:"100%",display:'flex',alignItems: "center",justifyContent: "space-around"}}>暂无数据</div>} |
|
|
|
</Module> |
|
|
|
|
|
|
|
</div> |
|
|
@ -191,11 +195,11 @@ const Build = (props) => { |
|
|
|
<Module title={"公路等级统计"} style={{ width: "100%", |
|
|
|
height:" 30%",marginTop:'3%' |
|
|
|
}} customize = {true}> |
|
|
|
<RightBottom width='100%' |
|
|
|
{safetyData?<RightBottom width='100%' |
|
|
|
height='100%' |
|
|
|
text='道路总公里' |
|
|
|
total={sunsafetyData} |
|
|
|
data={keepThreeNum(safetyData)}/> |
|
|
|
data={keepThreeNum(safetyData)}/>:<div style={{color:"#fff",textAlign:'center',height:"100%",display:'flex',alignItems: "center",justifyContent: "space-around"}}>暂无数据</div>} |
|
|
|
</Module> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|