From 9b0aea677dad78de73311316b6803a2397c35467 Mon Sep 17 00:00:00 2001 From: chndfang Date: Sun, 8 Jun 2025 22:32:52 +0800 Subject: [PATCH] feat: change point coordinate to center --- README.md | 7 ++--- src/apis/robot/type.ts | 4 ++- src/components/card/point-detail-card.vue | 10 ++++-- src/components/card/point-edit-card.vue | 12 +++---- src/services/editor.service.ts | 38 +++++++++++++++++------ 5 files changed, 47 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 8cf5057..e40cc3e 100644 --- a/README.md +++ b/README.md @@ -142,10 +142,7 @@ RobotRealtimeInfo [JSON] "y": 500, "active": true, "angle": -90, - "path": [ - [600, 500], - [100, 400] - ] + "path": [] } ``` @@ -397,7 +394,7 @@ export interface RobotRealtimeInfo extends RobotInfo { y: number; // 坐标y active?: boolean; // 是否运行 angle?: number; // 旋转角度 - path?: Array<[number, number]>; // 规划路径 + path?: Array<{ x: number; y: number }>; // 规划路径 } enum RobotBrand { diff --git a/src/apis/robot/type.ts b/src/apis/robot/type.ts index eecef87..6b72641 100644 --- a/src/apis/robot/type.ts +++ b/src/apis/robot/type.ts @@ -1,3 +1,5 @@ +import type { Point } from '@api/map'; + import type { RobotBrand, RobotState, RobotType } from './constant'; export interface RobotGroup { @@ -38,5 +40,5 @@ export interface RobotRealtimeInfo extends RobotInfo { y: number; // 坐标y active?: boolean; // 是否运行 angle?: number; // 旋转角度 - path?: Array<[number, number]>; // 规划路径 + path?: Array; // 规划路径 } diff --git a/src/components/card/point-detail-card.vue b/src/components/card/point-detail-card.vue index a8f4282..5849a73 100644 --- a/src/components/card/point-detail-card.vue +++ b/src/components/card/point-detail-card.vue @@ -1,7 +1,8 @@