diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index 6144fb1..aadda90 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -109,18 +109,6 @@ export function useWorkflowData() { setAnyAttribute, applyScript } = useScriptService(); - // 初始化剧本 - useUpdateEffect(() => { - if (taskObject.currentStage === 'script') { - console.log('开始初始化剧本', originalText,episodeId); - // TODO 为什么一开始没项目id - originalText && initializeFromProject(episodeId, originalText).then(() => { - console.log('应用剧本'); - // 自动模式下 应用剧本;手动模式 需要点击 下一步 触发 - mode.includes('auto') && applyScript(); - }); - } - }, [originalText], {mode: 'none'}); // 监听剧本加载完毕 useEffect(() => { if (scriptBlocksMemo.length > 0) { @@ -596,6 +584,16 @@ export function useWorkflowData() { console.log('---look-taskData', taskCurrent); + if (taskCurrent.currentStage === 'script') { + console.log('开始初始化剧本', originalText,episodeId); + // TODO 为什么一开始没项目id + originalText && initializeFromProject(episodeId, originalText).then(() => { + console.log('应用剧本'); + // 自动模式下 应用剧本;手动模式 需要点击 下一步 触发 + mode.includes('auto') && applyScript(); + }); + } + // 设置步骤 setTaskObject(prev => { const newState = JSON.parse(JSON.stringify({...prev, ...taskCurrent}));