From d1f59bbdbf43c8008536409a9f5087eeca587e20 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 19 Nov 2021 11:25:08 +0800
Subject: [PATCH] 人员定位及轨迹修改
---
src/views/map/peopleGps.vue | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/views/map/peopleGps.vue b/src/views/map/peopleGps.vue
index d2c1a2c..2205cce 100644
--- a/src/views/map/peopleGps.vue
+++ b/src/views/map/peopleGps.vue
@@ -2,7 +2,7 @@
* @Author: Morpheus
* @Date: 2021-07-05 16:31:54
* @Last Modified by: Morpheus
- * @Last Modified time: 2021-11-19 10:43:46
+ * @Last Modified time: 2021-11-19 11:21:31
* menu-name 押运人员定位
*/
<template>
@@ -153,7 +153,7 @@
},
created () {
this.newAxios = axios.create({
- baseURL: 'http://47.104.104.46/',
+ baseURL: 'http://47.104.104.46',
timeout: 600000 // request timeout
})
@@ -194,12 +194,14 @@
positionClick (val) {
getPosition({ type: 1, workerId: val.id }).then((result) => {
- newPeople().then(res => {
- console.log(res)
+ this.newAxios({
+ url: '/api/client/getgis.php?acc=7731',
+ method: 'get'
+ }).then(res => {
- if (JSON.stringify(res) != "{}") {
- var arr = arr.sort(function (a, b) {
- return b[0]['date'] < a[0]['date'] ? 1 : -1
+ if (JSON.stringify(res.data) != "{}") {
+ var arr = res.data.sort(function (a, b) {
+ return a['date'] < b['date'] ? 1 : -1
})
this.$refs.modalForm.addEntitys(
@@ -288,16 +290,16 @@
}).then((result) => {
this.newAxios({
- url: 'api/client/getgistrack.php?number=7730&acc=7731',
+ url: '/api/client/getgistrack.php?number=7730&acc=7731',
method: 'get'
}).then(res => {
- if (JSON.stringify(res) != "{}") {
+ if (JSON.stringify(res.data.track) != "{}") {
- if (res.length > 1) {
+ if (res.data.track.length > 1) {
let arr = [];
- res.track.forEach((item) => {
+ res.data.track.forEach((item) => {
arr.push([Number(item.gis_jd), Number(item.gis_wd)]);
});
--
Gitblit v1.9.3