diff --git a/src/views/components/carMile.vue b/src/views/components/carMile.vue index 7a6fdf5..38098ab 100644 --- a/src/views/components/carMile.vue +++ b/src/views/components/carMile.vue @@ -27,7 +27,7 @@ {{ index+ 1}} - {{ item.cardNo }} + {{ item.cardNo }} {{ item.mile }} 查询 @@ -52,7 +52,7 @@ export default { methods: { //定位 queryMap(item) { - this.$emit('queryLunz') + this.$emit('doMap',item); }, //昨日里程 queryYesterdayMile() { diff --git a/src/views/components/pathMap.vue b/src/views/components/pathMap.vue index 8c6b4fd..1f4ffd7 100644 --- a/src/views/components/pathMap.vue +++ b/src/views/components/pathMap.vue @@ -51,9 +51,9 @@ export default { this.baiduMap.setMapStyleV2({ styleId: 'ec6ebc8ad35bcfbd56a424a29f325360'//'ef4f05652d24d0f23332710fbacad245'// }); - this.view = new mapvgl.View({ - map: this.baiduMap - }); + // this.view = new mapvgl.View({ + // map: this.baiduMap + // }); var bdary = new BMapGL.Boundary(); bdary.get("日照市莒县", rs => { var count = rs.boundaries.length; @@ -84,11 +84,14 @@ export default { }) this.baiduMap.addEventListener('tilesloaded', () => { this.carList.map((item, index) => { + this.markList.map(mark => { + this.baiduMap.removeOverlay(mark); + }) this.markList = []; this.queryLunz(item.deviceId, item.key, item.cardNo, index); }) this.setInterval = setInterval(() => { - this.view.removeAllLayers(); + // this.view.removeAllLayers(); this.markList.map(mark => { this.baiduMap.removeOverlay(mark); }) @@ -102,6 +105,15 @@ export default { }) }, + //单个设备定位聚焦放大 + queryDingwei(deviceId) { + lunzApi.getCurrentDeviceInfoByIMEI(this.appKey, deviceId).then(res => { + let lng = res.Data.BaiduLng; + let lat = res.Data.BaiduLat; + let pt = new BMapGL.Point(lng, lat); + this.baiduMap.centerAndZoom(pt, 18); + }) + }, //查询定位 queryLunz(deviceId, key, carNo, index) { // lunzApi.getCarUserSimpleByImei(this.appKey, deviceId).then(res1 => { @@ -133,13 +145,13 @@ export default {
最后定位时间:${res.Data.GPSTimeStamp.replace("T", " ")}
状态:${this.locationStatus[res.Data.SbcStatus]}
时速:${res.Data.spd}km/h
-
行车轨迹
+
行车轨迹
`; let infoWindow = new BMapGL.InfoWindow(sContent); // marker添加点击事件 infoWindow.addEventListener('open', () => { - document.getElementById('btnPath_' + key).addEventListener('click', () => { - this.queryPath(key) + document.getElementById('btnPath_' + deviceId).addEventListener('click', () => { + this.queryPath(deviceId) }) }); marker.addEventListener('click', () => { @@ -221,6 +233,13 @@ export default { "MaxValue": 500 } lunzApi.getLocationsByImei(this.key, param).then(res => { + if (res.Data == null) { + this.$message({ + message: '未查询到今日行车轨迹', + type: 'warning' + }); + return; + } let point = []; res.Data.map(item => { point.push(new BMapGL.Point(item.Lng, item.Lat)); @@ -231,6 +250,8 @@ export default { } this.polyline = new BMapGL.Polyline(point, { strokeColor: '#F5533D', strokeWeight: 5, strokeOpacity: 1, }) this.baiduMap.addOverlay(this.polyline); + this.baiduMap.centerAndZoom(point[0], 15); + this.baiduMap.closeInfoWindow(); // this.polyline = new BMapGL.Polyline(point, { // strokeColor: '#F5533D', // strokeWeight: 5, diff --git a/src/views/dashboard/homepage.vue b/src/views/dashboard/homepage.vue index 79d9fca..c8faed2 100644 --- a/src/views/dashboard/homepage.vue +++ b/src/views/dashboard/homepage.vue @@ -43,39 +43,39 @@
- {{ item1.no <= 3 ? "top" : "" }} + {{ item1.no <= 3 ? "top" : "" }}
+
{{ item1.no }}
+
{{ item1.name }}
+
{{ item1.count }}
-
{{ item1.no }}
-
{{ item1.name }}
-
{{ item1.count }}
- - + + + - - -
-
-
村点信息
-
-
-
-
站点名称
-
上行
-
下行
+
+
+
村点信息
-
-
-
-
-
-
{{ item1.name }}
-
{{ item1.upData }}
-
{{ item1.downData }}
+
+
+
站点名称
+
上行
+
下行
+
+
+
+
+
+
+
{{ item1.name }}
+
{{ item1.upData }}
+
{{ item1.downData }}
+
@@ -83,79 +83,78 @@
-
-
-
-
莒县物流服务中心
-
-
-
-
-
- 按日 -
-
- 按月 +
+
+
莒县物流服务中心
+
+
+
+
+
+ 按日 +
+
+ 按月 +
+
数据更新时间:{{ dateTime }}
-
数据更新时间:{{ dateTime }}
-
-
-
-
{{ item.name }}
-
{{ item.data }}
-
环比{{ item.huanbi }}
+
+
+
{{ item.name }}
+
{{ item.data }}
+
环比{{ item.huanbi }}
+
-
-
- -
-
-
- -
+
+
-
-
+
+
+ +
+
+
+
+
-
-
-
- - -
-
-
-
派件入库量占比
+
+
+ +
-
-
-
-
-
-
{{ item.name }}
-
{{ item.value }}
-
{{ item.percent }}%
+
+
+
派件入库量占比
+
+
+
+
+
+
+
{{ item.name }}
+
{{ item.value }}
+
{{ item.percent }}%
+
-
-
-
-
车辆行驶里程
+
+
+
车辆行驶里程
+
+
- -
-
-
-
车辆报警
+
+
+
车辆报警
+
+
-
-