@@ -78,10 +80,19 @@ export default {
],
}
},
- mounted() {},
+ mounted() {
+ this.getEquipmentInfo()
+ },
methods: {
handleQuery() {
console.log('🚀 ~ handleQuery ~ 查询:', this.queryForm.date)
+ const params = {
+ date: this.queryForm.date,
+ }
+ this.getEquipmentInfo(params)
+ // 先销毁地图 再重新初始化
+ this.map.clearOverlays()
+ this.initMap()
},
openMapDialog(val) {
this.openMap = val
@@ -91,9 +102,14 @@ export default {
this.$emit('getList')
},
// 获取装备信息
- getEquipmentInfo(params) {
+ getEquipmentInfo(params = {}) {
console.log('🚀 ~ getEquipmentInfo ~ 获取装备信息', params)
- this.equipment = params.deviceType
+ // 接口(params).then(res => {
+ // this.equipment = res.equipment
+ // this.equipmentNumber = res.equipmentNumber
+ // this.engineering = res.engineering
+ // this.linePointList = res.linePointList
+ // })
},
// 初始化地图和轨迹
initMap() {
@@ -106,6 +122,7 @@ export default {
// 添加轨迹
let pointList = []
+ if (this.linePointList.length === 0) return
for (var i = 0; i < this.linePointList.length; i++) {
pointList.push(new BMapGL.Point(this.linePointList[i].lng, this.linePointList[i].lat))
}
@@ -122,7 +139,7 @@ export default {
})
// 设置起点终点图标
- this.simulateMovement()
+ this.triggerMovement()
trackAni.start()
})
},
@@ -136,10 +153,9 @@ export default {
let endMarker = new BMapGL.Marker(endLatLng, { icon: endIcon })
this.map.addOverlay(endMarker)
},
-
- // 模拟轨迹运动结束后的回调
- simulateMovement() {
- // 模拟轨迹运动结束后获取起点和终点的经纬度坐标
+ // 轨迹运动结束后的回调
+ triggerMovement() {
+ // 轨迹运动结束后获取起点和终点的经纬度坐标
let startLatLng = new BMapGL.Point(this.linePointList[0].lng, this.linePointList[0].lat)
let endLatLng = new BMapGL.Point(
this.linePointList[this.linePointList.length - 1].lng,
diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue
index 768b29c1..01a87d73 100644
--- a/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue
+++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue
@@ -533,7 +533,7 @@
-
+
@@ -824,9 +824,9 @@ export default {
deviceType: row.deviceType,
}
// 点击打开弹框
- this.$refs.mapDIalog.openMapDialog(true)
- this.$refs.mapDIalog.getEquipmentInfo(params)
- this.$refs.mapDIalog.initMap()
+ this.$refs.mapDialog.openMapDialog(true)
+ this.$refs.mapDialog.getEquipmentInfo(params)
+ this.$refs.mapDialog.initMap()
}
},
}