forked from 77media/video-flow
新增模式状态管理,优化暂停/播放按钮逻辑,添加“下一步”按钮以支持手动模式。
This commit is contained in:
parent
2132805acd
commit
05df45fa62
@ -10,7 +10,7 @@ import { MediaViewer } from "./work-flow/media-viewer";
|
|||||||
import { ThumbnailGrid } from "./work-flow/thumbnail-grid";
|
import { ThumbnailGrid } from "./work-flow/thumbnail-grid";
|
||||||
import { useWorkflowData } from "./work-flow/use-workflow-data";
|
import { useWorkflowData } from "./work-flow/use-workflow-data";
|
||||||
import { usePlaybackControls } from "./work-flow/use-playback-controls";
|
import { usePlaybackControls } from "./work-flow/use-playback-controls";
|
||||||
import { AlertCircle, RefreshCw, Pause, Play } from "lucide-react";
|
import { AlertCircle, RefreshCw, Pause, Play, ChevronLast } from "lucide-react";
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
import { GlassIconButton } from '@/components/ui/glass-icon-button';
|
import { GlassIconButton } from '@/components/ui/glass-icon-button';
|
||||||
|
|
||||||
@ -42,6 +42,7 @@ export default function WorkFlow() {
|
|||||||
setCurrentSketchIndex,
|
setCurrentSketchIndex,
|
||||||
retryLoadData,
|
retryLoadData,
|
||||||
isPauseWorkFlow,
|
isPauseWorkFlow,
|
||||||
|
mode,
|
||||||
setIsPauseWorkFlow,
|
setIsPauseWorkFlow,
|
||||||
} = useWorkflowData();
|
} = useWorkflowData();
|
||||||
|
|
||||||
@ -214,14 +215,26 @@ export default function WorkFlow() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 暂停/播放按钮 */}
|
{/* 暂停/播放按钮 */}
|
||||||
<div className="absolute right-12 bottom-12 z-[9999]">
|
{
|
||||||
|
currentStep !== '6' && (
|
||||||
|
<div className="absolute right-12 bottom-16 z-[9999] flex gap-4">
|
||||||
<GlassIconButton
|
<GlassIconButton
|
||||||
icon={isPauseWorkFlow ? Play : Pause}
|
icon={isPauseWorkFlow ? Play : Pause}
|
||||||
size='lg'
|
size='lg'
|
||||||
tooltip={isPauseWorkFlow ? "Play" : "Pause"}
|
tooltip={isPauseWorkFlow ? "Play" : "Pause"}
|
||||||
onClick={() => setIsPauseWorkFlow(!isPauseWorkFlow)}
|
onClick={() => setIsPauseWorkFlow(!isPauseWorkFlow)}
|
||||||
/>
|
/>
|
||||||
|
{ mode !== 'auto' && (
|
||||||
|
<GlassIconButton
|
||||||
|
icon={ChevronLast}
|
||||||
|
size='lg'
|
||||||
|
tooltip="Next"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
{/* AI 建议栏 */}
|
{/* AI 建议栏 */}
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
|
|||||||
@ -75,6 +75,7 @@ export function useWorkflowData() {
|
|||||||
const [dataLoadError, setDataLoadError] = useState<string | null>(null);
|
const [dataLoadError, setDataLoadError] = useState<string | null>(null);
|
||||||
const [needStreamData, setNeedStreamData] = useState(false);
|
const [needStreamData, setNeedStreamData] = useState(false);
|
||||||
const [isPauseWorkFlow, setIsPauseWorkFlow] = useState(false);
|
const [isPauseWorkFlow, setIsPauseWorkFlow] = useState(false);
|
||||||
|
const [mode, setMode] = useState<'auto' | 'manual'>('manual');
|
||||||
|
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const { sketchCount, videoCount } = useAppSelector((state) => state.workflow);
|
const { sketchCount, videoCount } = useAppSelector((state) => state.workflow);
|
||||||
@ -576,6 +577,7 @@ export function useWorkflowData() {
|
|||||||
retryLoadData,
|
retryLoadData,
|
||||||
handleManualPlay,
|
handleManualPlay,
|
||||||
isPauseWorkFlow,
|
isPauseWorkFlow,
|
||||||
|
mode,
|
||||||
setIsPauseWorkFlow,
|
setIsPauseWorkFlow,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user