From 8b5b1811556bf9a9c95574276b2a93cb5099cec4 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期日, 07 四月 2024 08:36:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/Four-Way-Rack' into Four-Way-Rack

---
 zy-asrs-flow/src/pages/map/utils.js |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/utils.js b/zy-asrs-flow/src/pages/map/utils.js
index f25e436..3188b8f 100644
--- a/zy-asrs-flow/src/pages/map/utils.js
+++ b/zy-asrs-flow/src/pages/map/utils.js
@@ -113,6 +113,17 @@
     };
 }
 
+export const querySprite = (type, no) => {
+    if (!mapContainer) {
+        return;
+    }
+    for (const sprite of mapContainer.children) {
+        if (sprite.data?.type === type && sprite.data?.no === no) {
+            return sprite;
+        }
+    }
+}
+
 // show sprite feature from sprite click event
 export const viewFeature = (sprite, setCurSPrite) => {
     sprite.off('pointerup');
@@ -588,6 +599,13 @@
     const mapVo = JSON.parse(data);
     // shuttle
     for (const shuttleVo of mapVo.shuttleVos) {
-        console.log(shuttleVo);
+        const shuttle = querySprite(SENSOR_TYPE.SHUTTLE, shuttleVo.shuttleNo);
+        if (!shuttle && !shuttleVo.curLocNo) { continue; }
+        const { row, bay, lev } = parseLocNo(shuttleVo.curLocNo);
+        const shelf = querySprite(SENSOR_TYPE.SHELF, row + '-' + bay);
+        new TWEEDLE.Tween(shuttle.position).easing(TWEEDLE.Easing.Linear.None).to({
+            x: shelf.position.x,
+            y: shelf.position.y
+        }, 1000).start();
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1