From 2174e8350b8281698a69b039f6f58f3514ead913 Mon Sep 17 00:00:00 2001 From: xudan Date: Fri, 5 Sep 2025 13:53:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=9D=A2=E6=9D=BF=EF=BC=8C=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=86=97=E4=BD=99=E9=A2=9C=E8=89=B2=E9=80=89=E9=A1=B9=E5=B9=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A6=81=E8=A1=8C=E8=B7=AF=E7=BA=BF=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/color-config-panel.vue | 67 +++------------------------ src/services/color-config.service.ts | 21 ++------- src/services/editor.service.ts | 6 ++- 3 files changed, 17 insertions(+), 77 deletions(-) diff --git a/src/components/color-config-panel.vue b/src/components/color-config-panel.vue index f68837d..8e8588a 100644 --- a/src/components/color-config-panel.vue +++ b/src/components/color-config-panel.vue @@ -43,31 +43,6 @@ - -
-

路线颜色

-
- - -
-
- - -
-
- - -
-
@@ -126,6 +101,13 @@ @update:modelValue="(value) => updateColor('route.strokeLoaded', { target: { value } })" />
+
+ + +
@@ -171,13 +153,6 @@ @update:modelValue="(value) => updateColor('storage.occupied', { target: { value } })" /> -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
diff --git a/src/services/color-config.service.ts b/src/services/color-config.service.ts index f7a45dc..88d031a 100644 --- a/src/services/color-config.service.ts +++ b/src/services/color-config.service.ts @@ -36,10 +36,9 @@ export interface EditorColorConfig { // 路线颜色 route: { strokeActive: string; - stroke: Record; // 按路线类型索引 - // 空载和载货路线专用颜色 strokeEmpty: string; // 空载路线颜色 strokeLoaded: string; // 载货路线颜色 + strokeForbidden: string; // 禁行路线颜色 }; // 区域颜色 @@ -143,14 +142,9 @@ const DEFAULT_COLORS: EditorColorConfig = { }, route: { strokeActive: '#EBB214', - stroke: { - 0: '#8C8C8C', - 1: '#52C41A', - 2: '#1982F3', - 10: '#E63A3A' - }, - strokeEmpty: '#52C41A', // 空载路线 - 绿色 - strokeLoaded: '#1982F3' // 载货路线 - 蓝色 + strokeEmpty: '#52C41A', // 空载路线 - 绿色 + strokeLoaded: '#1982F3', // 载货路线 - 蓝色 + strokeForbidden: '#E63A3A' // 禁行路线 - 红色 }, area: { strokeActive: '#EBB214', @@ -386,14 +380,9 @@ class ColorConfigService { }, route: { strokeActive: theme.route?.strokeActive || DEFAULT_COLORS.route.strokeActive, - stroke: { - 0: theme.route?.['stroke-0'] || DEFAULT_COLORS.route.stroke[0], - 1: theme.route?.['stroke-1'] || DEFAULT_COLORS.route.stroke[1], - 2: theme.route?.['stroke-2'] || DEFAULT_COLORS.route.stroke[2], - 10: theme.route?.['stroke-10'] || DEFAULT_COLORS.route.stroke[10], - }, strokeEmpty: theme.route?.['stroke-empty'] || DEFAULT_COLORS.route.strokeEmpty, strokeLoaded: theme.route?.['stroke-loaded'] || DEFAULT_COLORS.route.strokeLoaded, + strokeForbidden: theme.route?.['stroke-forbidden'] || DEFAULT_COLORS.route.strokeForbidden, }, area: { strokeActive: theme.area?.strokeActive || DEFAULT_COLORS.area.strokeActive, diff --git a/src/services/editor.service.ts b/src/services/editor.service.ts index deb5a13..baf2adc 100644 --- a/src/services/editor.service.ts +++ b/src/services/editor.service.ts @@ -1751,8 +1751,12 @@ function drawLine(ctx: CanvasRenderingContext2D, pen: MapPen): void { case MapRoutePassType.仅载货可通行: routeColor = colorConfig.getColor('route.strokeLoaded') || get(theme, 'route.stroke-loaded') || ''; break; + case MapRoutePassType.禁行: + routeColor = colorConfig.getColor('route.strokeForbidden') || get(theme, 'route.stroke-forbidden') || ''; + break; default: - routeColor = colorConfig.getColor(`route.stroke.${pass}`) || get(theme, `route.stroke-${pass}`) || ''; + // 无限制路线使用空载路线颜色作为默认 + routeColor = colorConfig.getColor('route.strokeEmpty') || get(theme, 'route.stroke-empty') || ''; break; } }