From 7a050021c88b99cb9ba012ffac6a575b4e41e424 Mon Sep 17 00:00:00 2001
From: husq <931347610@qq.com>
Date: Thu, 14 Sep 2023 15:56:45 +0800
Subject: [PATCH] 恢复demo的高德地图

---
 src/components/GMap.vue                            |   43 ++++++++++-----------
 src/api/http/config.ts                             |    2 
 src/pages/page-web/projects/project_list/index.vue |    6 ++-
 src/pages/page-web/projects/workspace.vue          |   22 +++++-----
 4 files changed, 36 insertions(+), 37 deletions(-)

diff --git a/src/api/http/config.ts b/src/api/http/config.ts
index 315fe75..daa346d 100644
--- a/src/api/http/config.ts
+++ b/src/api/http/config.ts
@@ -34,6 +34,6 @@
 
   // map
   // You can apply on the AMap website.
-  amapKey: 'Please enter the amap key.',
+  amapKey: '5221d3ca929a7bf59c301be186c03791',
 
 }
diff --git a/src/components/GMap.vue b/src/components/GMap.vue
index e5c8775..1a99fcc 100644
--- a/src/components/GMap.vue
+++ b/src/components/GMap.vue
@@ -1,9 +1,7 @@
 <template>
   <div class="g-map-wrapper">
     <!-- 地图区域 -->
-    <div id="g-container" :style="{ width: '100%', height: '100%' }" >
-    <Cesium />
-    </div>
+    <div id="g-container" :style="{ width: '100%', height: '100%' }" />
     <!-- 绘制面板 -->
     <div
       class="g-action-panel"
@@ -23,7 +21,7 @@
       </div>
     </div>
     <!-- 飞机OSD -->
-    <!-- <div v-if="osdVisible.visible && !osdVisible.is_dock" class="osd-panel fz12">
+    <div v-if="osdVisible.visible && !osdVisible.is_dock" class="osd-panel fz12">
       <div class="pl5 pr5 flex-align-center flex-row flex-justify-between" style="border-bottom: 1px solid #515151; height: 18%;">
         <span>{{ osdVisible.callsign }}</span>
         <span><a class="fz16" style="color: white;" @click="() => osdVisible.visible = false"><CloseOutlined /></a></span>
@@ -141,15 +139,15 @@
           {{ 10 > (deviceInfo.device.battery.remain_flight_time % 60) ? '0' : ''}}{{deviceInfo.device.battery.remain_flight_time % 60 }}
         </div>
       </div>
-    </div> -->
+    </div>
     <!-- 机场OSD -->
-    <!-- <div v-if="osdVisible.visible && osdVisible.is_dock" class="osd-panel fz12">
+    <div v-if="osdVisible.visible && osdVisible.is_dock" class="osd-panel fz12">
       <div class="fz16 pl5 pr5 flex-align-center flex-row flex-justify-between" style="border-bottom: 1px solid #515151; height: 10%;">
         <span>{{ osdVisible.gateway_callsign }}</span>
         <span><a style="color: white;" @click="() => osdVisible.visible = false"><CloseOutlined /></a></span>
       </div>
-        < 机场 -->
-      <!-- <div class ="flex-display" style="border-bottom: 1px solid #515151;">
+        <!-- 机场 -->
+      <div class ="flex-display" style="border-bottom: 1px solid #515151;">
         <div class="flex-column flex-align-stretch flex-justify-center" style="width: 60px; background: #2d2d2d;">
           <a-tooltip :title="osdVisible.model">
             <div class="flex-column  flex-align-center flex-justify-center" style="width: 90%;">
@@ -280,13 +278,13 @@
                 </a-button>
               </a-col>
             </a-row>
-            <!机场控制面板 -->
-            <!-- <DockControlPanel v-if="dockControlPanelVisible" :sn="osdVisible.gateway_sn"  :deviceInfo="deviceInfo" @close-control-panel="onCloseControlPanel"> -->
-            <!-- </DockControlPanel> -->
-        <!-- </div> -->
-      <!-- </div> -->
+            <!-- 机场控制面板 -->
+            <DockControlPanel v-if="dockControlPanelVisible" :sn="osdVisible.gateway_sn"  :deviceInfo="deviceInfo" @close-control-panel="onCloseControlPanel">
+            </DockControlPanel>
+        </div>
+      </div>
       <!--  飞机-->
-      <!-- <div class ="flex-display">
+      <div class ="flex-display">
         <div class="flex-column flex-align-stretch flex-justify-center" style="width: 60px;  background: #2d2d2d;">
           <a-tooltip :title="osdVisible.model">
             <div style="width: 90%;" class="flex-column flex-align-center flex-justify-center">
@@ -400,9 +398,9 @@
               </a-col>
             </a-row>
         </div>
-      </div> -->
-      <!-- <div class="battery-slide" v-if="deviceInfo.device && deviceInfo.device.battery.remain_flight_time !== 0" style="border: 1px solid red"> -->
-        <!-- <div style="background: #535759;" class="width-100"></div>
+      </div>
+      <div class="battery-slide" v-if="deviceInfo.device && deviceInfo.device.battery.remain_flight_time !== 0" style="border: 1px solid red">
+        <div style="background: #535759;" class="width-100"></div>
         <div class="capacity-percent" :style="{ width: deviceInfo.device.battery.capacity_percent + '%'}"></div>
         <div class="return-home" :style="{ width: deviceInfo.device.battery.return_home_power + '%'}"></div>
         <div class="landing" :style="{ width: deviceInfo.device.battery.landing_power + '%'}"></div>
@@ -410,11 +408,11 @@
         <div class="battery" :style="{ left: deviceInfo.device.battery.capacity_percent + '%' }">
           {{ Math.floor(deviceInfo.device.battery.remain_flight_time / 60) }}:
           {{ 10 > (deviceInfo.device.battery.remain_flight_time % 60) ? '0' : ''}}{{deviceInfo.device.battery.remain_flight_time % 60 }}
-        </div> -->
-      <!-- </div> -->
+        </div>
+      </div>
       <!-- 飞行指令 -->
-      <!-- <DroneControlPanel :sn="osdVisible.gateway_sn" :deviceInfo="deviceInfo" :payloads="osdVisible.payloads"></DroneControlPanel> -->
-    <!-- </div> -->
+      <DroneControlPanel :sn="osdVisible.gateway_sn" :deviceInfo="deviceInfo" :payloads="osdVisible.payloads"></DroneControlPanel>
+    </div>
   </div>
 </template>
 
@@ -425,7 +423,6 @@
   generatePointContent,
   generatePolyContent
 } from '../utils/map-layer-utils'
-import Cesium from './cesiumMap/cesium.vue'
 import { postElementsReq } from '/@/api/layer'
 import { MapDoodleType, MapElementEnum } from '/@/constants/map'
 import { useGMapManage } from '/@/hooks/use-g-map'
@@ -847,7 +844,7 @@
 
   .g-action-panel {
     position: absolute;
-    top: 32px;
+    top: 16px;
     right: 16px;
     .g-action-item {
       width: 28px;
diff --git a/src/pages/page-web/projects/project_list/index.vue b/src/pages/page-web/projects/project_list/index.vue
index 43c5940..ac8b103 100644
--- a/src/pages/page-web/projects/project_list/index.vue
+++ b/src/pages/page-web/projects/project_list/index.vue
@@ -5,7 +5,8 @@
         </div>
         <div class="right_content">
             <div class="map">
-                <Map />
+                <!-- <Map /> -->
+                <GMap />
             </div>
             <div class="media-wrapper" v-if="root.$route.name === ERouterName.MEDIA">
                 <MediaPanel />
@@ -18,7 +19,8 @@
 </template>
 
 <script setup lang="ts">
-import Map from '/@/components/cesiumMap/cesium.vue'
+// import Map from '/@/components/cesiumMap/cesium.vue'
+import GMap from '/@/components/GMap.vue'
 import MediaPanel from '/@/components/MediaPanel.vue'
 import TaskPanel from '/@/components/task/TaskPanel.vue'
 import { EBizCode, ERouterName } from '/@/types'
diff --git a/src/pages/page-web/projects/workspace.vue b/src/pages/page-web/projects/workspace.vue
index 5ad885b..5dbff55 100644
--- a/src/pages/page-web/projects/workspace.vue
+++ b/src/pages/page-web/projects/workspace.vue
@@ -6,17 +6,17 @@
         <router-view />
       </div>
     </div>
-    <!-- <div class="right"> -->
-      <!-- <div class="map-wrapper">
+    <!-- <div class="right">
+      <div class="map-wrapper">
         <GMap />
-      </div> -->
-      <!-- <div class="media-wrapper" v-if="root.$route.name === ERouterName.MEDIA"> -->
-        <!-- <MediaPanel /> -->
-      <!-- </div> -->
-      <!-- <div class="task-wrapper" v-if="root.$route.name === ERouterName.TASK"> -->
-        <!-- <TaskPanel /> -->
-      <!-- </div> -->
-    <!-- </div> -->
+      </div>
+      <div class="media-wrapper" v-if="root.$route.name === ERouterName.MEDIA">
+        <MediaPanel />
+      </div>
+      <div class="task-wrapper" v-if="root.$route.name === ERouterName.TASK">
+        <TaskPanel />
+       </div>
+    </div> -->
   </div>
 </template>
 <script lang="ts" setup>
@@ -145,7 +145,7 @@
     flex-grow: 1;
     position: relative;
 
-    .map-wrapper{
+    .map-wrapper {
       width: 100%;
       height: 100%;
     }

--
Gitblit v1.9.3