diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue index f0f9595c..c099d075 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue @@ -115,7 +115,7 @@ /> - + e == this.IOTForm.iotType) + if (isType) { + this.$message.error( + '当前机具已绑定改IOT类型设备,不可重复绑定!', + ) + return + } try { // 校验 this.$refs.IOTForm.validate(async (valid) => { diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue index d977fbaf..0eb8fd67 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue @@ -40,18 +40,21 @@ -
-
{{ index + 1 }}
+ + -
-
- {{ - index + 1 - }} - {{ item.startTime }} - {{ item.hours }}时{{ - item.mints - }}分 + + -
-
- {{ - index + 1 - }} - {{ item.warnTime }} + + @@ -193,6 +210,7 @@ export default { trackAni: null, // 轨迹实例 calLon: '', calLat: '', + // 查询设备行程信息的参数 tripParams: { beginTime: moment() @@ -206,18 +224,20 @@ export default { activeIndex: '', // 停留点信息 parkList: [], + warningList: [], + loadingData: true, } }, - created() { - this.handleQuery() - }, + created() {}, mounted() { - Promise.all([this.getIotDeviceLocation()]) + Promise.all([this.getIotDeviceLocation(), this.handleQuery()]) .then((res) => { + this.loadingData = false this.initMap() }) .catch((err) => { console.log(err) + this.loadingData = false }) // this.getIotDeviceLocation() @@ -231,9 +251,12 @@ export default { this.trackAni.cancel() } // 2. 清除地图上面的标点覆盖物 并清除地图实例 - this.map.clearOverlays() - this.map.destroy() - this.map = null + + if (this.map) { + this.map.clearOverlays() + this.map.destroy() + this.map = null + } }, methods: { @@ -250,6 +273,10 @@ export default { }, /** 查询按钮 */ async handleQuery() { + if (!this.queryForm.date) { + this.$message.error('请选择时间范围!') + return + } this.tripParams.iotId = this.iotCode const res = await getIotDeviceTripApi({ ...this.tripParams }) console.log(res, '行程信息--') @@ -448,8 +475,10 @@ export default { }, /** 时间选择器 */ onChangeTime(val) { - this.tripParams.beginTime = val[0] - this.tripParams.endTime = val[1] + if (val) { + this.tripParams.beginTime = val[0] + this.tripParams.endTime = val[1] + } }, }, }