haodingding 1 年間 前
コミット
10176ebd8c

+ 294 - 121
src/views/system/device/index.vue

@@ -83,7 +83,7 @@
             <el-dropdown-menu slot="dropdown">
               <el-dropdown-item command="settingOpen">设备设置</el-dropdown-item>
               <el-dropdown-item command="healthInterval">健康阈值设置</el-dropdown-item>
-              <el-dropdown-item command="fence">电子围栏</el-dropdown-item>
+              <el-dropdown-item command="fenceOpen">电子围栏</el-dropdown-item>
               <el-dropdown-item command="health">健康指标</el-dropdown-item>
               <el-dropdown-item command="deviceLog">设备消息日志</el-dropdown-item>
               <!-- <el-dropdown-item command="settingLog">设置日志</el-dropdown-item> -->
@@ -558,38 +558,56 @@
       <pagination v-show="logTotal > 0" :total="logTotal" :page.sync="logQuery.pageNum" :limit.sync="logQuery.pageSize"
         @pagination="getDeviceLog" />
     </el-dialog>
-    <el-dialog title="电子围栏" :visible.sync="fence" width="1200px" :before-close="beforeClose" destroy-on-close>
+    <el-dialog title="电子围栏" :visible.sync="fenceOpen" width="1200px" :before-close="beforeClose" destroy-on-close :close-on-click-modal="false">
       <div id="map">
         <el-row class="map-tool">
-          <el-select size="mini" v-model="fenceType">
-            <el-option :label="1" :value="1">123</el-option>
+          <el-select size="mini" v-model="fenceName" @change="selectFence">
+            <el-option v-for="(item, index) in fenceList" :key="index" :label="item.fenceName"
+              :value="item.fenceName"></el-option>
           </el-select>
-          <el-button size="mini" type="primary" style="margin-left: 10px;">新增</el-button>
-          <el-button size="mini" type="warning">修改</el-button>
+          <el-button size="mini" type="primary" style="margin-left: 10px;" @click="editAdd">新增</el-button>
+          <el-button size="mini" type="warning" @click="editUpdate">修改</el-button>
           <el-button size="mini" type="danger">删除</el-button>
         </el-row>
-        <el-form class="update-tool" :model="fenceInfo" label-width="70px" size="mini">
+        <el-form class="update-tool" :model="fenceInfo" label-width="70px" size="mini" v-show="fenceEdit">
           <el-form-item label="围栏名称">
-            <el-input size="mini"></el-input>
+            <el-input size="mini" v-model="fenceInfo.fenceName"></el-input>
           </el-form-item>
           <el-form-item label="开始时间">
-            <el-input size="mini"></el-input>
+            <el-time-picker v-model="fenceInfo.start_time" value-format="HH:mm" placeholder="选择日期时间">
+            </el-time-picker>
           </el-form-item>
           <el-form-item label="结束时间">
-            <el-input size="mini"></el-input>
+            <el-time-picker v-model="fenceInfo.end_time" :picker-options="{ minTime: fenceInfo.startTime }"
+              value-format="HH:mm" placeholder="选择日期时间">
+            </el-time-picker>
           </el-form-item>
           <el-form-item label="围栏类型">
-            <el-input size="mini"></el-input>
+            <el-select v-model="fenceInfo.type">
+              <el-option v-for="i in fenceType" :key="i.dictValue" :value="i.dictValue" :label="i.dictLabel"></el-option>
+            </el-select>
           </el-form-item>
           <el-form-item label="是否开启">
-            <el-input size="mini"></el-input>
+            <el-select v-model="fenceInfo.state">
+              <el-option :value="1" label="是"></el-option>
+              <el-option :value="0" label="否"></el-option>
+            </el-select>
           </el-form-item>
         </el-form>
-        <el-row class="edit">
-          <el-button class="edit-btn" size="small" type="primary">圆形</el-button>
-          <el-button class="edit-btn" size="small" type="primary">重新绘制</el-button>
-          <el-button class="edit-btn" size="small" type="primary">取消绘制</el-button>
-          <el-button class="edit-btn" size="small" type="primary">提交</el-button>
+        <el-row class="edit" v-show="fenceEdit">
+          <el-dropdown size="small" trigger="click" style="margin-right: 10px;" @command="switchFenceType">
+            <el-button type="primary" size="small">
+              {{ fenceBtn }}<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item command="circle">圆形</el-dropdown-item>
+              <!-- <el-dropdown-item command="rect">矩形</el-dropdown-item> -->
+              <el-dropdown-item command="polygon">多边形</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+          <el-button class="edit-btn" size="small" type="primary" @click="switchFenceType('circle')">重新绘制</el-button>
+          <el-button class="edit-btn" size="small" type="primary" @click="editCancel">取消绘制</el-button>
+          <el-button class="edit-btn" size="small" type="primary" @click="subFence">提交</el-button>
         </el-row>
       </div>
     </el-dialog>
@@ -635,7 +653,8 @@ import {
   getStepRate,
   getRollRate,
   getDeviceLog,
-  setDeviceInterval
+  setDeviceInterval,
+  addFence
 }
   from "@/api/system/device";
 import { listProfile, getProfile } from "@/api/system/profile";
@@ -748,9 +767,9 @@ export default {
       health: false,
       tab: 0,
       map: null,
-      fence: false,
+      fenceOpen: false,
       fenceInfo: {},
-      fenceType: 0,
+      fenceName: null,
       echartsQuery: {
         device_id_code: null,
         pageNum: 1,
@@ -785,7 +804,16 @@ export default {
         shouhuan_oxygen_min: null,
         shouhuan_body_max: null,
         shouhuan_body_min: null
-      }
+      },
+      fenceEdit: false,
+      fenceType: [],
+      fenceBtn: '圆形',
+      fence: null,
+      fenceEditor: null,
+      fenceData: {},
+      fenceList: [],
+      fenceName: null,
+      add_flag: true
     };
   },
   created() {
@@ -812,6 +840,9 @@ export default {
     this.getDicts('sys_user_type').then(res => {
       this.clientType = res.data
     })
+    this.getDicts('sys_fence_type').then(res => {
+      this.fenceType = res.data
+    })
   },
   watch: {
     'form.grantType': {
@@ -848,21 +879,23 @@ export default {
     closeInterval() {
       this.healthInterval = false
       this.deviceInterval = {
-            shouhuan_heart_max: null,
-            shouhuan_heart_min: null,
-            shouhuan_blood_high_max: null,
-            shouhuan_blood_high_min: null,
-            shouhuan_blood_low_max: null,
-            shouhuan_blood_low_min: null,
-            shouhuan_oxygen_max: null,
-            shouhuan_oxygen_min: null,
-            shouhuan_body_max: null,
-            shouhuan_body_min: null
-          }
+        shouhuan_heart_max: null,
+        shouhuan_heart_min: null,
+        shouhuan_blood_high_max: null,
+        shouhuan_blood_high_min: null,
+        shouhuan_blood_low_max: null,
+        shouhuan_blood_low_min: null,
+        shouhuan_oxygen_max: null,
+        shouhuan_oxygen_min: null,
+        shouhuan_body_max: null,
+        shouhuan_body_min: null
+      }
+    },
+    selectSetting(e) {
+      this.settingPage = e
     },
     async setDeviceInfo() {
-      let flag = 0
-      if (Object.keys(this.sosForm).length) {
+      if (Object.keys(this.sosForm).length && this.settingPage == 'sos') {
         let arr = []
         arr.push(this.sosForm.tel1)
         arr.push(this.sosForm.tel2)
@@ -873,25 +906,19 @@ export default {
         obj.param = { tels: arr }
         await axios({
           method: 'POST',
-          url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
+          url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
           headers: {
             Authorization: getToken(),
           },
           data: obj,
         }).then(res => {
           if (res.data && res.data.code == 200) {
-            if (flag == 2) {
-              return
-            } else {
-              flag = 1
-            }
+            this.$modal.msgSuccess('设置成功')
           } else {
             this.$modal.msgError('SOS设置失败')
-            flag = 2
           }
         })
-      }
-      if (Object.keys(this.intervalForm).length) {
+      } else if (Object.keys(this.intervalForm).length && this.settingPage == 'sos') {
         let obj = {}
         obj.facility_id = this.setUser.fid
         obj.device_id_code = this.setUser.deviceId
@@ -899,25 +926,19 @@ export default {
         obj.param = this.intervalForm
         await axios({
           method: 'POST',
-          url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
+          url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
           headers: {
             Authorization: getToken(),
           },
           data: obj,
         }).then(res => {
           if (res.data && res.data.code == 200) {
-            if (flag == 2) {
-              return
-            } else {
-              flag = 1
-            }
+            this.$modal.msgSuccess('设置成功')
           } else {
             this.$modal.msgError('测量间隔设置失败')
-            flag = 2
           }
         })
-      }
-      if (Object.keys(this.pedoForm).length) {
+      } else if (Object.keys(this.pedoForm).length && this.settingPage == 'sos') {
         let is_open = this.pedoForm.isopen ? 1 : 0
         let obj = {}
         obj.facility_id = this.setUser.fid
@@ -926,25 +947,19 @@ export default {
         obj.param = { is_open: is_open }
         await axios({
           method: 'POST',
-          url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
+          url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
           headers: {
             Authorization: getToken(),
           },
           data: obj,
         }).then(res => {
           if (res.data && res.data.code == 200) {
-            if (flag == 2) {
-              return
-            } else {
-              flag = 1
-            }
+            this.$modal.msgSuccess('设置成功')
           } else {
             this.$modal.msgError('计步设置失败')
-            flag = 2
           }
         })
-      }
-      if (Object.keys(this.telForm).length) {
+      } else if (Object.keys(this.telForm).length && this.settingPage == 'sos') {
         let arr = []
         if (this.telForm.tel1 && this.telForm.name1) {
           arr.push({ telno: this.telForm.tel1, name: this.telForm.name1 })
@@ -962,25 +977,19 @@ export default {
         obj.param = arr
         await axios({
           method: 'POST',
-          url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
+          url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
           headers: {
             Authorization: getToken(),
           },
           data: obj,
         }).then(res => {
           if (res.data && res.data.code == 200) {
-            if (flag == 2) {
-
-            } else {
-              flag = 1
-            }
+            this.$modal.msgSuccess('设置成功')
           } else {
             this.$modal.msgError('通讯录设置失败')
-            flag = 2
           }
         })
-      }
-      if (Object.keys(this.onoffForm).length) {
+      } else if (Object.keys(this.onoffForm).length && this.settingPage == 'sos') {
         this.onoffForm.is_open = this.onoffForm.is_open ? 1 : 0
         let obj = {}
         obj.facility_id = this.setUser.fid
@@ -989,25 +998,19 @@ export default {
         obj.param = this.onoffForm
         await axios({
           method: 'POST',
-          url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
+          url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
           headers: {
             Authorization: getToken(),
           },
           data: obj,
         }).then(res => {
           if (res.data && res.data.code == 200) {
-            if (flag == 2) {
-
-            } else {
-              flag = 1
-            }
+            this.$modal.msgSuccess('设置成功')
           } else {
             this.$modal.msgError('定时开关机设置失败')
-            flag = 2
           }
         })
-      }
-      if (Object.keys(this.wearForm).length) {
+      } else if (Object.keys(this.wearForm).length && this.settingPage == 'sos') {
         this.wearForm.is_open = this.wearForm.is_open ? 1 : 0
         let obj = {}
         obj.facility_id = this.setUser.fid
@@ -1016,25 +1019,19 @@ export default {
         obj.param = this.wearForm
         await axios({
           method: 'POST',
-          url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
+          url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
           headers: {
             Authorization: getToken(),
           },
           data: obj,
         }).then(res => {
           if (res.data && res.data.code == 200) {
-            if (flag == 2) {
-
-            } else {
-              flag = 1
-            }
+            this.$modal.msgSuccess('设置成功')
           } else {
             this.$modal.msgError('定时开关机设置失败')
-            flag = 2
           }
         })
-      }
-      if (this.clockList.length) {
+      } else if (this.clockList.length && this.settingPage == 'sos') {
         this.clockList.map(item => {
           if (item.weeks.length) {
             item.type = 3
@@ -1049,25 +1046,19 @@ export default {
         obj.param = this.clockList
         await axios({
           method: 'POST',
-          url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
+          url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
           headers: {
             Authorization: getToken(),
           },
           data: obj,
         }).then(res => {
           if (res.data && res.data.code == 200) {
-            if (flag == 2) {
-
-            } else {
-              flag = 1
-            }
+            this.$modal.msgSuccess('设置成功')
           } else {
             this.$modal.msgError('闹钟设置失败')
-            flag = 2
           }
         })
-      }
-      if (Object.keys(this.fallForm).length) {
+      } else if (Object.keys(this.fallForm).length && this.settingPage == 'sos') {
         this.fallForm.is_open = this.onoffForm.is_open ? 1 : 0
         let obj = {}
         obj.facility_id = this.setUser.fid
@@ -1076,28 +1067,19 @@ export default {
         obj.param = this.fallForm
         await axios({
           method: 'POST',
-          url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
+          url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
           headers: {
             Authorization: getToken(),
           },
           data: obj,
         }).then(res => {
           if (res.data && res.data.code == 200) {
-            if (flag == 2) {
-
-            } else {
-              flag = 1
-            }
+            this.$modal.msgSuccess('设置成功')
           } else {
             this.$modal.msgError('跌倒提醒设置失败')
-            flag = 2
           }
         })
       }
-      if (flag == 1) {
-        this.$modal.msgSuccess('设置成功')
-        this.settingOpen = false
-      }
     },
     resetDeviceInfo() {
       this.sosForm = {}
@@ -1369,23 +1351,216 @@ export default {
         })
       }
     },
+    subFence() {
+      this.fenceEditor.close()
+      if (this.add_flag) {
+        this.fenceInfo.deviceid = this.setUser.deviceId
+        console.log(this.fenceInfo);
+        // addFence(this.fenceInfo).then(res => {
+
+        // })
+        this.fenceList.push(this.fenceInfo)
+      } else {
+        this.fenceList.map(item => {
+          if (item.fenceName == this.fenceInfo.fenceName) {
+            item = this.fenceInfo
+          }
+        })
+      }
+      this.fenceEdit = false
+    },
+    switchFenceType(e) {
+      if (e == 'circle') {
+        if (this.fence) {
+          this.fenceEditor.close()
+          this.map.remove(this.fence)
+        }
+        this.fenceBtn = '圆形'
+        this.fenceInfo.geofence_type = 0
+        let radius = 500
+        let lnglat = this.map.getCenter()
+        this.fence = new AMap.Circle({
+          center: lnglat,
+          radius: radius, //半径
+          borderWeight: 3,
+          fillOpacity: 0.4,
+          strokeStyle: 'dashed',
+          strokeDasharray: [10, 10],
+          // 线样式还支持 'dashed'
+          fillColor: '#1791fc',
+          zIndex: 50,
+        })
+        this.map.add(this.fence);
+        // 缩放地图到合适的视野级别
+        // this.map.setFitView([this.circle])
+        this.fenceEditor = new AMap.CircleEditor(this.map, this.fence)
+        this.fenceEditor.open()
+        this.fenceEditor.on('end', (e) => {
+          this.fenceInfo.radius = radius
+          this.fenceInfo.lnglat = lnglat
+        })
+        this.fenceEditor.on('adjust', (e) => {
+          radius = e.radius
+        })
+        this.fenceEditor.on('move', (e) => {
+          lnglat = e.lnglat
+        })
+      } else if (e == 'rect') {
+        if (this.fence) {
+          this.fenceEditor.close()
+          this.map.remove(this.fence)
+        }
+        this.fenceBtn = '矩形'
+        let center = this.map.getCenter()
+        var southWest = new AMap.LngLat(center.lng + 0.01, center.lat + 0.005)
+        var northEast = new AMap.LngLat(center.lng - 0.01, center.lat - 0.005)
+
+        var bounds = new AMap.Bounds(southWest, northEast)
+
+        this.fence = new AMap.Rectangle({
+          bounds: bounds,
+          fillColor: 'blue',
+          fillOpacity: 0.5,
+          cursor: 'pointer',
+          zIndex: 50,
+        })
+
+        this.map.add(this.fence);
+        // 缩放地图到合适的视野级别
+
+        this.fenceEditor = new AMap.RectangleEditor(this.map, this.fence)
+        this.fenceEditor.open()
+      } else if (e == 'polygon') {
+        if (this.fence) {
+          this.fenceEditor.close()
+          this.map.remove(this.fence)
+        }
+        this.fenceBtn = '多边形'
+        let center = this.map.getCenter()
+        let path = [
+          [center.lng - 0.01, center.lat + 0.005],
+          [center.lng + 0.01, center.lat + 0.005],
+          [center.lng + 0.01, center.lat - 0.005],
+          [center.lng - 0.01, center.lat - 0.005]
+        ]
+        this.fence = new AMap.Polygon({
+          path: path,
+          strokeColor: "#FF33FF",
+          strokeWeight: 6,
+          strokeOpacity: 0.2,
+          fillOpacity: 0.4,
+          fillColor: '#1791fc',
+          zIndex: 50,
+          bubble: true,
+          draggable: true,
+        })
+        this.map.add(this.fence);
+        this.fenceEditor = new AMap.PolygonEditor(this.map, this.fence);
+        this.fenceEditor.open();
+        this.fenceEditor.on('end', (e) => {
+          this.fenceInfo.path = e.target._opts.path
+        })
+      }
+    },
+    editAdd() {
+      this.fenceEdit = true
+      this.add_flag = true
+      if (this.fence == null) {
+        this.switchFenceType('circle')
+      }
+    },
+    editCancel() {
+      this.fenceEdit = false
+      this.map.remove(this.fence)
+      this.fence = null
+      this.fenceEditor = null
+    },
+    editUpdate() {
+      this.add_flag = false
+      this.fenceEdit = true
+      if (this.fence) {
+        if (this.fence._opts.radius) {
+        this.fenceEditor = new AMap.CircleEditor(this.map, this.fence)
+        let radius = this.fenceInfo.radius
+        let lnglat = this.fenceInfo.lnglat
+        this.fenceEditor.open()
+        this.fenceEditor.on('end', (e) => {
+          this.fenceInfo.radius = radius
+          this.fenceInfo.lnglat = lnglat
+        })
+        this.fenceEditor.on('adjust', (e) => {
+          radius = e.radius
+        })
+        this.fenceEditor.on('move', (e) => {
+          lnglat = e.lnglat
+        })
+        }
+      }
+    },
+    selectFence(e) {
+      this.fenceList.map(item => {
+        if (item.fenceName == e) {
+          if (this.fence) {
+            this.map.remove(this.fence)
+          }
+          if (item.type == 'circle') {
+            this.fence = new AMap.Circle({
+              center: item.lnglat,
+              radius: item.radius, //半径
+              borderWeight: 3,
+              fillOpacity: 0.4,
+              strokeStyle: 'dashed',
+              strokeDasharray: [10, 10],
+              // 线样式还支持 'dashed'
+              fillColor: '#1791fc',
+              zIndex: 50,
+            })
+            this.map.add(this.fence);
+            this.map.setCenter(item.lnglat)
+            this.map.setFitView([this.fence])
+          }
+        }
+      })
+    },
     createMap() {
       window._AMapSecurityConfig = {
-        securityJsCode: '6aaa52f268bd774edcc494a7055cf167'
+        securityJsCode: 'e91e92cbd76e89c48f3ff1d6180f288c'
       }
       AMapLoader.load({
-        key: '533a73da5000e2db8d89b8fda02f33bf',
+        key: 'c968deab485d6e688e7c68689722ffb4',
         version: '2.0'
       }).then(AMap => {
         this.map = new AMap.Map('map', {
-          zoom: 13
-        })
-        this.map.plugin(['AMap.ToolBar', 'AMap.Scale'], () => {
-          this.map.addControl(new AMap.ToolBar({
-            position: 'RT'
-          }))
-          this.map.addControl(new AMap.Scale())
+          zoom: 15
         })
+        this.map.plugin([
+          'AMap.ToolBar',
+          'AMap.Scale',
+          'AMap.Geolocation',
+          'AMap.CircleEditor',
+          'AMap.RectangleEditor',
+          'AMap.PolygonEditor'], () => {
+            this.map.addControl(new AMap.ToolBar({
+              position: 'RT'
+            }))
+            this.map.addControl(new AMap.Scale())
+            var geolocation = new AMap.Geolocation({
+              enableHighAccuracy: true, // 是否使用高精度定位,默认:true
+              timeout: 10000, // 设置定位超时时间,默认:无穷大
+              offset: [10, 20],  // 定位按钮的停靠位置的偏移量
+              zoomToAccuracy: true,  //  定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
+              position: 'RB' //  定位按钮的排放位置,  RB表示右下
+            })
+
+            geolocation.getCurrentPosition((status, result) => {
+              if (status == 'complete') {
+                this.$modal.msgSuccess('定位成功')
+                this.map.setCenter([result.position.lng, result.position.lat])
+              } else {
+                this.$modal.msgError('获取定位失败')
+              }
+            });
+          })
       })
     },
     getUserList() {
@@ -1469,9 +1644,6 @@ export default {
         }
       })
     },
-    selectSetting(e) {
-      this.settingPage = e
-    },
     openSetting(e, row) {
       this.echartsQuery.device_id_code = row.deviceId
       this[e] = true
@@ -1479,8 +1651,9 @@ export default {
         setTimeout(() => {
           this.setEcharts(0)
         }, 100);
-      } else if (e == 'fence') {
+      } else if (e == 'fenceOpen') {
         this.createMap()
+        this.setUser = row
       } else if (e == 'deviceLog') {
         this.getDeviceLog()
       } else if (e == 'settingOpen') {

+ 8 - 8
src/views/system/fallsolve/index.vue

@@ -4,8 +4,8 @@
       <el-form-item label="用户姓名" prop="userid">
         <el-input v-model="queryParams.name" placeholder="请输入用户姓名" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
-      <el-form-item label="处理状态" prop="solveStatus">
-        <el-select v-model="queryParams.solveStatus">
+      <el-form-item label="处理状态" prop="solve_status">
+        <el-select v-model="queryParams.solve_status">
           <el-option label="已处理" :value="1"></el-option>
           <el-option label="未处理" :value="0"></el-option>
         </el-select>
@@ -190,7 +190,7 @@
         </el-col>
       </el-row>
       <el-row>
-        <div id="map"></div>
+        <div id="fall-map"></div>
       </el-row>
       <div slot="footer" class="dialog-footer" style="text-align: center;">
         <el-button type="primary" @click="submit" v-if="deal_flag">提 交</el-button>
@@ -233,7 +233,7 @@ export default {
         userid: null,
         deviceIdCode: null,
         alarmMsg: null,
-        solveStatus: null,
+        solve_status: null,
         serviceUserid: null,
         msg: null,
         createTime: null,
@@ -255,13 +255,13 @@ export default {
   methods: {
     createMap() {
       window._AMapSecurityConfig = {
-        securityJsCode: '6aaa52f268bd774edcc494a7055cf167'
+        securityJsCode: 'e91e92cbd76e89c48f3ff1d6180f288c'
       }
       AMapLoader.load({
-        key: '533a73da5000e2db8d89b8fda02f33bf',
+        key: 'c968deab485d6e688e7c68689722ffb4',
         version: '2.0'
       }).then(AMap => {
-        this.map = new AMap.Map('map', {
+        this.map = new AMap.Map('fall-map', {
           zoom: 15,
           center: [this.form.gps_long, this.form.gps_lat]
         })
@@ -445,7 +445,7 @@ export default {
   text-align: end;
 }
 
-#map {
+#fall-map {
   width: 100%;
   height: 500px;
 }

+ 8 - 8
src/views/system/healthsolve/index.vue

@@ -4,8 +4,8 @@
       <el-form-item label="用户姓名" prop="userid">
         <el-input v-model="queryParams.name" placeholder="请输入用户姓名" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
-      <el-form-item label="处理状态" prop="solveStatus">
-        <el-select v-model="queryParams.solveStatus">
+      <el-form-item label="处理状态" prop="solve_status">
+        <el-select v-model="queryParams.solve_status">
           <el-option label="已处理" :value="1"></el-option>
           <el-option label="未处理" :value="0"></el-option>
         </el-select>
@@ -190,7 +190,7 @@
         </el-col>
       </el-row>
       <el-row>
-        <div id="map"></div>
+        <div id="health-map"></div>
       </el-row>
       <div slot="footer" class="dialog-footer" style="text-align: center;">
         <el-button type="primary" @click="submit" v-if="deal_flag">提 交</el-button>
@@ -233,7 +233,7 @@ export default {
         userid: null,
         deviceIdCode: null,
         alarmMsg: null,
-        solveStatus: null,
+        solve_status: null,
         serviceUserid: null,
         msg: null,
         createTime: null,
@@ -255,13 +255,13 @@ export default {
   methods: {
     createMap() {
       window._AMapSecurityConfig = {
-        securityJsCode: '6aaa52f268bd774edcc494a7055cf167'
+        securityJsCode: 'e91e92cbd76e89c48f3ff1d6180f288c'
       }
       AMapLoader.load({
-        key: '533a73da5000e2db8d89b8fda02f33bf',
+        key: 'c968deab485d6e688e7c68689722ffb4',
         version: '2.0'
       }).then(AMap => {
-        this.map = new AMap.Map('map', {
+        this.map = new AMap.Map('health-map', {
           zoom: 15,
           center: [this.form.gps_long, this.form.gps_lat]
         })
@@ -445,7 +445,7 @@ export default {
   text-align: end;
 }
 
-#map {
+#health-map {
   width: 100%;
   height: 500px;
 }

+ 0 - 53
src/views/system/manage/index.vue

@@ -409,8 +409,6 @@
         </div>
       </el-upload>
     </el-dialog>
-    <div id="map">
-    </div>
   </div>
 </template>
 
@@ -418,7 +416,6 @@
 import { listManage, getManage, delManage, addManage, updateManage } from "@/api/system/manage";
 import imageUpload from '@/components/ImageUpload'
 import fileUpload from '@/components/FileUpload'
-import AMapLoader from '@amap/amap-jsapi-loader';
 import { getToken } from "@/utils/auth";
 export default {
   name: "Manage",
@@ -525,9 +522,6 @@ export default {
       this.settleTime = res.data
     })
   },
-  mounted() {
-    this.createMap()
-  },
   watch: {
     'form.date': {
       handler(val) {
@@ -583,53 +577,6 @@ export default {
       this.$modal.loading("正在上传文件,请稍候...");
       return true;
     },
-    createMap() {
-      let that = this
-      window._AMapSecurityConfig = {
-        securityJsCode: '6aaa52f268bd774edcc494a7055cf167',
-      }
-      AMapLoader.load({
-        key: "533a73da5000e2db8d89b8fda02f33bf",       // 申请好的Web端开发者Key,首次调用 load 时必填
-        version: "2.0",                 // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
-      }).then((AMap) => {
-        this.map = new AMap.Map('map', {
-          zoom: 11,
-          resizeEnable: true
-        });
-        this.map.plugin([
-          'AMap.ToolBar',
-          'AMap.Scale',
-          'AMap.Geolocation',
-        ], function () {
-          that.map.addControl(new AMap.ToolBar({
-            position: 'LT',
-            locate: false
-          }));
-          that.map.addControl(new AMap.Scale());
-          //   var getlocation = new AMap.Geolocation({
-          //     needAddress: true,
-          //     extensions: 'all',
-          //     enableHighAccuracy: true,//是否使用高精度定位,默认:true
-          //     timeout: 10000,          //超过10秒后停止定位,默认:5s
-          //     position: 'RB',    //定位按钮的停靠位置
-          //     offset: [10, 20], //定位按钮与设置的停靠位置的偏移量,默认:[10, 20]
-          //     zoomToAccuracy: true,   //定位成功后是否自动调整地图视野到定位点
-          //   })
-          //   that.map.addControl(getlocation);
-          //   document.querySelector('.amap-geolocation').onclick = function () {
-          //   getlocation.getCurrentPosition(function (status, result) {
-          //     console.log(result);
-          //   });
-          // }
-        });
-        let marker = new AMap.Marker()
-        this.map.on('click', (e) => {
-          let lnglat = [e.lnglat.lng, e.lnglat.lat]
-          this.map.add(marker)
-          marker.setPosition(lnglat)
-        })
-      })
-    },
     checkeInfo(e) {
       this.form.releaseScope = JSON.stringify(e)
     },

+ 8 - 8
src/views/system/othersolve/index.vue

@@ -4,8 +4,8 @@
       <el-form-item label="用户姓名" prop="userid">
         <el-input v-model="queryParams.name" placeholder="请输入用户姓名" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
-      <el-form-item label="处理状态" prop="solveStatus">
-        <el-select v-model="queryParams.solveStatus">
+      <el-form-item label="处理状态" prop="solve_status">
+        <el-select v-model="queryParams.solve_status">
           <el-option label="已处理" :value="1"></el-option>
           <el-option label="未处理" :value="0"></el-option>
         </el-select>
@@ -190,7 +190,7 @@
         </el-col>
       </el-row>
       <el-row>
-        <div id="map"></div>
+        <div id="other-map"></div>
       </el-row>
       <div slot="footer" class="dialog-footer" style="text-align: center;">
         <el-button type="primary" @click="submit" v-if="deal_flag">提 交</el-button>
@@ -233,7 +233,7 @@ export default {
         userid: null,
         deviceIdCode: null,
         alarmMsg: null,
-        solveStatus: null,
+        solve_status: null,
         serviceUserid: null,
         msg: null,
         createTime: null,
@@ -255,13 +255,13 @@ export default {
   methods: {
     createMap() {
       window._AMapSecurityConfig = {
-        securityJsCode: '6aaa52f268bd774edcc494a7055cf167'
+        securityJsCode: 'e91e92cbd76e89c48f3ff1d6180f288c'
       }
       AMapLoader.load({
-        key: '533a73da5000e2db8d89b8fda02f33bf',
+        key: 'c968deab485d6e688e7c68689722ffb4',
         version: '2.0'
       }).then(AMap => {
-        this.map = new AMap.Map('map', {
+        this.map = new AMap.Map('other-map', {
           zoom: 15,
           center: [this.form.gps_long, this.form.gps_lat]
         })
@@ -445,7 +445,7 @@ export default {
   text-align: end;
 }
 
-#map {
+#other-map {
   width: 100%;
   height: 500px;
 }

+ 8 - 8
src/views/system/railsolve/index.vue

@@ -4,8 +4,8 @@
       <el-form-item label="用户姓名" prop="userid">
         <el-input v-model="queryParams.name" placeholder="请输入用户姓名" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
-      <el-form-item label="处理状态" prop="solveStatus">
-        <el-select v-model="queryParams.solveStatus">
+      <el-form-item label="处理状态" prop="solve_status">
+        <el-select v-model="queryParams.solve_status">
           <el-option label="已处理" :value="1"></el-option>
           <el-option label="未处理" :value="0"></el-option>
         </el-select>
@@ -190,7 +190,7 @@
         </el-col>
       </el-row>
       <el-row>
-        <div id="map"></div>
+        <div id="rail-map"></div>
       </el-row>
       <div slot="footer" class="dialog-footer" style="text-align: center;">
         <el-button type="primary" @click="submit" v-if="deal_flag">提 交</el-button>
@@ -233,7 +233,7 @@ export default {
         userid: null,
         deviceIdCode: null,
         alarmMsg: null,
-        solveStatus: null,
+        solve_status: null,
         serviceUserid: null,
         msg: null,
         createTime: null,
@@ -255,13 +255,13 @@ export default {
   methods: {
     createMap() {
       window._AMapSecurityConfig = {
-        securityJsCode: '6aaa52f268bd774edcc494a7055cf167'
+        securityJsCode: 'e91e92cbd76e89c48f3ff1d6180f288c'
       }
       AMapLoader.load({
-        key: '533a73da5000e2db8d89b8fda02f33bf',
+        key: 'c968deab485d6e688e7c68689722ffb4',
         version: '2.0'
       }).then(AMap => {
-        this.map = new AMap.Map('map', {
+        this.map = new AMap.Map('rail-map', {
           zoom: 15,
           center: [this.form.gps_long, this.form.gps_lat]
         })
@@ -445,7 +445,7 @@ export default {
   text-align: end;
 }
 
-#map {
+#rail-map {
   width: 100%;
   height: 500px;
 }

+ 8 - 8
src/views/system/solve/index.vue

@@ -4,8 +4,8 @@
       <el-form-item label="用户姓名" prop="userid">
         <el-input v-model="queryParams.name" placeholder="请输入用户姓名" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
-      <el-form-item label="处理状态" prop="solveStatus">
-        <el-select v-model="queryParams.solveStatus">
+      <el-form-item label="处理状态" prop="solve_status">
+        <el-select v-model="queryParams.solve_status">
           <el-option label="已处理" :value="1"></el-option>
           <el-option label="未处理" :value="0"></el-option>
         </el-select>
@@ -190,7 +190,7 @@
         </el-col>
       </el-row>
       <el-row>
-        <div id="map"></div>
+        <div id="sos-map"></div>
       </el-row>
       <div slot="footer" class="dialog-footer" style="text-align: center;">
         <el-button type="primary" @click="submit" v-if="deal_flag">提 交</el-button>
@@ -233,7 +233,7 @@ export default {
         userid: null,
         deviceIdCode: null,
         alarmMsg: null,
-        solveStatus: null,
+        solve_status: null,
         serviceUserid: null,
         msg: null,
         createTime: null,
@@ -255,13 +255,13 @@ export default {
   methods: {
     createMap() {
       window._AMapSecurityConfig = {
-        securityJsCode: '6aaa52f268bd774edcc494a7055cf167'
+        securityJsCode: 'e91e92cbd76e89c48f3ff1d6180f288c'
       }
       AMapLoader.load({
-        key: '533a73da5000e2db8d89b8fda02f33bf',
+        key: 'c968deab485d6e688e7c68689722ffb4',
         version: '2.0'
       }).then(AMap => {
-        this.map = new AMap.Map('map', {
+        this.map = new AMap.Map('sos-map', {
           zoom: 15,
           center: [this.form.gps_long, this.form.gps_lat]
         })
@@ -445,7 +445,7 @@ export default {
   text-align: end;
 }
 
-#map {
+#sos-map {
   width: 100%;
   height: 500px;
 }