From 2c5aff1ab5b938c71cb5e22d01852dbbbd34f372 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: Sat, 16 Aug 2025 22:02:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E5=88=B6=20=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8F=B0=20=E6=98=BE=E7=A4=BA=E4=B8=8E=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/pages/work-flow.tsx | 9 +----- components/pages/work-flow/media-viewer.tsx | 12 -------- components/pages/work-flow/task-info.tsx | 30 ++++++++----------- .../pages/work-flow/use-workflow-data.tsx | 11 +++---- 4 files changed, 20 insertions(+), 42 deletions(-) diff --git a/components/pages/work-flow.tsx b/components/pages/work-flow.tsx index c0431e3..4712df5 100644 --- a/components/pages/work-flow.tsx +++ b/components/pages/work-flow.tsx @@ -44,7 +44,6 @@ const WorkFlow = React.memo(function WorkFlow() { isGeneratingVideo, currentLoadingText, totalSketchCount, - roles, final, dataLoadError, setCurrentSketchIndex, @@ -104,7 +103,7 @@ const WorkFlow = React.memo(function WorkFlow() { taskObject={taskObject} currentLoadingText={currentLoadingText} dataLoadError={dataLoadError} - roles={roles} + roles={taskObject.roles.data} isPauseWorkFlow={isPauseWorkFlow} /> @@ -155,15 +154,9 @@ const WorkFlow = React.memo(function WorkFlow() { taskObject={taskObject} scriptData={scriptData} currentSketchIndex={currentSketchIndex} - taskSketch={taskSketch} - taskVideos={taskVideos} isVideoPlaying={isVideoPlaying} - isGeneratingSketch={isGeneratingSketch} - isGeneratingVideo={isGeneratingVideo} onEditModalOpen={handleEditModalOpen} onToggleVideoPlay={toggleVideoPlay} - onTogglePlay={togglePlay} - final={final} setIsPauseWorkFlow={setIsPauseWorkFlow} setAnyAttribute={setAnyAttribute} isPauseWorkFlow={isPauseWorkFlow} diff --git a/components/pages/work-flow/media-viewer.tsx b/components/pages/work-flow/media-viewer.tsx index 93b7278..27d4c89 100644 --- a/components/pages/work-flow/media-viewer.tsx +++ b/components/pages/work-flow/media-viewer.tsx @@ -14,15 +14,9 @@ interface MediaViewerProps { taskObject: TaskObject; scriptData: any; currentSketchIndex: number; - taskSketch: any[]; - taskVideos: any[]; isVideoPlaying: boolean; - isGeneratingSketch: boolean; - isGeneratingVideo: boolean; onEditModalOpen: (tab: string) => void; onToggleVideoPlay: () => void; - onTogglePlay: () => void; - final?: any; setIsPauseWorkFlow: (isPause: boolean) => void; setAnyAttribute: any; isPauseWorkFlow: boolean; @@ -34,15 +28,9 @@ export const MediaViewer = React.memo(function MediaViewer({ taskObject, scriptData, currentSketchIndex, - taskSketch, - taskVideos, isVideoPlaying, - isGeneratingSketch, - isGeneratingVideo, onEditModalOpen, onToggleVideoPlay, - onTogglePlay, - final, setIsPauseWorkFlow, setAnyAttribute, isPauseWorkFlow, diff --git a/components/pages/work-flow/task-info.tsx b/components/pages/work-flow/task-info.tsx index 5699626..b972cb0 100644 --- a/components/pages/work-flow/task-info.tsx +++ b/components/pages/work-flow/task-info.tsx @@ -158,21 +158,21 @@ export function TaskInfo({ setCurrentStage(3); console.log('isScriptModalOpen-Post-production', currentLoadingText, isScriptModalOpen); timerRef.current = setTimeout(() => { - // setIsScriptModalOpen(true); + setIsScriptModalOpen(true); }, 8000); } - if (currentLoadingText.includes('video') && !currentLoadingText.includes('Post-production')) { + if (currentLoadingText.includes('Generating video')) { console.log('isScriptModalOpen-video', currentLoadingText, isScriptModalOpen); if (isScriptModalOpen) { setIsScriptModalOpen(false); setCurrentStage(2); // 延迟8s 再次打开 - // timerRef.current = setTimeout(() => { - // setIsScriptModalOpen(true); - // }, 8000); + timerRef.current = setTimeout(() => { + setIsScriptModalOpen(true); + }, 8000); } else { - // setIsScriptModalOpen(true); + setIsScriptModalOpen(true); setCurrentStage(2); } } @@ -180,21 +180,20 @@ export function TaskInfo({ if (isScriptModalOpen) { setIsScriptModalOpen(false); } - // setIsScriptModalOpen(true); setCurrentStage(2); } - if (currentLoadingText.includes('sketch')) { + if (currentLoadingText.includes('Generating sketch') || currentLoadingText.includes('Generating shot sketch')) { console.log('isScriptModalOpen-sketch', currentLoadingText, isScriptModalOpen); if (isScriptModalOpen) { setIsScriptModalOpen(false); setCurrentStage(1); // 延迟8s 再次打开 - // timerRef.current = setTimeout(() => { - // setIsScriptModalOpen(true); - // }, 8000); + timerRef.current = setTimeout(() => { + setIsScriptModalOpen(true); + }, 8000); } else { - // setIsScriptModalOpen(true); + setIsScriptModalOpen(true); setCurrentStage(1); } } @@ -202,19 +201,16 @@ export function TaskInfo({ if (isScriptModalOpen) { setIsScriptModalOpen(false); } - // setIsScriptModalOpen(true); setCurrentStage(1); } if (currentLoadingText.includes('script')) { console.log('isScriptModalOpen-script', currentLoadingText, isScriptModalOpen); - if (isScriptModalOpen) { - setIsScriptModalOpen(false); - } + setIsScriptModalOpen(true); setCurrentStage(0); } if (currentLoadingText.includes('initializing')) { console.log('isScriptModalOpen-initializing', currentLoadingText, isScriptModalOpen); - // setIsScriptModalOpen(true); + setIsScriptModalOpen(true); setCurrentStage(0); } return () => { diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index fb6a103..eca57f9 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -167,6 +167,10 @@ export function useWorkflowData() { console.log('-----look-taskObject_find_changed-----', taskObject); if (taskObject.currentStage === 'script') { if (scriptBlocksMemo.length > 0) { + console.log('应用剧本'); + // 自动模式下 应用剧本;手动模式 需要点击 下一步 触发 + // 确保仅自动触发一次 + state.mode.includes('auto') && loadingText.current !== LOADING_TEXT_MAP.getSketchStatus && applyScript(); loadingText.current = LOADING_TEXT_MAP.getSketchStatus; } else { loadingText.current = LOADING_TEXT_MAP.script; @@ -211,7 +215,7 @@ export function useWorkflowData() { loadingText.current = LOADING_TEXT_MAP.complete; } setCurrentLoadingText(loadingText.current); - }, [scriptBlocksMemo, taskObject.currentStage, taskObject.scenes.data, taskObject.roles.data, taskObject.shot_sketch.data, taskObject.videos.data], {mode: 'none'}); + }, [scriptBlocksMemo, taskObject.currentStage, taskObject.scenes.data, taskObject.roles.data, taskObject.shot_sketch.data, taskObject.videos.data, taskObject.status], {mode: 'none'}); // 更新 setSketchCount const updateSketchCount = useCallback((count: number) => { @@ -586,9 +590,6 @@ export function useWorkflowData() { console.log('开始初始化剧本', original_text,episodeId); // TODO 为什么一开始没项目id original_text && initializeFromProject(episodeId, original_text).then(() => { - console.log('应用剧本'); - // 自动模式下 应用剧本;手动模式 需要点击 下一步 触发 - mode.includes('auto') && applyScript(); }); } @@ -621,7 +622,7 @@ export function useWorkflowData() { const fallbackToStep = (step: string) => { console.log('fallbackToStep', step); setNeedStreamData(true); - tempTaskObject.current.currentStage = step as Stage; + // tempTaskObject.current.currentStage = step as Stage; // loadingText = LOADING_TEXT_MAP.initializing; }