From 1c66354b9403bb81b2523523afc1ef6206590ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= Date: Sat, 14 Mar 2026 09:58:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=BC=A0=E6=A0=87=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E6=98=BE=E7=A4=BA=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2/components/softwareFactory.jsx | 56 +++++++++++++++---- src/forge/Main/projecthome/v2/index.scss | 14 +++++ 2 files changed, 58 insertions(+), 12 deletions(-) diff --git a/src/forge/Main/projecthome/v2/components/softwareFactory.jsx b/src/forge/Main/projecthome/v2/components/softwareFactory.jsx index a60a40cc3..ef731c764 100644 --- a/src/forge/Main/projecthome/v2/components/softwareFactory.jsx +++ b/src/forge/Main/projecthome/v2/components/softwareFactory.jsx @@ -1,39 +1,72 @@ -import React, { useCallback, useEffect, useState } from 'react'; +import React, { useEffect, useState, useRef } from 'react'; import img11 from '../image/img11.png'; import img12 from '../image/img12.png'; -import { Button } from 'antd'; import { rollingButton } from '../../../../../components/button'; function SoftwareFactory() { const [active, setActive] = useState(1); + const [isTimerRunning, setIsTimerRunning] = useState(true); + const timerRef = useRef(null); useEffect(() => { - const interval = setInterval(() => { - setActive(prevActive => { - return prevActive === 1 ? 2 : 1; - }); + // 初始启动定时器 + timerRef.current = setInterval(() => { + setActive(prevActive => prevActive === 1 ? 2 : 1); }, 6000); - // 清理定时器 + // 组件卸载时清理 return () => { - clearInterval(interval); + if (timerRef.current) { + clearInterval(timerRef.current); + } }; }, []); + // 点击切换 + const handleToggle = (mode) => { + setActive(mode); + if (timerRef.current) { + clearInterval(timerRef.current); + timerRef.current = null; + } + setIsTimerRunning(false); + }; + + // 鼠标移出恢复轮播 + const handleMouseLeave = () => { + if (!timerRef.current) { + timerRef.current = setInterval(() => { + setActive(prevActive => prevActive === 1 ? 2 : 1); + }, 6000); + setIsTimerRunning(true); + } + }; + return (
软件工厂
-
+
-
+
handleToggle(1)} + style={{ cursor: 'pointer' }} + >
敏捷模式 全流程迭代演化
敏捷模式聚焦需求 - 任务 - 代码 - 迭代 - 测试 - 制品的全流程
数字化升级和在线化组织
-
+
handleToggle(2)} + style={{ cursor: 'pointer' }} + >
极速模式 高效率快速响应 @@ -46,7 +79,6 @@ function SoftwareFactory() {
- {/* 角标 */}
{active === 1 ? "敏捷模式" : "极速模式"}
diff --git a/src/forge/Main/projecthome/v2/index.scss b/src/forge/Main/projecthome/v2/index.scss index 1186f6617..f353ca14c 100644 --- a/src/forge/Main/projecthome/v2/index.scss +++ b/src/forge/Main/projecthome/v2/index.scss @@ -829,6 +829,20 @@ animation: height0-83 5.9s linear 0s infinite; } } + &.isTimerRunning{ + position: relative; + + &::before { + content: ''; + position: absolute; + top: 12px; + left: -12px; + width: 1.5px; + height: 83%; + background-color: rgba(9, 18, 33, 1); + } + + } .icon-a-zu15512 { position: relative;