From 1b0f043f12791e15a03df6914c5254b08a1121c7 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: Thu, 4 Sep 2025 22:39:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=80=E6=AF=81=20=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/pages/work-flow.tsx | 9 ++++++++- components/pages/work-flow/editing-notification.tsx | 2 ++ components/pages/work-flow/use-workflow-data.tsx | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/components/pages/work-flow.tsx b/components/pages/work-flow.tsx index 14e9abf..5207b86 100644 --- a/components/pages/work-flow.tsx +++ b/components/pages/work-flow.tsx @@ -21,7 +21,13 @@ import { AIEditingIframeButton } from './work-flow/ai-editing-iframe'; const WorkFlow = React.memo(function WorkFlow() { useEffect(() => { console.log("init-WorkFlow"); - return () => console.log("unmount-WorkFlow"); + return () => { + console.log("unmount-WorkFlow"); + // 销毁编辑通知 + if (editingNotificationKey.current) { + notification.destroy(editingNotificationKey.current); + } + }; }, []); const containerRef = useRef(null); const [isEditModalOpen, setIsEditModalOpen] = React.useState(false); @@ -108,6 +114,7 @@ const WorkFlow = React.memo(function WorkFlow() { key: editingNotificationKey.current, onComplete: () => { console.log('编辑完成'); + localStorage.setItem(`isLoaded_plan_${episodeId}`, 'true'); // 3秒后关闭通知 setTimeout(() => { if (editingNotificationKey.current) { diff --git a/components/pages/work-flow/editing-notification.tsx b/components/pages/work-flow/editing-notification.tsx index 5101d4d..f5a75a7 100644 --- a/components/pages/work-flow/editing-notification.tsx +++ b/components/pages/work-flow/editing-notification.tsx @@ -29,6 +29,8 @@ const descriptionStyle = { color: 'rgba(255, 255, 255, 0.65)', marginBottom: '12px', lineHeight: '1.5', + display: 'flex', + alignItems: 'center' }; interface EditingNotificationProps { diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index ca0db4f..f3fd483 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -136,7 +136,6 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps = await getGenerateEditPlan({ project_id: episodeId }); console.error('生成剪辑计划成功'); setIsGenerateEditPlan(true); - localStorage.setItem(`isLoaded_plan_${episodeId}`, 'true'); isLoadedRef.current = 'true'; setNeedStreamData(true); // 触发回调,通知父组件计划生成完成