zjj
2025-02-17 a4093814b51bba7eae9530cfa076f6242df3f5f8
zy-asrs-flow/src/pages/map/components/device.jsx
@@ -38,6 +38,7 @@
import shuttle from '/public/img/map/shuttle.svg'
import agv from '/public/img/map/agv.svg'
import shelf from '/public/img/map/shelf.png'
import conveyor from '/public/img/map/conveyor.png'
import point from '/public/img/map/point.svg'
const Device = (props) => {
@@ -50,29 +51,7 @@
    const onDragStart = (e, type) => {
        setDragging(true);
        setDragSpriteType(type);
        let image = new window.Image();
        switch (type) {
            case Utils.SENSOR_TYPE.SHUTTLE:
                image.src = shuttle;
                break;
            case Utils.SENSOR_TYPE.AGV:
                image.src = agv;
                break;
            case Utils.SENSOR_TYPE.SHELF:
                image.src = shuttle;
                break;
            case Utils.SENSOR_TYPE.POINT:
                image.src = point;
                break;
            default:
                break;
        }
        image.width = 300;
        image.height = 300;
        const texture = PIXI.Texture.from(image);
        const sprite = new PIXI.Sprite(texture);
        // const sprite = PIXI.Sprite.from(e.target);
        const sprite = Utils.generateSprite(type);
        setDragSprite(sprite);
    };
@@ -163,14 +142,14 @@
                    </Col>
                    <Col className={styles.mapCol} span={8} >
                        <Image
                            src={shelf}
                            src={conveyor}
                            width='35px'
                            preview={false}
                            draggable="true"
                            onDragStart={(e) => onDragStart(e, Utils.SENSOR_TYPE.SHELF)}
                            onDragStart={(e) => onDragStart(e, Utils.SENSOR_TYPE.CONVEYOR)}
                        />
                        <div className={styles.title}>
                            <FormattedMessage id='map.sensor.type.shelf' defaultMessage='货架' />
                            <FormattedMessage id='map.sensor.type.conveyor' defaultMessage='输送线' />
                        </div>
                    </Col>
                    <Col className={styles.mapCol} span={8} >