From 4efeb31d5b4921d7e851c256009486ad86bc70e2 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Tue, 21 Jun 2022 09:14:57 +0800
Subject: [PATCH] 地址替换

---
 mapWz/js/vueMain.js |   44 +++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/mapWz/js/vueMain.js b/mapWz/js/vueMain.js
index 0385bd7..3eb7a63 100644
--- a/mapWz/js/vueMain.js
+++ b/mapWz/js/vueMain.js
@@ -1,3 +1,9 @@
+/*
+ * @Author: Morpheus
+ * @Date: 2021-08-26 16:22:11
+ * @Last Modified by: Morpheus
+ * @Last Modified time: 2021-08-28 15:03:25
+ */
 var me = new Vue({
     el: '#mapVue',
     data: {
@@ -34,13 +40,32 @@
             //url解码
 
             var jurisdictionId = this.GetQueryString('id')
+
             this.userId = this.GetQueryString('userid')
 
-            axios.get('http://223.82.109.183:2080/api/blade-user/page?size=99999&jurisdiction=' + jurisdictionId).then((res) => {
+            var deptid = this.GetQueryString('deptid')
+
+            var roleName = this.GetQueryChinese('roleName')
+
+            console.log(roleName)
+
+            var url = ''
+
+            if (roleName == '保安公司管理员') {
+
+                url = 'http://61.131.136.25:2080/api/blade-user/pages?&current=1&size=999999&deptId=' + deptid
+
+            } else {
+
+                url = 'http://61.131.136.25:2080/api/blade-user/pages?dispatch=0&jurisdiction=' + jurisdictionId + '&current=1&size=999999'
+
+            }
+
+            axios.get(url).then((res) => {
 
                 if (res.data.data.records.length > 0) {
                     res.data.data.records.forEach(item => {
-                        if (item.longitude && item.latitude) {
+                        if (item.longitude && item.latitude && item.roleId != this.userId) {
                             resultData.push(item)
                         }
                     })
@@ -59,6 +84,12 @@
             var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
             var r = window.location.search.substr(1).match(reg);
             if (r != null) return unescape(r[2]);
+            return null;
+        },
+        GetQueryChinese(name) {
+            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
+            var r = window.location.search.substr(1).match(reg);
+            if (r != null) return decodeURI(r[2]);
             return null;
         },
         beginMap(map, data) {
@@ -329,12 +360,13 @@
             };
 
             function showPosition(position) {
+
                 var adCode = position.adCode; //邮政编码
                 var nation = position.nation; //中国
                 var city = position.city; //城市
                 var addr = position.addr; //详细地址
                 that.lat = position.lat; //
-                that.lng = position.lng; //火星坐标 //TODO 实现业务代码逻辑 
+                that.lng = position.lng; //火星坐标 //TODO 实现业务代码逻辑
 
                 if (that.LXdhStart != null) {
                     that.map.removeLayer(that.LXdhStart);
@@ -362,8 +394,9 @@
             };
 
             function showErr() {
-                //TODO 如果出错了调用此方法 
+                //TODO 如果出错了调用此方法
             };
+
 
             geolocation.getLocation(showPosition, showErr, options);
 
@@ -383,6 +416,7 @@
             that.getLocationData(that.geolocation);
 
         }, 30000);
+
     },
     wacth: {}
-})
\ No newline at end of file
+})

--
Gitblit v1.9.3