董国庆
2026-06-17 2115a47a481eb6ff2769f6543feedfa33069cd36
测试工作台加上禁行区不允许于场站相交校验
1个文件已修改
32 ■■■■■ 已修改文件
src/views/testDemo/operationWorkbench/map.vue 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/testDemo/operationWorkbench/map.vue
@@ -3151,6 +3151,13 @@
    window.$message?.warning('禁行区域必须完全处于运营区域内')
    return false
  }
  const overlapStation = stationData.value.find(
    station => Array.isArray(station.polygonPath) && station.polygonPath.length >= 3 && doesPolygonOverlap(points, station.polygonPath)
  )
  if (overlapStation) {
    window.$message?.warning(`禁行区域不能与场站(${overlapStation.name || '未命名场站'})相交`)
    return false
  }
  return true
}
@@ -3196,30 +3203,7 @@
      .map((point: any) => [point.lng, point.lat] as LngLatTuple)
    restrictedDrawingVertexCount.value = points.length
    map.value.remove(event.obj)
    if (points.length < 3) {
      window.$message?.warning('请绘制至少3个点的禁行区')
      setTimeout(() => startRestrictedAreaDraw(areaId), 0)
      return
    }
    if (points.length > restrictedAreaVertexLimit) {
      window.$message?.warning(
        `禁行区最多支持设置 ${restrictedAreaVertexLimit} 个点位`,
      )
      setTimeout(() => startRestrictedAreaDraw(areaId), 0)
      return
    }
    if (isFencePolygonSelfIntersect(points)) {
      window.$message?.warning('禁行区不允许自相交')
      setTimeout(() => startRestrictedAreaDraw(areaId), 0)
      return
    }
    if (calcFenceArea(points) > 81) {
      window.$message?.warning('当前禁行区范围过大,请缩小区域')
      setTimeout(() => startRestrictedAreaDraw(areaId), 0)
      return
    }
    if (!isRingInRing(points, fenceDraftPoints.value)) {
      window.$message?.warning('禁行区域必须完全处于运营区域内')
    if (!validateRestrictedAreaGeometry(points)) {
      setTimeout(() => startRestrictedAreaDraw(areaId), 0)
      return
    }