diff --git a/api/DTO/movieEdit.ts b/api/DTO/movieEdit.ts index 71ae535..62b67ea 100644 --- a/api/DTO/movieEdit.ts +++ b/api/DTO/movieEdit.ts @@ -119,6 +119,8 @@ export interface SketchResponse { total_count: number; /** 草图数据列表 */ data: SketchData[]; + /** 任务状态 */ + task_status: string; } /** * 角色响应数据接口 @@ -141,6 +143,8 @@ export interface CharacterData { data: CharacterResponse[]; /** 总数 */ total_count: number; + /** 任务状态 */ + task_status: string; } /** * 镜头草图提示JSON结构接口 @@ -191,6 +195,8 @@ export interface ShotSketchResponse { data: ShotSketchData[]; /** 总数 */ total_count: number; + /** 任务状态 */ + task_status: string; } /** * 主要角色列表项 @@ -261,6 +267,8 @@ export interface VideoData { video_name_prefix: string; /** 视频URL列表 */ urls: string[]; + /** 视频状态 */ + video_status: number; } /** * 视频响应数据接口 @@ -275,6 +283,8 @@ export interface VideoResponse { guid: string; /** 项目ID */ project_id: string; + /** 任务状态 */ + task_status: string; } /** * 音乐数据接口 @@ -313,6 +323,8 @@ export interface ProjectContentData { video: VideoResponse; /** 音乐数据 */ music: MusicData; + /** 粗剪视频 */ + final_simple_video: FinalVideo; /** 最终视频 */ final_video: FinalVideo; /** 多语言视频 */ @@ -608,3 +620,54 @@ export interface RoleResponse { character_draft: string; } + +interface Role { + name: string; + url: string; + status: number; +} +interface Scene { + url: string; + script: string; + status: number; +} +interface ShotSketch { + url: string; + script: string; + status: number; +} +interface Video { + video_id: string; + urls: string[]; + video_status: number; +} + +export type Status = 'IN_PROGRESS' | 'COMPLETED' | 'FAILED'; +export type Stage = 'script' | 'character' | 'scene' | 'shot_sketch' | 'video' | 'final_video'; +// 添加 TaskObject 接口 +export interface TaskObject { + title: string; // 标题 + tags?: any[]; // 主题 + currentStage: Stage; // 当前阶段 + status: Status; // 状态 + roles: { + data: Role[]; + total_count: number; + }; // 角色 + scenes: { + data: Scene[]; + total_count: number; + }; // 场景 + shot_sketch: { + data: ShotSketch[]; + total_count: number; + }; // 分镜草图 + videos: { + data: Video[]; + total_count: number; + }; // 视频 + final: { + url: string; + note: string; + }; // 剪辑视频 +} \ No newline at end of file diff --git a/components/pages/style/work-flow.css b/components/pages/style/work-flow.css index f52b2b8..20c859b 100644 --- a/components/pages/style/work-flow.css +++ b/components/pages/style/work-flow.css @@ -161,7 +161,7 @@ min-height: 0; } .videoContainer-qteKNi { - /* flex: 1; */ + flex: 1; min-height: 0; display: flex; position: relative; @@ -224,7 +224,7 @@ @media (height >= 880px) { .imageGrid-ymZV9z { - flex: 1; + /* flex: 1; */ height: auto; min-height: 0; display: grid; diff --git a/components/pages/work-flow.tsx b/components/pages/work-flow.tsx index 4684827..537b8bd 100644 --- a/components/pages/work-flow.tsx +++ b/components/pages/work-flow.tsx @@ -54,8 +54,7 @@ const WorkFlow = React.memo(function WorkFlow() { setAnyAttribute, applyScript, fallbackToStep, - originalText, - currentStage + originalText } = useWorkflowData(); const { @@ -69,36 +68,9 @@ const WorkFlow = React.memo(function WorkFlow() { playTimerRef, } = usePlaybackControls(taskSketch, taskVideos, currentStep); - // 跟踪是否已经自动开始播放过,避免重复触发 - const hasAutoStartedRef = useRef(false); - - // 跟踪循环播放的起始索引,用于判断是否完成一轮循环 - const loopStartIndexRef = useRef(null); - - // 调试:监控关键状态变化 useEffect(() => { - console.log('工作流状态:', { - currentStep, - isGeneratingSketch, - isGeneratingVideo, - isPlaying, - taskSketchLength: taskSketch.length, - sketchCount, - totalSketchCount - }); - }, [currentStep, isGeneratingSketch, isGeneratingVideo, isPlaying, taskSketch.length, sketchCount, totalSketchCount]); - - // 专门监控isPlaying状态变化 - useEffect(() => { - console.log('播放状态变化:', isPlaying ? '开始播放' : '停止播放'); - }, [isPlaying]); - - // 检查分镜数据 - useEffect(() => { - if (taskSketch.length > 0) { - console.log('分镜数据:', `${taskSketch.length}个分镜,当前索引:${currentSketchIndex}`); - } - }, [taskSketch.length, currentSketchIndex]); + console.log('changedIndex_work-flow', currentSketchIndex, taskObject); + }, [currentSketchIndex]); // 模拟 AI 建议 英文 const mockSuggestions = [ @@ -145,7 +117,6 @@ const WorkFlow = React.memo(function WorkFlow() {
{dataLoadError ? ( @@ -182,17 +153,15 @@ const WorkFlow = React.memo(function WorkFlow() { ) : isLoading ? ( ) : ( -
+
)}
- {currentStage !== 'final_video' && currentStage !== 'script' && ( + {taskObject.currentStage !== 'final_video' && taskObject.currentStage !== 'script' && (
(null); const finalVideoRef = useRef(null); @@ -150,26 +147,26 @@ export const MediaViewer = React.memo(function MediaViewer({ // 使用 useMemo 缓存最终视频元素,避免重复创建和请求 const memoizedFinalVideoElement = useMemo(() => { - console.log('final', final); - if (!final?.url) return null; + console.log('final', taskObject.final); + if (!taskObject.final?.url) return null; return (
@@ -409,21 +403,6 @@ export const MediaViewer = React.memo(function MediaViewer({ whileTap={{ scale: 0.9 }} className="relative" > - {/* 播放时的发光效果 */} - {isFinalVideoPlaying && ( - - )} { - const currentSketch = taskSketch[currentSketchIndex]; - const defaultBgColors = ['RGB(45, 50, 70)', 'RGB(75, 80, 100)', 'RGB(105, 110, 130)']; - const bgColors = currentSketch?.bg_rgb || defaultBgColors; - return (
{/* 生成中 */} - {taskVideos[currentSketchIndex].video_status === 0 && ( -
+ {taskObject.videos.data[currentSketchIndex].video_status === 0 && ( +
Generating... @@ -485,8 +460,8 @@ export const MediaViewer = React.memo(function MediaViewer({
)} {/* 生成失败 */} - {taskVideos[currentSketchIndex].video_status === 2 && ( -
+ {taskObject.videos.data[currentSketchIndex].video_status === 2 && ( +
Failed @@ -496,7 +471,7 @@ export const MediaViewer = React.memo(function MediaViewer({
{/* 视频 多个 取第一个 */} - { taskVideos[currentSketchIndex].url && ( + { taskObject.videos.data[currentSketchIndex].urls && (