From 8d1bbe4a78d28ec7c9a6c2d20595f47a444504fa Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 13 三月 2024 10:40:08 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/locales/en-US/map.ts | 3 +++
zy-asrs-flow/src/pages/map/components/configSettings.jsx | 13 ++++++++++---
zy-asrs-flow/src/pages/map/components/mapSettings.jsx | 4 ++--
zy-asrs-flow/src/pages/map/utils.js | 18 +++++++++++++++++-
4 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/zy-asrs-flow/src/locales/en-US/map.ts b/zy-asrs-flow/src/locales/en-US/map.ts
index 9dc0596..ad006f6 100644
--- a/zy-asrs-flow/src/locales/en-US/map.ts
+++ b/zy-asrs-flow/src/locales/en-US/map.ts
@@ -15,6 +15,9 @@
'map.settings.more': 'More',
'map.settings.delete': 'Delete',
'map.settings.type': 'Type',
+ 'map.settings.uuid': 'Uuid',
+ 'map.settings.component': 'Component',
+ 'map.settings.name': 'Name',
'map.settings.position': 'Position',
'map.settings.scale': 'Scale',
'map.settings.rotation': 'Rotation',
diff --git a/zy-asrs-flow/src/pages/map/components/configSettings.jsx b/zy-asrs-flow/src/pages/map/components/configSettings.jsx
index e853278..142cac9 100644
--- a/zy-asrs-flow/src/pages/map/components/configSettings.jsx
+++ b/zy-asrs-flow/src/pages/map/components/configSettings.jsx
@@ -65,17 +65,24 @@
<Col span={24}>
<Row gutter={24}>
- <Col span={18}>
+ <Col span={12}>
<Form.Item
label={intl.formatMessage({ id: 'map.settings.type', defaultMessage: '绫诲瀷' })}
- labelCol={{ span: 4 }}
+ labelCol={{ span: 6 }}
>
<span>{curSprite?.data?.type}</span>
</Form.Item>
</Col>
+ <Col span={12}>
+ <Form.Item
+ label={intl.formatMessage({ id: 'map.settings.uuid', defaultMessage: '缂栧彿' })}
+ labelCol={{ span: 6 }}
+ >
+ <span>{curSprite?.data?.uuid}</span>
+ </Form.Item>
+ </Col>
</Row>
</Col>
-
</Row>
</Form>
diff --git a/zy-asrs-flow/src/pages/map/components/mapSettings.jsx b/zy-asrs-flow/src/pages/map/components/mapSettings.jsx
index 98b9dba..c61af82 100644
--- a/zy-asrs-flow/src/pages/map/components/mapSettings.jsx
+++ b/zy-asrs-flow/src/pages/map/components/mapSettings.jsx
@@ -148,10 +148,10 @@
<Row gutter={24}>
<Col span={18}>
<Form.Item
- label={intl.formatMessage({ id: 'map.settings.type', defaultMessage: '绫诲瀷' })}
+ label={intl.formatMessage({ id: 'map.settings.component', defaultMessage: '缁勪欢' })}
labelCol={{ span: 4 }}
>
- <span>{curSprite?.data?.type}</span>
+ <span>{curSprite?.data?.type}-{curSprite?.data?.uuid}</span>
</Form.Item>
</Col>
</Row>
diff --git a/zy-asrs-flow/src/pages/map/utils.js b/zy-asrs-flow/src/pages/map/utils.js
index 349652b..eb57314 100644
--- a/zy-asrs-flow/src/pages/map/utils.js
+++ b/zy-asrs-flow/src/pages/map/utils.js
@@ -20,6 +20,11 @@
SELECTION_BOX: Symbol.for(0),
})
+export const SENSOR_TYPE = Object.freeze({
+ AGV: "AGV",
+ SHELF: "SHELF",
+})
+
export const getRealPosition = (x, y, mapContainer) => {
const rect = app.view.getBoundingClientRect();
return {
@@ -33,7 +38,8 @@
sprite.cursor = 'pointer';
sprite.eventMode = 'static';
sprite.data = {
- type: type
+ type: type,
+ uuid: generateID()
};
}
@@ -215,6 +221,8 @@
copiedSprite.position.set(sprite.position.x, sprite.position.y);
copiedSprite.scale.set(sprite.scale.x, sprite.scale.y);
copiedSprite.rotation = sprite.rotation;
+ copiedSprite.data = deepCopy(sprite.data);
+ copiedSprite.data.uuid = generateID();
return copiedSprite;
}
@@ -224,4 +232,12 @@
export const unMarkSprite = (sprite) => {
sprite.alpha = 1;
+}
+
+export const generateID = () => {
+ return Date.now().toString(36) + Math.random().toString(36).substring(2);
+}
+
+export const deepCopy = (data) => {
+ return JSON.parse(JSON.stringify(data));
}
\ No newline at end of file
--
Gitblit v1.9.1