From 8d1d323cc04712dc874e7b58341622abaf21afd7 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Wed, 26 Nov 2025 09:46:35 +0800
Subject: [PATCH] feat:生产环境限制

---
 src/views/layerManagement/index.vue |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/src/views/layerManagement/index.vue b/src/views/layerManagement/index.vue
index 0c56040..c014986 100644
--- a/src/views/layerManagement/index.vue
+++ b/src/views/layerManagement/index.vue
@@ -52,7 +52,7 @@
 import * as Cesium from 'cesium';
 import { PublicCesium } from '@/utils/cesium/publicCesium';
 import _, { cloneDeep, throttle } from 'lodash';
-
+const isProd = import.meta.env.VITE_APP_ENV === 'production'
 import { provide } from 'vue';
 import { useStore } from 'vuex';
 const store = useStore();
@@ -66,20 +66,27 @@
 const selectDataList = ref([]);
 // 当前面位置信息
 let curPolygonPosition = [];
-const tabData = ref([
-  {
-    name: '自定义识别区',
-    type: '0',
-  },
-  {
-    name: '自定义禁飞区',
-    type: '1',
-  },
-  {
-    name: '国土空间规划',
-    type: '2',
-  },
-]);
+const tabData = computed(() => {
+  const allTabs = [
+    {
+      name: '自定义识别区',
+      type: '0',
+    },
+    {
+      name: '自定义禁飞区',
+      type: '1',
+    },
+    {
+      name: '国土空间规划',
+      type: '2',
+    },
+  ];
+  // 如果是生产环境,只返回自定义识别区
+  if (isProd) {
+    return allTabs.filter(tab => tab.type === '0');
+  }
+  return allTabs;
+});
 const layerParams = ref({
   addNest: false,
   editNest: false,

--
Gitblit v1.9.3