#
luxiaotao1123
2024-10-16 2b28b96bf59f1ea19a9b8d6cb11a6b4caa54f886
#
1个文件已修改
32 ■■■■■ 已修改文件
zy-acs-flow/src/map/insight/shelf/ShelfMain.jsx 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/insight/shelf/ShelfMain.jsx
@@ -12,7 +12,6 @@
    Stack,
} from '@mui/material';
import ShelfThree from './ShelfThree';
import request from '@/utils/request';
import { getLocGroup } from '../../http';
let shelfThree;
@@ -94,10 +93,7 @@
    const translate = useTranslate();
    const containerRef = useRef();
    const [loading, setLoading] = useState(true);
    const [shelfThree, setShelfThree] = useState(null);
    const [info, setInfo] = useState(null);
    useEffect(() => {
        if (data) {
@@ -109,6 +105,8 @@
    }, [data]);
    useEffect(() => {
        console.log(curLocNo);
        if (info) {
            endThree();
            setLoading(true);
@@ -121,35 +119,9 @@
                renderThree(info, curLocNo);
                setLoading(false);
            }, 300)
        }
        return endThree;
    }, [info]);
    useEffect(() => {
        const initThree = () => {
            const shelfThreeInstance = new ShelfThree(containerRef.current);
            shelfThreeInstance.startup();
            shelfThreeInstance.handleClick = (objName) => {
                setCurLocNo(objName);
            };
            setShelfThree(shelfThreeInstance);
            setLoading(false);
            // Fetch initial data
        };
        initThree();
        return () => {
            if (shelfThree) {
                shelfThree.destroy();
            }
        };
    }, []);
    return (