From ce79f7c56c3832d1a4ebdb1d7d1c2bbd87d8b004 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期一, 21 十月 2024 13:56:03 +0800 Subject: [PATCH] # --- zy-acs-flow/src/map/constants.js | 10 ++++++++++ zy-acs-flow/src/map/tool.js | 19 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletions(-) diff --git a/zy-acs-flow/src/map/constants.js b/zy-acs-flow/src/map/constants.js index 3c4c9a4..a88723d 100644 --- a/zy-acs-flow/src/map/constants.js +++ b/zy-acs-flow/src/map/constants.js @@ -38,6 +38,16 @@ POINT: 0xCACDCF, }) +export const DEVICE_SPRITE_TINT_DARK = Object.freeze({ + SHELF: 0xdcdde1, + STATION: null, + CHARGE: null, + DIRECTION: null, + + AGV: null, + POINT: 0xf1f2f6, +}) + export const DEVICE_SELECTED_EFFECT_PADDING = Object.freeze({ SHELF: 10, STATION: 10, diff --git a/zy-acs-flow/src/map/tool.js b/zy-acs-flow/src/map/tool.js index 8ecc0f9..c84c2ca 100644 --- a/zy-acs-flow/src/map/tool.js +++ b/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; -- Gitblit v1.9.1