From c42c548a635e7086f6cffc132625c5c7902b63b5 Mon Sep 17 00:00:00 2001
From: 陈泽平 <chenzeping>
Date: 星期六, 29 五月 2021 11:12:48 +0800
Subject: [PATCH] 企业应急-事件上报-定位修改

---
 src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue |  111 +++----------------------------------------------------
 1 files changed, 6 insertions(+), 105 deletions(-)

diff --git a/src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue b/src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue
index 084d73e..e42ad35 100644
--- a/src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue
+++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue
@@ -8,133 +8,34 @@
                 <ReportLocationSection></ReportLocationSection>
             </el-tab-pane>
             <el-tab-pane label="缁忕含搴﹀畾浣�" name="third">
-                <el-row class="place-box">
-                    <div class="place-left">
-                        <el-form :model="LongLatPos" label-width="90px">
-                            <el-form-item label="缁忓害:">
-                                <el-input v-model="LongLatPos.longPos"></el-input>
-                            </el-form-item>
-                            <el-form-item label="绾害:">
-                                <el-input v-model="LongLatPos.latPos"></el-input>
-                            </el-form-item>
-                        </el-form>
-                    </div>
-                    <div class="place-right">
-                        <el-button type="primary" size="small" @click="mapPoints">鐐瑰嚮瀹氫綅</el-button>
-                        <el-button type="primary" size="small" @click="dataPoints">鏁版嵁瀹氫綅</el-button>
-                    </div>
-                </el-row>
-                <div class="place-bottom" style="text-align: center;margin: 5px">
-                    <el-button type="primary" @click="confirm">纭</el-button>
-                </div>
+                <ReportLocationPoint></ReportLocationPoint>
             </el-tab-pane>
         </el-tabs>
     </div>
 </template>
 
 <script>
-// import eventBus from '../../../../eventBus'
+
 // 绠℃瀹氫綅缁勪欢
 import ReportLocationSection from './ReportLocationSection'
 import ReportLocationSearch from './ReportLocationSearch'
-
-import { pulseEffect } from '../../../../utils/utils'
-
-import iconUrl from '../../../../../public/assets/images/map/loc.png'
+import ReportLocationPoint from './ReportLocationPoint'
 
 export default {
   name: 'ReportLocation',
   components: {
     ReportLocationSearch,
-    ReportLocationSection
+    ReportLocationSection,
+    ReportLocationPoint
   },
   data () {
     return {
       // active tab鍒囨崲
-      activeName: 'first',
-      // 缁忕含搴﹀畾浣�
-      LongLatPos: {
-        longPos: '',
-        latPos: ''
-      }
-    }
-  },
-  methods: {
-    // 鐐瑰嚮瀹氫綅
-    mapPoints () {
-      window.map.on('click', (e) => {
-        this.LongLatPos.longPos = parseFloat(e.latlng.lng).toFixed(6)
-        this.LongLatPos.latPos = parseFloat(e.latlng.lat).toFixed(6)
-        const as = [this.LongLatPos.latPos, this.LongLatPos.longPos]
-        // console.log(as)
-        window.map.setView(as, 17)
-        pulseEffect(as)
-        const marker = window.L.marker(as, {
-          icon: window.L.icon({
-            iconUrl: iconUrl,
-            iconSize: [30, 30],
-            iconAnchor: [15, 15]
-          })
-        })
-        window.map.addLayer(marker)
-        window.map.off('click')
-      })
-    },
-    // 閫氳繃鏁版嵁瀹氫綅
-    dataPoints () {
-      const as = [this.LongLatPos.latPos, this.LongLatPos.longPos]
-      // console.log(as)
-      window.map.setView(as, 17)
-      pulseEffect(as)
-      const marker = window.L.marker(as, {
-        icon: window.L.icon({
-          iconUrl: iconUrl,
-          iconSize: [30, 30],
-          iconAnchor: [15, 15]
-        })
-      })
-      window.map.addLayer(marker)
-      this.LongLatPos.latPos = ''
-      this.LongLatPos.longPos = ''
-    },
-    // 鐐瑰嚮纭鎸夐挳浜嬩欢
-    confirm () {
-      // 閫氳繃瀛愮粍浠跺悜鐖剁粍浠朵紶閫掓暟鎹�
-      this.$emit('locationClick', this.LongLatPos)
-      this.clickLocation = ''
-      this.LongLatPos.longPos = ''
-      this.LongLatPos.latPos = ''
+      activeName: 'first'
     }
   }
 }
 </script>
 
 <style lang="less" scoped>
-    .place-box {
-        display: flex;
-        align-items: center;
-        justify-content: space-around;
-    }
-
-    .place {
-        text-align: center;
-
-        .place-top {
-            display: flex;
-            align-items: center;
-            justify-content: space-around;
-
-            .place-right {
-                .el-button {
-                    margin: 15px;
-                }
-            }
-        }
-
-        .place-bottom {
-            .el-button {
-                /*margin: 15px;*/
-            }
-        }
-    }
 </style>

--
Gitblit v1.8.0