瀏覽代碼

人员轨迹、团队最新定位页面调整优化

zhanglikun 4 年之前
父節點
當前提交
65c7632a7d
共有 2 個文件被更改,包括 36 次插入87 次删除
  1. 16 63
      src/apps/mobile/views/personnel/index.vue
  2. 20 24
      src/apps/mobile/views/personnel/team.vue

+ 16 - 63
src/apps/mobile/views/personnel/index.vue

@@ -42,7 +42,6 @@
 <script>
 // 引入高德使用高德
 import aMap from "vue-amap";
-import { lazyAMapApiLoaderInstance } from "vue-amap";
 import { getUserByCompanyId, queryTrail } from '@/apps/mobile/api/monitoring-center/index';
 // 初始化高德
 aMap.initAMapApiLoader({
@@ -63,59 +62,17 @@ aMap.initAMapApiLoader({
 export default {
   data() {
     return {
-          searchForm: {},
-          zoom: 15,
-          center: [114.459891,30.463359],
-          userList: [],
-          polyline: {
-              path: [[114.462895,30.473531], [114.461607,30.468315], [114.459891,30.463359], [114.431927,30.478135],
-              [114.416134,30.451206], [114.445703,30.454832], [114.39708,30.505279], [114.391715,30.498956]],
-              strokeOpacity: 1,
-              strokeColor: "#FF9900",
-              strokeWeight: 6,
-          },
-          texts: [
-            {
-              position: [114.462895,30.473531],
-              text: '1.2020-07-15 9:00pm',
-              offset: [0,-50],
-            },
-            {
-              position: [114.461607,30.468315],
-              text: '2.2020-07-15 7:00pm',
-              offset: [0,-50],
-            },
-            {
-              position: [114.459891,30.463359],
-              text: '3.2020-07-14 6:00am',
-              offset: [0,-50],
-            },
-            {
-              position: [114.431927,30.478135],
-              text: '4.2020-07-15 3:00am',
-              offset: [0,-50],
-            },
-            {
-              position: [114.416134,30.451206],
-              text: '5.2020-07-13 7:00am',
-              offset: [0,-50],
-            },
-            {
-              position: [114.445703,30.454832],
-              text: '6.2020-07-13 9:00am',
-              offset: [0,-50],
-            },
-            {
-              position: [114.39708,30.505279],
-              text: '7.2020-07-14 9:20am',
-              offset: [0,-50],
-            },
-            {
-              position: [114.391715,30.498956],
-              text: '8.2020-07-14 9:50am',
-              offset: [0,-50],
-            }
-          ]
+        searchForm: {},
+        zoom: 15,
+        center: [114.407749, 30.455714],
+        userList: [],
+        polyline: {
+          path: [],
+          strokeOpacity: 1,
+          strokeColor: "#FF9900",
+          strokeWeight: 6,
+        },
+        texts: []
     };
   },
   created() {
@@ -125,9 +82,9 @@ export default {
       let companyId = companyData.id;
       getUserByCompanyId(companyId)
           .then(res => {
-                for (let i = 0; i < res.data.length; i++) {
-                    this.userList.push(res.data[i]);
-                }
+              for (let i = 0; i < res.data.length; i++) {
+                  this.userList.push(res.data[i]);
+              }
           })
           .catch(err => err);
   },
@@ -143,12 +100,12 @@ export default {
               this.polyline.path = [];
               this.texts = [];
               this.polyline.path = res.data.polylines;
-              this.texts= res.data.texts;
+              this.texts = res.data.texts;
               this.texts.forEach(tem => {
                   tem.offset = [0,-50];
               })
             })
-            .catch(() => {
+          .catch(() => {
           });
       }
   }
@@ -177,10 +134,6 @@ export default {
     ::v-deep .el-input {
         width: auto;
     }
-
-    ::v-deep .el-input__inner {
-        width: 200px;
-    }
   }
 }
 </style>

+ 20 - 24
src/apps/mobile/views/personnel/team.vue

@@ -24,7 +24,6 @@
 <script>
 // 引入高德使用高德
 import aMap from "vue-amap";
-import { lazyAMapApiLoaderInstance } from "vue-amap";
 import { queryTrailByTeam } from '@/apps/mobile/api/monitoring-center/index';
 // 初始化高德
 aMap.initAMapApiLoader({
@@ -79,10 +78,10 @@ export default {
                 this.markers = [];
                 this.markers = res.data.texts;
 
-                const texts = []
-                const windows = []
-                const that = this
-          this.markers.forEach((item, index) => {
+                let texts = []
+                let windows = []
+                let that = this
+            this.markers.forEach((item, index) => {
                 texts.push({
                   position: item.position,
                   // icon:item.url, //不设置默认蓝色水滴
@@ -92,33 +91,30 @@ export default {
                       that.windows.forEach(window => {
                         window.visible = false // 关闭窗体
                       })
-                        that.window = that.windows[index]
+                      that.window = that.windows[index]
                       that.$nextTick(() => {
                         that.window.visible = true
                       })
                     }
                   }
                 })
-            windows.push({
-              position: item.position,
-              isCustom: true,
-              offset: [115, 55], // 窗体偏移
-              showShadow: false,
-              visible: false, // 初始是否显示
-              text: item.text
+              windows.push({
+                position: item.position,
+                isCustom: true,
+                offset: [115, 55], // 窗体偏移
+                showShadow: false,
+                visible: false, // 初始是否显示
+                text: item.text
+              })
             })
-          })
-          //  加点
-          this.texts = texts
-          // 加弹窗
-          this.windows = windows
-          })
-          .catch(() => {
-          });
+            //  加点
+            this.texts = texts
+            // 加弹窗
+            this.windows = windows
+              })
+              .catch(() => {
+              });
     },
-    // checkDetail() {
-    //   alert('点击了查看详情')
-    // }
   }
 };
 </script>