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); // 设置初始数据