#
luxiaotao1123
2024-10-21 ce79f7c56c3832d1a4ebdb1d7d1c2bbd87d8b004
zy-acs-flow/src/map/tool.js
@@ -8,6 +8,7 @@
    DEVICE_SELECTED_EFFECT_PADDING,
    DEVICE_SELECTED_EFFECT_COLOR,
    POINT_ROUTE_DIRECTION,
    DEVICE_SPRITE_TINT_DARK,
} from './constants';
import { getRouteList } from './http';
import PointRoute from "./PointRoute";
@@ -51,6 +52,21 @@
export function setThemeMode(param) {
    themeMode = param;
    if (mapContainer) {
        // mapContainer.children.forEach(child => {
        //     const deviceType = child.data?.type;
        //     if (deviceType) {
        //         if (themeMode === 'dark') {
        //             const tint = DEVICE_SPRITE_TINT_DARK[deviceType]
        //             if (tint) {
        //                 child.tint = tint;
        //             }
        //         } else {
        //             DEVICE_SPRITE_TINT[deviceType] != null && (child.tint = DEVICE_SPRITE_TINT[deviceType]);
        //         }
        //     }
        // })
    }
}
@@ -108,7 +124,8 @@
        default:
            break;
    }
    DEVICE_SPRITE_TINT[deviceType] != null && (sprite.tint = DEVICE_SPRITE_TINT[deviceType]);
    const tintType = themeMode === 'dark' ? DEVICE_SPRITE_TINT_DARK : DEVICE_SPRITE_TINT;
    tintType[deviceType] != null && (sprite.tint = tintType[deviceType]);
    if (sprite && deviceType !== DEVICE_TYPE.AGV) {
        sprite.blendMode = PIXI.BLEND_MODES.MULTIPLY;
@@ -324,11 +341,15 @@
    text.y = 3;
    background.addChild(text);
    tooltip = new PIXI.Container();
    tooltip.name = "tooltip";
    tooltip.addChild(background);
    return tooltip;
}
function onSpriteMouseOver(event) {
    if (tooltip) {
        app.stage.removeChild(tooltip);
    }
    tooltip = createSpriteTooltip(this);// this => sprite
    tooltip.x = event.data.global.x + 10;
    tooltip.y = event.data.global.y + 10;
@@ -479,7 +500,7 @@
            const pointRoute = new PointRoute(POINT_ROUTE_DIRECTION[route.direction]);
            pointRoute.setPoint(startPoint, endPoint);
            pointRoute.clear();
            pointRoute.lineStyle(10, 0x2d3436);
            pointRoute.lineStyle(8, themeMode === 'light' ? '#2d3436' : '#dcdde1');
            pointRoute.moveTo(startPoint.position.x, startPoint.position.y);
            pointRoute.lineTo(endPoint.position.x, endPoint.position.y);
            pointRoute.alpha = 1;