From 8a01559e2223cac318f3cb08b33ec4b6a4dd2b0c Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Mon, 21 Aug 2023 11:40:40 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E6=B0=B4=E5=88=A9=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=9B=BE=E8=A1=A8=E5=A2=9E=E5=8A=A0=E7=99=BE?= =?UTF-8?q?=E5=88=86=E6=AF=94=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../water-prevention/components/charts/ring.js | 3 ++- .../water-prevention/components/left-bottom.js | 4 ++-- .../src/sections/water-prevention/containers/gis.js | 10 ++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/super-screen/client/src/sections/water-prevention/components/charts/ring.js b/super-screen/client/src/sections/water-prevention/components/charts/ring.js index 34205a2..a10284e 100644 --- a/super-screen/client/src/sections/water-prevention/components/charts/ring.js +++ b/super-screen/client/src/sections/water-prevention/components/charts/ring.js @@ -93,13 +93,14 @@ function RingChart(props) { const { height, width } = props; const options = getOption(); const percent_colors = ['#24DDFA', '#267FD3', '#F8C86B',] + const total = data?.reduce((p, c) => p + c.value, 0) const renderList = () => data.map((s, index) => (
{s.name}
-
{s.value}个 14%
+
{s.value}个 {Math.round(s.value / total * 100)}%
)); diff --git a/super-screen/client/src/sections/water-prevention/components/left-bottom.js b/super-screen/client/src/sections/water-prevention/components/left-bottom.js index 4f6561c..b236c20 100644 --- a/super-screen/client/src/sections/water-prevention/components/left-bottom.js +++ b/super-screen/client/src/sections/water-prevention/components/left-bottom.js @@ -33,9 +33,9 @@ function LeftBottom(props) { ]; const data = [ - { name: '泵站站点', value: SHUI_ZHAN.length }, + { name: '泵站站点', value: 12 }, { name: '雨量站点', value: 1 }, - { name: '水位站点', value: waterLevelLength } + { name: '水位站点', value: 23 } ] return diff --git a/super-screen/client/src/sections/water-prevention/containers/gis.js b/super-screen/client/src/sections/water-prevention/containers/gis.js index 5d9c938..82de562 100644 --- a/super-screen/client/src/sections/water-prevention/containers/gis.js +++ b/super-screen/client/src/sections/water-prevention/containers/gis.js @@ -135,10 +135,12 @@ function Map(props) { setTimeout(() => { if (document.getElementById(`contentid${x.name}`)) { render(
-
{ - map.setCenter([115.922069, 28.554867]) - map.clearInfoWindow(); - }} /> +
{ + map.setCenter([115.922069, 28.554867]) + map.clearInfoWindow(); + }} />
泵站名称: {x.name}