From 0e8b41f6f2ffa21ca6394e20053b262d2dc1e1be Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 20 三月 2024 14:00:38 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/utils.js | 31 +++++++++++++++++++++++++------
1 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/utils.js b/zy-asrs-flow/src/pages/map/utils.js
index 64b1d49..b089a48 100644
--- a/zy-asrs-flow/src/pages/map/utils.js
+++ b/zy-asrs-flow/src/pages/map/utils.js
@@ -5,6 +5,7 @@
import { API_TIMEOUT } from '@/config/setting'
import agv from '/public/img/map/agv.svg'
import shelf from '/public/img/map/shelf.png'
+import point from '/public/img/map/point.svg'
let app = null;
let mapContainer = null;
@@ -28,6 +29,7 @@
export const SENSOR_TYPE = Object.freeze({
SHELF: "SHELF",
+ POINT: "POINT",
AGV: "AGV",
})
@@ -307,6 +309,12 @@
label: intl.formatMessage({ id: 'map.sensor.type.agv', defaultMessage: '鏃犱汉灏忚溅' })
})
break;
+ case SENSOR_TYPE.POINT:
+ options.push({
+ value: value,
+ label: intl.formatMessage({ id: 'map.sensor.type.point', defaultMessage: '瀹氫綅鐐�' })
+ })
+ break;
default:
break;
}
@@ -328,6 +336,9 @@
case SENSOR_TYPE.AGV:
sprite = PIXI.Sprite.from(agv);
break;
+ case SENSOR_TYPE.POINT:
+ sprite = PIXI.Sprite.from(point);
+ break;
default:
break;
}
@@ -336,6 +347,9 @@
// data
sprite.data.uuid = item.uuid;
sprite.data.no = item.no;
+
+ // dynamical data
+ Object.assign(sprite.data, item.property);
// graph
sprite.position.set(item.positionX, item.positionY);
@@ -359,11 +373,13 @@
let mapItemList = [];
mapContainer?.children.forEach(child => {
if (child.data?.uuid) {
+ const { type, uuid, no, ...property } = child.data;
mapItemList.push({
// data
- type: child.data.type,
- uuid: child.data.uuid,
- no: child.data.no,
+ type: type,
+ uuid: uuid,
+ no: no,
+ property: property,
// graph
positionX: child.position.x,
@@ -411,6 +427,9 @@
return;
}
+ mapContainer.scale.set(1);
+ mapContainer.position.set(0, 0);
+
let bounds = sprite.getBounds();
let centerPoint = {
x: bounds.x + bounds.width / 2,
@@ -418,10 +437,10 @@
};
let targetPos = {
- x: app.renderer.width / 2 - centerPoint.x * mapContainer.scale.x,
- y: app.renderer.height / 2 - centerPoint.y * mapContainer.scale.y
+ x: app.renderer.width / 3 - centerPoint.x * mapContainer.scale.x,
+ y: app.renderer.height / 3 - centerPoint.y * mapContainer.scale.y
};
new TWEEDLE.Tween(mapContainer.position).easing(TWEEDLE.Easing.Quadratic.Out)
- .to(targetPos, 200).start();
+ .to(targetPos, 500).start();
}
\ No newline at end of file
--
Gitblit v1.9.1