From ed7ab5a8d3ba55e0b0b4e5c9894edf728d004c9d Mon Sep 17 00:00:00 2001 From: wangyue Date: Thu, 28 Jul 2022 16:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../footer/leadership/centerleft/daolu.js | 15 ++--- .../footer/leadership/centerleft/handong.js | 19 +++--- .../footer/leadership/centerleft/qiqoliang.js | 15 ++--- .../leadership/left/echarts/lefttopecharts.js | 60 +++++++++++-------- .../footer/leadership/left/left-top.js | 2 +- .../footer/leadership/right/hudong.js | 2 +- .../footer/leadership/right/right-bottom.js | 1 - .../quanju/containers/heand/style.less | 8 ++- .../quanju/containers/public/module.js | 8 +-- 9 files changed, 76 insertions(+), 54 deletions(-) diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js index 7ba29493..75fe7a59 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js @@ -42,12 +42,13 @@ const Right = (props) => { }} onMouseLeave={() => { setBeijing() }}> - {beijing == index ? : ""} + {beijing == index ? : ""} {beijing == index ? : ""} -

日常养护

- {item.user?.name ?

{item.user.name}

:

--

} -

{item.road ? item.road : "--"}

-

{moment(item.time).format("YYYY-MM-Do HH:mm:ss") ? moment(item.time).format("YYYY-MM-Do HH:mm:ss") : "--"}

+

{item.roadSectionStart ? item.roadSectionStart : ""}{item.roadSectionStart && item.roadSectionEnd ? "———" : ""}{item.roadSectionEnd ? item.roadSectionEnd : ""}{item.roadSectionStart || item.roadSectionEnd ? "" : "--"}

+

日常养护

+ {item.user?.name ?

{item.user.name}

:

--

} +

{item.road ? item.road : "--"}

+

{moment(item.time).format("YYYY-MM-Do HH:mm:ss") ? moment(item.time).format("YYYY-MM-Do HH:mm:ss") : "--"}

) }) } @@ -60,7 +61,7 @@ const Right = (props) => {
-

占比{(roads?.["县"] / (roads?.["乡"] + roads?.["村"] + roads?.["县"])).toFixed(4) * 100}%

+

占比{((roads?.["县"] / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}%

{roads?.["县"].toFixed(3)}公里县道道路

@@ -74,7 +75,7 @@ const Right = (props) => {

乡村道道路{(roads?.["乡"] + roads?.["村"]).toFixed(3)}公里

-

占比{((roads?.["乡"] + roads?.["村"]) / (roads?.["乡"] + roads?.["村"] + roads?.["县"])).toFixed(4) * 100}%

+

占比{(((roads?.["乡"] + roads?.["村"]) / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}%

diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/handong.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/handong.js index 8fdd7310..e09e4731 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/handong.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/handong.js @@ -18,7 +18,9 @@ const Right = (props) => { setNums(res.payload.data.reportCount.filter((item, index) => { return item.projectType == "culvert" })) + // console.log(nums); }) + }, []) useEffect(() => { const daolus = dispatch(getdaolutongji()).then((res) => { @@ -34,6 +36,8 @@ const Right = (props) => {
{ list.map((item, index) => { + console.log(list); + return (
  • { }} onMouseLeave={() => { setBeijing() }}> - {beijing == index ? : ""} + {beijing == index ? : ""} {beijing == index ? : ""} -

    日常养护

    - {item.user?.name ?

    {item.user.name}

    :

    --

    } -

    {item.road ? item.road : "--"}

    -

    {moment(item.time).format("YYYY-MM-Do HH:mm:ss") ? moment(item.time).format("YYYY-MM-Do HH:mm:ss") : "--"}

  • +

    {item.roadSectionStart ? item.roadSectionStart : ""}{item.roadSectionStart && item.roadSectionEnd ? "———" : ""}{item.roadSectionEnd ? item.roadSectionEnd : ""}{item.roadSectionStart || item.roadSectionEnd ? "" : "--"}

    +

    日常养护

    + {item.user?.name ?

    {item.user.name}

    :

    --

    } +

    {item.road ? item.road : "--"}

    +

    {moment(item.time).format("YYYY-MM-Do HH:mm:ss") ? moment(item.time).format("YYYY-MM-Do HH:mm:ss") : "--"}

    ) }) } @@ -61,7 +66,7 @@ const Right = (props) => {
    -

    占比{(roads?.["县"] / (roads?.["乡"] + roads?.["村"] + roads?.["县"])).toFixed(4) * 100}%

    +

    占比{((roads?.["县"] / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}%

    {roads?.["县"].toFixed(0)}县涵洞

    @@ -75,7 +80,7 @@ const Right = (props) => {

    乡村涵洞{(roads?.["乡"] + roads?.["村"]).toFixed(0)}

    -

    占比{((roads?.["乡"] + roads?.["村"]) / (roads?.["乡"] + roads?.["村"] + roads?.["县"])).toFixed(4) * 100}%

    +

    占比{(((roads?.["乡"] + roads?.["村"]) / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}%

    diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/qiqoliang.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/qiqoliang.js index a9ce0bde..75a35e83 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/qiqoliang.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/qiqoliang.js @@ -42,12 +42,13 @@ const Right = (props) => { }} onMouseLeave={() => { setBeijing() }}> - {beijing == index ? : ""} + {beijing == index ? : ""} {beijing == index ? : ""} -

    日常养护

    - {item.user?.name ?

    {item.user.name}

    :

    --

    } -

    {item.road ? item.road : "--"}

    -

    {moment(item.time).format("YYYY-MM-Do HH:mm:ss") ? moment(item.time).format("YYYY-MM-Do HH:mm:ss") : "--"}

    +

    {item.roadSectionStart ? item.roadSectionStart : ""}{item.roadSectionStart && item.roadSectionEnd ? "———" : ""}{item.roadSectionEnd ? item.roadSectionEnd : ""}{item.roadSectionStart || item.roadSectionEnd ? "" : "--"}

    +

    日常养护

    + {item.user?.name ?

    {item.user.name}

    :

    --

    } +

    {item.road ? item.road : "--"}

    +

    {moment(item.time).format("YYYY-MM-Do HH:mm:ss") ? moment(item.time).format("YYYY-MM-Do HH:mm:ss") : "--"}

    ) }) } @@ -60,7 +61,7 @@ const Right = (props) => {
    -

    占比{(roads?.["大桥"] / (roads?.["小桥"] + roads?.["中桥"] + roads?.["大桥"])).toFixed(4) * 100}%

    +

    占比{((roads?.["大桥"] / (roads?.["小桥"] + roads?.["中桥"] + roads?.["大桥"])) * 100).toFixed(2)}%

    {roads?.["大桥"]}大桥

    @@ -74,7 +75,7 @@ const Right = (props) => {

    中小桥梁{roads?.["小桥"] + roads?.["中桥"]}

    -

    占比{((roads?.["小桥"] + roads?.["中桥"]) / (roads?.["小桥"] + roads?.["中桥"] + roads?.["大桥"])).toFixed(4) * 100}%

    +

    占比{(((roads?.["小桥"] + roads?.["中桥"]) / (roads?.["小桥"] + roads?.["中桥"] + roads?.["大桥"])) * 100).toFixed(2)}%

    diff --git a/web/client/src/sections/quanju/containers/footer/leadership/left/echarts/lefttopecharts.js b/web/client/src/sections/quanju/containers/footer/leadership/left/echarts/lefttopecharts.js index b0cba9dc..bccc2914 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/left/echarts/lefttopecharts.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/left/echarts/lefttopecharts.js @@ -2,18 +2,29 @@ import React, { useEffect, useRef, useState } from 'react' import * as echarts from 'echarts'; import { getGodshuju } from "../../../../../actions/example" - +// const newshow = 1 const Lefttopecharts = (props) => { const { dispatch } = props const chartRef = useRef(null); const [mass, setMass] = useState() + const [shows, setShows] = useState(1) useEffect(() => { const shuju = dispatch(getGodshuju()).then((res) => { // console.log(res); setMass(res.payload.data.index) // setspeed(res.payload.data.speed) + // console.log(124); }) - }, []) + }, [shows]) + useEffect(() => { + const timer = window.setInterval(() => { + setShows(new Date()); + }, 300000); + return () => { + clearInterval(timer); + }; + }, []); + // console.log(shows); useEffect(() => { // const shuju = dispatch(getGodshuju()).then((res) => { // // console.log(res); @@ -24,7 +35,7 @@ const Lefttopecharts = (props) => { var chartInstance = echarts.init(chartRef.current); // var dataArr = mass || 0; var names = names() - var colorSet = /* colors() *//* "red" + */ /* {mass<30?""} */"#33B000"; + var colorSet = colors(); function names() { if (mass) { if (mass >= 0 && mass < 30) { @@ -39,19 +50,19 @@ const Lefttopecharts = (props) => { } } - // function colors() { - // if (mass) { - // if (mass >= 0 && mass < 30) { - // return (colorSet = { color: "#33B000" }); - // } else if (mass >= 30 && mass < 50) { - // return (colorSet = { color: "#FECB00" }); - // } else if (mass >= 50 && mass < 70) { - // return (colorSet = { color: "#DF0001" }); - // } else if (mass >= 70 && mass <= 100) { - // return (colorSet = { color: "#8E0E0B" }); - // } - // } - // } + function colors() { + // if (mass || 50) { + if (mass || 0 >= 0 && mass || 0 < 30) { + return (colorSet = { color: "#33B000" }); + } else if (mass || 0 >= 30 && mass || 0 < 50) { + return (colorSet = { color: "#FECB00" }); + } else if (mass || 0 >= 50 && mass || 0 < 70) { + return (colorSet = { color: "#DF0001" }); + } else if (mass || 0 >= 70 && mass || 0 <= 100) { + return (colorSet = { color: "#8E0E0B" }); + } + // } + } var option = { // backgroundColor: "#0E1327", tooltip: { @@ -69,8 +80,8 @@ const Lefttopecharts = (props) => { axisLine: { lineStyle: { color: [ - [mass || [] / 100, colorSet.color], - [1, "#111F42"], + [mass || [] /* / 100 */, colorSet.color || []], + // [2, "#111F42"], ], width: 3, }, @@ -89,10 +100,11 @@ const Lefttopecharts = (props) => { // }, detail: { formatter: function (value) { + // console.log(value, 12121); if (value !== 0) { - var num = Math.round(value); + // var num = Math.round(value); return ( - parseInt(num).toFixed(0) + + value.toFixed(2) + "%" + "\n" + "\n" + @@ -105,7 +117,7 @@ const Lefttopecharts = (props) => { return 0; } }, - offsetCenter: [0, 82], + offsetCenter: [0, 60], textStyle: { padding: [0, 0, 0, 0], fontSize: 18, @@ -212,10 +224,8 @@ const Lefttopecharts = (props) => {
    -
    Km/h
    -
    当前
    - {/*
    */} -
    + +

    畅通

    {"[0,30)"}

    diff --git a/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js b/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js index 997b5782..fabe7b54 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js @@ -45,7 +45,7 @@ const Lefttop = (props) => { fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC", color: "rgba(216,240,255,0.8000)", position: "absolute", left: "30%", top: "65%" }}>预测明日

    -

    {(speed + ((Math.random() * (3 + 0)))).toFixed(2)}Km/h

    +

    {(speed + ((Math.random() * (6) - 3))).toFixed(2)}Km/h

    diff --git a/web/client/src/sections/quanju/containers/footer/leadership/right/hudong.js b/web/client/src/sections/quanju/containers/footer/leadership/right/hudong.js index 0f169f72..98b76ca3 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/right/hudong.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/right/hudong.js @@ -144,7 +144,7 @@ class ReactCarousel extends Component { let { timer } = this.state; timer = setInterval(() => { this.next(); - }, 2000); + }, 300000); this.setState({ timer }) diff --git a/web/client/src/sections/quanju/containers/footer/leadership/right/right-bottom.js b/web/client/src/sections/quanju/containers/footer/leadership/right/right-bottom.js index 5ca8a3d4..64d271ae 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/right/right-bottom.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/right/right-bottom.js @@ -19,7 +19,6 @@ const Rightbottom = (props) => { setNums(res.payload?.data?.processed) }) }, []) - // console.log(list); const renderBody = () => { return (
    diff --git a/web/client/src/sections/quanju/containers/heand/style.less b/web/client/src/sections/quanju/containers/heand/style.less index 931b4d46..13e6d2ec 100644 --- a/web/client/src/sections/quanju/containers/heand/style.less +++ b/web/client/src/sections/quanju/containers/heand/style.less @@ -5,8 +5,11 @@ position: absolute; top: 3vh; a{ - color: #c3d4f5; + color: #FFFFFF; + font-size: 2vh; + font-family: PingFangSC-Medium, PingFang SC; line-height: 4.7vh; + font-weight: 500; } } .notabKey{ @@ -17,7 +20,10 @@ text-align: center; a{ color: #6593c6; + font-size: 2vh; + font-family: PingFangSC-Medium, PingFang SC; line-height: 4.7vh; + font-weight: 500; } } \ No newline at end of file diff --git a/web/client/src/sections/quanju/containers/public/module.js b/web/client/src/sections/quanju/containers/public/module.js index e3aaa454..001cdd00 100644 --- a/web/client/src/sections/quanju/containers/public/module.js +++ b/web/client/src/sections/quanju/containers/public/module.js @@ -3,17 +3,17 @@ import "./font.css" import "./left.less" const Module = (props) => { - const { style, children, title, hualun,customize } = props + const { style, children, title, hualun, customize } = props return ( <>
    {/*

    {title || []}

    */} - - {title || []} + + {title || []}
    -
    +
    {children}