|
|
@@ -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; //地图加载完成
|
|
|
},
|