From 1c38b4e3dc3d029337daa39b1ced09a39075f240 Mon Sep 17 00:00:00 2001 From: xudan Date: Fri, 10 Oct 2025 17:01:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E5=9C=B0=E5=9B=BE=E5=92=8C?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E6=8E=A5=E5=8F=A3=E4=B8=AD=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E9=80=9F=E5=BA=A6=E5=B1=9E=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E5=9C=A8=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=9C=80=E5=A4=A7=E9=80=9F=E5=BA=A6=E7=9A=84?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=92=8C=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/map/type.ts | 1 + src/apis/scene/type.ts | 1 + src/components/card/route-detail-card.vue | 4 ++++ src/components/card/route-edit-card.vue | 22 ++++++++++++++++++++++ src/services/editor.service.ts | 6 ++++-- 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/apis/map/type.ts b/src/apis/map/type.ts index 049cc41..76f049d 100644 --- a/src/apis/map/type.ts +++ b/src/apis/map/type.ts @@ -43,6 +43,7 @@ export interface MapRouteInfo { type: MapRouteType; // 线路类型 direction?: -1 | 1; // 方向 pass?: MapRoutePassType; // 可通行类型 + maxSpeed?: number; // 最大速度 c1?: Point; // 控制点1 c2?: Point; // 控制点2 } diff --git a/src/apis/scene/type.ts b/src/apis/scene/type.ts index 230b53c..506ba44 100644 --- a/src/apis/scene/type.ts +++ b/src/apis/scene/type.ts @@ -59,6 +59,7 @@ export interface StandardSceneRoute { to: string; // 终点点位id type: 'line' | 'bezier2' | 'bezier3'; // 线路类型 pass?: number; // 可通行类型 + maxSpeed?: number; // 最大速度 c1?: { x?: number; y?: number }; // 控制点1 c2?: { x?: number; y?: number }; // 控制点2 config?: object; // 其它属性配置(可按需增加) diff --git a/src/components/card/route-detail-card.vue b/src/components/card/route-detail-card.vue index d406090..2283f4e 100644 --- a/src/components/card/route-detail-card.vue +++ b/src/components/card/route-detail-card.vue @@ -48,6 +48,10 @@ const label = computed(() => editor.value.getRouteLabel(pen.value?.id)); {{ $t('路段长度') }} {{ pen.length?.toFixed() }} + + {{ $t('最大速度(m/s)') }} + {{ route.maxSpeed }} + {{ $t('路段方向') }} diff --git a/src/components/card/route-edit-card.vue b/src/components/card/route-edit-card.vue index 2116eae..48bae5b 100644 --- a/src/components/card/route-edit-card.vue +++ b/src/components/card/route-edit-card.vue @@ -78,6 +78,12 @@ function handlePassChange(pass: any) { editor.value.updateRoute(props.id, { pass: Number(pass) as MapRoutePassType }); } +// 处理最大速度变化 +function handleMaxSpeedChange(maxSpeed: any) { + if (!props.id) return; + editor.value.updateRoute(props.id, { maxSpeed: Number(maxSpeed) }); +} +