#
Junjie
2024-04-09 1739d0c61e3a781a38cab29543575b15c4cd48b2
zy-asrs-flow/src/pages/map/utils.js
@@ -52,6 +52,8 @@
export const SHELF_TYPE = Object.freeze({
    STORE: 0,
    TRACK: 3,
    LIFT: 67,
    CHARGE: 5,
    DISABLE: 1,
})
@@ -338,9 +340,11 @@
    // const copiedSprite = new PIXI.Sprite(sprite.texture);
    const copiedSprite = generateSprite(sprite.data.type)
    initSprite(copiedSprite);
    copiedSprite.position.set(sprite.position.x, sprite.position.y);
    copiedSprite.scale.set(sprite.scale.x, sprite.scale.y);
    copiedSprite.rotation = sprite.rotation;
    setTimeout(() => {
        copiedSprite.position.set(sprite.position.x, sprite.position.y);
        copiedSprite.scale.set(sprite.scale.x, sprite.scale.y);
        copiedSprite.rotation = sprite.rotation;
    }, 50);
    copiedSprite.data = deepCopy(sprite.data);
    copiedSprite.data.uuid = generateID();
    if (copiedSprite.data.type === SENSOR_TYPE.SHELF) {
@@ -457,9 +461,11 @@
                    showSheflType(sprite);
                    // graph
                    sprite.position.set(item.positionX, item.positionY);
                    sprite.scale.set(item.scaleX, item.scaleY);
                    sprite.rotation = rotationParseNum(item.rotation);
                    setTimeout(() => {
                        sprite.position.set(item.positionX, item.positionY);
                        sprite.scale.set(item.scaleX, item.scaleY);
                        sprite.rotation = rotationParseNum(item.rotation);
                    }, 50);
                    mapContainer.addChild(sprite);
                }
@@ -578,6 +584,12 @@
        case SHELF_TYPE.TRACK:
            showColor = '#faf6e9';
            break;
        case SHELF_TYPE.LIFT:
            showColor = '#EBDEF0';
            break;
        case SHELF_TYPE.CHARGE:
            showColor = '#D4EFDF';
            break;
        case SHELF_TYPE.DISABLE:
            showColor = '#ffc8c8';
            break;
@@ -650,14 +662,13 @@
    pathLine = new PIXI.Graphics();
    pathLine.name = pathLineName;
    pathLine.lineStyle(3 * (1 / mapContainer.scale.x), 0x3498db, 1);
    pathLine.lineStyle(2 * (1 / mapContainer.scale.x), 0x3498db, 0.8);
    pathLine.zIndex = SENSOR_ZINDEX.TRAVEL_PATH;
    let firstNode = true;
    for (let i = path.indexOf(curLocNo) - 1; i < path.length; i++) {
    for (let i = Math.max(0, path.indexOf(curLocNo) - 1); i < path.length; i++) {
        const { row, bay, lev } = parseLocNo(path[i]);
        if (Number(lev) !== curFloor) { continue }
        const shelf = querySprite(SENSOR_TYPE.SHELF, row + '-' + bay);
        if (!shelf) { continue };
        let position = shelf.position;
        let x = position.x;
@@ -690,7 +701,7 @@
        mapContainer.addChild(shuttle);
        viewFeature(shuttle, setCurSPrite);
    }
    new TWEEDLE.Tween(shuttle?.position).easing(TWEEDLE.Easing.Linear.None).to({
        x: shelf.position.x,
        y: shelf.position.y