forked from 77media/video-flow
调整工作流loading
This commit is contained in:
parent
f8722ba8ed
commit
7ab05c26b1
@ -26,21 +26,6 @@ interface TaskInfoProps {
|
||||
roles: any[];
|
||||
}
|
||||
|
||||
// 根据加载文本返回对应的图标
|
||||
const getStageIcon = (currentStage: number) => {
|
||||
if (currentStage === 0) {
|
||||
return Heart;
|
||||
} else if (currentStage === 1) {
|
||||
return Camera;
|
||||
} else if (currentStage === 2) {
|
||||
return Film;
|
||||
} else if (currentStage === 3) {
|
||||
return Scissors;
|
||||
} else {
|
||||
return Loader2;
|
||||
}
|
||||
};
|
||||
|
||||
const stageIconMap = {
|
||||
0: {
|
||||
icon: Heart,
|
||||
@ -72,11 +57,12 @@ const StageIcons = ({ currentStage, isExpanded }: { currentStage: number, isExpa
|
||||
}));
|
||||
|
||||
// 将当前阶段移到第一位
|
||||
return stages.sort((a, b) => {
|
||||
if (a.stage === currentStage) return -1;
|
||||
if (b.stage === currentStage) return 1;
|
||||
return a.stage - b.stage;
|
||||
});
|
||||
// return stages.sort((a, b) => {
|
||||
// if (a.stage === currentStage) return -1;
|
||||
// if (b.stage === currentStage) return 1;
|
||||
// return a.stage - b.stage;
|
||||
// });
|
||||
return stages;
|
||||
}, [currentStage]);
|
||||
|
||||
return (
|
||||
@ -228,21 +214,21 @@ export function TaskInfo({
|
||||
setIsScriptModalOpen(true);
|
||||
setCurrentStage(1);
|
||||
}
|
||||
// if (currentLoadingText.includes('character')) {
|
||||
// console.log('isScriptModalOpen-character', currentLoadingText, isScriptModalOpen);
|
||||
// if (isScriptModalOpen) {
|
||||
// setIsScriptModalOpen(false);
|
||||
if (currentLoadingText.includes('character')) {
|
||||
console.log('isScriptModalOpen-character', currentLoadingText, isScriptModalOpen);
|
||||
if (isScriptModalOpen) {
|
||||
setIsScriptModalOpen(false);
|
||||
|
||||
// // 延迟8s 再次打开
|
||||
// timerRef.current = setTimeout(() => {
|
||||
// setIsScriptModalOpen(true);
|
||||
// setCurrentStage(0);
|
||||
// }, 8000);
|
||||
// } else {
|
||||
// setIsScriptModalOpen(true);
|
||||
// setCurrentStage(0);
|
||||
// }
|
||||
// }
|
||||
// 延迟8s 再次打开
|
||||
timerRef.current = setTimeout(() => {
|
||||
setIsScriptModalOpen(true);
|
||||
setCurrentStage(0);
|
||||
}, 8000);
|
||||
} else {
|
||||
setIsScriptModalOpen(true);
|
||||
setCurrentStage(0);
|
||||
}
|
||||
}
|
||||
if (currentLoadingText.includes('initializing')) {
|
||||
console.log('isScriptModalOpen-initializing', currentLoadingText, isScriptModalOpen);
|
||||
setIsScriptModalOpen(true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user