| | |
| | | method: 'get', |
| | | params: param |
| | | }) |
| | | } |
| | | } |
| | | export const newPeople = (param) => { |
| | | return request({ |
| | | url: '/Escort/getgis.php?acc=7731', |
| | | method: 'get', |
| | | params: param |
| | | }) |
| | | } |
| | |
| | | * @Author: Morpheus |
| | | * @Date: 2021-07-05 16:31:54 |
| | | * @Last Modified by: Morpheus |
| | | * @Last Modified time: 2021-11-17 09:21:25 |
| | | * @Last Modified time: 2021-11-19 10:43:46 |
| | | * menu-name 押运人员定位 |
| | | */ |
| | | <template> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getPeopleList, getPosition, getTrack } from "@/api/map/people"; |
| | | import axios from 'axios' |
| | | import { getPeopleList, getPosition, getTrack, newPeople } from "@/api/map/people"; |
| | | |
| | | import peoplePng from "@/assets/img/people.png"; |
| | | |
| | | export default { |
| | | data () { |
| | | return { |
| | |
| | | loading: true, |
| | | trackTime: [], |
| | | detailObj: {}, |
| | | newAxios: null |
| | | }; |
| | | }, |
| | | created () { }, |
| | | created () { |
| | | this.newAxios = axios.create({ |
| | | baseURL: 'http://47.104.104.46/', |
| | | timeout: 600000 // request timeout |
| | | }) |
| | | |
| | | }, |
| | | mounted () { |
| | | this.getList(); |
| | | }, |
| | |
| | | |
| | | positionClick (val) { |
| | | getPosition({ type: 1, workerId: val.id }).then((result) => { |
| | | var res = result.data.data; |
| | | if (JSON.stringify(res) != "{}") { |
| | | this.$refs.modalForm.addEntitys( |
| | | { |
| | | LGTD: res.longitude, |
| | | LTTD: res.latitude, |
| | | name: "人员位置", |
| | | }, |
| | | peoplePng, |
| | | 0.5, |
| | | "peoplelayer", |
| | | "peopleAddlayer" |
| | | ); |
| | | } |
| | | newPeople().then(res => { |
| | | console.log(res) |
| | | |
| | | if (JSON.stringify(res) != "{}") { |
| | | var arr = arr.sort(function (a, b) { |
| | | return b[0]['date'] < a[0]['date'] ? 1 : -1 |
| | | }) |
| | | |
| | | this.$refs.modalForm.addEntitys( |
| | | { |
| | | LGTD: arr[0].gis_jd, |
| | | LTTD: arr[0].gis_wd, |
| | | name: "人员位置", |
| | | }, |
| | | peoplePng, |
| | | 0.5, |
| | | "peoplelayer", |
| | | "peopleAddlayer" |
| | | ); |
| | | } |
| | | }) |
| | | // var res = result.data.data; |
| | | // if (JSON.stringify(res) != "{}") { |
| | | // this.$refs.modalForm.addEntitys( |
| | | // { |
| | | // LGTD: res.longitude, |
| | | // LTTD: res.latitude, |
| | | // name: "人员位置", |
| | | // }, |
| | | // peoplePng, |
| | | // 0.5, |
| | | // "peoplelayer", |
| | | // "peopleAddlayer" |
| | | // ); |
| | | // } |
| | | |
| | | }); |
| | | }, |
| | | |
| | |
| | | type: 1, |
| | | startTime: start, |
| | | endTime: end, |
| | | }).then((res) => { |
| | | var result = res.data.data; |
| | | if (result.length > 1) { |
| | | let arr = []; |
| | | }).then((result) => { |
| | | |
| | | result.forEach((item) => { |
| | | arr.push([Number(item.longitude), Number(item.latitude)]); |
| | | }); |
| | | this.newAxios({ |
| | | url: 'api/client/getgistrack.php?number=7730&acc=7731', |
| | | method: 'get' |
| | | }).then(res => { |
| | | |
| | | this.$refs.modalForm.addLines(arr); |
| | | } |
| | | if (JSON.stringify(res) != "{}") { |
| | | |
| | | if (res.length > 1) { |
| | | let arr = []; |
| | | |
| | | res.track.forEach((item) => { |
| | | arr.push([Number(item.gis_jd), Number(item.gis_wd)]); |
| | | }); |
| | | |
| | | this.$refs.modalForm.addLines(arr); |
| | | } |
| | | |
| | | } |
| | | |
| | | }) |
| | | |
| | | // var result = res.data.data; |
| | | // if (result.length > 1) { |
| | | // let arr = []; |
| | | |
| | | // result.forEach((item) => { |
| | | // arr.push([Number(item.longitude), Number(item.latitude)]); |
| | | // }); |
| | | |
| | | // this.$refs.modalForm.addLines(arr); |
| | | // } |
| | | }); |
| | | }, |
| | | // 处理时间补零操作 |