| | |
| | | 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 |
| | | } |
| | | |
| | |
| | | .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 |
| | | } |