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