|
@@ -138,8 +138,8 @@ export default {
|
|
|
let data = {
|
|
|
billCode: "CS01",
|
|
|
plateNumber: "湘A79D2R",
|
|
|
- startTime: "2023-02-06",
|
|
|
- endTime: "2023-02-08"
|
|
|
+ startTime: "2023-02-01",
|
|
|
+ endTime: "2023-02-02"
|
|
|
}
|
|
|
|
|
|
console.log(data, 'data');
|
|
@@ -155,32 +155,41 @@ export default {
|
|
|
let text;
|
|
|
let count = 0;
|
|
|
if (code == 200) {
|
|
|
- this.xData = res.data.temperature;
|
|
|
- for (let i = 1; i < data.length; i = i + Math.trunc((data.length / 9))) {
|
|
|
- // console.log("i",i)
|
|
|
- text += `&via[${count}][lnglat]=${data[i].gpsLongitude},${data[i].gpsLatitude}` ;
|
|
|
- this.resData[i] = res.data[i];
|
|
|
- this.resX[count] = res.data[i].hisDate;
|
|
|
- this.resYTemperature[count] = res.data[i].temperature;
|
|
|
- this.resYHumidity[count] = res.data[i].humidity / 100;
|
|
|
- count++;
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ if (data[i].gpsLatitude != 0 && data[i].gpsLongitude != 0) {
|
|
|
+ for (let j = data.length - 1; j > i; j--) {
|
|
|
+ if (data[j].gpsLatitude != 0 && data[j].gpsLongitude != 0) {
|
|
|
+ for (let z = i; z < j; z = z + Math.trunc(j / 10)) {
|
|
|
+ // console.log("i",i)
|
|
|
+ text += `&via[${count}][lnglat]=${data[z].gpsLongitude},${data[z].gpsLatitude}` ;
|
|
|
+ this.resData[z] = res.data[z];
|
|
|
+ this.resX[count] = res.data[z].hisDate;
|
|
|
+ this.resYTemperature[count] = res.data[z].temperature;
|
|
|
+ this.resYHumidity[count] = res.data[z].humidity / 100;
|
|
|
+ count++;
|
|
|
+ }
|
|
|
+ // this.position = data;
|
|
|
+ // let url = `//uri.amap.com/navigation?from=${data[0].gpsLongitude},${data[0].gpsLatitude},startpoint&to=${data[data.length-1].gpsLongitude},${data[data.length-1].gpsLatitude},endpoint&via=${data[260].gpsLongitude},${data[260].gpsLatitude},midwaypoint&mode=car&policy=0&src=mypage&coordinate=gaode&callnative=0`
|
|
|
+ let url = `https://ditu.amap.com/dir?type=car&policy=1&from[lnglat]=${data[i].gpsLongitude},${data[i].gpsLatitude}&from[name]=startpoint&from[id]=${i}-from&to[lnglat]=${data[j].gpsLongitude},${data[j].gpsLatitude}&to[name]=endpoint&to[id]=${i}-to&${text}&src=mypage&callnative=0&innersrc=uriapi`
|
|
|
+ console.log(url, 'url---------------------');
|
|
|
+ this.url = url;
|
|
|
+ this.xData = res.data.temperature;
|
|
|
+ this.tableData = this.resData;
|
|
|
+ // window.location.href = url;
|
|
|
+ // window.open(url, "newWindow", "width=1000,height=1000");
|
|
|
+ // window.location.reload();
|
|
|
+ this.xData = this.resX;
|
|
|
+ this.temperatureData = this.resYTemperature;
|
|
|
+ this.humidityData = this.resYHumidity;
|
|
|
+ // console.log('this.xData',this.xData);
|
|
|
+ // console.log('this.temperatureData',this.temperatureData);
|
|
|
+ // console.log('this.humidityData',this.humidityData);
|
|
|
+ this.initEcharts();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- // this.position = data;
|
|
|
- // let url = `//uri.amap.com/navigation?from=${data[0].gpsLongitude},${data[0].gpsLatitude},startpoint&to=${data[data.length-1].gpsLongitude},${data[data.length-1].gpsLatitude},endpoint&via=${data[260].gpsLongitude},${data[260].gpsLatitude},midwaypoint&mode=car&policy=0&src=mypage&coordinate=gaode&callnative=0`
|
|
|
- let url = `https://ditu.amap.com/dir?type=car&policy=1&from[lnglat]=${data[1].gpsLongitude},${data[1].gpsLatitude}&from[name]=startpoint&from[id]=0-from&to[lnglat]=${data[data.length-1].gpsLongitude},${data[data.length-1].gpsLatitude}&to[name]=endpoint&to[id]=1-to&${text}&src=mypage&callnative=0&innersrc=uriapi`
|
|
|
- console.log(url, 'url---------------------');
|
|
|
- this.url = url;
|
|
|
- this.tableData = this.resData;
|
|
|
- // window.location.href = url;
|
|
|
- // window.open(url, "newWindow", "width=1000,height=1000");
|
|
|
- // window.location.reload();
|
|
|
- this.xData = this.resX;
|
|
|
- this.temperatureData = this.resYTemperature;
|
|
|
- this.humidityData = this.resYHumidity;
|
|
|
- // console.log('this.xData',this.xData);
|
|
|
- // console.log('this.temperatureData',this.temperatureData);
|
|
|
- // console.log('this.humidityData',this.humidityData);
|
|
|
- this.initEcharts();
|
|
|
}
|
|
|
})
|
|
|
|