diff --git a/src/components/公共组件/GraphBase/index.jsx b/src/components/公共组件/GraphBase/index.jsx index 8a1965a..cc10b95 100644 --- a/src/components/公共组件/GraphBase/index.jsx +++ b/src/components/公共组件/GraphBase/index.jsx @@ -43,7 +43,15 @@ function GraphBase(props) { const [showChart, setShowChart] = useState(true); let dto = null; + const switchStyle = {}; + if (props.switchPosition) { + props.switchPosition.forEach((item, index) => { + if (item != null) { + switchStyle[index == 0 ? 'top' : 'left'] = item + 'px'; + } + }); + } if (dateOptions) { dto = dateOptions.map((item) => ( @@ -75,7 +83,7 @@ function GraphBase(props) {
{desc &&
{desc}
} {switchOptions && ( -
+
{showChart && 历史详情} {!showChart && 实时流量} @@ -96,7 +104,7 @@ function GraphBase(props) { )} {dateOptions && ( onDateChange(target.value)} diff --git a/src/components/公共组件/当前温度/index.jsx b/src/components/公共组件/当前温度/index.jsx index 6e409df..4f91dbe 100644 --- a/src/components/公共组件/当前温度/index.jsx +++ b/src/components/公共组件/当前温度/index.jsx @@ -1,4 +1,5 @@ import BottomBarItem from '../BottomItemBackground'; +import GraphBase from '../GraphBase'; import { Radio } from 'antd'; import cls from './index.module.css'; import { useState } from 'react'; @@ -40,47 +41,20 @@ const SmallBox = (props) => { }; function WindFrequence(props) { - const [dataSource, setDataSource] = useState('fan'); + const [dataSource, setDataSource] = useState('风机'); - function handleSourceChange(e) { - console.log('val', e.target.value); - if (e.target.value == 'fan') { - setDataSource('fan'); - } else if (e.target.value == 'switcher') { - setDataSource('switcher'); - } else if (e.target.value == 'heating') { - setDataSource('heating'); - } + function handleSourceChange(v) { + console.log('val', v); } return ( - -
-
- - - 风机 - - - 风阀 - - - 电加热 - - -
-
-

A1区板上

@@ -157,7 +131,7 @@ function WindFrequence(props) {
- + ); } diff --git a/src/components/公共组件/风机运行频率/index.jsx b/src/components/公共组件/风机运行频率/index.jsx index 6737bf4..ac6cee1 100644 --- a/src/components/公共组件/风机运行频率/index.jsx +++ b/src/components/公共组件/风机运行频率/index.jsx @@ -162,15 +162,14 @@ function WindFrequence(props) { } } return ( - -
-
- - {showChart && 历史详情} - {!showChart && 实时流量} -
-
- +
{showChart && ( diff --git a/src/components/模块组件/退火监测/LeftSide/index.jsx b/src/components/模块组件/退火监测/LeftSide/index.jsx index 1785489..bd9bfa7 100644 --- a/src/components/模块组件/退火监测/LeftSide/index.jsx +++ b/src/components/模块组件/退火监测/LeftSide/index.jsx @@ -15,8 +15,12 @@ export default function index() { exit={{ opacity: 0, position: 'relative' }} transition={{ type: 'tween' }} > - - +
+ +
+
+ +
); }