import KFIcon from '@/components/KFIcon'; import { useNavigate } from '@umijs/max'; import { debounce } from 'lodash'; import { useEffect, useState } from 'react'; import WorkArrow from './WorkArrow'; import WorkFlow from './WorkFlow'; import styles from './index.less'; function QuickStart() { const navigate = useNavigate(); const [scale, setScale] = useState(1); const [space, setSpace] = useState(29); const [canvasWidth, setCanvasWidth] = useState('100%'); useEffect(() => { const changeScale = () => { // body 的宽度 - 菜单的宽度 - 两个 padding - 右边用户管理的宽度 - 右边用户管理的 marginLeft - 滚动条的宽度, const width = document.body.offsetWidth - 256 - 80 - 60 - 326 - 15 - 8; if (width >= 1002) { const spaceX = (width - 192 * 4 - 60) / 6; setSpace(spaceX); setCanvasWidth('100%'); setScale(1.0); } else { const ratio = width / 1002; setCanvasWidth('1223px'); setSpace(29); setScale(ratio); } }; changeScale(); const debounceFunc = debounce(changeScale, 16); window.addEventListener('resize', debounceFunc); return () => { window.removeEventListener('resize', debounceFunc); }; }, []); const arrowWidth = space - 12; const left = space; const taskWholeWidth = 192 - 56 + 90 + space - 143; const taskLeftArrowWidth = taskWholeWidth * (56 / (56 + 49)); const taskRightArrowWidth = taskWholeWidth * (49 / (56 + 49)); return (