From 40139aaade9bce8f0511f094ca30fd4b5cc60ccf Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 25 三月 2024 09:48:09 +0800
Subject: [PATCH] #

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

diff --git a/zy-asrs-flow/src/pages/map/utils.js b/zy-asrs-flow/src/pages/map/utils.js
index 6865dbc..3679e5e 100644
--- a/zy-asrs-flow/src/pages/map/utils.js
+++ b/zy-asrs-flow/src/pages/map/utils.js
@@ -38,6 +38,12 @@
     AGV: "AGV",
 })
 
+export const SHELF_TYPE = Object.freeze({
+    STORE: 0,
+    TRACK: 3,
+    DISABLE: 1,
+})
+
 export const getRealPosition = (x, y, mapContainer) => {
     const rect = app.view.getBoundingClientRect();
     return {
@@ -356,10 +362,13 @@
                 // dynamical data
                 Object.assign(sprite.data, item.property);
 
+                showSheflType(sprite);
                 // graph
                 sprite.position.set(item.positionX, item.positionY);
                 sprite.scale.set(item.scaleX, item.scaleY);
                 sprite.rotation = rotationParseNum(item.rotation);
+
+                // sprite.tint = '#000';
                 mapContainer.addChild(sprite);
             }
         })
@@ -462,4 +471,24 @@
         closeIcon: false,
         onClick: () => { }
     });
+}
+
+export const showSheflType = (sprite) => {
+    let showColor;
+    switch (sprite.data.shelfType) {
+        case SHELF_TYPE.STORE:
+            break;
+        case SHELF_TYPE.TRACK:
+            showColor = '#faf6e9';
+            break;
+        case SHELF_TYPE.DISABLE:
+            showColor = '#ffc8c8';
+            break;
+        default:
+            break;
+    }
+    if (showColor) {
+        sprite.tint = showColor;
+    }
+    return showColor;
 }
\ No newline at end of file

--
Gitblit v1.9.1