From afedb522ac910d1e5265ad93b9bacb1da41cfefb Mon Sep 17 00:00:00 2001
From: fei.wang <wf18701153496@163.com>
Date: 星期一, 17 三月 2025 10:58:16 +0800
Subject: [PATCH] 新增储罐管理,数据分析新增导出功能

---
 src/views/dpdv/map.vue |   86 ++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 81 insertions(+), 5 deletions(-)

diff --git a/src/views/dpdv/map.vue b/src/views/dpdv/map.vue
index 314f738..810ba57 100644
--- a/src/views/dpdv/map.vue
+++ b/src/views/dpdv/map.vue
@@ -195,6 +195,8 @@
 }
 import jizhun from "@/assets/images/ceju.png"
 import jiance from "@/assets/images/lingjin.png"
+import onlie from "@/assets/images/onile.png"
+
 import processBar from "@/components/processPar";
 import Pagination from '@/components/Pagination'
 import drawMixin from "@/utils/drawMixin"; //鑷�傚簲缂╂斁
@@ -269,7 +271,11 @@
     mounted() {
         const params = { username: localStorage.getItem('username'), phone: localStorage.getItem('phone') };
         alldevice(params).then(response => {
-            this.initMap(response.data.dataList, response.data.view)
+            console.log(111111111);
+            
+            console.log(response);
+            
+            this.initMap(response.data.dataList, response.data.view,response.data.shijiao)
         })
 
 
@@ -283,7 +289,7 @@
             this.gpsnum = ''
             this.gpsstate = ''
         },
-        initMap(tags, view) {
+        initMap(tags, view,shijiao) {
 
             // $(window).scrollTop(0);
             // window.scroll(0, 0);
@@ -292,8 +298,30 @@
             // var point = new BMapGL.Point(116.404, 39.915); // 鍦板浘涓績鐐瑰潗鏍�  
             // map.centerAndZoom(point, 15);
             const views = view.split(";");
-            map.centerAndZoom(new BMapGL.Point(views[0], views[1]), 12);
+            map.centerAndZoom(new BMapGL.Point(views[0], views[1]), 19);
             map.enableScrollWheelZoom(true);
+            map.setHeading(shijiao); // 璁剧疆鍦板浘鏃嬭浆瑙掑害
+            map.setTilt(shijiao); // 璁剧疆鍦板浘鍊炬枩瑙掑害
+
+            map.addEventListener("rightclick", function(e) {
+                console.log(e);
+                
+        // e.point 鏄偣鍑讳綅缃殑鍍忕礌鍧愭爣
+        // e.pixel 鏄偣鍑讳綅缃殑鍦扮悊鍧愭爣锛堢粡绾害锛�
+        console.log(e.point);
+        console.log(e.pixel);
+        
+        
+        var lat = e.latlng.lat; // 绾害
+        var lng = e.latlng.lng; // 缁忓害
+        
+
+        // 鍦ㄦ帶鍒跺彴鎵撳嵃缁忕含搴�
+        console.log("鍙抽敭鐐瑰嚮鐨勭粡绾害锛�", `绾害: ${lat}, 缁忓害: ${lng}`);
+
+        // 浣犱篃鍙互灏嗙粡绾害鏄剧ず鍦ㄩ〉闈笂
+        alert(`鍙抽敭鐐瑰嚮鐨勭粡绾害锛� ${lng}; ${lat}`);
+    });
             var scaleCtrl = new BMapGL.ScaleControl();  // 娣诲姞姣斾緥灏烘帶浠�
             map.addControl(scaleCtrl);
             var zoomCtrl = new BMapGL.ZoomControl();  // 娣诲姞缂╂斁鎺т欢
@@ -301,13 +329,18 @@
             //缁胯壊鐩戞祴锛屾鑹插熀鍑�
             let jizhunzhan = new BMapGL.Icon(jizhun, new BMapGL.Size(30, 30))
             let jiancezhan = new BMapGL.Icon(jiance, new BMapGL.Size(30, 30))
+            let onliezhan = new BMapGL.Icon(onlie, new BMapGL.Size(30, 30))
             for (let i = 0; i < tags.length; i++) {
                 if (tags[i].lon != null && tags[i].lon != "" && tags[i].lat != null && tags[i].lat != "") {
                     if (tags[i].lon.toString().length > 5 && tags[i].lat.toString().length > 4) {
                         var marker;
                         var label = new BMapGL.Label(tags[i].anchorname + "  " + tags[i].tagid, { offset: new BMapGL.Size(0, -40) });
+                        console.log(tags[i]);
+                        
                         if (tags[i].type == 0) {
-                            var rr = c.WGS2BD09({
+
+                            if(tags[i].onlie==1){
+                                var rr = c.WGS2BD09({
                                 lng: new Number(ToDigital(tags[i].lon.substring(0, 3), tags[i].lon.substring(3, 5), tags[i].lon.substring(5))),
                                 lat: new Number(ToDigital(tags[i].lat.substring(0, 2), tags[i].lat.substring(2, 4), tags[i].lat.substring(4)))
                             });
@@ -324,8 +357,31 @@
                                 backgroundColor: "#fa770b",
                                 transform: 'translateX(-50%)',
                             })
+                            }else{
+                                var rr = c.WGS2BD09({
+                                lng: new Number(ToDigital(tags[i].lon.substring(0, 3), tags[i].lon.substring(3, 5), tags[i].lon.substring(5))),
+                                lat: new Number(ToDigital(tags[i].lat.substring(0, 2), tags[i].lat.substring(2, 4), tags[i].lat.substring(4)))
+                            });
+                            var pt = new BMapGL.Point(rr.lng, rr.lat)
+                            marker = new BMapGL.Marker(pt, {
+                                icon: onliezhan
+                            });
+                            label.setStyle({
+                                color: "#fff",
+                                fontSize: "14px",
+                                borderRadius: "5px",
+                                padding: "5px 5px",
+                                border: "0",
+                                backgroundColor: "#474747",
+                                transform: 'translateX(-50%)',
+                            })
+                            }
+                          
+
                         } else {
-                            var rr = c.WGS2BD09({
+
+                            if(tags[i].onlie==1){
+                                var rr = c.WGS2BD09({
                                 lng: new Number(ToDigital(tags[i].lon.substring(0, 3), tags[i].lon.substring(3, 5), tags[i].lon.substring(5))),
                                 lat: new Number(ToDigital(tags[i].lat.substring(0, 2), tags[i].lat.substring(2, 4), tags[i].lat.substring(4)))
                             });
@@ -342,6 +398,26 @@
                                 backgroundColor: "#32CD32",
                                 transform: 'translateX(-50%)',
                             })
+                            }else{
+                                var rr = c.WGS2BD09({
+                                lng: new Number(ToDigital(tags[i].lon.substring(0, 3), tags[i].lon.substring(3, 5), tags[i].lon.substring(5))),
+                                lat: new Number(ToDigital(tags[i].lat.substring(0, 2), tags[i].lat.substring(2, 4), tags[i].lat.substring(4)))
+                            });
+                            var pt = new BMapGL.Point(rr.lng, rr.lat)
+                            marker = new BMapGL.Marker(pt, {
+                                icon: onliezhan
+                            });
+                            label.setStyle({
+                                color: "#fff",
+                                fontSize: "14px",
+                                borderRadius: "5px",
+                                padding: "5px 5px",
+                                border: "0",
+                                backgroundColor: "#474747",
+                                transform: 'translateX(-50%)',
+                            })
+                            }
+                           
                         }
                         marker.addEventListener("click", () => {
                             this.tagid = tags[i].tagid

--
Gitblit v1.9.3