瀏覽代碼

登录页调整,地图调整,设备新增所属部门搜索

lipenghui 2 月之前
父節點
當前提交
a9737853aa
共有 4 個文件被更改,包括 13 次插入7 次删除
  1. 1 1
      index.html
  2. 1 0
      public/images/dingou.svg
  3. 二進制
      public/images/dingwei.png
  4. 11 6
      src/views/pms/map/Map.vue

+ 1 - 1
index.html

@@ -3,7 +3,7 @@
   <head>
       <script src="https://g.alicdn.com/dingding/dinglogin/0.0.5/ddLogin.js"></script>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/js-base64@3.6.0/base64.min.js"></script>
-      <script src="http://api.map.baidu.com/api?v=3.0&ak=c0crhdxQ5H7WcqbcazGr7mnHrLa4GmO0"></script>
+      <script src="https://api.map.baidu.com/api?v=3.0&ak=c0crhdxQ5H7WcqbcazGr7mnHrLa4GmO0"></script>
       <meta charset="UTF-8" />
     <link rel="icon" href="/favicon.ico" />
     <meta http-equiv="X-UA-Compatible" content="IE=edge" />

+ 1 - 0
public/images/dingou.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1749695532183" class="icon" viewBox="0 0 1129 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6359" width="35.28125" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M828.027586 330.151724c-35.310345-82.97931-105.931034-146.537931-187.144827-171.255172-22.951724-7.062069-47.668966-10.593103-72.386207-10.593104-86.510345 0-171.255172 44.137931-224.22069 118.289655-60.027586 81.213793-82.97931 187.144828-33.544828 278.951725 40.606897 74.151724 204.8 286.013793 248.937932 346.041379 75.917241-105.931034 171.255172-201.268966 238.344827-314.262069 30.013793-51.2 42.372414-63.558621 49.434483-114.758621 5.296552-42.372414 0-86.510345-19.42069-132.413793zM564.965517 609.103448c-95.337931 0-173.02069-77.682759-173.020689-173.020689s77.682759-173.02069 173.020689-173.02069 173.02069 77.682759 173.02069 173.02069-77.682759 173.02069-173.02069 173.020689z" fill="#d4237a" p-id="6360"></path><path d="M564.965517 436.082759m-82.97931 0a82.97931 82.97931 0 1 0 165.958621 0 82.97931 82.97931 0 1 0-165.958621 0Z" fill="#d4237a" p-id="6361"></path></svg>

二進制
public/images/dingwei.png


+ 11 - 6
src/views/pms/map/Map.vue

@@ -115,24 +115,29 @@ const initDeviceMarkers = () => {
 }
 
 const createDeviceMarker = (device: IotDeviceVO, point: any) => {
+  // 根据设备是否在线选择不同的图标
+  const iconUrl = device.ifInline === 3
+    ? 'https://iot.deepoil.cc/images/ding300.svg'
+    : 'https://iot.deepoil.cc/images/dingou.svg';
+
   const marker = new (window as any).BMap.Marker(point, {
     icon: new (window as any).BMap.Icon(
-      'https://iot.deepoil.cc/images/ding300.svg',
+      iconUrl,
       new (window as any).BMap.Size(28, 30),
       {
         anchor: new (window as any).BMap.Size(14, 25)
         // imageOffset: new (window as any).BMap.Size(0, -5)
       }
     )
-  })
+  });
 
   // 添加点击事件
   marker.addEventListener('click', () => {
-    showDeviceInfoWindow(device, point)
-  })
+    showDeviceInfoWindow(device, point);
+  });
 
-  return marker
-}
+  return marker;
+};
 
 const createClusterLabel = (cluster: Cluster, point: any) => {
   const label = new (window as any).BMap.Label(cluster.count.toString(), {