From 89244932c6185cd39e9a9f8aa8bf3acf99329335 Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: 星期日, 11 四月 2021 15:00:52 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/wvp-28181-2.0' into wvp-28181-2.0 --- web_src/src/components/devicePosition.vue | 42 ++++++++++++++++++++++++++++-------------- 1 files changed, 28 insertions(+), 14 deletions(-) diff --git a/web_src/src/components/devicePosition.vue b/web_src/src/components/devicePosition.vue index 2910623..dfee0b1 100644 --- a/web_src/src/components/devicePosition.vue +++ b/web_src/src/components/devicePosition.vue @@ -81,7 +81,7 @@ parentChannelId: this.$route.params.parentChannelId, updateLooper: 0, //鏁版嵁鍒锋柊杞鏍囧織 total: 0, - beforeUrl: "/videoList", + beforeUrl: "/deviceList", isLoging: false, autoList: false, }; @@ -111,7 +111,7 @@ // this.currentPage = parseInt(this.$route.params.page); // this.count = parseInt(this.$route.params.count); // if (this.parentChannelId == "" || this.parentChannelId == 0) { - // this.beforeUrl = "/videoList"; + // this.beforeUrl = "/deviceList"; // } }, initBaiduMap() { @@ -171,7 +171,7 @@ this.endTime = null; } let self = this; - this.$axios.get(`/api/positions/${this.deviceId}/history`, { + this.$axios.get(`/api/position/history/${this.deviceId}`, { params: { start: self.startTime, end: self.endTime, @@ -181,10 +181,17 @@ self.total = res.data.length; self.mobilePositionList = res.data; console.log(self.mobilePositionList); - // 闃叉鍑虹幇琛ㄦ牸閿欎綅 - self.$nextTick(() => { - self.showMarkPoints(self); - }); + if (self.total == 0) { + self.$message({ + showClose: true, + message: '鏈壘鍒扮鍚堟潯浠剁殑绉诲姩浣嶇疆淇℃伅', + type: 'error' + }); + } else { + self.$nextTick(() => { + self.showMarkPoints(self); + }); + } }) .catch(function (error) { console.log(error); @@ -195,16 +202,23 @@ this.mapPointList = []; this.mobilePositionList = []; let self = this; - this.$axios.get(`/api/positions/${this.deviceId}/latest`) + this.$axios.get(`/api/position/latest/${this.deviceId}`) .then(function (res) { console.log(res.data); self.total = res.data.length; self.mobilePositionList.push(res.data); console.log(self.mobilePositionList); - // 闃叉鍑虹幇琛ㄦ牸閿欎綅 - self.$nextTick(() => { - self.showMarkPoints(self); - }); + if (self.total == 0) { + self.$message({ + showClose: true, + message: '鏈壘鍒扮鍚堟潯浠剁殑绉诲姩浣嶇疆淇℃伅', + type: 'error' + }); + } else { + self.$nextTick(() => { + self.showMarkPoints(self); + }); + } }) .catch(function (error) { console.log(error); @@ -212,7 +226,7 @@ }, subscribeMobilePosition: function() { let self = this; - this.$axios.get(`/api/positions/${this.deviceId}/subscribe`, { + this.$axios.get(`/api/position/subscribe/${this.deviceId}`, { params: { expires: self.expired, interval: self.interval, @@ -227,7 +241,7 @@ }, unSubscribeMobilePosition: function() { let self = this; - this.$axios.get(`/api/positions/${this.deviceId}/subscribe`, { + this.$axios.get(`/api/position/subscribe/${this.deviceId}`, { params: { expires: 0, interval: self.interval, -- Gitblit v1.8.0