From fbde521b53ed8fc5bdb9c4bbb6cf8f6871378ec2 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 26 Nov 2021 10:09:06 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_regulatory

---
 src/views/commandQuery/taskDistribution.vue |   77 +++++++++++++++++++++++++++++---------
 1 files changed, 58 insertions(+), 19 deletions(-)

diff --git a/src/views/commandQuery/taskDistribution.vue b/src/views/commandQuery/taskDistribution.vue
index eed42be..37beb26 100644
--- a/src/views/commandQuery/taskDistribution.vue
+++ b/src/views/commandQuery/taskDistribution.vue
@@ -2,7 +2,7 @@
  * @Author: Morpheus
  * @Date: 2021-07-07 17:30:05
  * @Last Modified by: Morpheus
- * @Last Modified time: 2021-11-17 09:21:36
+ * @Last Modified time: 2021-11-25 14:54:40
  * menu-name 监管信息
  */
 <template>
@@ -43,7 +43,7 @@
                    :visible.sync="seeLocationFlag"
                    :modal-append-to-body="false"
                    width="width">
-            <Map ref="locationForm" />
+            <Map v-if="seeLocationFlag" ref="locationForm" />
         </el-dialog>
 
         <el-dialog class="see-track"
@@ -67,7 +67,7 @@
                 </el-button>
             </div>
 
-            <Map ref="tarckForm" />
+            <Map v-if="seeTrackFlag" ref="tarckForm" />
         </el-dialog>
     </basic-container>
 </template>
@@ -84,7 +84,8 @@
 // import { datasing } from "./dataqualificationExamination";
 // import { getList } from "@/api/qualificationExamination/qualificationExamination";
 import { getLisperetaskDistribution } from "@/api/commandQuery/commandQuery";
-import { getDirectiveLiveLocationVoList, getDirectiveLocusInfoList } from "@/api/map/people";
+import { getDirectiveLiveLocationVoList, getDirectiveLocusInfoList, getNewPeople, getNewTark } from "@/api/map/people";
+
 import peoplePng from "@/assets/img/people.png";
 
 export default {
@@ -380,13 +381,17 @@
             this.seeLocationFlag = true
 
             getDirectiveLiveLocationVoList({ type: 1, userIds: row.receiveDirectiveIds }).then((result) => {
-                var res = result.data.data;
-                if (JSON.stringify(res) != "[]") {
-                    res.forEach((data)=>{
+                getNewPeople().then(res => {
+
+                    if (JSON.stringify(res.data) != "{}") {
+                        var arr = res.data.sort(function (a, b) {
+                            return a['date'] < b['date'] ? 1 : -1
+                        })
+
                         this.$refs.locationForm.addEntitys(
                             {
-                                LGTD: data.longitude,
-                                LTTD: data.latitude,
+                                LGTD: arr[0].gis_jd,
+                                LTTD: arr[0].gis_wd,
                                 name: "人员位置",
                             },
                             peoplePng,
@@ -394,9 +399,25 @@
                             "peoplelayer",
                             "peopleAddlayer"
                         );
-                    })
+                    }
+                })
 
-                }
+                // var res = result.data.data;
+                // if (JSON.stringify(res) != "[]") {
+                //     res.forEach((data)=>{
+                //         this.$refs.locationForm.addEntitys(
+                //             {
+                //                 LGTD: data.longitude,
+                //                 LTTD: data.latitude,
+                //                 name: "人员位置",
+                //             },
+                //             peoplePng,
+                //             0.5,
+                //             "peoplelayer",
+                //             "peopleAddlayer"
+                //         );
+                //     })
+                // }
             });
         },
 
@@ -449,20 +470,38 @@
                 startTime: start,
                 endTime: end,
             }).then((res) => {
-                var result = res.data.data;
-                if (JSON.stringify(res) != "[]") {
-                    result.forEach((item) => {
-                        if (item.length > 1) {
+                getNewTark().then(res => {
+
+                    if (JSON.stringify(res.data.track) != "{}") {
+
+                        if (res.data.track.length > 1) {
                             let arr = [];
 
-                            item.forEach((data) => {
-                                arr.push([Number(data.longitude), Number(data.latitude)]);
+                            res.data.track.forEach((item) => {
+                                arr.push([Number(item.gis_jd), Number(item.gis_wd)]);
                             });
 
                             this.$refs.tarckForm.addLines(arr);
                         }
-                    })
-                }
+
+                    }
+
+                })
+
+                // var result = res.data.data;
+                // if (JSON.stringify(res) != "[]") {
+                //     result.forEach((item) => {
+                //         if (item.length > 1) {
+                //             let arr = [];
+
+                //             item.forEach((data) => {
+                //                 arr.push([Number(data.longitude), Number(data.latitude)]);
+                //             });
+
+                //             this.$refs.tarckForm.addLines(arr);
+                //         }
+                //     })
+                // }
             });
         },
 

--
Gitblit v1.9.3