From a1b6e56427fa7279e65afc880b7124c6cf289177 Mon Sep 17 00:00:00 2001 From: mk1990 <153958232@qq.com> Date: 星期一, 28 三月 2022 10:11:13 +0800 Subject: [PATCH] 1. 修改control.vue 报Invalid prop: type check failed for prop "column". Expected Number with value 1, got String with value "1". 2. 修改control.vue Error: [vue-clipboards] Invalid value. Please use a valid value. 3. 修改DeviceList.vue 刷新时报 [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "loading" --- web_src/src/components/devicePosition.vue | 49 ++++++++++++++++++++++++++----------------------- 1 files changed, 26 insertions(+), 23 deletions(-) diff --git a/web_src/src/components/devicePosition.vue b/web_src/src/components/devicePosition.vue index 4a52c74..777b11e 100644 --- a/web_src/src/components/devicePosition.vue +++ b/web_src/src/components/devicePosition.vue @@ -171,13 +171,14 @@ 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); @@ -192,8 +193,7 @@ self.showMarkPoints(self); }); } - }) - .catch(function (error) { + }).catch(function (error) { console.log(error); }); }, @@ -202,8 +202,10 @@ 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); @@ -219,20 +221,20 @@ self.showMarkPoints(self); }); } - }) - .catch(function (error) { + }).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) { @@ -241,16 +243,17 @@ }, 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); }); }, -- Gitblit v1.8.0