From 8a830f3e5f9ff3bca3161b5bf800abeb1a64e866 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期六, 22 六月 2024 16:30:35 +0800 Subject: [PATCH] # --- zy-asrs-flow/src/pages/map/utils.js | 53 +++++++++++++++++++++++++++++------------------------ 1 files changed, 29 insertions(+), 24 deletions(-) diff --git a/zy-asrs-flow/src/pages/map/utils.js b/zy-asrs-flow/src/pages/map/utils.js index 57bde65..cefb134 100644 --- a/zy-asrs-flow/src/pages/map/utils.js +++ b/zy-asrs-flow/src/pages/map/utils.js @@ -689,38 +689,43 @@ }).start(); } -export const showLockPath = (nodes, curFloor, setCurSPrite) => { - const pathLineName = 'lockPath-' + curFloor; +export const showLockPath = (lockPath, curFloor, setCurSPrite) => { + const pathLineName = 'lockPath'; let pathLine = mapContainer.getChildByName(pathLineName); if (pathLine) { mapContainer.removeChild(pathLine); } - pathLine = new PIXI.Graphics(); - pathLine.name = pathLineName; - pathLine.lineStyle(3 * (1 / mapContainer.scale.x), 0xff0000, 0.8); - pathLine.zIndex = SENSOR_ZINDEX.TRAVEL_PATH; - let firstNode = true; + for (let i = 0; i < lockPath.length; i++) { + const item = lockPath[i] + if(item.lev != curFloor) {continue} + const nodes = item.path; - for (let i = 0; i < nodes.length; i++) { - const node = nodes[i]; - if (node.z !== curFloor) { continue } - const shelf = querySprite(SENSOR_TYPE.SHELF, node.x + '-' + node.y); - if (!shelf) { continue } - - let position = shelf.position; - let x = position.x; - let y = position.y; - if (firstNode) { - pathLine.moveTo(x, y); - firstNode = false; - } else { - pathLine.lineTo(x, y); + pathLine = new PIXI.Graphics(); + pathLine.name = pathLineName; + pathLine.lineStyle(3 * (1 / mapContainer.scale.x), 0xff0000, 0.8); + pathLine.zIndex = SENSOR_ZINDEX.TRAVEL_PATH; + let firstNode = true; + + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + const shelf = querySprite(SENSOR_TYPE.SHELF, node.x + '-' + node.y); + if (!shelf) { continue } + + let position = shelf.position; + let x = position.x; + let y = position.y; + if (firstNode) { + pathLine.moveTo(x, y); + firstNode = false; + } else { + pathLine.lineTo(x, y); + } + } - + + mapContainer.addChild(pathLine); } - - mapContainer.addChild(pathLine); } export const showConveyorSta = (conveyorSta, curFloor, setCurSPrite) => { -- Gitblit v1.9.1