#
luxiaotao1123
2024-10-19 00b0ec55e1b0eef82b3a31166e8273ecea776568
zy-acs-flow/src/map/tool.js
@@ -4,6 +4,9 @@
    DEVICE_TYPE,
    DEVICE_Z_INDEX,
    AGV_STATUS_MODE,
    DEVICE_SPRITE_TINT,
    DEVICE_SELECTED_EFFECT_PADDING,
    DEVICE_SELECTED_EFFECT_COLOR,
} from './constants';
import shelf from '/map/shelf.svg';
@@ -101,6 +104,8 @@
        default:
            break;
    }
    DEVICE_SPRITE_TINT[deviceType] != null && (sprite.tint = DEVICE_SPRITE_TINT[deviceType]);
    if (sprite && deviceType !== DEVICE_TYPE.AGV) {
        sprite.blendMode = PIXI.BLEND_MODES.MULTIPLY;
    }
@@ -337,10 +342,17 @@
    const { width, height } = sprite;
    const maxDimension = Math.max(width, height);
    const radius = (maxDimension / 2) + maxDimension / 5;
    const radius = (maxDimension / 2) + (DEVICE_SELECTED_EFFECT_PADDING[sprite.data?.type] || 10);
    const color = themeMode === 'light' ? 0x2f68ac : 0xffffff;
    const alpha = .5;
    let color;
    const spriteEffectColor = DEVICE_SELECTED_EFFECT_COLOR[sprite.data?.type];
    if (spriteEffectColor) {
        color = spriteEffectColor;
    } else {
        color = themeMode === 'light' ? '#747d8c' : '#718093';
    }
    const alpha = 1;
    effectCircle = new PIXI.Graphics();
    effectCircle.beginFill(color, alpha);
@@ -383,7 +395,6 @@
    }
    if (effectCircle) {
        mapContainer.removeChild(effectCircle);
        effectCircle.destroy();
        effectCircle = null;
    }
    selectedSprite = null;
@@ -393,7 +404,6 @@
    if (!selectedSprite || !effectCircle) {
        return;
    }
    // 更新圆的位置,确保跟随sprite
    effectCircle.position.set(selectedSprite.x, selectedSprite.y);
};