|
@ -36,7 +36,8 @@ const Build = (props) => { |
|
|
const requestbuildingnumber = async ()=>{ |
|
|
const requestbuildingnumber = async ()=>{ |
|
|
const res = await dispatch(getdaolutongji()); |
|
|
const res = await dispatch(getdaolutongji()); |
|
|
let alltype = Object.keys(res.payload.data?.roadType || {}).map((item)=>({name:item,value:Number(keepThreeNum(res.payload.data.roadType[item]))})) |
|
|
let alltype = Object.keys(res.payload.data?.roadType || {}).map((item)=>({name:item,value:Number(keepThreeNum(res.payload.data.roadType[item]))})) |
|
|
setdata(alltype.filter(item=>item.name!=='null')) |
|
|
console.log(alltype,'打他啊') |
|
|
|
|
|
setdata(alltype.filter(item=>item.name==='县'||item.name==="乡"||item.name==='村')) |
|
|
setbuildingnumber(res.payload.data) |
|
|
setbuildingnumber(res.payload.data) |
|
|
console.log(res.payload.data,'哈哈哈') |
|
|
console.log(res.payload.data,'哈哈哈') |
|
|
|
|
|
|
|
@ -82,7 +83,7 @@ const Build = (props) => { |
|
|
|
|
|
|
|
|
let onlineproject = Object.keys(buildingnumber?.townProject||{}).map((item)=>({name:item,total:buildingnumber.townProject[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 sunonlineproject = onlineproject?.reduce((x,y)=>x+y.total,0) |
|
|
let safetyData = alldengji?.filter(item=>item.name!=='null') |
|
|
let safetyData = alldengji?.filter(item=>item.name==='一级公路'||item.name==='二级公路'||item.name==='三级公路'||item.name==='四级公路'||item.name==='等外公路') |
|
|
let sundata = data?.reduce((x,y)=>x+y.value,0) |
|
|
let sundata = data?.reduce((x,y)=>x+y.value,0) |
|
|
let sunsafetyData = safetyData?.reduce((x,y)=>x+y.value,0) |
|
|
let sunsafetyData = safetyData?.reduce((x,y)=>x+y.value,0) |
|
|
// console.log(safetyData,'好凶猛')
|
|
|
// console.log(safetyData,'好凶猛')
|
|
@ -166,7 +167,7 @@ const Build = (props) => { |
|
|
<Module title={"道路统计"} style={{ width: "100%", |
|
|
<Module title={"道路统计"} style={{ width: "100%", |
|
|
height:" 30%",marginTop:'3%' |
|
|
height:" 30%",marginTop:'3%' |
|
|
}} customize = {true}> |
|
|
}} customize = {true}> |
|
|
{ data?<LeftBottom |
|
|
{ data&&sundata!==0?<LeftBottom |
|
|
data={data} |
|
|
data={data} |
|
|
width='100%' |
|
|
width='100%' |
|
|
height='100%' |
|
|
height='100%' |
|
@ -195,7 +196,7 @@ const Build = (props) => { |
|
|
<Module title={"公路等级统计"} style={{ width: "100%", |
|
|
<Module title={"公路等级统计"} style={{ width: "100%", |
|
|
height:" 30%",marginTop:'3%' |
|
|
height:" 30%",marginTop:'3%' |
|
|
}} customize = {true}> |
|
|
}} customize = {true}> |
|
|
{safetyData?<RightBottom width='100%' |
|
|
{safetyData&&sunsafetyData!==0?<RightBottom width='100%' |
|
|
height='100%' |
|
|
height='100%' |
|
|
text='道路总公里' |
|
|
text='道路总公里' |
|
|
total={sunsafetyData} |
|
|
total={sunsafetyData} |
|
|