diff --git a/web/client/src/sections/quanju/containers/footer/build/Rightbottom.js b/web/client/src/sections/quanju/containers/footer/build/Rightbottom.js
index 2c8107f0..502a138c 100644
--- a/web/client/src/sections/quanju/containers/footer/build/Rightbottom.js
+++ b/web/client/src/sections/quanju/containers/footer/build/Rightbottom.js
@@ -133,14 +133,14 @@ function Rightbottom(props) {
// }
myChart.setOption(option);
return ()=>{
- clearInterval(changePieInterval)
+ // clearInterval(changePieInterval)
}
-}, []);
+}, [data]);
return (
-
3234.23
+ {total||0}
道路总公里
diff --git a/web/client/src/sections/quanju/containers/footer/build/Rightcenter.js b/web/client/src/sections/quanju/containers/footer/build/Rightcenter.js
index 0c716667..d3e74644 100644
--- a/web/client/src/sections/quanju/containers/footer/build/Rightcenter.js
+++ b/web/client/src/sections/quanju/containers/footer/build/Rightcenter.js
@@ -1,25 +1,25 @@
import React from 'react'
import './style.less'
import AutoRollComponent from './AutoRollComponent'
-export default function Rightcenter() {
- const data =[ {name: '莲塘镇', total: 12739},
- {name: '向塘镇', total: 2445},
- {name: '蒋巷镇', total: 2035},
- {name: '幽兰镇', total: 1999},
- {name: '塘南镇', total: 1915},
- {name: '武阳镇', total: 1842},
- {name: '冈上镇', total: 1446},
- {name: '广福镇', total: 1063},
- {name: '三江镇', total: 851},
- {name: '泾口乡', total: 657},
- {name: '南新镇', total: 640},
- {name: '八一乡', total: 569},
- {name: '黄马乡', total: 541},
- {name: '塔城乡', total: 534},
- {name: '富山乡', total: 515},
- {name: '东新乡', total: 513},
- {name: '银三角', total: 513},
- {name: '八月湖街道', total: 513},]
+export default function Rightcenter({data,sundata}) {
+ // const data =[ {name: '莲塘镇', total: 12739},
+ // {name: '向塘镇', total: 2445},
+ // {name: '蒋巷镇', total: 2035},
+ // {name: '幽兰镇', total: 1999},
+ // {name: '塘南镇', total: 1915},
+ // {name: '武阳镇', total: 1842},
+ // {name: '冈上镇', total: 1446},
+ // {name: '广福镇', total: 1063},
+ // {name: '三江镇', total: 851},
+ // {name: '泾口乡', total: 657},
+ // {name: '南新镇', total: 640},
+ // {name: '八一乡', total: 569},
+ // {name: '黄马乡', total: 541},
+ // {name: '塔城乡', total: 534},
+ // {name: '富山乡', total: 515},
+ // {name: '东新乡', total: 513},
+ // {name: '银三角', total: 513},
+ // {name: '八月湖街道', total: 513},]
const province = undefined
const FIRST = "linear-gradient(360deg, rgba(43, 180, 211, 0.1) 0%, rgba(43, 180, 211, 0.4) 100%)"
const SECOND = "linear-gradient(360deg, rgba(255, 209, 86, 0.1) 0%, rgba(255, 209, 86, 0.4) 100%)"
@@ -27,6 +27,7 @@ const THIRD = "linear-gradient(360deg, rgba(148, 148, 255, 0.1) 0%, rgba(148, 14
const OTHER = "linear-gradient(360deg, rgba(28, 96, 253, 0) 0%, rgba(28, 96, 253, 0.2) 100%)"
let TOTALS = data?.map(({ name, total }, index) => {
let max = province ? data.length * 30 + 100 : data.length * 500 + 100
+ console.log(max,'好朋友吗')
return {
name,
value: total,
@@ -81,7 +82,7 @@ const RNAKS = [FIRST, SECOND, THIRD]
在线公路工程数量
-
1234,123
+
{sundata}
{
const { dispatch } = props
- let data = [
- { value: 435, name: "县道" },
- { value: 679, name: "乡道" },
- { value: 848, name: "村道" },
+ let data1 = [
+ {name: "县", value: 207},
+ {name: "乡", value: 729},
+ {name: "村", value: 1938}
]
- const safetyData = [
- {name: '一级公路', value: 42},
- {name: '二级公路', value: 17},
- {name: '三级公路', value: 17},
- {name: '四级公路', value: 30},
+// const safetyData = [
+// {name: '一级公路', value: 42},
+// {name: '二级公路', value: 17},
+// {name: '三级公路', value: 17},
+// {name: '四级公路', value: 30},
- ]
+// ]
const [buildingnumber,setbuildingnumber] = useState(0)
+ const [data,setdata] = useState([])
+ const [xuandata,setxuandata] = useState(null)
+
+ //获取道路管理数据
const requestbuildingnumber = async ()=>{
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]))}))
+ setdata(alltype.filter(item=>item.name!=='null'))
setbuildingnumber(res.payload.data)
- // console.log(res.payload.data,'哈哈哈')
+ console.log(res.payload.data,'哈哈哈')
+
+ }
+
+ //获取宣传栏数据
+ const requestxuanchuanlan = async ()=>{
+ const res = await dispatch(getxuanchuan());
+
+ // setdata(alltype.filter(item=>item.name!=='null'))
+ setxuandata(res.payload.data)
+ console.log(res.payload.data,'宣传栏数据')
}
+ let t1 = Object.values(buildingnumber?.townRoad || {})
+
+ let totalgongli = t1.length!==0 ? t1.reduce((x,y)=>x+y.mileage,0):0 //乡镇道路占比总公里数
+ let totalcount = t1.length !==0 ? t1.reduce((x,y)=>x+y.roadCount,0):0 //乡镇道路占比公路总条数
+
+ // let sungongli = alltype.reduce((x,y)=>x+y.value,0)
+
+ const keepThreeNum=(value)=> {
+ let resValue = 0
+ //小数点的位置
+ let index = value&&value.toString().indexOf('.') + 1
+ //小数的位数
+ let num = value&&Math.abs(Number(value)).toString().length - index
+ if(index && num > 3){
+ resValue = value&&Number(value).toFixed(3)
+ } else {
+ resValue = value
+ }
+ 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 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,'对比')
+ // console.log(totalgongli,"好好的")
+ // console.log(keepThreeNum(totalgongli),'jjjjj')
useEffect(()=>{
- requestbuildingnumber()
+ requestbuildingnumber();
+ requestxuanchuanlan()
},[])
- const datas = new Array(15)
- datas.fill({
- name:"东乡镇",
- number:"11111",
- gongli:'9999'
- },0,15)
+ // const datas = new Array(15)
+ // datas.fill({
+ // name:"东乡镇",
+ // number:"11111",
+ // gongli:'9999'
+ // },0,15)
const rendercontent = ()=>{
return (
{datas.map(({name,number,gongli},index)=>
@@ -65,7 +117,7 @@ const Build = (props) => {
在建公路数量
-
{buildingnumber.buildingRoad || 0}
+
{buildingnumber?.buildingRoad || 0}
@@ -74,7 +126,7 @@ const Build = (props) => {
已建公路数量
- {buildingnumber.buildedRoad || 0}
+ {buildingnumber?.buildedRoad || 0}