import React from 'react'; import { Layout, Button, Typography, Flex } from 'antd'; import { ArrowLeftOutlined } from '@ant-design/icons'; import { useIntl } from 'react-intl'; import { useDispatch, useSelector } from 'react-redux'; import { switchToOperationPanel } from '../../../states/panelSwitchSliceForView'; import { setCropAction, setRatio, type CropAction, type CropRatio, } from '../../../states/view/rectCropPanelSlice'; import { RootState } from '../../../states/store'; import Icon from '@/components/Icon'; import '@/themes/truncateText.css'; const { Header, Content } = Layout; const { Title, Text } = Typography; // 功能按钮组件 const FunctionButton = ({ title, action, iconName, }: { title: string; action: string; iconName?: string; }) => { const dispatch = useDispatch(); const handleCropAction = (action: string) => { console.log(`执行裁剪操作: ${action}`); dispatch(setCropAction(action as CropAction)); }; return ( ); }; // 比例按钮组件 const RatioButton = ({ ratio, isSelected, }: { ratio: CropRatio; isSelected: boolean; }) => { const dispatch = useDispatch(); const handleClick = () => { dispatch(setRatio(ratio)); }; return ( ); }; const RectCropPanel = () => { const intl = useIntl(); const dispatch = useDispatch(); const selectedRatio = useSelector( (state: RootState) => state.rectCropPanel.selectedRatio ); const handleReturn = () => { dispatch(switchToOperationPanel()); }; // 比例数据,按两列排列 const ratios: CropRatio[] = [ '8x10', '10x8', '10x12', '12x10', '10x14', '14x10', '11x14', '14x11', '14x17', '17x14', '14x14', '17x17', ]; return ( {/* 顶部导航栏 */}
{/* 主体内容 */} {/* 功能按钮区域 */}
{/* 尺寸比例选择区域 */}
{ratios.map((ratio) => ( ))}
); }; export default RectCropPanel;