wangyue 2 years ago
parent
commit
3bff18627e
  1. 22
      web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js
  2. 10
      web/log/development.txt

22
web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js

@ -6,14 +6,18 @@ const Leftbottomecharts = (props) => {
const { dispatch } = props
const [list, setList] = useState([])
const [count, setCount] = useState([])
const [value, setValue] = useState([])
const [flag, setFlag] = useState(true)
useEffect(() => {
const res = dispatch(getdaolutongji()).then((res) => {
console.log(res);
setList(res.payload.data.construction.map((item, index) => {
return item.year
}));
setCount(res.payload.data.construction.map((item, index) => {
return item.count.toFixed(3)
}))
setValue()
});
}, [])
// console.log(list, count);
@ -134,7 +138,7 @@ const Leftbottomecharts = (props) => {
shadowBlur: 10,
},
},
data: count,
data: flag ? count : value,
},
],
};
@ -142,15 +146,21 @@ const Leftbottomecharts = (props) => {
window.addEventListener('resize', function () {
chartInstance.resize();
})
}, [list, count]);
}, [count, flag, list]);
console.log(flag);
return (
<>
<div style={{ width: "72px", height: "20px", backgroundColor: "rgba(216,240,255,0.1000)", float: "right", textAlign: "center", marginRight: "4%", borderLeft: "solid 2px #6E7A83" }}>
<p style={{ color: "rgba(216,240,255,0.8000)", fontSize: "0.4vh", lineHeight: "20px" }}>公里</p></div>
<div onClick={() => {
setFlag(true)
}} style={{ position: "absolute", top: "75%", left: "75%", width: "72px", height: "20px", backgroundColor: "rgba(216,240,255,0.1000)", float: "right", textAlign: "center", zIndex: 100, marginRight: "4%", borderLeft: "solid 2px #6E7A83" }} >
<p style={{ color: flag == false ? "rgba(216,240,255,0.8000)" : "#fff", fontSize: "0.4vh", lineHeight: "20px" }}>已建</p></div>
<div onClick={() => {
setFlag(false)
}} style={{ position: "absolute", width: "72px", left: "45%", top: "75%", height: "20px", backgroundColor: "rgba(216,240,255,0.1000)", float: "right", textAlign: "center", marginRight: "4%", borderLeft: "solid 2px #6E7A83" }}>
<p style={{ color: flag == true ? "rgba(216,240,255,0.8000)" : "#fff", fontSize: "0.4vh", lineHeight: "20px" }} >未建</p></div >
<div ref={chartRef} style={{
height: "20vh", width: "100%"
height: "18vh", width: "100%", position: "absolute", top: "77%"
}}></div>
</>
);

10
web/log/development.txt

@ -66685,3 +66685,13 @@
' at F:\\Highways4Good\\web\\node_modules\\koa-66\\index.js:209:56\n' +
' at dispatch (F:\\Highways4Good\\web\\node_modules\\koa\\node_modules\\koa-compose\\index.js:42:32)'
}
2022-08-11 10:02:05.357 - error: [FS-ERRHD]
{
message: 'qndmn is not defined',
stack: 'ReferenceError: qndmn is not defined\n' +
' at getApiRoot (F:\\Highways4Good\\web\\routes\\attachment\\index.js:24:40)\n' +
' at dispatch (F:\\Highways4Good\\web\\node_modules\\koa-compose\\index.js:44:32)\n' +
' at F:\\Highways4Good\\web\\node_modules\\koa-compose\\index.js:36:12\n' +
' at F:\\Highways4Good\\web\\node_modules\\koa-66\\index.js:209:56\n' +
' at dispatch (F:\\Highways4Good\\web\\node_modules\\koa\\node_modules\\koa-compose\\index.js:42:32)'
}

Loading…
Cancel
Save