| | |
| | | '': '', |
| | | '': '', |
| | | '': '', |
| | | 'map.settings.point.horizontal': 'Horizontal', |
| | | 'map.settings.point.vertical': 'Vertical', |
| | | '': '', |
| | | '': '', |
| | | '': '', |
| | | '': '', |
| | | '': '', |
| | | '': '', |
| | | 'map.settings.sub.copy.reverse': 'Reverse', |
| | |
| | | }); |
| | | } |
| | | break; |
| | | case 'vertical': |
| | | const horizontal = form.getFieldValue('horizontal') |
| | | if (value && horizontal) { |
| | | form.setFieldsValue({ |
| | | no: Utils.pureNumStr(value) + '-' + Utils.pureNumStr(horizontal) |
| | | }); |
| | | } else { |
| | | form.setFieldsValue({ |
| | | no: '' |
| | | }); |
| | | } |
| | | break; |
| | | case 'horizontal': |
| | | const vertical = form.getFieldValue('vertical') |
| | | if (value && vertical) { |
| | | form.setFieldsValue({ |
| | | no: Utils.pureNumStr(vertical) + '-' + Utils.pureNumStr(value) |
| | | }); |
| | | } else { |
| | | form.setFieldsValue({ |
| | | no: '' |
| | | }); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | |
| | | curSprite.data.no = values.no; // * |
| | | curSprite.data.row = values.row; |
| | | curSprite.data.bay = values.bay; |
| | | break; |
| | | case Utils.SENSOR_TYPE.POINT: |
| | | curSprite.data.no = values.no; // * |
| | | curSprite.data.horizontal = values.horizontal; |
| | | curSprite.data.vertical = values.vertical; |
| | | break; |
| | | case Utils.SENSOR_TYPE.AGV: |
| | | curSprite.data.no = values.no; // * |
| | |
| | | </> |
| | | )} |
| | | |
| | | {curSprite?.data?.type === Utils.SENSOR_TYPE.POINT && ( |
| | | <> |
| | | <Form.Item |
| | | name='vertical' |
| | | label={intl.formatMessage({ id: 'map.settings.point.vertical', defaultMessage: '纵向' })} |
| | | rules={[ |
| | | { |
| | | required: false, |
| | | }, |
| | | ]} |
| | | > |
| | | <InputNumber |
| | | style={{ |
| | | width: '50%', |
| | | }} |
| | | /> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name='horizontal' |
| | | label={intl.formatMessage({ id: 'map.settings.point.horizontal', defaultMessage: '横向' })} |
| | | rules={[ |
| | | { |
| | | required: false, |
| | | }, |
| | | ]} |
| | | > |
| | | <InputNumber |
| | | style={{ |
| | | width: '50%', |
| | | }} |
| | | /> |
| | | </Form.Item> |
| | | </> |
| | | )} |
| | | |
| | | <Form.Item |
| | | name='no' |
| | | label={intl.formatMessage({ id: 'map.settings.no', defaultMessage: '编号' })} |
| | |
| | | setDragging(true); |
| | | setDragSpriteType(type); |
| | | const sprite = PIXI.Sprite.from(e.target); |
| | | sprite.width = 20; |
| | | sprite.height = 20; |
| | | setDragSprite(sprite); |
| | | }; |
| | | |
| | |
| | | import * as Utils from '../utils' |
| | | import ShelfDrawer from './shelf'; |
| | | import AgvDrawer from './agv'; |
| | | import PointDrawer from './point' |
| | | |
| | | const useStyles = createStyles(({ token, css }) => { |
| | | |
| | |
| | | /> |
| | | </> |
| | | )} |
| | | {props.curSprite?.data?.type === Utils.SENSOR_TYPE.POINT && ( |
| | | <> |
| | | <PointDrawer |
| | | curSprite={curSprite} |
| | | /> |
| | | </> |
| | | )} |
| | | {props.curSprite?.data?.type === Utils.SENSOR_TYPE.AGV && ( |
| | | <> |
| | | <AgvDrawer |
New file |
| | |
| | | import React, { useState, useRef, useEffect } from 'react'; |
| | | import { Card, Form, Button } from 'antd'; |
| | | import { FormattedMessage, useIntl, useModel } from '@umijs/max'; |
| | | import { createStyles } from 'antd-style'; |
| | | import * as Utils from '../../utils' |
| | | import Http from '@/utils/http'; |
| | | import ShowJson from '../showJson'; |
| | | |
| | | const useStyles = createStyles(({ token, css }) => { |
| | | |
| | | }) |
| | | |
| | | const PointDrawer = (props) => { |
| | | const intl = useIntl(); |
| | | const { styles } = useStyles(); |
| | | const [activeTabKey, setActiveTabKey] = useState('json'); |
| | | |
| | | const contentList = { |
| | | json: ( |
| | | <ShowJson |
| | | curSprite={props.curSprite} |
| | | /> |
| | | ), |
| | | }; |
| | | |
| | | return ( |
| | | <> |
| | | <Card |
| | | className='drawer-card' |
| | | hoverable |
| | | bordered={false} |
| | | type='inner' |
| | | tabList={[ |
| | | { |
| | | key: 'json', |
| | | tab: intl.formatMessage({ id: 'map.drawer.json', defaultMessage: 'JSON' }), |
| | | }, |
| | | ]} |
| | | activeTabKey={activeTabKey} |
| | | onTabChange={(key) => { |
| | | setActiveTabKey(key) |
| | | }} |
| | | tabProps={{ |
| | | centered: true, |
| | | size: 'large', |
| | | type: "card", |
| | | style: { |
| | | } |
| | | }} |
| | | style={{ |
| | | height: '100%' |
| | | }} |
| | | > |
| | | {contentList[activeTabKey]} |
| | | </Card> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default PointDrawer; |
| | |
| | | ) |
| | | }) |
| | | break; |
| | | case Utils.SENSOR_TYPE.POINT: |
| | | options.push({ |
| | | value: value, |
| | | label: |
| | | ( |
| | | <> |
| | | <span style={{ fontWeight: 'bold' }} >{intl.formatMessage({ id: 'map.sensor.type.point', defaultMessage: '定位点' })}</span> |
| | | </> |
| | | ) |
| | | }) |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | |
| | | import { API_TIMEOUT } from '@/config/setting' |
| | | import agv from '/public/img/map/agv.svg' |
| | | import shelf from '/public/img/map/shelf.png' |
| | | import point from '/public/img/map/point.svg' |
| | | |
| | | let app = null; |
| | | let mapContainer = null; |
| | |
| | | label: intl.formatMessage({ id: 'map.sensor.type.agv', defaultMessage: '无人小车' }) |
| | | }) |
| | | break; |
| | | case SENSOR_TYPE.POINT: |
| | | options.push({ |
| | | value: value, |
| | | label: intl.formatMessage({ id: 'map.sensor.type.point', defaultMessage: '定位点' }) |
| | | }) |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | |
| | | case SENSOR_TYPE.AGV: |
| | | sprite = PIXI.Sprite.from(agv); |
| | | break; |
| | | case SENSOR_TYPE.POINT: |
| | | sprite = PIXI.Sprite.from(point); |
| | | break; |
| | | default: |
| | | break; |
| | | } |