From 940be61de9917de7c52a203132705dbfae59acc9 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, 7 Aug 2025 19:08:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=20useWorkflowData=20=E9=92=A9?= =?UTF-8?q?=E5=AD=90=E4=B8=AD=E6=B7=BB=E5=8A=A0=E5=AF=B9=20applyScript=20?= =?UTF-8?q?=E7=9A=84=E8=B0=83=E7=94=A8=EF=BC=8C=E4=BB=A5=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=9A=84=E5=89=A7?= =?UTF-8?q?=E6=9C=AC=E5=BA=94=E7=94=A8=E9=80=BB=E8=BE=91=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/pages/work-flow/use-workflow-data.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index 8ff766e..ffb8a34 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -88,7 +88,8 @@ export function useWorkflowData() { const { scriptBlocksMemo, // 渲染剧本数据 initializeFromProject, - setAnyAttribute + setAnyAttribute, + applyScript } = useScriptService(); // 初始化剧本 useEffect(() => { @@ -103,6 +104,15 @@ export function useWorkflowData() { setCurrentLoadingText(LOADING_TEXT_MAP.script); } }, [scriptBlocksMemo]); + // 监听继续 请求更新数据 + useEffect(() => { + // 应用剧本 自动模式 默认应用剧本 + console.log('isPauseWorkFlow', isPauseWorkFlow, currentStep, scriptBlocksMemo.length, mode); + if (!isPauseWorkFlow && currentStep === '0' && scriptBlocksMemo.length > 0 && mode.includes('auto')) { + console.log('应用剧本'); + applyScript(); + } + }, [isPauseWorkFlow, scriptBlocksMemo]); // 自动开始播放一轮 const autoPlaySketch = useCallback(() => {