New file |
| | |
| | | import React, { useState, useRef, useEffect } from 'react'; |
| | | import { Segmented, AutoComplete } from 'antd'; |
| | | import { FormattedMessage, useIntl } from '@umijs/max'; |
| | | import { createStyles } from 'antd-style'; |
| | | import * as Utils from '../utils' |
| | | |
| | | const useStyles = createStyles(({ token }) => { |
| | | return { |
| | | floorBox: { |
| | | position: 'absolute', |
| | | left: '50%', |
| | | top: '3%', |
| | | transform: 'translate(-50%, -50%)', |
| | | } |
| | | } |
| | | }) |
| | | |
| | | |
| | | const MapFloor = (props) => { |
| | | const intl = useIntl(); |
| | | const { styles } = useStyles(); |
| | | |
| | | React.useEffect(() => { |
| | | |
| | | }, [props]); |
| | | |
| | | return ( |
| | | <> |
| | | <div className={styles.floorBox}> |
| | | <Segmented |
| | | size={'large'} |
| | | options={['1F', '2F', '3F', '4F', '5F']} |
| | | onChange={(value) => { |
| | | console.log(value); // string |
| | | }} |
| | | /> |
| | | </div> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default MapFloor; |
| | |
| | | import * as React from 'react' |
| | | import * as PIXI from 'pixi.js'; |
| | | import { FormattedMessage, useIntl, useModel } from '@umijs/max'; |
| | | import { Layout, Button, Flex, Row, Col, FloatButton, Select, notification } from 'antd'; |
| | | import { Layout, Button, Flex, Row, Col, FloatButton, Select, notification, Segmented } from 'antd'; |
| | | const { Header, Content } = Layout; |
| | | import { |
| | | AppstoreAddOutlined, |
| | |
| | | import * as Utils from './utils' |
| | | import Player from './player'; |
| | | import MapSearch from './header/search'; |
| | | import MapFloor from './header/floor'; |
| | | import MapDrawer from './drawer'; |
| | | |
| | | const useStyles = createStyles(({ token }) => { |
| | |
| | | </Header> |
| | | <Content ref={contentRef} className={styles.content}> |
| | | <div ref={mapRef} style={{ position: "relative" }} > |
| | | <MapFloor |
| | | |
| | | /> |
| | | <FloatButton.Group |
| | | shape="square" |
| | | style={{ |