update lunbo
This commit is contained in:
부모
6cf533e718
커밋
4374260acd
Binary file not shown.
BIN
public/video/floor1.webm
Normal file
BIN
public/video/floor1.webm
Normal file
Binary file not shown.
38
src/App.js
38
src/App.js
@ -7,6 +7,7 @@ import { useEffect, useState } from "react";
|
|||||||
import Home from "./pages/Home";
|
import Home from "./pages/Home";
|
||||||
import EnergyAnalysis from "./pages/EnergyCostAnalysis";
|
import EnergyAnalysis from "./pages/EnergyCostAnalysis";
|
||||||
import RulerContainer from "./components/Tools/Ruler";
|
import RulerContainer from "./components/Tools/Ruler";
|
||||||
|
import { Switch } from "antd";
|
||||||
import { createPortal } from "react-dom";
|
import { createPortal } from "react-dom";
|
||||||
|
|
||||||
const Menus = ["窑炉总览", "窑炉内部", "退火监测", "质检统计", "能耗分析"];
|
const Menus = ["窑炉总览", "窑炉内部", "退火监测", "质检统计", "能耗分析"];
|
||||||
@ -14,16 +15,23 @@ const Menus = ["窑炉总览", "窑炉内部", "退火监测", "质检统计", "
|
|||||||
function App() {
|
function App() {
|
||||||
const { styles, value, setValue } = useSlider(100);
|
const { styles, value, setValue } = useSlider(100);
|
||||||
const [navActive, setNavActive] = useState("窑炉总览");
|
const [navActive, setNavActive] = useState("窑炉总览");
|
||||||
|
const [lunbo, setlunbo] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const timer = setInterval(() => {
|
let timer;
|
||||||
handleMenuChange(Menus[(Menus.indexOf(navActive) + 1) % Menus.length]);
|
if (lunbo) {
|
||||||
}, 10000);
|
timer = setInterval(() => {
|
||||||
|
handleMenuChange(Menus[(Menus.indexOf(navActive) + 1) % Menus.length]);
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
return () => {
|
return () => {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
};
|
};
|
||||||
}, [navActive]);
|
}, [lunbo, navActive]);
|
||||||
|
|
||||||
|
function handleSwitchChange(val) {
|
||||||
|
setlunbo(val);
|
||||||
|
}
|
||||||
|
|
||||||
function handleMenuChange(value) {
|
function handleMenuChange(value) {
|
||||||
setNavActive(value);
|
setNavActive(value);
|
||||||
@ -34,7 +42,25 @@ function App() {
|
|||||||
<div id="FullScreen" style={{ ...styles, overflow: "hidden" }}>
|
<div id="FullScreen" style={{ ...styles, overflow: "hidden" }}>
|
||||||
<NavMenu active={navActive} onChangeActive={handleMenuChange} />
|
<NavMenu active={navActive} onChangeActive={handleMenuChange} />
|
||||||
<Head />
|
<Head />
|
||||||
|
<div
|
||||||
|
className="lunbo-setting"
|
||||||
|
style={{
|
||||||
|
position: "fixed",
|
||||||
|
top: "64px",
|
||||||
|
right: "680px",
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: "16px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span style={{ fontSize: "20px", color: "#00fff7" }}>模块轮播</span>
|
||||||
|
<Switch
|
||||||
|
className="lunbo-btn"
|
||||||
|
size="small"
|
||||||
|
value={lunbo}
|
||||||
|
onChange={handleSwitchChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
{navActive == "能耗分析" && <EnergyAnalysis />}
|
{navActive == "能耗分析" && <EnergyAnalysis />}
|
||||||
{navActive == "能耗分析" && <div className="bgDitu"></div>}
|
{navActive == "能耗分析" && <div className="bgDitu"></div>}
|
||||||
{navActive != "能耗分析" && <Home active={navActive} />}
|
{navActive != "能耗分析" && <Home active={navActive} />}
|
||||||
|
@ -139,3 +139,18 @@ body {
|
|||||||
.dv-scroll-board .header .header-item:not(:first-child) {
|
.dv-scroll-board .header .header-item:not(:first-child) {
|
||||||
border-left: 1px solid #0004;
|
border-left: 1px solid #0004;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.lunbo-btn.ant-switch {
|
||||||
|
background: #095063 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lunbo-btn.ant-switch .ant-switch-handle::before {
|
||||||
|
background: #c0f7ff !important;
|
||||||
|
}
|
||||||
|
.lunbo-btn.ant-switch-checked {
|
||||||
|
background: #00fff7 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lunbo-btn.ant-switch-checked .ant-switch-handle::before {
|
||||||
|
background: #c0f7ff !important;
|
||||||
|
}
|
||||||
|
불러오는 중...
Reference in New Issue
Block a user