Browse Source

治超详情

dev
yangsen 3 years ago
parent
commit
cb765f028d
  1. 6
      api/log/development.log
  2. BIN
      web/client/assets/images/quanju/all.png
  3. 125
      web/client/src/sections/quanju/containers/footer/build/Rightbottom.js
  4. 2147
      web/log/development.txt

6
api/log/development.log

@ -10815,4 +10815,10 @@ headers: {}
2022-07-30 17:48:40.061 - debug: [FS-LOGGER] Init. 2022-07-30 17:48:40.061 - debug: [FS-LOGGER] Init.
2022-07-30 17:48:40.152 - info: [FS-ATTACHMENT] Inject attachment mw into router. 2022-07-30 17:48:40.152 - info: [FS-ATTACHMENT] Inject attachment mw into router.
2022-07-30 17:48:40.152 - info: [FS-AUTH] Inject auth and api mv into router. 2022-07-30 17:48:40.152 - info: [FS-AUTH] Inject auth and api mv into router.
<<<<<<< Updated upstream
>>>>>>> d8f96cea72338cf7a61dea293bd6d0cd5da48bb0 >>>>>>> d8f96cea72338cf7a61dea293bd6d0cd5da48bb0
=======
2022-08-11 09:02:08.616 - debug: [FS-LOGGER] Init.
2022-08-11 09:02:08.699 - info: [FS-ATTACHMENT] Inject attachment mw into router.
2022-08-11 09:02:08.699 - info: [FS-AUTH] Inject auth and api mv into router.
>>>>>>> Stashed changes

BIN
web/client/assets/images/quanju/all.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

125
web/client/src/sections/quanju/containers/footer/build/Rightbottom.js

@ -4,8 +4,8 @@ import { Col, Progress, Row } from 'antd';
import React, { useEffect, useRef } from 'react'; import React, { useEffect, useRef } from 'react';
// import ReactEcharts from 'echarts-for-react'; // import ReactEcharts from 'echarts-for-react';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
function Rightbottom(props) { function Rightbottom (props) {
const { width, height, total,data, text } = props const { width, height, total, data, text } = props
const chartRef = useRef(null); const chartRef = useRef(null);
let colorList = [ let colorList = [
"rgba(7,185,254,1)", "rgba(7,185,254,1)",
@ -33,23 +33,29 @@ function Rightbottom(props) {
// ] // ]
const rightLegend = ['一级公路', '二级公路', '三级公路','四级公路','等外公路'] const rightLegend = ['一级公路', '二级公路', '三级公路', '四级公路', '等外公路']
// let data=[ // const rightLegend = ['三级及以上','四级']
// {name: "四级公路", value: 2969}, // let data=[
// {name: "等外公路", value: 171}, // {name: "四级公路", value: 2969},
// {name: "三级公路", value: 103}, // {name: "等外公路", value: 171},
// {name: "二级公路", value: 15}, // {name: "三级公路", value: 103},
// ] // {name: "二级公路", value: 15},
// console.log(data.map(i=>i.name),'jjj') // ]
let dataq = rightLegend.map((item,index)=>{ // console.log(data.map(i=>i.name),'jjj')
if(data.map(i=>i.name).includes(item)){ console.log(data);
return {name:item,value:data.filter(i1=>i1.name===item)[0].value} let dataq = rightLegend.map((item, index) => {
}else{ console.log(item, index);
return {name:item,value:0} if (data.map(i => i.name).includes(item)) {
console.log(item);
console.log(1);
return { name: item, value: data.filter(i1 => i1.name === item)[0].value }
} else {
console.log(2);
return { name: item, value: 0 }
} }
}) })
console.log(dataq,'数据') console.log(dataq, '数据')
dataq?.sort((a,b)=>b.value - a.value) dataq?.sort((a, b) => b.value - a.value)
dataq?.forEach(d => { dataq?.forEach(d => {
name.push(d.name) name.push(d.name)
emptyName.push({ emptyName.push({
@ -76,39 +82,39 @@ let dataq = rightLegend.map((item,index)=>{
}, },
formatter: (values) => `${values.seriesName}<br /> ${values.marker} ${values.name}<b>${values.value}</b>段`, formatter: (values) => `${values.seriesName}<br /> ${values.marker} ${values.name}<b>${values.value}</b>段`,
}, },
legend: { // legend: {
orient: "vertical", // orient: "vertical",
itemWidth: 10, // itemWidth: 10,
itemHeight: 10, // itemHeight: 10,
// right: '30%', // // right: '30%',
left: '50%', // left: '50%',
top: 'center', // top: 'center',
align: 'left', // align: 'left',
data: name, // data: name,
formatter: (name) => { // formatter: (name) => {
for (let i = 0; i < option.series[1].data.length; i += 1) { // for (let i = 0; i < option.series[1].data.length; i += 1) {
if (name === option.series[1].data[i].name) { // if (name === option.series[1].data[i].name) {
let arr = [`{a|${name}}`, `{b|${option.series[1].data[i].value}}`] // let arr = [`{a|${name}}`, `{b|${option.series[1].data[i].value}}`]
return arr.join('\t'); // return arr.join('\t');
} // }
} // }
}, // },
textStyle: { // textStyle: {
rich: { // rich: {
a: { // a: {
color: '#E9F7FF', // color: '#E9F7FF',
fontSize: 14, // fontSize: 14,
padding:[0,10] // padding:[0,10]
}, // },
b: { // b: {
fontSize: 16, // fontSize: 16,
fontFamily: 'YouSheBiaoTiHei', // fontFamily: 'YouSheBiaoTiHei',
color: '#fff', // color: '#fff',
padding:[0,0,0,15] // padding:[0,0,0,15]
}, // },
} // }
} // }
}, // },
grid: { grid: {
left: '10%' left: '10%'
}, },
@ -180,20 +186,25 @@ let dataq = rightLegend.map((item,index)=>{
// myChart.onChartReady = (instance) => { // myChart.onChartReady = (instance) => {
// chartRef.current.safetyChart = instance; // chartRef.current.safetyChart = instance;
// } // }
myChart.setOption(option); // myChart.setOption(option);
return ()=>{ return () => {
// clearInterval(changePieInterval) // clearInterval(changePieInterval)
} }
}, [data]); }, [data]);
return ( return (
<div className='build-right-bottom'> <div className='build-right-bottom'>
<span style={{position:"absolute",width:"10%",color:"#FFF",backgroundColor:'rgba(216, 240, 255, 0.1)',right:"5%",textAlign:"center",top:0}}></span> {/* <span style={{position:"absolute",width:"10%",color:"#FFF",backgroundColor:'rgba(216, 240, 255, 0.1)',right:"5%",textAlign:"center",top:0}}>段</span> */}
<div className='build-right-bottom-title'> <div className='build-right-bottom-title'>
<h2>{total||0}</h2> <h2>{total || 0}</h2>
<span>道路总公里</span> <span>道路总公里</span>
</div> </div>
<img src='/assets/images/quanju/chart-circle.png'></img> <div className='img1'>
<img src='/assets/images/quanju/all.png' />
</div>
<div className='img2'>
<img src='/assets/images/quanju/chart-circle.png' />
</div>
<div ref={chartRef} style={{ width: width || "70%", height: height || "90%" }} id="ech"></div> <div ref={chartRef} style={{ width: width || "70%", height: height || "90%" }} id="ech"></div>
</div> </div>
); );

2147
web/log/development.txt

File diff suppressed because it is too large
Loading…
Cancel
Save