From 150c1636bb87ddc43c8c9b4e1ba65c3392f3282a 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: Tue, 2 Sep 2025 14:45:31 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E8=AF=95=E8=A7=86=E9=A2=91=EF=BC=8C?= =?UTF-8?q?=E7=AD=89=E5=BE=85=20=E6=8E=A5=E5=8F=A3=20=E6=94=AF=E6=8C=81=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/video_flow.ts | 10 ++++ components/pages/work-flow.tsx | 1 + components/pages/work-flow/media-viewer.tsx | 24 +++----- components/pages/work-flow/thumbnail-grid.tsx | 25 +++++--- .../pages/work-flow/use-workflow-data.tsx | 57 +++++++++++++------ 5 files changed, 76 insertions(+), 41 deletions(-) diff --git a/api/video_flow.ts b/api/video_flow.ts index beccef3..43bdf45 100644 --- a/api/video_flow.ts +++ b/api/video_flow.ts @@ -665,6 +665,16 @@ export const regenerateShot = async (request: { return post("/movie/regenerate_shot_video", request); }; +// 重新生成视频 +export const regenerateVideo = async (request: { + /** 项目ID */ + project_id: string; + /** 视频ID */ + video_id: string; +}): Promise> => { + return post("/movie_cut/regenerate_video", request); +}; + /** * 获取分镜列表 diff --git a/components/pages/work-flow.tsx b/components/pages/work-flow.tsx index 52e3846..14f2f84 100644 --- a/components/pages/work-flow.tsx +++ b/components/pages/work-flow.tsx @@ -139,6 +139,7 @@ const WorkFlow = React.memo(function WorkFlow() { taskObject={taskObject} currentSketchIndex={currentSketchIndex} onSketchSelect={setCurrentSketchIndex} + onRetryVideo={handleRetryVideo} /> )} diff --git a/components/pages/work-flow/media-viewer.tsx b/components/pages/work-flow/media-viewer.tsx index bde8956..5c579de 100644 --- a/components/pages/work-flow/media-viewer.tsx +++ b/components/pages/work-flow/media-viewer.tsx @@ -430,10 +430,14 @@ export const MediaViewer = React.memo(function MediaViewer({ {taskObject.videos.data[currentSketchIndex].video_status === 2 && (
- - Retry + { + const video = taskObject.videos.data[currentSketchIndex]; + if (onRetryVideo && video?.video_id) { + onRetryVideo(video.video_id); + } + }} />
)} @@ -442,7 +446,7 @@ export const MediaViewer = React.memo(function MediaViewer({ {/* 视频 多个 取第一个 */} - { taskObject.videos.data[currentSketchIndex].urls && ( + { taskObject.videos.data[currentSketchIndex].urls && taskObject.videos.data[currentSketchIndex].urls.length > 0 && ( <> applyVolumeSettings(mainVideoRef.current!)} onEnded={() => { if (isVideoPlaying) { // 自动切换到下一个视频的逻辑在父组件处理 @@ -471,17 +474,6 @@ export const MediaViewer = React.memo(function MediaViewer({
- {/* 重试按钮 */} - {taskObject.videos.data[currentSketchIndex].video_status === 2 && ( - - { - const video = taskObject.videos.data[currentSketchIndex]; - if (onRetryVideo && video?.video_id) { - onRetryVideo(video.video_id); - } - }} /> - - )} {/* 添加到chat去编辑 按钮 */} { diff --git a/components/pages/work-flow/thumbnail-grid.tsx b/components/pages/work-flow/thumbnail-grid.tsx index 106c43d..4e86a09 100644 --- a/components/pages/work-flow/thumbnail-grid.tsx +++ b/components/pages/work-flow/thumbnail-grid.tsx @@ -12,13 +12,15 @@ interface ThumbnailGridProps { taskObject: TaskObject; currentSketchIndex: number; onSketchSelect: (index: number) => void; + onRetryVideo: (video_id: string) => void; } export function ThumbnailGrid({ isDisabledFocus, taskObject, currentSketchIndex, - onSketchSelect + onSketchSelect, + onRetryVideo }: ThumbnailGridProps) { const thumbnailsRef = useRef(null); const [isDragging, setIsDragging] = useState(false); @@ -186,19 +188,24 @@ export function ThumbnailGrid({ )} {taskObject.videos.data[index].video_status === 2 && (
-
- +
+
)} - {taskObject.videos.data[index].urls ? ( -