From de26c331fc9febdc11b85ff98ad657fb12cc2b73 Mon Sep 17 00:00:00 2001
From: wanglizhong <wlz>
Date: 星期六, 03 五月 2025 19:57:36 +0800
Subject: [PATCH] feat:车辆GPS

---
 ruoyi-ui/src/views/system/gps/map.vue |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/ruoyi-ui/src/views/system/gps/map.vue b/ruoyi-ui/src/views/system/gps/map.vue
index 854d9b0..c659550 100644
--- a/ruoyi-ui/src/views/system/gps/map.vue
+++ b/ruoyi-ui/src/views/system/gps/map.vue
@@ -151,10 +151,14 @@
     };
   },
   created() {
-    // 鑾峰彇URL鍙傛暟涓殑杞︾墝鍙�
-    const vehicleNo = this.$route.query.vehicleNo;
-    if (vehicleNo) {
-      this.queryParams.vehicleNo = vehicleNo;
+    // 鑾峰彇URL鍙傛暟
+    const query = this.$route.query;
+    if (query.vehicleNo) {
+      this.queryParams.vehicleNo = query.vehicleNo;
+    }
+    // 璁剧疆鏃堕棿鑼冨洿
+    if (query.startTime && query.endTime) {
+      this.dateRange = [query.startTime, query.endTime];
     }
     this.getList();
   },
@@ -347,6 +351,7 @@
               padding: "2px 6px",
               borderRadius: "3px",
             });
+
             marker = new BMap.Marker(bdPoint,{rotation:direction});
             marker.setLabel(label);
           } else {
@@ -365,6 +370,21 @@
               rotation: direction,
             });
           }
+          //鍦ㄨ溅鍥炬爣涓婃樉绀鸿溅鐗�
+          const label = new BMap.Label(currentSegment[index].vehicleNo, {
+            offset: new BMap.Size(0, -25), // 鍚戜笂鍋忕Щ25鍍忕礌
+            position: bdPoint,
+          });
+          label.setStyle({
+            color: "white",
+            fontSize: "12px",
+            backgroundColor: "#3388ff",
+            border: "none",
+            padding: "2px 6px",
+            borderRadius: "3px",
+          });
+          marker.setLabel(label);
+          
 
           // 鑾峰彇鍦板潃淇℃伅
           const geoc = new BMap.Geocoder();

--
Gitblit v1.9.1