#
luxiaotao1123
2024-02-29 cef2b5c7fa9ad9287116ae7d6f07d74499acc388
#
2个文件已修改
28 ■■■■■ 已修改文件
zy-asrs-flow/src/pages/map/index.css 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/index.jsx 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/index.css
@@ -4,5 +4,5 @@
}
.ant-card .ant-card-body {
    padding: 0;
    padding: 15;
}
zy-asrs-flow/src/pages/map/index.jsx
@@ -3,6 +3,12 @@
import * as TWEEDLE from 'tweedle.js';
import { Button, message, Modal, Card } from 'antd';
import './index.css'
import {
    FooterToolbar,
    PageContainer,
    ProTable,
    LightFilter,
} from '@ant-design/pro-components';
const Map = () => {
    const mapRef = React.useRef();
@@ -15,14 +21,11 @@
            antialias: true,
        })
    })
    app.stage.interactive = true;
    app.stage.hitArea = app.screen;
    globalThis.__PIXI_APP__ = app;
    mapRef.current.appendChild(app.view);
    React.useEffect(() => {
        const onResize = () => {
            const width = mapRef.current.offsetWidth;
            console.log(1);
            const width = mapRef.current.offsetWidth + 2;
            const height = window.innerHeight - 92;
            console.log(width, height);
            if (mapRef) {
@@ -32,10 +35,15 @@
        window.addEventListener('resize', onResize);
        onResize();
        return () => {
            app.destroy(true, true);
            window.removeEventListener('resize', onResize);
        }
        app.stage.interactive = true;
        app.stage.hitArea = app.screen;
        globalThis.__PIXI_APP__ = app;
        mapRef.current.appendChild(app.view);
        // return () => {
        //     app.destroy(true, true);
        //     window.removeEventListener('resize', onResize);
        // }
    }, []);
    return (