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/components/configSettings.jsx | 6 +++---
zy-asrs-flow/src/pages/map/utils.js | 29 +++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/components/configSettings.jsx b/zy-asrs-flow/src/pages/map/components/configSettings.jsx
index 9bd8aaa..abe1cd9 100644
--- a/zy-asrs-flow/src/pages/map/components/configSettings.jsx
+++ b/zy-asrs-flow/src/pages/map/components/configSettings.jsx
@@ -200,15 +200,15 @@
options={[
{
label: intl.formatMessage({ id: 'map.settings.shelf.store', defaultMessage: '搴撲綅' }),
- value: 0
+ value: Utils.SHELF_TYPE.STORE
},
{
label: intl.formatMessage({ id: 'map.settings.shelf.track', defaultMessage: '杞ㄩ亾' }),
- value: 3
+ value: Utils.SHELF_TYPE.TRACK
},
{
label: intl.formatMessage({ id: 'map.settings.shelf.diable', defaultMessage: '绂佺敤' }),
- value: 1
+ value: Utils.SHELF_TYPE.DISABLE
},
]}
defaultValue={0}
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