lihongxiao 2 лет назад
Родитель
Сommit
bab9e957f5
2 измененных файлов с 34 добавлено и 35 удалено
  1. 2 2
      config/dev.env.js
  2. 32 33
      src/views/PeopleManage/PcLoginRecord.vue

+ 2 - 2
config/dev.env.js

@@ -5,10 +5,10 @@ const prodEnv = require('./prod.env')
 module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
   ENV_CONFIG: '"dev"',
-  // BASE_URL: '"https://test.baoxianzhanggui.com/web-api"',//测试服务器
+  BASE_URL: '"https://test.baoxianzhanggui.com/web-api"',//测试服务器
   // BASE_URL:'"https://sxzgkj.baoxianzhanggui.com/web-api"',//正式服务器
   // BASE_URL:'"https://sxzgkj.baoxianzhanggui.com/web-api"'//正式服务器
-  BASE_URL: '"http://192.168.0.115:8080/"', //凯森
+  // BASE_URL: '"http://192.168.0.115:8080/"', //凯森
   // BASE_URL: '"http://192.168.0.106:8080/"',//屈晨
   // BASE_URL: '"http://192.168.0.253:8080/"',//田智
   // BASE_URL: '"http:///192.168.0.42:8080/"',//武鸿鹏

+ 32 - 33
src/views/PeopleManage/PcLoginRecord.vue

@@ -19,7 +19,7 @@
           :value="option.code"></el-option>
       </el-select>
       <el-button size="small" type="primary" @click="onSearch">搜索</el-button>
-      <!-- <el-button size="small" type="primary" @click="onCircular">圆形定位</el-button> -->
+      <el-button size="small" type="primary" @click="onCircular">圆形定位</el-button>
       <!-- <el-button size="small" type="primary" @click="map.remove(circle)">删除定位</el-button> -->
     </div>
     <div class="source-window">
@@ -357,7 +357,7 @@ export default {
     },
     morelFun() {
       this.$api.user
-        .queryPcAddressInfo({ lng: this.position[0], lat: this.position[1], pageSize: 5, pageNum: this.personnelPageNum })
+        .queryPcAddressInfo({ lng: this.position[0], lat: this.position[1], source: this.source,pageSize: 5, pageNum: this.personnelPageNum })
         .then(res => {
           if (res.code == 200) {
             this.personnelTotalSize = res.data.totalSize
@@ -445,36 +445,33 @@ export default {
           // _this.map.add(marker);
           // this.addMarker(data)
       let res = await _this.$api.user.ipAddrLocations(data)
-      _this.map.on("load", () => {
-            if (res.code == 200) {
-              if (res.data && res.data.length > 0) {
-                //处理后台返回要用到的数据
-                // _this.positionData = res.data.data
-                _this.positionData = res.data.map(item => ({
-                  userName: item.userName,
-                  id: item.id,
-                  userId: item.userId,
-                  address: item.address,
-                  leaderName: item.leaderName,
-                  // onlineImg: item.status ? "Frame-1(2).png" : "Frame(2).png",
-                  onlineImg: "Frame-1(2).png",
-                  operationTime: item.operationTime,
-                  source: item.source,
-                  // status: item.status ? "在线" : "离线",
-                  positionArr: [item.longitude, item.latitude]
-                }));
-                _this.mapPoint();
-              }
-              else {
-                _this.positionData=[]
-                _this.loading = false; //地图加载完成
-              }
-            } else {
-              _this.$message.error(res.msg)
-              _this.loading = false;
-            }
-
-        });
+        if (res.code == 200) {
+          if (res.data && res.data.length > 0) {
+            //处理后台返回要用到的数据
+            // _this.positionData = res.data.data
+            _this.positionData = res.data.map(item => ({
+              userName: item.userName,
+              id: item.id,
+              userId: item.userId,
+              address: item.address,
+              leaderName: item.leaderName,
+              // onlineImg: item.status ? "Frame-1(2).png" : "Frame(2).png",
+              onlineImg: "Frame-1(2).png",
+              operationTime: item.operationTime,
+              source: item.source,
+              // status: item.status ? "在线" : "离线",
+              positionArr: [item.longitude, item.latitude]
+            }));
+            _this.mapPoint();
+          }
+          else {
+            _this.positionData=[]
+            _this.loading = false; //地图加载完成
+          }
+        } else {
+          _this.$message.error(res.msg)
+          _this.loading = false;
+        }
 
     },
     queryPcNum() {
@@ -723,6 +720,7 @@ export default {
 
       _this.infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(0, -4), closeWhenClickMap: true, }); //信息窗口
       var position = JSON.parse(JSON.stringify(_this.positionData));
+
       for (var i = 0; i < position.length; i++) {
         var labelMarker = new AMap.LabelMarker({
           position: position[i].positionArr
@@ -748,9 +746,10 @@ export default {
         <div >登录时间: ${position[i].operationTime}</div>
         `
         normalMarker.on("click", _this.markerClick);
-        normalMarker.setExtData({ id: position[i].id }); //给标注添加信息,点击时可以获取
+        normalMarker.setExtData({ id: position[i].userId }); //给标注添加信息,点击时可以获取
       }
       // 一次性将海量点添加到图层
+
       labelsLayer.add(labelMarker);
       this.loading = false; //地图加载完成
     },