This commit is contained in:
海龙 2025-08-07 11:47:17 +08:00
commit 6df87250fb
5 changed files with 38 additions and 7 deletions

View File

@ -5,20 +5,26 @@
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
/* max-width: 1200px; */ /* max-width: 1200px; */
padding: 0 3rem; /* padding: 0 3rem; */
height: calc(100vh - 120px); height: calc(100vh - 120px);
max-height: 800px;
min-height: 600px; min-height: 600px;
display: flex; display: flex;
overflow: hidden; overflow: hidden;
} }
/* 大屏幕适配 */
@media (width >= 1024px) {
.container-H2sRZG {
width: 85%;
}
}
/* 小屏幕适配 */ /* 小屏幕适配 */
@media (max-width: 768px) { @media (max-width: 768px) {
.container-H2sRZG { .container-H2sRZG {
padding-inline: 10px; padding-inline: 10px;
max-width: 100%; max-width: 100%;
padding: 0 1rem; padding: 0 3rem;
height: calc(100vh - 80px); height: calc(100vh - 80px);
min-height: 500px; min-height: 500px;
} }

View File

@ -225,7 +225,7 @@ export default function WorkFlow() {
tooltip={isPauseWorkFlow ? "Play" : "Pause"} tooltip={isPauseWorkFlow ? "Play" : "Pause"}
onClick={() => setIsPauseWorkFlow(!isPauseWorkFlow)} onClick={() => setIsPauseWorkFlow(!isPauseWorkFlow)}
/> />
{ mode !== 'auto' && ( { mode !== 'automatic' && (
<GlassIconButton <GlassIconButton
icon={ChevronLast} icon={ChevronLast}
size='lg' size='lg'

View File

@ -49,9 +49,34 @@ export function ThumbnailGrid({
behavior: 'smooth' behavior: 'smooth'
}); });
} }
console.log('taskVideos', taskVideos);
}, [currentSketchIndex, taskSketch.length]); }, [currentSketchIndex, taskSketch.length]);
// 处理键盘左右键事件
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
const isVideoPhase = Number(currentStep) > 2 && taskVideos.length > 0 && Number(currentStep) < 6;
const maxIndex = isVideoPhase ? taskVideos.length - 1 : taskSketch.length - 1;
if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
e.preventDefault();
let newIndex = currentSketchIndex;
if (e.key === 'ArrowLeft') {
// 向左循环
newIndex = currentSketchIndex === 0 ? maxIndex : currentSketchIndex - 1;
} else {
// 向右循环
newIndex = currentSketchIndex === maxIndex ? 0 : currentSketchIndex + 1;
}
onSketchSelect(newIndex);
}
};
window.addEventListener('keydown', handleKeyDown);
return () => window.removeEventListener('keydown', handleKeyDown);
}, [currentStep, currentSketchIndex, taskSketch.length, taskVideos.length, onSketchSelect]);
// 处理鼠标/触摸拖动事件 // 处理鼠标/触摸拖动事件
const handleMouseDown = (e: React.MouseEvent<HTMLDivElement>) => { const handleMouseDown = (e: React.MouseEvent<HTMLDivElement>) => {
setIsDragging(true); setIsDragging(true);

View File

@ -75,7 +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'>('auto'); const [mode, setMode] = useState<'automatic' | 'manual'>('automatic');
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const { sketchCount, videoCount } = useAppSelector((state) => state.workflow); const { sketchCount, videoCount } = useAppSelector((state) => state.workflow);

View File

@ -16,7 +16,7 @@ gsap.registerPlugin(Draggable)
export interface HorizontalScrollerProps { export interface HorizontalScrollerProps {
children: ReactNode[] children: ReactNode[]
itemWidth?: number | 'auto' itemWidth?: number | string
gap?: number gap?: number
selectedIndex?: number selectedIndex?: number
onItemClick?: (index: number) => void onItemClick?: (index: number) => void