| | |
| | | parentChannelId: this.$route.params.parentChannelId, |
| | | updateLooper: 0, //数据刷新轮训标志 |
| | | total: 0, |
| | | beforeUrl: "/videoList", |
| | | beforeUrl: "/deviceList", |
| | | isLoging: false, |
| | | autoList: false, |
| | | }; |
| | |
| | | // 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() { |
| | |
| | | this.endTime = null; |
| | | } |
| | | let self = this; |
| | | this.$axios.get(`/api/positions/${this.deviceId}/history`, { |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/position/history/${this.deviceId}`, |
| | | params: { |
| | | start: self.startTime, |
| | | end: self.endTime, |
| | | }, |
| | | }) |
| | | .then(function (res) { |
| | | }).then(function (res) { |
| | | self.total = res.data.length; |
| | | self.mobilePositionList = res.data; |
| | | console.log(self.mobilePositionList); |
| | | // 防止出现表格错位 |
| | | self.$nextTick(() => { |
| | | self.showMarkPoints(self); |
| | | }); |
| | | }) |
| | | .catch(function (error) { |
| | | if (self.total == 0) { |
| | | self.$message({ |
| | | showClose: true, |
| | | message: '未找到符合条件的移动位置信息', |
| | | type: 'error' |
| | | }); |
| | | } else { |
| | | self.$nextTick(() => { |
| | | self.showMarkPoints(self); |
| | | }); |
| | | } |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | |
| | | this.mapPointList = []; |
| | | this.mobilePositionList = []; |
| | | let self = this; |
| | | this.$axios.get(`/api/positions/${this.deviceId}/latest`) |
| | | .then(function (res) { |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/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); |
| | | }); |
| | | }) |
| | | .catch(function (error) { |
| | | if (self.total == 0) { |
| | | self.$message({ |
| | | showClose: true, |
| | | message: '未找到符合条件的移动位置信息', |
| | | type: 'error' |
| | | }); |
| | | } else { |
| | | self.$nextTick(() => { |
| | | self.showMarkPoints(self); |
| | | }); |
| | | } |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | subscribeMobilePosition: function() { |
| | | let self = this; |
| | | this.$axios.get(`/api/positions/${this.deviceId}/subscribe`, { |
| | | params: { |
| | | expires: self.expired, |
| | | interval: self.interval, |
| | | }, |
| | | }) |
| | | .then(function (res) { |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/position/subscribe/${this.deviceId}`, |
| | | params: { |
| | | expires: self.expired, |
| | | interval: self.interval, |
| | | }, |
| | | }).then(function (res) { |
| | | console.log(res.data); |
| | | }) |
| | | .catch(function (error) { |
| | |
| | | }, |
| | | unSubscribeMobilePosition: function() { |
| | | let self = this; |
| | | this.$axios.get(`/api/positions/${this.deviceId}/subscribe`, { |
| | | params: { |
| | | expires: 0, |
| | | interval: self.interval, |
| | | }, |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/position/subscribe/${this.deviceId}`, |
| | | params: { |
| | | expires: 0, |
| | | interval: self.interval, |
| | | }, |
| | | }) |
| | | .then(function (res) { |
| | | console.log(res.data); |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }, |