From ce66da772efc825de3001fed13c2032e3c30e01a Mon Sep 17 00:00:00 2001 From: 18086616529 <344820985@qq.com> Date: Fri, 26 Jun 2026 09:23:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9C=B0=E5=9B=BE=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E4=B8=AD=E7=9A=84=E5=AD=97=E6=AE=B5=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dashboard/DashboardShortcutCatalog.cs | 20 +- .../Dashboard/DashboardShortcutService.cs | 36 +- .../map-editor/EditPropertyPanel.vue | 356 ++++++++++++++---- .../composables/useDashboardQuickEntries.ts | 28 +- .../src/composables/useSimpleFieldCatalog.ts | 98 +++++ .../simple-platform-vue/src/config/navMenu.ts | 10 +- .../src/config/quickEntries.ts | 35 +- .../src/views/admin/DashboardView.vue | 5 +- .../src/views/admin/MapEditorView.vue | 110 ++++-- .../src/views/admin/config/LocationView.vue | 39 ++ 10 files changed, 598 insertions(+), 139 deletions(-) create mode 100644 frontends/apps/simple-platform-vue/src/composables/useSimpleFieldCatalog.ts create mode 100644 frontends/apps/simple-platform-vue/src/views/admin/config/LocationView.vue diff --git a/MiGu.Server/Dashboard/DashboardShortcutCatalog.cs b/MiGu.Server/Dashboard/DashboardShortcutCatalog.cs index fe38d76..2e01644 100644 --- a/MiGu.Server/Dashboard/DashboardShortcutCatalog.cs +++ b/MiGu.Server/Dashboard/DashboardShortcutCatalog.cs @@ -59,11 +59,25 @@ public static class DashboardShortcutCatalog public static readonly int MaxKeysPerUser = 16; + /// Platform 域固定保留、不可删除的快捷入口。 + public static readonly IReadOnlyList MandatoryPlatformKeys = + [ + "admin-maps", + "admin-map-editor", + "admin-cars", + "admin-map-monitor", + "admin-vehicle-hub", + "admin-task-templates" + ]; + public static readonly IReadOnlyList DefaultPlatformKeys = [ + "admin-maps", "admin-map-editor", - "admin-task-templates", "admin-cars", + "admin-map-monitor", + "admin-vehicle-hub", + "admin-task-templates", "admin-config-system-center", "admin-config-ops-center", "admin-config-strategy" @@ -96,4 +110,8 @@ public static class DashboardShortcutCatalog public static string NormalizeKey(string key) => LegacyKeyAliases.TryGetValue(key.Trim(), out var canon) ? canon : key.Trim(); + + public static bool IsMandatoryKey(string key, string scope) => + string.Equals(scope, PageCatalog.ScopePlatform, StringComparison.OrdinalIgnoreCase) + && MandatoryPlatformKeys.Contains(NormalizeKey(key), StringComparer.OrdinalIgnoreCase); } diff --git a/MiGu.Server/Dashboard/DashboardShortcutService.cs b/MiGu.Server/Dashboard/DashboardShortcutService.cs index 583cdb2..7e3f668 100644 --- a/MiGu.Server/Dashboard/DashboardShortcutService.cs +++ b/MiGu.Server/Dashboard/DashboardShortcutService.cs @@ -34,14 +34,17 @@ public sealed class DashboardShortcutService if (row == null) { - var defaults = FilterKeys(DashboardShortcutCatalog.DefaultKeysForScope(scope), scope, allowed); + var defaults = EnsureMandatoryKeys( + FilterKeys(DashboardShortcutCatalog.DefaultKeysForScope(scope), scope, allowed), + scope, allowed); return new QuickEntriesResult( defaults.Take(DashboardShortcutCatalog.MaxKeysPerUser).ToList(), UsingDefaults: true); } var keys = ParseKeys(row.KeysJson); - var filtered = FilterKeys(keys, scope, allowed) + var filtered = EnsureMandatoryKeys( + FilterKeys(keys, scope, allowed), scope, allowed) .Take(DashboardShortcutCatalog.MaxKeysPerUser) .ToList(); return new QuickEntriesResult(filtered, UsingDefaults: false); @@ -52,7 +55,8 @@ public sealed class DashboardShortcutService { scope = NormalizeScope(scope); var allowed = AllowedPages(userId, scope); - var sanitized = FilterKeys(Deduplicate(keys ?? []), scope, allowed); + var sanitized = EnsureMandatoryKeys( + FilterKeys(Deduplicate(keys ?? []), scope, allowed), scope, allowed); if (sanitized.Count > DashboardShortcutCatalog.MaxKeysPerUser) sanitized = sanitized.Take(DashboardShortcutCatalog.MaxKeysPerUser).ToList(); @@ -114,6 +118,32 @@ public sealed class DashboardShortcutService return outKeys; } + private static List EnsureMandatoryKeys( + List keys, string scope, HashSet allowedPages) + { + if (!string.Equals(scope, PageCatalog.ScopePlatform, StringComparison.OrdinalIgnoreCase)) + return keys; + + var result = new List(); + var seen = new HashSet(StringComparer.OrdinalIgnoreCase); + + foreach (var raw in DashboardShortcutCatalog.MandatoryPlatformKeys) + { + var key = DashboardShortcutCatalog.NormalizeKey(raw); + if (!DashboardShortcutCatalog.IsValidKey(key)) continue; + var pageKey = DashboardShortcutCatalog.PageKeyFor(key); + if (!allowedPages.Contains(pageKey)) continue; + if (seen.Add(key)) result.Add(key); + } + + foreach (var key in keys) + { + if (seen.Add(key)) result.Add(key); + } + + return result; + } + private static List Deduplicate(IReadOnlyList keys) { var seen = new HashSet(StringComparer.OrdinalIgnoreCase); diff --git a/frontends/apps/simple-platform-vue/src/components/map-editor/EditPropertyPanel.vue b/frontends/apps/simple-platform-vue/src/components/map-editor/EditPropertyPanel.vue index 5c62f3b..bd5fd5b 100644 --- a/frontends/apps/simple-platform-vue/src/components/map-editor/EditPropertyPanel.vue +++ b/frontends/apps/simple-platform-vue/src/components/map-editor/EditPropertyPanel.vue @@ -76,6 +76,16 @@ + +
+ + +
@@ -114,68 +124,80 @@ - -
+ +
- 样式 / 外观 - {{ styleFields.length }} 项 + 扩展字段 + {{ customFieldRows.length }} 项
-
-
- - - - -
-
-
- -
-
- 其它字段 / 自定义 - {{ otherFields.length }} 项 -
-
-
- -
- - +
加载字段定义…
+
+ + + + + + +
@@ -427,8 +449,10 @@