From 6bcd8b0118a455c9ef9bb59841ee033dfeee83c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E6=9E=B3?= <7854742+wang_rumeng@user.noreply.gitee.com> Date: Wed, 6 Aug 2025 17:07:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E6=9A=82=E5=81=9C=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6=E4=BB=A5=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=9A=82=E5=81=9C=E7=8A=B6=E6=80=81=E7=9A=84=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=92=8C=E6=98=BE=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/pages/work-flow.tsx | 1 + components/pages/work-flow/task-info.tsx | 130 +++++++++--------- .../pages/work-flow/use-workflow-data.tsx | 5 +- 3 files changed, 70 insertions(+), 66 deletions(-) diff --git a/components/pages/work-flow.tsx b/components/pages/work-flow.tsx index 80f3461..3e22339 100644 --- a/components/pages/work-flow.tsx +++ b/components/pages/work-flow.tsx @@ -125,6 +125,7 @@ export default function WorkFlow() { currentLoadingText={currentLoadingText} dataLoadError={dataLoadError} roles={roles} + isPauseWorkFlow={isPauseWorkFlow} /> diff --git a/components/pages/work-flow/task-info.tsx b/components/pages/work-flow/task-info.tsx index 344be20..e4328ae 100644 --- a/components/pages/work-flow/task-info.tsx +++ b/components/pages/work-flow/task-info.tsx @@ -17,6 +17,7 @@ interface TaskInfoProps { currentLoadingText: string; dataLoadError?: string | null; roles: any[]; + isPauseWorkFlow: boolean; } const stageIconMap = { @@ -41,7 +42,7 @@ const stageIconMap = { const TAG_COLORS = ['#FF5733', '#126821', '#8d3913', '#FF33A1', '#A133FF', '#FF3333', '#3333FF', '#A1A1A1', '#a1115e', '#30527f']; // 阶段图标组件 -const StageIcons = ({ currentStage, isExpanded }: { currentStage: number, isExpanded: boolean }) => { +const StageIcons = ({ currentStage, isExpanded, isPauseWorkFlow }: { currentStage: number, isExpanded: boolean, isPauseWorkFlow: boolean }) => { // 根据当前阶段重新排序图标 const orderedStages = useMemo(() => { const stages = Object.entries(stageIconMap).map(([stage, data]) => ({ @@ -97,7 +98,7 @@ const StageIcons = ({ currentStage, isExpanded }: { currentStage: number, isExpa > {/* 阶段图标 */} @@ -321,7 +323,7 @@ export function TaskInfo({ onMouseEnter={() => setIsStageIconsExpanded(true)} onMouseLeave={() => setIsStageIconsExpanded(false)} > - + - {currentLoadingText} + {isPauseWorkFlow ? 'workflow paused' : currentLoadingText} {/* 主文字 - 颜色填充动画 */} {/* 文字底部装饰线 */} @@ -399,12 +401,12 @@ export function TaskInfo({ style={{ background: `linear-gradient(to right, ${stageColor}, rgb(34 211 238), rgb(168 85 247))`, }} - animate={{ - width: ["0%", "100%", "0%"] - }} - transition={{ - width: { duration: 2, repeat: Infinity, ease: "easeInOut" } - }} + animate={!isPauseWorkFlow ? { + width: ["0%", "100%", "0%"], + transition: { + width: { duration: 2, repeat: Infinity, ease: "easeInOut" } + } + } : {}} /> @@ -412,30 +414,30 @@ export function TaskInfo({ )} diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index e7df22e..58c2c5d 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -75,7 +75,7 @@ export function useWorkflowData() { const [dataLoadError, setDataLoadError] = useState(null); const [needStreamData, setNeedStreamData] = useState(false); const [isPauseWorkFlow, setIsPauseWorkFlow] = useState(false); - const [mode, setMode] = useState<'auto' | 'manual'>('manual'); + const [mode, setMode] = useState<'auto' | 'manual'>('auto'); const dispatch = useAppDispatch(); const { sketchCount, videoCount } = useAppSelector((state) => state.workflow); @@ -356,7 +356,8 @@ export function useWorkflowData() { throw new Error(response.message); } - const { name, status, data, tags } = response.data; + const { name, status, data, tags, mode } = response.data; + setMode(mode); setIsLoading(false); // 设置初始数据