shuishen
2021-11-19 212f4c1dfde3fe26dd6b9db9fcdcbea57181c1a3
人员修改
2 files modified
114 ■■■■ changed files
src/api/map/people.js 9 ●●●● patch | view | raw | blame | history
src/views/map/peopleGps.vue 105 ●●●● patch | view | raw | blame | history
src/api/map/people.js
@@ -38,4 +38,11 @@
        method: 'get',
        params: param
    })
}
}
export const newPeople = (param) => {
  return request({
      url: '/Escort/getgis.php?acc=7731',
      method: 'get',
      params: param
  })
}
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-17 09:21:25
 * @Last Modified time: 2021-11-19 10:43:46
 * menu-name 押运人员定位
 */
<template>
@@ -131,10 +131,10 @@
</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 {
@@ -148,9 +148,16 @@
            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();
    },
@@ -187,20 +194,42 @@
        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"
                //     );
                // }
            });
        },
@@ -256,17 +285,39 @@
                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);
                // }
            });
        },
        // 处理时间补零操作