瀏覽代碼

地图弹窗

hmm 11 月之前
父節點
當前提交
a3898eeea3

+ 14 - 0
src/api/emergencyCommandMap/JointDuty.ts

@@ -37,3 +37,17 @@ export function getCheckinList(eventId: string) {
     }
   });
 }
+
+// 更新事发地点
+export function updateEventLocation(evevtId: string, address: string, longitude: string, latitude: string) {
+  return request({
+    url: '/api/event_management/event/save_address',
+    method: 'post',
+    params: {
+      eventId: eventId,
+      address: address,
+      longitude: longitude,
+      latitude: latitude
+    }
+  });
+}

+ 10 - 1
src/components/Map/company-map.vue

@@ -77,6 +77,7 @@
 <script setup>
 import AMapLoader from '@amap/amap-jsapi-loader';
 import { useRouter } from 'vue-router';
+import { updateEventLocation } from '@/api/emergencyCommandMap/JointDuty';
 
 const props = defineProps({
   visible: {
@@ -108,6 +109,7 @@ let searchList = ref([]);
 let searchPop = ref(false);
 let placeSearch;
 let form = reactive({
+  eventId: '',
   address: '',
   longitude: '',
   latitude: ''
@@ -281,11 +283,18 @@ function submit() {
       console.log('提交数据', form);
       router.push({
         path: '/emergencyCommandMap',
-        query: { event_id: '11111111' }
+        query: { event_id: eventId.value }
       });
     }
   });
 }
+// 获取event_id
+updateEventLocation().then((res) => {
+  form.event_id = res.data.event_id;
+  form.address = res.data.address;
+  form.latitude = res.data.latitude;
+  form.longitude = res.data.longitude;
+});
 </script>
 
 <style lang="scss" scoped>

+ 0 - 1
src/types/components.d.ts

@@ -99,7 +99,6 @@ declare module 'vue' {
     UserSelect: typeof import('./../components/UserSelect/index.vue')['default']
     VideoContainer: typeof import('./../components/HKVideo/video-container.vue')['default']
     YMap: typeof import('./../components/Map/YMap.vue')['default']
-    YMapold: typeof import('./../components/Map/YMapold.vue')['default']
     YztMap: typeof import('./../components/Map/YztMap/index.vue')['default']
   }
   export interface ComponentCustomProperties {

+ 16 - 0
src/views/emergencyCommandMap/MiddleSection.vue

@@ -1,5 +1,9 @@
 <template>
   <div class="middle-section">
+    <div class="search-button">
+      <el-button type="primary" @click="handleQuery1">备战防御</el-button>
+      <el-button type="primary" @click="handleQuery2">指挥调度</el-button>
+    </div>
     <GlobalMap is-component width="3321" height="2140" />
   </div>
 </template>
@@ -15,6 +19,18 @@ import GlobalMap from '@/views/globalMap/index.vue';
   height: 2140px;
   animation: slideAndFade 1.5s;
 }
+.search-button {
+  position: absolute;
+  top: 240px;
+  left: 3700px;
+  z-index: 10;
+}
+.el-button {
+  width: 360px;
+  height: 100px;
+  padding: 20px 40px;
+  font-size: 48px;
+}
 
 @keyframes slideAndFade {
   0% {

+ 9 - 7
src/views/routineCommandMap/MiddleSection.vue

@@ -4,7 +4,7 @@
       <el-button type="primary" @click="handleQuery1">备战防御</el-button>
       <el-button type="primary" @click="handleQuery2">指挥调度</el-button>
     </div>
-    <company-map v-model:visible="mapDialogVisible" />
+    <company-map v-model:visible="mapDialogVisible" @change="handleMapChange" />
     <GlobalMap is-component width="3894" height="2140" />
   </div>
 </template>
@@ -16,9 +16,10 @@ import { ref } from 'vue';
 import CompanyMap from '@/components/Map/company-map.vue';
 
 const form = ref({
+  eventId: '',
   address: '',
-  lon: '',
-  lat: ''
+  longitude: '',
+  latitude: ''
 });
 const mapDialogVisible = ref(false);
 const handleQuery1 = () => {
@@ -28,11 +29,12 @@ const handleQuery1 = () => {
 const handleQuery2 = () => {
   mapDialogVisible.value = true;
 };
+
 const handleMapChange = (data) => {
-  form.value.drillAddress = data.address;
-  form.value.lon = data.lnglat[0];
-  form.value.lat = data.lnglat[1];
-  mapDialogVisible.value = false;
+  form.value.address = data.address;
+  form.value.longitude = data.longitude[0];
+  form.value.latitude = data.latitude[1];
+  mapDialogVisible.value = true;
 };
 </script>