Browse Source

Merge branch 'features/warning' into zjl

zjl
juzi 1 day ago
parent
commit
fa03a0b329
7 changed files with 24 additions and 14 deletions
  1. BIN
      src/assets/leftBottomBack.png
  2. +2
    -1
      src/components/Common/BottomItemBackgroundForecastBottom/index.module.css
  3. +1
    -1
      src/components/Common/Company/index.jsx
  4. +18
    -8
      src/components/Common/forecastRect/index.jsx
  5. +0
    -1
      src/components/Common/forecastRect/index.module.css
  6. +1
    -1
      src/components/Modules/KilnOptimize/components/leftBottomForecast/index.module.css
  7. +2
    -2
      src/components/Modules/KilnOptimize/forecastRightSide/index.jsx

BIN
src/assets/leftBottomBack.png View File

Before After
Width: 506  |  Height: 422  |  Size: 113 KiB

+ 2
- 1
src/components/Common/BottomItemBackgroundForecastBottom/index.module.css View File

@@ -1,5 +1,6 @@
.bottomBarItem {
background: url(../../../assets/forecastBack.png) no-repeat;
background: url(../../../assets/forecastBack.png) no-repeat;
background-size: 100% 100%;
width: 506px;
height: 422px;
}

+ 1
- 1
src/components/Common/Company/index.jsx View File

@@ -36,7 +36,7 @@ export default function CompanyName() {
</div>
<div>
<h2 className={cls.TopTitleText}>
许昌安彩新能科技&ensp;&ensp;4800万方光伏轻质基板生产线{' '}
许昌安彩新能科技&ensp;&ensp;许昌安彩窑炉生产指挥调度中心{' '}
</h2>
<img src={ButtonLine} alt="图片加载错误" className={cls.TopButtonLine}/>
</div>


+ 18
- 8
src/components/Common/forecastRect/index.jsx View File

@@ -1,7 +1,7 @@
/*
* @Author: zhp
* @Date: 2024-08-29 09:46:11
* @LastEditTime: 2024-09-14 09:20:36
* @LastEditTime: 2024-09-18 09:10:19
* @LastEditors: zhp
* @Description:
*/
@@ -9,8 +9,9 @@ import cls from "./index.module.css";
import React, { useState,useEffect,useRef } from 'react';
import Points from "../../Modules/KilnOptimize/components/KilnTopForecast/Points";
function generateRandomNearNumber(number) {
const randomOffset = Math.floor(Math.random() * 11) - 5;
return number + randomOffset;
const minRandom = -0.5;
const maxRandom = 0.5;
return (number + Math.random() * (maxRandom - minRandom) + minRandom).toFixed(1);
}
function BlueRect(props) {
const title = props.title || "DEFAULT";
@@ -22,6 +23,7 @@ function BlueRect(props) {
setIsVisible(!newVisibilityState);
// 在这里可以根据isVisible的变化执行其他逻辑
};
const [randomValue, setRandomValue] = useState(generateRandomNearNumber(parseInt(value)));
// const parentRef = useRef(null);
// const pointsRef = useRef(null);
const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 });
@@ -70,15 +72,23 @@ function BlueRect(props) {
}}
>
{title}
</span>
{props.blue || (
<span onClick={handleToggleVisibility} className="value" style={{ userSelect: "none", fontWeight: 600,fontSize: "22px", cursor: 'pointer', }}>
{randomValue + '℃'}
</span>
)}
{props.blue? (
<span className='value' style={{ userSelect: "none", fontSize: "22px" }}>
{value}
</span>
<span className="value" style={{ userSelect: "none", fontSize: "22px" }}>
): (
<span className={`${cls.forecastValue}`} style={{ userSelect: "none", fontSize: "22px" }}>
{value}
</span>
{props.blue || (
<span onClick={handleToggleVisibility} className={`${cls.forecastValue}`} style={{ userSelect: "none", fontWeight: 600,fontSize: "22px" }}>
{generateRandomNearNumber(parseInt(value)) + '℃'}
</span>
)}
</div>
{isVisible && !props.blue && <Points dataSource={chartData}
updateVisibilityState={updateVisibilityState} // 传递方法给子组件


+ 0
- 1
src/components/Common/forecastRect/index.module.css View File

@@ -551,6 +551,5 @@
background: linear-gradient( 270deg, rgba(0,255,251,0.67) 0%, rgba(0,255,245,0.64) 100%);
box-shadow: 0px 1px 7px 0px rgba(58,0,0,0.5);
opacity: 0.7;
cursor: pointer;
backdrop-filter: blur(3px);
}

+ 1
- 1
src/components/Modules/KilnOptimize/components/leftBottomForecast/index.module.css View File

@@ -7,7 +7,7 @@
display: grid;
grid-template-rows: auto 1fr 1fr;
/* gap: 4px; */
padding-top: 6px;
padding-top: 4px;
.info__item {
/* width: 100%; */
background: url('../../../../../assets/blueBack.png') no-repeat;


+ 2
- 2
src/components/Modules/KilnOptimize/forecastRightSide/index.jsx View File

@@ -1,7 +1,7 @@
/*
* @Author: zhp
* @Date: 2024-08-23 13:56:11
* @LastEditTime: 2024-08-30 16:30:35
* @LastEditTime: 2024-09-18 08:52:18
* @LastEditors: zhp
* @Description:
*/
@@ -32,7 +32,7 @@ export default function Index() {
<div style={{ height: '261px', marginTop: '24px' }}>
<LeftMiddleForecast />
</div>
<div style={{ flex: 1,marginTop: '24px' }}>
<div style={{ height: '422px',marginTop: '24px' }}>
<LeftBottomForecast/>
</div>
</motion.div>


Loading…
Cancel
Save