From e9986801ce245cd28a6fe385632f602784ad5412 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, 8 Sep 2025 23:50:34 +0800
Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=20=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/DTO/movieEdit.ts | 4 +++-
components/pages/work-flow.tsx | 3 ++-
components/pages/work-flow/task-info.tsx | 9 +++++---
.../pages/work-flow/use-workflow-data.tsx | 23 ++++++++++++++-----
4 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/api/DTO/movieEdit.ts b/api/DTO/movieEdit.ts
index 45690ec..aa61fde 100644
--- a/api/DTO/movieEdit.ts
+++ b/api/DTO/movieEdit.ts
@@ -669,7 +669,9 @@ export const LOADING_TEXT_MAP = {
audio: 'Generating background audio...',
postProduction: (step: string) => `Post-production: ${step}...`,
final: 'Generating final product...',
- complete: 'Task completed'
+ complete: 'Task completed',
+ toManyFailed: 'Too many failed storyboards, Please click the edit button to go to the intelligent editing platform.',
+ editingError: 'Editing failed. Please refresh the page and try again.'
} as const;
export type Status = 'IN_PROGRESS' | 'COMPLETED' | 'FAILED';
diff --git a/components/pages/work-flow.tsx b/components/pages/work-flow.tsx
index f4f3409..1d98d3d 100644
--- a/components/pages/work-flow.tsx
+++ b/components/pages/work-flow.tsx
@@ -98,7 +98,8 @@ const WorkFlow = React.memo(function WorkFlow() {
handleRetryVideo,
isShowAutoEditing
} = useWorkflowData({
- onEditPlanGenerated: handleEditPlanGenerated
+ onEditPlanGenerated: handleEditPlanGenerated,
+ editingStatus: editingStatus
});
const {
diff --git a/components/pages/work-flow/task-info.tsx b/components/pages/work-flow/task-info.tsx
index b32184b..ae2e1c5 100644
--- a/components/pages/work-flow/task-info.tsx
+++ b/components/pages/work-flow/task-info.tsx
@@ -4,7 +4,7 @@ import React, { useState, useEffect, useMemo, useRef } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { ScriptModal } from '@/components/ui/script-modal';
import {
- CheckCircle,
+ CircleAlert,
Heart,
Camera,
Film,
@@ -248,8 +248,11 @@ export function TaskInfo({
currentLoadingText={currentLoadingText}
/>
- {currentLoadingText === 'Task completed' ? (
- <>>
+ {currentLoadingText.includes('failed') ? (
+
+
+ {currentLoadingText}
+
) : (
void;
+ editingStatus?: string;
}
-export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps = {}) {
+export function useWorkflowData({ onEditPlanGenerated, editingStatus }: UseWorkflowDataProps = {}) {
const searchParams = useSearchParams();
const episodeId = searchParams.get('episodeId') || '';
const from = searchParams.get('from') || '';
@@ -191,14 +192,17 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps =
setNeedStreamData(true);
setIsGenerateEditPlan(false);
- // 显示失败通知,但保持进度条继续更新
+ // 显示失败通知3秒
showEditingNotification({
key: notificationKey,
description: `Generating intelligent editing plan... ${retryCount ? 'Retry Time: ' + retryCount : ''}`,
timeoutDescription: 'Editing plan generation failed. Retrying later.',
- timeout: 8 * 60 * 1000 // 延长超时时间到8分钟,给重试留出足够时间
+ timeout: 3000
});
- setIsLoadingGenerateEditPlan(false);
+ setTimeout(() => {
+ notification.destroy(notificationKey);
+ setIsLoadingGenerateEditPlan(false);
+ }, 8000);
}
}, [episodeId, onEditPlanGenerated, notificationKey]);
@@ -223,8 +227,15 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps =
useEffect(() => {
if (isShowError) {
window.msg.error('Too many failed storyboards, unable to execute automatic editing.', 8000);
+ setCurrentLoadingText(LOADING_TEXT_MAP.toManyFailed);
}
- }, [isShowError]);
+ if (editingStatus === 'error') {
+ window.msg.error('Editing failed, Please click the edit button to go to the intelligent editing platform.', 8000);
+ setCurrentLoadingText(LOADING_TEXT_MAP.editingError);
+ }
+ // 停止轮询
+ setNeedStreamData(false);
+ }, [isShowError, editingStatus]);
useUpdateEffect(() => {
@@ -747,6 +758,6 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps =
showGotoCutButton: (canGoToCut && (isGenerateEditPlan || taskObject.currentStage === 'final_video') || isShowError) ? true : false,
generateEditPlan: openEditPlan,
handleRetryVideo,
- isShowAutoEditing: canGoToCut && taskObject.currentStage !== 'final_video' ? true : false
+ isShowAutoEditing: canGoToCut && taskObject.currentStage !== 'final_video' && isGenerateEditPlan && !isShowError ? true : false
};
}