From aa446a40fb8e32701f6ad32b1a26fc97df008713 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: Mon, 22 Sep 2025 17:30:02 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=9C=AA=E5=B1=95?=
=?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20=E5=92=8C=20=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E8=B0=83=E7=94=A8=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/pages/work-flow.tsx | 2 +-
components/pages/work-flow/H5MediaViewer.tsx | 2 +-
components/pages/work-flow/media-viewer.tsx | 6 ++++--
components/pages/work-flow/use-workflow-data.tsx | 5 +++--
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/components/pages/work-flow.tsx b/components/pages/work-flow.tsx
index 88b3e6a..5ca4c15 100644
--- a/components/pages/work-flow.tsx
+++ b/components/pages/work-flow.tsx
@@ -445,7 +445,7 @@ Please process this video editing request.`;
{/* 左侧最终视频缩略图栏(仅桌面) */}
{taskObject?.final?.url && (
diff --git a/components/pages/work-flow/H5MediaViewer.tsx b/components/pages/work-flow/H5MediaViewer.tsx
index 02f6c2e..b9ffd7d 100644
--- a/components/pages/work-flow/H5MediaViewer.tsx
+++ b/components/pages/work-flow/H5MediaViewer.tsx
@@ -80,7 +80,7 @@ export function H5MediaViewer({
// 计算当前阶段类型
const stage = (selectedView === 'final' && taskObject.final?.url)
? 'final_video'
- : (selectedView === 'video' ? 'video' : taskObject.currentStage);
+ : (!['script', 'character', 'scene'].includes(taskObject.currentStage) ? 'video' : taskObject.currentStage);
// 生成各阶段对应的 slides 数据
const videoUrls = useMemo(() => {
diff --git a/components/pages/work-flow/media-viewer.tsx b/components/pages/work-flow/media-viewer.tsx
index 4620d27..9736e5b 100644
--- a/components/pages/work-flow/media-viewer.tsx
+++ b/components/pages/work-flow/media-viewer.tsx
@@ -739,7 +739,7 @@ export const MediaViewer = React.memo(function MediaViewer({
// 计算生效阶段:selectedView 优先于 taskObject.currentStage
const effectiveStage = (selectedView === 'final' && taskObject.final?.url)
? 'final_video'
- : (selectedView === 'video' ? 'video' : taskObject.currentStage);
+ : (!['script', 'character', 'scene'].includes(taskObject.currentStage) ? 'video' : taskObject.currentStage);
// 根据当前步骤渲染对应内容
if (effectiveStage === 'final_video') {
@@ -755,7 +755,9 @@ export const MediaViewer = React.memo(function MediaViewer({
}
if (effectiveStage === 'scene' || effectiveStage === 'character') {
- return renderSketchContent([...taskObject.roles.data, ...taskObject.scenes.data][currentSketchIndex]);
+ const allSketches = [...(taskObject.roles?.data || []), ...(taskObject.scenes?.data || [])];
+ const currentSketch = allSketches[currentSketchIndex];
+ return renderSketchContent(currentSketch);
}
diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx
index 1b12bf6..686799f 100644
--- a/components/pages/work-flow/use-workflow-data.tsx
+++ b/components/pages/work-flow/use-workflow-data.tsx
@@ -691,7 +691,8 @@ export function useWorkflowData({ onEditPlanGenerated, editingStatus, onExportFa
});
// 设置是否需要获取流式数据
- setNeedStreamData(taskCurrent.status !== 'COMPLETED');
+ // setNeedStreamData(taskCurrent.status !== 'COMPLETED');
+ setNeedStreamData(true);
} catch (error) {
console.error('初始化失败:', error);
@@ -704,7 +705,7 @@ export function useWorkflowData({ onEditPlanGenerated, editingStatus, onExportFa
isLoading: false
});
}
- }, [episodeId, initializeFromProject]);
+ }, [episodeId]);
// 重试生成视频
const handleRetryVideo = async (video_id: string) => {