#
luxiaotao1123
2024-03-19 819ffe3eeac0fc5c80e3e2a0ce662e3143120cd0
#
1个文件已添加
6个文件已修改
161 ■■■■■ 已修改文件
zy-asrs-flow/src/locales/en-US/map.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/components/configSettings.jsx 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/components/device.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/drawer/index.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/drawer/point/index.jsx 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/header/search.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/utils.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/locales/en-US/map.ts
@@ -52,6 +52,12 @@
    '': '',
    '': '',
    '': '',
    'map.settings.point.horizontal': 'Horizontal',
    'map.settings.point.vertical': 'Vertical',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    'map.settings.sub.copy.reverse': 'Reverse',
zy-asrs-flow/src/pages/map/components/configSettings.jsx
@@ -57,6 +57,30 @@
                                });
                            }
                            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;
                    }
@@ -79,6 +103,11 @@
                        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; // *
@@ -172,6 +201,41 @@
                    </>
                )}
                {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: '编号' })}
zy-asrs-flow/src/pages/map/components/device.jsx
@@ -50,8 +50,6 @@
        setDragging(true);
        setDragSpriteType(type);
        const sprite = PIXI.Sprite.from(e.target);
        sprite.width = 20;
        sprite.height = 20;
        setDragSprite(sprite);
    };
zy-asrs-flow/src/pages/map/drawer/index.jsx
@@ -5,6 +5,7 @@
import * as Utils from '../utils'
import ShelfDrawer from './shelf';
import AgvDrawer from './agv';
import PointDrawer from './point'
const useStyles = createStyles(({ token, css }) => {
@@ -46,6 +47,13 @@
                        />
                    </>
                )}
                {props.curSprite?.data?.type === Utils.SENSOR_TYPE.POINT && (
                    <>
                        <PointDrawer
                            curSprite={curSprite}
                        />
                    </>
                )}
                {props.curSprite?.data?.type === Utils.SENSOR_TYPE.AGV && (
                    <>
                        <AgvDrawer
zy-asrs-flow/src/pages/map/drawer/point/index.jsx
New file
@@ -0,0 +1,60 @@
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;
zy-asrs-flow/src/pages/map/header/search.jsx
@@ -37,6 +37,17 @@
                        )
                })
                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;
        }
zy-asrs-flow/src/pages/map/utils.js
@@ -5,6 +5,7 @@
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;
@@ -308,6 +309,12 @@
                    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;
        }
@@ -329,6 +336,9 @@
                case SENSOR_TYPE.AGV:
                    sprite = PIXI.Sprite.from(agv);
                    break;
                case SENSOR_TYPE.POINT:
                    sprite = PIXI.Sprite.from(point);
                    break;
                default:
                    break;
            }