董国庆
2026-03-13 3c28ec12da405d20ba247e08045e36e088f38c6b
Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/xp-robotaxi-web
1个文件已修改
38 ■■■■■ 已修改文件
src/views/businessOperations/geofenceManagement/detail.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/businessOperations/geofenceManagement/detail.vue
@@ -1706,19 +1706,40 @@
    if (!point.lon || !point.lat) {
      return
    }
    let iconUrl = MARK_ICON_RED
    if (point.operationStatus === 1 && point.verificationStatus === 3) {
      iconUrl = MARK_ICON_GREEN
    }
    const icon = new AMap.Icon({
      size: new AMap.Size(46, 46),
      image: getPointIconUrl(point.status),
      imageSize: new AMap.Size(46, 46),
      size: new AMap.Size(26, 36),
      image: iconUrl,
      imageSize: new AMap.Size(26, 36),
    })
    const marker = new AMap.Marker({
      position: [point.lon, point.lat],
      icon,
      title: point.name,
      map: showPoints ? map : null,
      // title: point.name, // 移除 title 属性,改用 label
      map,
      extData: point,
      offset: new AMap.Pixel(-23, -23),
      offset: new AMap.Pixel(-13, -36),
    })
    // 添加鼠标移入事件
    marker.on('mouseover', () => {
      marker.setLabel({
        offset: new AMap.Pixel(0, -5), // 设置文本标注偏移量
        content: `<div class="map-info"><div class="map-info-name">${point.name}</div><img class="map-info-icon" src="/src/assets/geofence/down.png" alt="图标"></div>`, // 设置文本标注内容
        direction: 'top', // 设置文本标注方位
      })
    })
    // 添加鼠标移出事件
    marker.on('mouseout', () => {
      marker.setLabel({
        content: '', // 清空内容
      })
    })
    newMarkers.push(marker)
  })
@@ -2488,6 +2509,11 @@
    height: 100vh;
  }
}
.amap-marker-label {
  border: none !important;
  background-color: transparent !important;
}
</style>
<style lang="scss" scoped>