From a48bf56c321ef769224182b5a85d59b4beb88d01 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 25 三月 2024 15:14:37 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/utils.js | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 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..b45a4cf 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 {
@@ -253,6 +259,7 @@
copiedSprite.rotation = sprite.rotation;
copiedSprite.data = deepCopy(sprite.data);
copiedSprite.data.uuid = generateID();
+ showSheflType(copiedSprite);
return copiedSprite;
}
@@ -356,10 +363,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 +472,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