#
luxiaotao1123
2024-03-04 44c66e71f552baa983b6cd50392249cd6e7e9896
#
2个文件已修改
34 ■■■■ 已修改文件
zy-asrs-flow/src/locales/en-US/map.ts 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/index.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/locales/en-US/map.ts
@@ -1,3 +1,11 @@
export default {
    'map.edit': 'Edit Map',
    'map.edit': 'Edit Model',
    'map.edit.close': 'Exit Edit',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
}
zy-asrs-flow/src/pages/map/index.jsx
@@ -50,8 +50,9 @@
        width: window.innerWidth,
        height: window.innerHeight,
    });
    const [app, setApp] = React.useState(null)
    const [mapContainer, setMapContainer] = React.useState(null)
    const [app, setApp] = React.useState(null);
    const [mapContainer, setMapContainer] = React.useState(null);
    const [mapEditModel, setMapEditModel] = React.useState(false);
    React.useEffect(() => {
        const player = new Player(mapRef.current, styles.dark);
@@ -77,9 +78,14 @@
        const height = contentRef.current.offsetHeight;
        app.renderer.resize(width, height);
    }, [app, mapContainer, windowSize])
    const editHandle = () => {
    }
    React.useEffect(() => {
        if (!mapContainer) {
            return;
        }
        console.log(mapEditModel);
    }, [mapEditModel]);
    const onDrop = (sprite, x, y) => {
        const { mapX, mapY } = Utils.getRealPosition(x, y, mapContainer);
@@ -96,7 +102,12 @@
                        <Col span={8} style={{}}></Col>
                        <Col span={16} style={{ backgroundColor: '#3C40C6', }}>
                            <Flex className={styles.flex} gap={'large'} justify={'flex-end'} align={'center'}>
                                <Button onClick={editHandle} size={'large'}><FormattedMessage id='map.edit' defaultMessage='编辑地图' /></Button>
                                <Button onClick={() => setMapEditModel(!mapEditModel)} size={'large'}>
                                    {!mapEditModel
                                        ? <FormattedMessage id='map.edit' defaultMessage='编辑地图' />
                                        : <span style={{ color: 'red', fontWeight: 'bold' }}><FormattedMessage id='map.edit.close' defaultMessage='退出编辑' /></span>
                                    }
                                </Button>
                            </Flex>
                        </Col>
                    </Row>
@@ -118,6 +129,7 @@
                    </FloatButton.Group>
                    <FloatButton.Group
                        hidden={!mapEditModel}
                        trigger="hover"
                        style={{
                            right: 35,