forked from 77media/video-flow
控制 工作台 显示与隐藏
This commit is contained in:
parent
ed79e49abe
commit
2c5aff1ab5
@ -44,7 +44,6 @@ const WorkFlow = React.memo(function WorkFlow() {
|
||||
isGeneratingVideo,
|
||||
currentLoadingText,
|
||||
totalSketchCount,
|
||||
roles,
|
||||
final,
|
||||
dataLoadError,
|
||||
setCurrentSketchIndex,
|
||||
@ -104,7 +103,7 @@ const WorkFlow = React.memo(function WorkFlow() {
|
||||
taskObject={taskObject}
|
||||
currentLoadingText={currentLoadingText}
|
||||
dataLoadError={dataLoadError}
|
||||
roles={roles}
|
||||
roles={taskObject.roles.data}
|
||||
isPauseWorkFlow={isPauseWorkFlow}
|
||||
/>
|
||||
</ErrorBoundary>
|
||||
@ -155,15 +154,9 @@ const WorkFlow = React.memo(function WorkFlow() {
|
||||
taskObject={taskObject}
|
||||
scriptData={scriptData}
|
||||
currentSketchIndex={currentSketchIndex}
|
||||
taskSketch={taskSketch}
|
||||
taskVideos={taskVideos}
|
||||
isVideoPlaying={isVideoPlaying}
|
||||
isGeneratingSketch={isGeneratingSketch}
|
||||
isGeneratingVideo={isGeneratingVideo}
|
||||
onEditModalOpen={handleEditModalOpen}
|
||||
onToggleVideoPlay={toggleVideoPlay}
|
||||
onTogglePlay={togglePlay}
|
||||
final={final}
|
||||
setIsPauseWorkFlow={setIsPauseWorkFlow}
|
||||
setAnyAttribute={setAnyAttribute}
|
||||
isPauseWorkFlow={isPauseWorkFlow}
|
||||
|
||||
@ -14,15 +14,9 @@ interface MediaViewerProps {
|
||||
taskObject: TaskObject;
|
||||
scriptData: any;
|
||||
currentSketchIndex: number;
|
||||
taskSketch: any[];
|
||||
taskVideos: any[];
|
||||
isVideoPlaying: boolean;
|
||||
isGeneratingSketch: boolean;
|
||||
isGeneratingVideo: boolean;
|
||||
onEditModalOpen: (tab: string) => void;
|
||||
onToggleVideoPlay: () => void;
|
||||
onTogglePlay: () => void;
|
||||
final?: any;
|
||||
setIsPauseWorkFlow: (isPause: boolean) => void;
|
||||
setAnyAttribute: any;
|
||||
isPauseWorkFlow: boolean;
|
||||
@ -34,15 +28,9 @@ export const MediaViewer = React.memo(function MediaViewer({
|
||||
taskObject,
|
||||
scriptData,
|
||||
currentSketchIndex,
|
||||
taskSketch,
|
||||
taskVideos,
|
||||
isVideoPlaying,
|
||||
isGeneratingSketch,
|
||||
isGeneratingVideo,
|
||||
onEditModalOpen,
|
||||
onToggleVideoPlay,
|
||||
onTogglePlay,
|
||||
final,
|
||||
setIsPauseWorkFlow,
|
||||
setAnyAttribute,
|
||||
isPauseWorkFlow,
|
||||
|
||||
@ -158,21 +158,21 @@ export function TaskInfo({
|
||||
setCurrentStage(3);
|
||||
console.log('isScriptModalOpen-Post-production', currentLoadingText, isScriptModalOpen);
|
||||
timerRef.current = setTimeout(() => {
|
||||
// setIsScriptModalOpen(true);
|
||||
setIsScriptModalOpen(true);
|
||||
}, 8000);
|
||||
}
|
||||
if (currentLoadingText.includes('video') && !currentLoadingText.includes('Post-production')) {
|
||||
if (currentLoadingText.includes('Generating video')) {
|
||||
console.log('isScriptModalOpen-video', currentLoadingText, isScriptModalOpen);
|
||||
if (isScriptModalOpen) {
|
||||
setIsScriptModalOpen(false);
|
||||
setCurrentStage(2);
|
||||
|
||||
// 延迟8s 再次打开
|
||||
// timerRef.current = setTimeout(() => {
|
||||
// setIsScriptModalOpen(true);
|
||||
// }, 8000);
|
||||
timerRef.current = setTimeout(() => {
|
||||
setIsScriptModalOpen(true);
|
||||
}, 8000);
|
||||
} else {
|
||||
// setIsScriptModalOpen(true);
|
||||
setIsScriptModalOpen(true);
|
||||
setCurrentStage(2);
|
||||
}
|
||||
}
|
||||
@ -180,21 +180,20 @@ export function TaskInfo({
|
||||
if (isScriptModalOpen) {
|
||||
setIsScriptModalOpen(false);
|
||||
}
|
||||
// setIsScriptModalOpen(true);
|
||||
setCurrentStage(2);
|
||||
}
|
||||
if (currentLoadingText.includes('sketch')) {
|
||||
if (currentLoadingText.includes('Generating sketch') || currentLoadingText.includes('Generating shot sketch')) {
|
||||
console.log('isScriptModalOpen-sketch', currentLoadingText, isScriptModalOpen);
|
||||
if (isScriptModalOpen) {
|
||||
setIsScriptModalOpen(false);
|
||||
setCurrentStage(1);
|
||||
|
||||
// 延迟8s 再次打开
|
||||
// timerRef.current = setTimeout(() => {
|
||||
// setIsScriptModalOpen(true);
|
||||
// }, 8000);
|
||||
timerRef.current = setTimeout(() => {
|
||||
setIsScriptModalOpen(true);
|
||||
}, 8000);
|
||||
} else {
|
||||
// setIsScriptModalOpen(true);
|
||||
setIsScriptModalOpen(true);
|
||||
setCurrentStage(1);
|
||||
}
|
||||
}
|
||||
@ -202,19 +201,16 @@ export function TaskInfo({
|
||||
if (isScriptModalOpen) {
|
||||
setIsScriptModalOpen(false);
|
||||
}
|
||||
// setIsScriptModalOpen(true);
|
||||
setCurrentStage(1);
|
||||
}
|
||||
if (currentLoadingText.includes('script')) {
|
||||
console.log('isScriptModalOpen-script', currentLoadingText, isScriptModalOpen);
|
||||
if (isScriptModalOpen) {
|
||||
setIsScriptModalOpen(false);
|
||||
}
|
||||
setIsScriptModalOpen(true);
|
||||
setCurrentStage(0);
|
||||
}
|
||||
if (currentLoadingText.includes('initializing')) {
|
||||
console.log('isScriptModalOpen-initializing', currentLoadingText, isScriptModalOpen);
|
||||
// setIsScriptModalOpen(true);
|
||||
setIsScriptModalOpen(true);
|
||||
setCurrentStage(0);
|
||||
}
|
||||
return () => {
|
||||
|
||||
@ -167,6 +167,10 @@ export function useWorkflowData() {
|
||||
console.log('-----look-taskObject_find_changed-----', taskObject);
|
||||
if (taskObject.currentStage === 'script') {
|
||||
if (scriptBlocksMemo.length > 0) {
|
||||
console.log('应用剧本');
|
||||
// 自动模式下 应用剧本;手动模式 需要点击 下一步 触发
|
||||
// 确保仅自动触发一次
|
||||
state.mode.includes('auto') && loadingText.current !== LOADING_TEXT_MAP.getSketchStatus && applyScript();
|
||||
loadingText.current = LOADING_TEXT_MAP.getSketchStatus;
|
||||
} else {
|
||||
loadingText.current = LOADING_TEXT_MAP.script;
|
||||
@ -211,7 +215,7 @@ export function useWorkflowData() {
|
||||
loadingText.current = LOADING_TEXT_MAP.complete;
|
||||
}
|
||||
setCurrentLoadingText(loadingText.current);
|
||||
}, [scriptBlocksMemo, taskObject.currentStage, taskObject.scenes.data, taskObject.roles.data, taskObject.shot_sketch.data, taskObject.videos.data], {mode: 'none'});
|
||||
}, [scriptBlocksMemo, taskObject.currentStage, taskObject.scenes.data, taskObject.roles.data, taskObject.shot_sketch.data, taskObject.videos.data, taskObject.status], {mode: 'none'});
|
||||
|
||||
// 更新 setSketchCount
|
||||
const updateSketchCount = useCallback((count: number) => {
|
||||
@ -586,9 +590,6 @@ export function useWorkflowData() {
|
||||
console.log('开始初始化剧本', original_text,episodeId);
|
||||
// TODO 为什么一开始没项目id
|
||||
original_text && initializeFromProject(episodeId, original_text).then(() => {
|
||||
console.log('应用剧本');
|
||||
// 自动模式下 应用剧本;手动模式 需要点击 下一步 触发
|
||||
mode.includes('auto') && applyScript();
|
||||
});
|
||||
}
|
||||
|
||||
@ -621,7 +622,7 @@ export function useWorkflowData() {
|
||||
const fallbackToStep = (step: string) => {
|
||||
console.log('fallbackToStep', step);
|
||||
setNeedStreamData(true);
|
||||
tempTaskObject.current.currentStage = step as Stage;
|
||||
// tempTaskObject.current.currentStage = step as Stage;
|
||||
// loadingText = LOADING_TEXT_MAP.initializing;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user