From 3449c98a4af9ce62f9dc2d9dc45ed5e1a3fa2230 Mon Sep 17 00:00:00 2001
From: 董国庆 <364620639@qq.com>
Date: 星期四, 25 六月 2026 22:36:53 +0800
Subject: [PATCH] 测试运营工作台不显示场站--626合并到2.0

---
 src/views/testDemo/operationWorkbench/map.vue |   53 +++++++++++++++++++++++++++++++++++------------------
 1 files changed, 35 insertions(+), 18 deletions(-)

diff --git a/src/views/testDemo/operationWorkbench/map.vue b/src/views/testDemo/operationWorkbench/map.vue
index d26fe14..c5286e6 100644
--- a/src/views/testDemo/operationWorkbench/map.vue
+++ b/src/views/testDemo/operationWorkbench/map.vue
@@ -905,8 +905,16 @@
 
 const initialEntryContext = getWorkbenchEntryContext()
 
+function isStationHiddenEntry(tab: WorkbenchTab) {
+  return tab === 'station'
+}
+
+function normalizeVisibleTab(tab: WorkbenchTab) {
+  return isStationHiddenEntry(tab) ? 'point' : tab
+}
+
 // 页面级筛选与面板展示状态。
-const activeTab = ref<WorkbenchTab>(initialEntryContext.tab)
+const activeTab = ref<WorkbenchTab>(normalizeVisibleTab(initialEntryContext.tab))
 const cityValue = ref<string>(initialEntryContext.cityCode)
 const keyword = ref('')
 const leftExpanded = ref(true)
@@ -932,10 +940,18 @@
 const previewImage = ref('')
 const selectShowState = reactive<Record<string, boolean>>({})
 const selectedCreateTool = ref<WorkbenchTab | ''>('')
+const visibleTabOptions = computed(() =>
+  tabOptions.filter(item => item.value !== 'station'),
+)
+const visibleCreateToolOptions = computed(() =>
+  createToolOptions.filter(item => item.value !== 'station'),
+)
 
 const selectedCreateToolOption = computed(() => {
   return (
-    createToolOptions.find(item => item.value === selectedCreateTool.value)
+    visibleCreateToolOptions.value.find(
+      item => item.value === selectedCreateTool.value,
+    )
     || null
   )
 })
@@ -1074,7 +1090,7 @@
   showOperationArea: true,
   showRestrictedArea: true,
   showPoint: true,
-  showStation: true,
+  showStation: false,
 })
 const pointDetailData = ref<Entity.Point | null>(null)
 const pointEditSnapshot = ref<string>('')
@@ -1228,7 +1244,7 @@
 })
 
 const currentTabLabel = computed(
-  () => tabOptions.find(item => item.value === activeTab.value)?.label || '',
+  () => visibleTabOptions.value.find(item => item.value === activeTab.value)?.label || '',
 )
 const currentCityLabel = computed(
   () =>
@@ -4889,9 +4905,9 @@
 }
 
 async function applyWorkbenchEntryPresentation(tab: WorkbenchTab, id: string) {
-  if (!id)
+  if (!id || isStationHiddenEntry(tab))
     return
-  activeTab.value = tab
+  activeTab.value = normalizeVisibleTab(tab)
   if (tab === 'point')
     pointPanelClosed.value = false
   if (tab === 'fence')
@@ -5065,12 +5081,13 @@
     const entryContext = getWorkbenchEntryContext(cityOptions.value)
     const routeQuery = route.query as Record<string, unknown>
     const cityChanged = cityValue.value !== entryContext.cityCode
-    if (activeTab.value !== entryContext.tab)
-      activeTab.value = entryContext.tab
+    const nextVisibleTab = normalizeVisibleTab(entryContext.tab)
+    if (activeTab.value !== nextVisibleTab)
+      activeTab.value = nextVisibleTab
     if (cityChanged)
       cityValue.value = entryContext.cityCode
     pendingWorkbenchType.value = entryContext.type || ''
-    if (entryContext.id) {
+    if (entryContext.id && !isStationHiddenEntry(entryContext.tab)) {
       if (workbenchDataReady.value)
         await applyWorkbenchEntryPresentation(entryContext.tab, entryContext.id)
       else if (selectedId.value !== entryContext.id)
@@ -5079,6 +5096,7 @@
     else if (
       !entryContext.id
       && entryContext.type === 'create'
+      && !isStationHiddenEntry(entryContext.tab)
       && !cityChanged
     ) {
       handleWorkbenchCreateByTab(entryContext.tab)
@@ -8046,9 +8064,11 @@
   workbenchDataReady.value = false
   await Promise.all([loadPointResources(), loadFenceData(), loadStationData()])
   workbenchDataReady.value = true
+  const entryContext = getWorkbenchEntryContext(cityOptions.value)
   if (pendingWorkbenchType.value === 'create') {
     pendingWorkbenchType.value = ''
-    await handleWorkbenchCreateByTab(activeTab.value)
+    if (!isStationHiddenEntry(entryContext.tab))
+      await handleWorkbenchCreateByTab(normalizeVisibleTab(entryContext.tab))
     return
   }
   if (map.value) {
@@ -8056,10 +8076,12 @@
     await nextTick()
     focusSelectedEntity(false)
   }
-  const entryContext = getWorkbenchEntryContext(cityOptions.value)
   if (
+    !isStationHiddenEntry(entryContext.tab)
+    && (
     entryContext.id
     && (entryContext.type === 'detail' || entryContext.type === 'edit')
+    )
   ) {
     await applyWorkbenchEntryPresentation(entryContext.tab, entryContext.id)
   }
@@ -8746,7 +8768,7 @@
 
       <div class="left-panel-tabs">
         <button
-          v-for="tab in tabOptions"
+          v-for="tab in visibleTabOptions"
           :key="tab.value"
           class="tab-btn"
           :class="{ active: activeTab === tab.value }"
@@ -9081,7 +9103,7 @@
               </n-popover>
               <div v-if="showCreateMenu" class="coverage-detail create-detail">
                 <div
-                  v-for="option in createToolOptions"
+                  v-for="option in visibleCreateToolOptions"
                   :key="option.value"
                   class="create-option"
                   :class="{ active: selectedCreateTool === option.value }"
@@ -9146,11 +9168,6 @@
                 <div class="layer-option">
                   <n-checkbox v-model:checked="layerControl.showPoint">
                     点位
-                  </n-checkbox>
-                </div>
-                <div class="layer-option">
-                  <n-checkbox v-model:checked="layerControl.showStation">
-                    场站
                   </n-checkbox>
                 </div>
               </div>

--
Gitblit v1.7.1