From 38bcd6306f20787e394347a34e50fcf80b265fc6 Mon Sep 17 00:00:00 2001
From: 陈泽平 <chenzeping>
Date: 星期一, 31 五月 2021 14:53:35 +0800
Subject: [PATCH] 企业应急-事件上报-事发位置问题修改

---
 src/components/base-page/enterprise-emergency/events-reported/ReportLocationPoint.vue |  134 ++++++++++++++++++--------------------------
 1 files changed, 55 insertions(+), 79 deletions(-)

diff --git a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationPoint.vue b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationPoint.vue
index 45d885a..0d4f60e 100644
--- a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationPoint.vue
+++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationPoint.vue
@@ -1,66 +1,45 @@
 <template>
-    <div class="location-lon-and-lat">
-        <!--        <el-row>-->
-        <!--            <el-form :model="lonlatpos" label-width="60px">-->
-        <!--                <el-col :span="12">-->
-        <!--                    <el-form-item label="缁忓害:">-->
-        <!--                        <el-input type="text" v-model="lonlatpos.longPos"></el-input>-->
-        <!--                    </el-form-item>-->
-        <!--                </el-col>-->
-        <!--                <el-col :span="12">-->
-        <!--                    <el-form-item label="绾害:">-->
-        <!--                        <el-input type="text" v-model="lonlatpos.latPos"></el-input>-->
-        <!--                    </el-form-item>-->
-        <!--                </el-col>-->
-        <!--            </el-form>-->
-        <!--            <el-row>-->
-        <!--                <el-col :span="12" style="text-align: center;margin: 5px 0">-->
-        <!--                    <el-button type="primary" size="small" @click="mapPoints">绮剧‘瀹氫綅</el-button>-->
-        <!--                </el-col>-->
-        <!--                <el-col :span="12" style="text-align: center;margin: 5px 0">-->
-        <!--                    <el-button type="primary" size="small" @click="dataPoints">鏁版嵁璇嗗彇</el-button>-->
-        <!--                </el-col>-->
-        <!--            </el-row>-->
-        <!--        </el-row>-->
-        <el-form :model="lonlatpos" label-width="60px">
-            <el-row class="pipe-line-search">
-                <el-col :span="12">
-                    <el-form-item label="缁忓害:">
-                        <el-input v-model="lonlatpos.longPos"></el-input>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="12">
-                    <el-form-item label="绾害:">
-                        <el-input v-model="lonlatpos.latPos"></el-input>
-                    </el-form-item>
-                </el-col>
-            </el-row>
-        </el-form>
-        <el-row>
-            <el-col :span="12" style="text-align: center;margin: 5px 0">
-                <el-button type="primary" size="small" @click="mapPoints">绮剧‘瀹氫綅</el-button>
-            </el-col>
-            <el-col :span="12" style="text-align: center;margin: 5px 0">
-                <el-button type="primary" size="small" @click="dataPoints">鏁版嵁璇嗗彇</el-button>
-            </el-col>
-        </el-row>
-        <el-row class="place-bottom" style="text-align: right;margin: 5px">
-            <el-button type="primary" @click="confirm" size="small">纭</el-button>
-        </el-row>
-    </div>
+  <div class="location-lon-and-lat">
+    <el-form :model="positionLocationForm" label-width="60px">
+      <el-row class="pipe-line-search">
+        <el-col :span="12">
+          <el-form-item label="缁忓害:">
+            <el-input v-model="positionLocationForm.longPos"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="绾害:">
+            <el-input v-model="positionLocationForm.latPos"></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <el-row>
+      <el-col :span="12" style="text-align: center;margin: 5px 0">
+        <el-button type="primary" size="small" @click="mapPoints">绮剧‘瀹氫綅</el-button>
+      </el-col>
+      <el-col :span="12" style="text-align: center;margin: 5px 0">
+        <el-button type="primary" size="small" @click="dataPoints">浣嶇疆鎷惧彇</el-button>
+      </el-col>
+    </el-row>
+    <el-row style="text-align: right;margin: 5px">
+      <el-button type="primary" @click="confirm" size="small">纭</el-button>
+    </el-row>
+  </div>
 </template>
 
 <script>
 import { pulseEffect } from '../../../../utils/utils'
 import iconUrl from '../../../../../public/assets/images/map/marker-icon.png'
 import eventBus from '../../../../eventBus'
+import { publicLocationStore } from './ReportLocation'
 
 export default {
   name: 'ReportLocationPoint',
   data () {
     return {
       // 缁忕含搴﹀畾浣�
-      lonlatpos: {
+      positionLocationForm: {
         longPos: '',
         latPos: ''
       },
@@ -72,8 +51,8 @@
     // 绮剧‘瀹氫綅
     mapPoints () {
       window.map.on('click', (e) => {
-        this.lonlatpos.longPos = parseFloat(e.latlng.lng).toFixed(8)
-        this.lonlatpos.latPos = parseFloat(e.latlng.lat).toFixed(8)
+        this.positionLocationForm.longPos = parseFloat(e.latlng.lng).toFixed(8)
+        this.positionLocationForm.latPos = parseFloat(e.latlng.lat).toFixed(8)
         const as = [e.latlng.lat, e.latlng.lng]
         // console.log(as)
         window.map.setView(as, 17)
@@ -85,17 +64,17 @@
             iconAnchor: [13, 20]
           })
         })
+        // 娣诲姞鐐规暟鎹�
         window.map.addLayer(this.marker)
         this.layersGroupArrList.push(this.marker)
+        // 浜嬩欢缁撴潫 鍏抽棴鐐瑰嚮浜嬩欢
         window.map.off('click')
       })
     },
     // 閫氳繃鏁版嵁瀹氫綅
     dataPoints () {
-      // this.lonlatpos.latPos = ''
-      // this.lonlatpos.longPos = ''
-      if (this.lonlatpos.latPos !== '' && this.lonlatpos.longPos !== '') {
-        const as = [this.lonlatpos.latPos, this.lonlatpos.longPos]
+      if (this.positionLocationForm.latPos !== '' && this.positionLocationForm.longPos !== '') {
+        const as = [this.positionLocationForm.latPos, this.positionLocationForm.longPos]
         window.map.setView(as, 17)
         pulseEffect(as)
         this.marker = window.L.marker(as, {
@@ -113,39 +92,36 @@
     },
     // 鐐瑰嚮纭鎸夐挳浜嬩欢
     confirm () {
+      // 寰幆鏁版嵁 娓呴櫎 鍥惧眰娣诲姞鐨勭偣鏁版嵁
       for (let i = 0; i < this.layersGroupArrList.length; i++) {
         window.map.removeLayer(this.layersGroupArrList[i])
       }
       window.mapManager.clearHighlight()
       // window.map.removeLayer(this.marker)
       eventBus.$emit('location-setChange', true)
-      this.lonlatpos.longPos = ''
-      this.lonlatpos.latPos = ''
+      // 浜嬩欢涓婃姤 浣嶇疆淇℃伅 瀛樺偍鏁版嵁搴�
+      const data = {
+        ID: '',
+        EventID: '',
+        EventPipeline: '',
+        EventPipeSeg: '',
+        EventAffType: '',
+        EventAffCode: '',
+        EventAffPointNum: '',
+        EventPosX: this.positionLocationForm.longPos,
+        EventPosY: this.positionLocationForm.latPos,
+        AcquisitionPeople: '',
+        AcquisitionDate: ''
+      }
+      // 閫氳繃鏂规硶 瀛樺偍鏁版嵁 杩涜 鏁版嵁搴撳瓨鍌ㄦ暟鎹�
+      publicLocationStore(data)
+      // 纭畾鐐规暟鎹� 浣嶇疆淇℃伅 杩涜鏁版嵁 鐨勭疆绌�
+      this.positionLocationForm.longPos = ''
+      this.positionLocationForm.latPos = ''
     }
   }
 }
 </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;
-                }
-            }
-        }
-    }
 </style>

--
Gitblit v1.8.0