From cab87dcfaa7b1e2bc1298572b775026bb17ef38b Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期四, 17 十月 2024 13:54:41 +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