From 01509ad3d510a6cc230d5c2a0ce8a0177388e9b0 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: Wed, 13 Aug 2025 21:51:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A7=92=E8=89=B2=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84=EF=BC=8C=E5=B0=86?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=B1=9E=E6=80=A7=E4=BB=8Echaracters?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=B8=BAdata=EF=BC=9B=E5=9C=A8RoleEditUseCas?= =?UTF-8?q?e=E5=92=8CSaveEditUseCase=E4=B8=AD=E7=9B=B8=E5=BA=94=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=95=B0=E6=8D=AE=E6=98=A0=E5=B0=84=E5=92=8C=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=9B=E5=9C=A8useWorkflowData=E4=B8=AD=E9=87=8D?= =?UTF-8?q?=E7=BD=AEtaskData=E7=BB=93=E6=9E=84=E4=BB=A5=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=95=B0=E6=8D=AE=EF=BC=9B=E5=9C=A8edit-moda?= =?UTF-8?q?l=E4=B8=AD=E8=B0=83=E7=94=A8SaveEditUseCase=E4=BB=A5=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=95=B0=E6=8D=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/usecase/SaveEditUseCase.ts | 4 ---- components/pages/work-flow/use-workflow-data.tsx | 11 ++++++++++- components/ui/edit-modal.tsx | 5 +++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/service/usecase/SaveEditUseCase.ts b/app/service/usecase/SaveEditUseCase.ts index fec9862..0d59300 100644 --- a/app/service/usecase/SaveEditUseCase.ts +++ b/app/service/usecase/SaveEditUseCase.ts @@ -92,10 +92,6 @@ export class SaveEditUseCase { throw new Error('项目ID不能为空'); } - if (SaveEditUseCase.videoTasks.length === 0) { - throw new Error('视频任务列表不能为空'); - } - const response = await modifyCharacterOrScene({ project_id: SaveEditUseCase.projectId, character_id: SaveEditUseCase.characterId, diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index e97bc7e..b878c00 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -83,7 +83,7 @@ export function useWorkflowData() { const [isPauseWorkFlow, setIsPauseWorkFlow] = useState(false); const [mode, setMode] = useState<'automatic' | 'manual' | 'auto'>('automatic'); - const taskData: any = { + let taskData: any = { sketch: { data: [], total_count: -1 }, character: { data: [], total_count: -1 }, shot_sketch: { data: [], total_count: -1 }, @@ -612,8 +612,17 @@ export function useWorkflowData() { // 回退到 指定状态 重新获取数据 const fallbackToStep = (step: string) => { + console.log('fallbackToStep', step); setCurrentStep(step); setNeedStreamData(true); + taskData = { + sketch: { data: [], total_count: -1 }, + character: { data: [], total_count: -1 }, + shot_sketch: { data: [], total_count: -1 }, + video: { data: [], total_count: -1 }, + status: step + }; + // loadingText = LOADING_TEXT_MAP.initializing; } // 重试加载数据 diff --git a/components/ui/edit-modal.tsx b/components/ui/edit-modal.tsx index 76b773d..745cade 100644 --- a/components/ui/edit-modal.tsx +++ b/components/ui/edit-modal.tsx @@ -11,6 +11,7 @@ import { SettingsTabContent } from './settings-tab-content'; import { CharacterTabContent } from './character-tab-content'; import { MusicTabContent } from './music-tab-content'; import FloatingGlassPanel from './FloatingGlassPanel'; +import { SaveEditUseCase } from '@/app/service/usecase/SaveEditUseCase'; interface EditModalProps { isOpen: boolean; @@ -126,12 +127,16 @@ const [pendingSwitchTabId, setPendingSwitchTabId] = useState(null const handleConfirmGotoFallback = () => { console.log('handleConfirmGotoFallback'); + SaveEditUseCase.saveData(); if (activeTab === '0') { fallbackToStep('0'); // 应用剧本 } else { fallbackToStep('1'); } + setIsRemindFallbackOpen(false); + // 关闭弹窗 + onClose(); } const handleCloseRemindFallbackPanel = () => { if (pendingSwitchTabId) {