@fleet-frontend/mower-maps 0.2.0-beta.6 → 0.2.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (460) hide show
  1. package/dist/config/constants.d.ts.map +1 -0
  2. package/dist/config/edit.d.ts.map +1 -0
  3. package/dist/config/index.d.ts.map +1 -0
  4. package/dist/config/styles.d.ts.map +1 -0
  5. package/dist/context/common.d.ts.map +1 -0
  6. package/dist/context/index.d.ts.map +1 -0
  7. package/dist/{src/context → context}/mapEdit.d.ts +1 -0
  8. package/dist/context/mapEdit.d.ts.map +1 -0
  9. package/dist/{src/context → context}/mapRequest.d.ts.map +1 -1
  10. package/dist/context/svgEdit.d.ts.map +1 -0
  11. package/dist/{src/index.d.ts → index.d.ts} +4 -1
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.esm.js +287 -1949
  14. package/dist/index.js +333 -1990
  15. package/dist/processor/MapDataProcessor.d.ts.map +1 -0
  16. package/dist/processor/PathDataProcessor.d.ts.map +1 -0
  17. package/dist/processor/builder/AntennaDataBuilder.d.ts.map +1 -0
  18. package/dist/processor/builder/BoundaryDataBuilder.d.ts.map +1 -0
  19. package/dist/processor/builder/ChannelDataBuilder.d.ts.map +1 -0
  20. package/dist/processor/builder/ChargingPileDataBuilder.d.ts.map +1 -0
  21. package/dist/processor/builder/ObstacleDataBuilder.d.ts.map +1 -0
  22. package/dist/processor/builder/PathDataBuilder.d.ts.map +1 -0
  23. package/dist/processor/builder/PointDataBuilder.d.ts.map +1 -0
  24. package/dist/processor/builder/SvgElementDataBuilder.d.ts.map +1 -0
  25. package/dist/processor/builder/VisionOffDataBuilder.d.ts.map +1 -0
  26. package/dist/processor/builder/index.d.ts.map +1 -0
  27. package/dist/processor/index.d.ts.map +1 -0
  28. package/dist/processor/unified/BaseData.d.ts.map +1 -0
  29. package/dist/processor/unified/UnifiedMapDataProcessor.d.ts.map +1 -0
  30. package/dist/processor/unified/index.d.ts.map +1 -0
  31. package/dist/processor/unified/initData.d.ts.map +1 -0
  32. package/dist/render/AntennaManager.d.ts.map +1 -0
  33. package/dist/render/BoundaryLabelsManager.d.ts.map +1 -0
  34. package/dist/render/BoundarySvgRender.d.ts.map +1 -0
  35. package/dist/render/ChargingPileManager.d.ts.map +1 -0
  36. package/dist/render/MowerMapOverlay.d.ts.map +1 -0
  37. package/dist/render/MowerMapRenderer.d.ts.map +1 -0
  38. package/dist/render/MowerPositionManager.d.ts.map +1 -0
  39. package/dist/render/Overlay/domHelper.d.ts.map +1 -0
  40. package/dist/render/Overlay/overlay.d.ts.map +1 -0
  41. package/dist/render/Overlay/overlayView.d.ts.map +1 -0
  42. package/dist/render/SvgMapView.d.ts.map +1 -0
  43. package/dist/render/antennas/index.d.ts.map +1 -0
  44. package/dist/render/antennas/useAntennaInfo.d.ts.map +1 -0
  45. package/dist/render/boundaryLabels/index.d.ts.map +1 -0
  46. package/dist/render/boundaryLabels/useBoundaryLabels.d.ts.map +1 -0
  47. package/dist/render/charginPile/index.d.ts.map +1 -0
  48. package/dist/render/charginPile/useChargingPile.d.ts.map +1 -0
  49. package/dist/render/components/CustomModal/index.d.ts.map +1 -0
  50. package/dist/render/components/CutHeightSlider/index.d.ts.map +1 -0
  51. package/dist/render/drag/drag.d.ts.map +1 -0
  52. package/dist/render/drag/index.d.ts.map +1 -0
  53. package/dist/render/drag/rotate.d.ts.map +1 -0
  54. package/dist/render/drag/useDrag.d.ts.map +1 -0
  55. package/dist/render/layers/AntennaLayer.d.ts.map +1 -0
  56. package/dist/render/layers/BaseLayer.d.ts.map +1 -0
  57. package/dist/render/layers/BoundaryBorderLayer.d.ts.map +1 -0
  58. package/dist/render/layers/BoundaryLayer.d.ts.map +1 -0
  59. package/dist/render/layers/ChannelLayer.d.ts.map +1 -0
  60. package/dist/render/layers/ChargingPileLayer.d.ts.map +1 -0
  61. package/dist/render/layers/DrawLayer.d.ts.map +1 -0
  62. package/dist/render/layers/ObstacleLayer.d.ts.map +1 -0
  63. package/dist/render/layers/PathLayer.d.ts.map +1 -0
  64. package/dist/render/layers/PointLayer.d.ts.map +1 -0
  65. package/dist/render/layers/SvgElementLayer.d.ts.map +1 -0
  66. package/dist/render/layers/VisionOffLayer.d.ts.map +1 -0
  67. package/dist/render/layers/index.d.ts.map +1 -0
  68. package/dist/render/layers/types.d.ts.map +1 -0
  69. package/dist/render/mowerPosition/index.d.ts.map +1 -0
  70. package/dist/render/mowerPosition/usePosition.d.ts.map +1 -0
  71. package/dist/render/svgEditMap/components/AddEntry/components/DoodleModal/index.d.ts.map +1 -0
  72. package/dist/render/svgEditMap/components/AddEntry/index.d.ts.map +1 -0
  73. package/dist/render/svgEditMap/components/Crosshair/index.d.ts.map +1 -0
  74. package/dist/render/svgEditMap/components/HandleElementInfo/boundary.d.ts.map +1 -0
  75. package/dist/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/DirectLine.d.ts.map +1 -0
  76. package/dist/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/index.d.ts.map +1 -0
  77. package/dist/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/util.d.ts.map +1 -0
  78. package/dist/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/index.d.ts.map +1 -0
  79. package/dist/render/svgEditMap/components/HandleElementInfo/components/Header/index.d.ts.map +1 -0
  80. package/dist/render/svgEditMap/components/HandleElementInfo/components/HeightModal/index.d.ts.map +1 -0
  81. package/dist/render/svgEditMap/components/HandleElementInfo/components/Item/index.d.ts.map +1 -0
  82. package/dist/render/svgEditMap/components/HandleElementInfo/components/MowingEdgeModal/index.d.ts.map +1 -0
  83. package/dist/render/svgEditMap/components/HandleElementInfo/components/NameEdit/index.d.ts.map +1 -0
  84. package/dist/render/svgEditMap/components/HandleElementInfo/components/NameEdit/nameModal.d.ts.map +1 -0
  85. package/dist/render/svgEditMap/components/HandleElementInfo/components/OtherInfo/index.d.ts.map +1 -0
  86. package/dist/render/svgEditMap/components/HandleElementInfo/components/TimePeriod/index.d.ts.map +1 -0
  87. package/dist/render/svgEditMap/components/HandleElementInfo/doodle.d.ts.map +1 -0
  88. package/dist/render/svgEditMap/components/HandleElementInfo/index.d.ts.map +1 -0
  89. package/dist/render/svgEditMap/components/HandleElementInfo/obstacle.d.ts.map +1 -0
  90. package/dist/render/svgEditMap/components/HandleElementInfo/visionOff.d.ts.map +1 -0
  91. package/dist/render/svgEditMap/components/contants.d.ts.map +1 -0
  92. package/dist/render/svgEditMap/hooks/useCheckElement.d.ts.map +1 -0
  93. package/dist/render/svgEditMap/hooks/useCreateVisionOffElement.d.ts.map +1 -0
  94. package/dist/render/svgEditMap/hooks/useHistoryHandle.d.ts.map +1 -0
  95. package/dist/render/svgEditMap/hooks/usePolygonDrawing.d.ts.map +1 -0
  96. package/dist/{src/render → render}/svgEditMap/index.d.ts +3 -0
  97. package/dist/render/svgEditMap/index.d.ts.map +1 -0
  98. package/dist/render/svgElement/BoundaryElement/index.d.ts.map +1 -0
  99. package/dist/render/svgElement/ChannelClipPath/index.d.ts.map +1 -0
  100. package/dist/render/svgElement/ChannelElement/index.d.ts.map +1 -0
  101. package/dist/render/svgElement/DoodleElement/index.d.ts.map +1 -0
  102. package/dist/render/svgElement/DoodleTransform/index.d.ts.map +1 -0
  103. package/dist/render/svgElement/Gelement/index.d.ts.map +1 -0
  104. package/dist/render/svgElement/Mobile/CreateObstacleElement/coordinateUtils.d.ts.map +1 -0
  105. package/dist/render/svgElement/Mobile/CreateObstacleElement/index.d.ts.map +1 -0
  106. package/dist/render/svgElement/ObstacleElement/index.d.ts.map +1 -0
  107. package/dist/render/svgElement/PolygonELement/components/DistanceLabels.d.ts.map +1 -0
  108. package/dist/render/svgElement/PolygonELement/components/DragDistanceIndicator.d.ts.map +1 -0
  109. package/dist/render/svgElement/PolygonELement/dashPath/index.d.ts.map +1 -0
  110. package/dist/render/svgElement/PolygonELement/index.d.ts.map +1 -0
  111. package/dist/render/svgElement/PolygonELement/vertex/index.d.ts.map +1 -0
  112. package/dist/render/svgElement/TextElement/index.d.ts.map +1 -0
  113. package/dist/render/svgElement/TransformWrapper/DoodleTransformWrapper/DoodleTransformWrapper.d.ts.map +1 -0
  114. package/dist/render/svgElement/TransformWrapper/DoodleTransformWrapper/useDoodleTransform.d.ts.map +1 -0
  115. package/dist/render/svgElement/TransformWrapper/HandleIcon/index.d.ts.map +1 -0
  116. package/dist/render/svgElement/TransformWrapper/VisionOffTransformWrapper/VisionOffTransformWrapper.d.ts.map +1 -0
  117. package/dist/render/svgElement/TransformWrapper/VisionOffTransformWrapper/useVisionOffTransform.d.ts.map +1 -0
  118. package/dist/render/svgElement/VisionOffElement/index.d.ts.map +1 -0
  119. package/dist/render/svgElement/index.d.ts.map +1 -0
  120. package/dist/render/svgMap/index.d.ts.map +1 -0
  121. package/dist/render/svgMap/useSvgMapView.d.ts.map +1 -0
  122. package/dist/store/useCurrentMowingDataStore.d.ts.map +1 -0
  123. package/dist/store/usePartitionDataStore.d.ts.map +1 -0
  124. package/dist/types/antenna.d.ts.map +1 -0
  125. package/dist/types/common.d.ts.map +1 -0
  126. package/dist/types/constants.d.ts.map +1 -0
  127. package/dist/types/edit.d.ts.map +1 -0
  128. package/dist/types/elements.d.ts.map +1 -0
  129. package/dist/types/index.d.ts.map +1 -0
  130. package/dist/types/layers.d.ts.map +1 -0
  131. package/dist/types/map.d.ts.map +1 -0
  132. package/dist/types/path.d.ts.map +1 -0
  133. package/dist/types/processor.d.ts.map +1 -0
  134. package/dist/types/realTime.d.ts.map +1 -0
  135. package/dist/{src/types → types}/renderer.d.ts +1 -0
  136. package/dist/types/renderer.d.ts.map +1 -0
  137. package/dist/types/store.d.ts.map +1 -0
  138. package/dist/types/ui.d.ts.map +1 -0
  139. package/dist/types/utils.d.ts.map +1 -0
  140. package/dist/utils/boundaryUtils.d.ts.map +1 -0
  141. package/dist/utils/common.d.ts.map +1 -0
  142. package/dist/utils/coordinates.d.ts.map +1 -0
  143. package/dist/utils/dateTimeUtils.d.ts.map +1 -0
  144. package/dist/utils/display.d.ts.map +1 -0
  145. package/dist/utils/formatUtils.d.ts.map +1 -0
  146. package/dist/utils/geometryUtils.d.ts.map +1 -0
  147. package/dist/utils/handleRealTime.d.ts.map +1 -0
  148. package/dist/utils/index.d.ts.map +1 -0
  149. package/dist/utils/mapBounds.d.ts.map +1 -0
  150. package/dist/utils/math.d.ts.map +1 -0
  151. package/dist/utils/mower.d.ts.map +1 -0
  152. package/dist/utils/pathSegments.d.ts.map +1 -0
  153. package/dist/utils/pointInBoundary.d.ts.map +1 -0
  154. package/dist/utils/sleep.d.ts.map +1 -0
  155. package/dist/utils/svgParserNative.d.ts.map +1 -0
  156. package/dist/utils/svgTransform.d.ts.map +1 -0
  157. package/dist/utils/touchEvents.d.ts.map +1 -0
  158. package/dist/utils/unionFind.d.ts.map +1 -0
  159. package/package.json +1 -1
  160. package/dist/dev/components/AddPonit/index.d.ts +0 -35
  161. package/dist/dev/components/AddPonit/index.d.ts.map +0 -1
  162. package/dist/src/config/constants.d.ts.map +0 -1
  163. package/dist/src/config/edit.d.ts.map +0 -1
  164. package/dist/src/config/index.d.ts.map +0 -1
  165. package/dist/src/config/styles.d.ts.map +0 -1
  166. package/dist/src/context/common.d.ts.map +0 -1
  167. package/dist/src/context/index.d.ts.map +0 -1
  168. package/dist/src/context/mapEdit.d.ts.map +0 -1
  169. package/dist/src/context/svgEdit.d.ts.map +0 -1
  170. package/dist/src/index.d.ts.map +0 -1
  171. package/dist/src/processor/MapDataProcessor.d.ts.map +0 -1
  172. package/dist/src/processor/PathDataProcessor.d.ts.map +0 -1
  173. package/dist/src/processor/builder/AntennaDataBuilder.d.ts.map +0 -1
  174. package/dist/src/processor/builder/BoundaryDataBuilder.d.ts.map +0 -1
  175. package/dist/src/processor/builder/ChannelDataBuilder.d.ts.map +0 -1
  176. package/dist/src/processor/builder/ChargingPileDataBuilder.d.ts.map +0 -1
  177. package/dist/src/processor/builder/ObstacleDataBuilder.d.ts.map +0 -1
  178. package/dist/src/processor/builder/PathDataBuilder.d.ts.map +0 -1
  179. package/dist/src/processor/builder/PointDataBuilder.d.ts.map +0 -1
  180. package/dist/src/processor/builder/SvgElementDataBuilder.d.ts.map +0 -1
  181. package/dist/src/processor/builder/VisionOffDataBuilder.d.ts.map +0 -1
  182. package/dist/src/processor/builder/index.d.ts.map +0 -1
  183. package/dist/src/processor/index.d.ts.map +0 -1
  184. package/dist/src/processor/unified/BaseData.d.ts.map +0 -1
  185. package/dist/src/processor/unified/UnifiedMapDataProcessor.d.ts.map +0 -1
  186. package/dist/src/processor/unified/index.d.ts.map +0 -1
  187. package/dist/src/processor/unified/initData.d.ts.map +0 -1
  188. package/dist/src/render/AntennaManager.d.ts.map +0 -1
  189. package/dist/src/render/BoundaryLabelsManager.d.ts.map +0 -1
  190. package/dist/src/render/BoundarySvgRender.d.ts.map +0 -1
  191. package/dist/src/render/ChargingPileManager.d.ts.map +0 -1
  192. package/dist/src/render/MowerMapOverlay.d.ts.map +0 -1
  193. package/dist/src/render/MowerMapRenderer.d.ts.map +0 -1
  194. package/dist/src/render/MowerPositionManager.d.ts.map +0 -1
  195. package/dist/src/render/Overlay/domHelper.d.ts.map +0 -1
  196. package/dist/src/render/Overlay/overlay.d.ts.map +0 -1
  197. package/dist/src/render/Overlay/overlayView.d.ts.map +0 -1
  198. package/dist/src/render/SvgMapView.d.ts.map +0 -1
  199. package/dist/src/render/antennas/index.d.ts.map +0 -1
  200. package/dist/src/render/antennas/useAntennaInfo.d.ts.map +0 -1
  201. package/dist/src/render/boundaryLabels/index.d.ts.map +0 -1
  202. package/dist/src/render/boundaryLabels/useBoundaryLabels.d.ts.map +0 -1
  203. package/dist/src/render/charginPile/index.d.ts.map +0 -1
  204. package/dist/src/render/charginPile/useChargingPile.d.ts.map +0 -1
  205. package/dist/src/render/components/CustomModal/index.d.ts.map +0 -1
  206. package/dist/src/render/components/CutHeightSlider/index.d.ts.map +0 -1
  207. package/dist/src/render/drag/drag.d.ts.map +0 -1
  208. package/dist/src/render/drag/index.d.ts.map +0 -1
  209. package/dist/src/render/drag/rotate.d.ts.map +0 -1
  210. package/dist/src/render/drag/useDrag.d.ts.map +0 -1
  211. package/dist/src/render/layers/AntennaLayer.d.ts.map +0 -1
  212. package/dist/src/render/layers/BaseLayer.d.ts.map +0 -1
  213. package/dist/src/render/layers/BoundaryBorderLayer.d.ts.map +0 -1
  214. package/dist/src/render/layers/BoundaryLayer.d.ts.map +0 -1
  215. package/dist/src/render/layers/ChannelLayer.d.ts.map +0 -1
  216. package/dist/src/render/layers/ChargingPileLayer.d.ts.map +0 -1
  217. package/dist/src/render/layers/DrawLayer.d.ts.map +0 -1
  218. package/dist/src/render/layers/ObstacleLayer.d.ts.map +0 -1
  219. package/dist/src/render/layers/PathLayer.d.ts.map +0 -1
  220. package/dist/src/render/layers/PointLayer.d.ts.map +0 -1
  221. package/dist/src/render/layers/SvgElementLayer.d.ts.map +0 -1
  222. package/dist/src/render/layers/VisionOffLayer.d.ts.map +0 -1
  223. package/dist/src/render/layers/index.d.ts.map +0 -1
  224. package/dist/src/render/layers/types.d.ts.map +0 -1
  225. package/dist/src/render/mowerPosition/index.d.ts.map +0 -1
  226. package/dist/src/render/mowerPosition/usePosition.d.ts.map +0 -1
  227. package/dist/src/render/svgEditMap/components/AddEntry/components/DoodleModal/index.d.ts.map +0 -1
  228. package/dist/src/render/svgEditMap/components/AddEntry/index.d.ts.map +0 -1
  229. package/dist/src/render/svgEditMap/components/Crosshair/index.d.ts.map +0 -1
  230. package/dist/src/render/svgEditMap/components/HandleElementInfo/boundary.d.ts.map +0 -1
  231. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/DirectLine.d.ts.map +0 -1
  232. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/index.d.ts.map +0 -1
  233. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/util.d.ts.map +0 -1
  234. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/index.d.ts.map +0 -1
  235. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/Header/index.d.ts.map +0 -1
  236. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/HeightModal/index.d.ts.map +0 -1
  237. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/Item/index.d.ts.map +0 -1
  238. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/MowingEdgeModal/index.d.ts.map +0 -1
  239. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/NameEdit/index.d.ts.map +0 -1
  240. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/NameEdit/nameModal.d.ts.map +0 -1
  241. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/OtherInfo/index.d.ts.map +0 -1
  242. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/TimePeriod/index.d.ts.map +0 -1
  243. package/dist/src/render/svgEditMap/components/HandleElementInfo/doodle.d.ts.map +0 -1
  244. package/dist/src/render/svgEditMap/components/HandleElementInfo/index.d.ts.map +0 -1
  245. package/dist/src/render/svgEditMap/components/HandleElementInfo/obstacle.d.ts.map +0 -1
  246. package/dist/src/render/svgEditMap/components/HandleElementInfo/visionOff.d.ts.map +0 -1
  247. package/dist/src/render/svgEditMap/components/contants.d.ts.map +0 -1
  248. package/dist/src/render/svgEditMap/hooks/useCheckElement.d.ts.map +0 -1
  249. package/dist/src/render/svgEditMap/hooks/useCreateVisionOffElement.d.ts.map +0 -1
  250. package/dist/src/render/svgEditMap/hooks/useHistoryHandle.d.ts.map +0 -1
  251. package/dist/src/render/svgEditMap/hooks/usePolygonDrawing.d.ts.map +0 -1
  252. package/dist/src/render/svgEditMap/index.d.ts.map +0 -1
  253. package/dist/src/render/svgElement/BoundaryElement/index.d.ts.map +0 -1
  254. package/dist/src/render/svgElement/ChannelClipPath/index.d.ts.map +0 -1
  255. package/dist/src/render/svgElement/ChannelElement/index.d.ts.map +0 -1
  256. package/dist/src/render/svgElement/DoodleElement/index.d.ts.map +0 -1
  257. package/dist/src/render/svgElement/DoodleTransform/index.d.ts.map +0 -1
  258. package/dist/src/render/svgElement/Gelement/index.d.ts.map +0 -1
  259. package/dist/src/render/svgElement/Mobile/CreateObstacleElement/coordinateUtils.d.ts.map +0 -1
  260. package/dist/src/render/svgElement/Mobile/CreateObstacleElement/index.d.ts.map +0 -1
  261. package/dist/src/render/svgElement/ObstacleElement/index.d.ts.map +0 -1
  262. package/dist/src/render/svgElement/PolygonELement/components/DistanceLabels.d.ts.map +0 -1
  263. package/dist/src/render/svgElement/PolygonELement/components/DragDistanceIndicator.d.ts.map +0 -1
  264. package/dist/src/render/svgElement/PolygonELement/dashPath/index.d.ts.map +0 -1
  265. package/dist/src/render/svgElement/PolygonELement/index.d.ts.map +0 -1
  266. package/dist/src/render/svgElement/PolygonELement/vertex/index.d.ts.map +0 -1
  267. package/dist/src/render/svgElement/TextElement/index.d.ts.map +0 -1
  268. package/dist/src/render/svgElement/TransformWrapper/DoodleTransformWrapper/DoodleTransformWrapper.d.ts.map +0 -1
  269. package/dist/src/render/svgElement/TransformWrapper/DoodleTransformWrapper/useDoodleTransform.d.ts.map +0 -1
  270. package/dist/src/render/svgElement/TransformWrapper/HandleIcon/index.d.ts.map +0 -1
  271. package/dist/src/render/svgElement/TransformWrapper/VisionOffTransformWrapper/VisionOffTransformWrapper.d.ts.map +0 -1
  272. package/dist/src/render/svgElement/TransformWrapper/VisionOffTransformWrapper/useVisionOffTransform.d.ts.map +0 -1
  273. package/dist/src/render/svgElement/VisionOffElement/index.d.ts.map +0 -1
  274. package/dist/src/render/svgElement/index.d.ts.map +0 -1
  275. package/dist/src/render/svgMap/index.d.ts.map +0 -1
  276. package/dist/src/render/svgMap/useSvgMapView.d.ts.map +0 -1
  277. package/dist/src/store/useCurrentMowingDataStore.d.ts.map +0 -1
  278. package/dist/src/store/usePartitionDataStore.d.ts.map +0 -1
  279. package/dist/src/types/antenna.d.ts.map +0 -1
  280. package/dist/src/types/common.d.ts.map +0 -1
  281. package/dist/src/types/constants.d.ts.map +0 -1
  282. package/dist/src/types/edit.d.ts.map +0 -1
  283. package/dist/src/types/elements.d.ts.map +0 -1
  284. package/dist/src/types/index.d.ts.map +0 -1
  285. package/dist/src/types/layers.d.ts.map +0 -1
  286. package/dist/src/types/map.d.ts.map +0 -1
  287. package/dist/src/types/path.d.ts.map +0 -1
  288. package/dist/src/types/processor.d.ts.map +0 -1
  289. package/dist/src/types/realTime.d.ts.map +0 -1
  290. package/dist/src/types/renderer.d.ts.map +0 -1
  291. package/dist/src/types/store.d.ts.map +0 -1
  292. package/dist/src/types/ui.d.ts.map +0 -1
  293. package/dist/src/types/utils.d.ts.map +0 -1
  294. package/dist/src/utils/boundaryUtils.d.ts.map +0 -1
  295. package/dist/src/utils/common.d.ts.map +0 -1
  296. package/dist/src/utils/coordinates.d.ts.map +0 -1
  297. package/dist/src/utils/dateTimeUtils.d.ts.map +0 -1
  298. package/dist/src/utils/display.d.ts.map +0 -1
  299. package/dist/src/utils/formatUtils.d.ts.map +0 -1
  300. package/dist/src/utils/geometryUtils.d.ts.map +0 -1
  301. package/dist/src/utils/handleRealTime.d.ts.map +0 -1
  302. package/dist/src/utils/index.d.ts.map +0 -1
  303. package/dist/src/utils/mapBounds.d.ts.map +0 -1
  304. package/dist/src/utils/math.d.ts.map +0 -1
  305. package/dist/src/utils/mower.d.ts.map +0 -1
  306. package/dist/src/utils/pathSegments.d.ts.map +0 -1
  307. package/dist/src/utils/pointInBoundary.d.ts.map +0 -1
  308. package/dist/src/utils/sleep.d.ts.map +0 -1
  309. package/dist/src/utils/svgParserNative.d.ts.map +0 -1
  310. package/dist/src/utils/svgTransform.d.ts.map +0 -1
  311. package/dist/src/utils/touchEvents.d.ts.map +0 -1
  312. package/dist/src/utils/unionFind.d.ts.map +0 -1
  313. /package/dist/{src/config → config}/constants.d.ts +0 -0
  314. /package/dist/{src/config → config}/edit.d.ts +0 -0
  315. /package/dist/{src/config → config}/index.d.ts +0 -0
  316. /package/dist/{src/config → config}/styles.d.ts +0 -0
  317. /package/dist/{src/context → context}/common.d.ts +0 -0
  318. /package/dist/{src/context → context}/index.d.ts +0 -0
  319. /package/dist/{src/context → context}/mapRequest.d.ts +0 -0
  320. /package/dist/{src/context → context}/svgEdit.d.ts +0 -0
  321. /package/dist/{src/processor → processor}/MapDataProcessor.d.ts +0 -0
  322. /package/dist/{src/processor → processor}/PathDataProcessor.d.ts +0 -0
  323. /package/dist/{src/processor → processor}/builder/AntennaDataBuilder.d.ts +0 -0
  324. /package/dist/{src/processor → processor}/builder/BoundaryDataBuilder.d.ts +0 -0
  325. /package/dist/{src/processor → processor}/builder/ChannelDataBuilder.d.ts +0 -0
  326. /package/dist/{src/processor → processor}/builder/ChargingPileDataBuilder.d.ts +0 -0
  327. /package/dist/{src/processor → processor}/builder/ObstacleDataBuilder.d.ts +0 -0
  328. /package/dist/{src/processor → processor}/builder/PathDataBuilder.d.ts +0 -0
  329. /package/dist/{src/processor → processor}/builder/PointDataBuilder.d.ts +0 -0
  330. /package/dist/{src/processor → processor}/builder/SvgElementDataBuilder.d.ts +0 -0
  331. /package/dist/{src/processor → processor}/builder/VisionOffDataBuilder.d.ts +0 -0
  332. /package/dist/{src/processor → processor}/builder/index.d.ts +0 -0
  333. /package/dist/{src/processor → processor}/index.d.ts +0 -0
  334. /package/dist/{src/processor → processor}/unified/BaseData.d.ts +0 -0
  335. /package/dist/{src/processor → processor}/unified/UnifiedMapDataProcessor.d.ts +0 -0
  336. /package/dist/{src/processor → processor}/unified/index.d.ts +0 -0
  337. /package/dist/{src/processor → processor}/unified/initData.d.ts +0 -0
  338. /package/dist/{src/render → render}/AntennaManager.d.ts +0 -0
  339. /package/dist/{src/render → render}/BoundaryLabelsManager.d.ts +0 -0
  340. /package/dist/{src/render → render}/BoundarySvgRender.d.ts +0 -0
  341. /package/dist/{src/render → render}/ChargingPileManager.d.ts +0 -0
  342. /package/dist/{src/render → render}/MowerMapOverlay.d.ts +0 -0
  343. /package/dist/{src/render → render}/MowerMapRenderer.d.ts +0 -0
  344. /package/dist/{src/render → render}/MowerPositionManager.d.ts +0 -0
  345. /package/dist/{src/render → render}/Overlay/domHelper.d.ts +0 -0
  346. /package/dist/{src/render → render}/Overlay/overlay.d.ts +0 -0
  347. /package/dist/{src/render → render}/Overlay/overlayView.d.ts +0 -0
  348. /package/dist/{src/render → render}/SvgMapView.d.ts +0 -0
  349. /package/dist/{src/render → render}/antennas/index.d.ts +0 -0
  350. /package/dist/{src/render → render}/antennas/useAntennaInfo.d.ts +0 -0
  351. /package/dist/{src/render → render}/boundaryLabels/index.d.ts +0 -0
  352. /package/dist/{src/render → render}/boundaryLabels/useBoundaryLabels.d.ts +0 -0
  353. /package/dist/{src/render → render}/charginPile/index.d.ts +0 -0
  354. /package/dist/{src/render → render}/charginPile/useChargingPile.d.ts +0 -0
  355. /package/dist/{src/render → render}/components/CustomModal/index.d.ts +0 -0
  356. /package/dist/{src/render → render}/components/CutHeightSlider/index.d.ts +0 -0
  357. /package/dist/{src/render → render}/drag/drag.d.ts +0 -0
  358. /package/dist/{src/render → render}/drag/index.d.ts +0 -0
  359. /package/dist/{src/render → render}/drag/rotate.d.ts +0 -0
  360. /package/dist/{src/render → render}/drag/useDrag.d.ts +0 -0
  361. /package/dist/{src/render → render}/layers/AntennaLayer.d.ts +0 -0
  362. /package/dist/{src/render → render}/layers/BaseLayer.d.ts +0 -0
  363. /package/dist/{src/render → render}/layers/BoundaryBorderLayer.d.ts +0 -0
  364. /package/dist/{src/render → render}/layers/BoundaryLayer.d.ts +0 -0
  365. /package/dist/{src/render → render}/layers/ChannelLayer.d.ts +0 -0
  366. /package/dist/{src/render → render}/layers/ChargingPileLayer.d.ts +0 -0
  367. /package/dist/{src/render → render}/layers/DrawLayer.d.ts +0 -0
  368. /package/dist/{src/render → render}/layers/ObstacleLayer.d.ts +0 -0
  369. /package/dist/{src/render → render}/layers/PathLayer.d.ts +0 -0
  370. /package/dist/{src/render → render}/layers/PointLayer.d.ts +0 -0
  371. /package/dist/{src/render → render}/layers/SvgElementLayer.d.ts +0 -0
  372. /package/dist/{src/render → render}/layers/VisionOffLayer.d.ts +0 -0
  373. /package/dist/{src/render → render}/layers/index.d.ts +0 -0
  374. /package/dist/{src/render → render}/layers/types.d.ts +0 -0
  375. /package/dist/{src/render → render}/mowerPosition/index.d.ts +0 -0
  376. /package/dist/{src/render → render}/mowerPosition/usePosition.d.ts +0 -0
  377. /package/dist/{src/render → render}/svgEditMap/components/AddEntry/components/DoodleModal/index.d.ts +0 -0
  378. /package/dist/{src/render → render}/svgEditMap/components/AddEntry/index.d.ts +0 -0
  379. /package/dist/{src/render → render}/svgEditMap/components/Crosshair/index.d.ts +0 -0
  380. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/boundary.d.ts +0 -0
  381. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/DirectLine.d.ts +0 -0
  382. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/index.d.ts +0 -0
  383. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/util.d.ts +0 -0
  384. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/DirectionModal/index.d.ts +0 -0
  385. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/Header/index.d.ts +0 -0
  386. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/HeightModal/index.d.ts +0 -0
  387. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/Item/index.d.ts +0 -0
  388. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/MowingEdgeModal/index.d.ts +0 -0
  389. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/NameEdit/index.d.ts +0 -0
  390. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/NameEdit/nameModal.d.ts +0 -0
  391. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/OtherInfo/index.d.ts +0 -0
  392. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/TimePeriod/index.d.ts +0 -0
  393. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/doodle.d.ts +0 -0
  394. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/index.d.ts +0 -0
  395. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/obstacle.d.ts +0 -0
  396. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/visionOff.d.ts +0 -0
  397. /package/dist/{src/render → render}/svgEditMap/components/contants.d.ts +0 -0
  398. /package/dist/{src/render → render}/svgEditMap/hooks/useCheckElement.d.ts +0 -0
  399. /package/dist/{src/render → render}/svgEditMap/hooks/useCreateVisionOffElement.d.ts +0 -0
  400. /package/dist/{src/render → render}/svgEditMap/hooks/useHistoryHandle.d.ts +0 -0
  401. /package/dist/{src/render → render}/svgEditMap/hooks/usePolygonDrawing.d.ts +0 -0
  402. /package/dist/{src/render → render}/svgElement/BoundaryElement/index.d.ts +0 -0
  403. /package/dist/{src/render → render}/svgElement/ChannelClipPath/index.d.ts +0 -0
  404. /package/dist/{src/render → render}/svgElement/ChannelElement/index.d.ts +0 -0
  405. /package/dist/{src/render → render}/svgElement/DoodleElement/index.d.ts +0 -0
  406. /package/dist/{src/render → render}/svgElement/DoodleTransform/index.d.ts +0 -0
  407. /package/dist/{src/render → render}/svgElement/Gelement/index.d.ts +0 -0
  408. /package/dist/{src/render → render}/svgElement/Mobile/CreateObstacleElement/coordinateUtils.d.ts +0 -0
  409. /package/dist/{src/render → render}/svgElement/Mobile/CreateObstacleElement/index.d.ts +0 -0
  410. /package/dist/{src/render → render}/svgElement/ObstacleElement/index.d.ts +0 -0
  411. /package/dist/{src/render → render}/svgElement/PolygonELement/components/DistanceLabels.d.ts +0 -0
  412. /package/dist/{src/render → render}/svgElement/PolygonELement/components/DragDistanceIndicator.d.ts +0 -0
  413. /package/dist/{src/render → render}/svgElement/PolygonELement/dashPath/index.d.ts +0 -0
  414. /package/dist/{src/render → render}/svgElement/PolygonELement/index.d.ts +0 -0
  415. /package/dist/{src/render → render}/svgElement/PolygonELement/vertex/index.d.ts +0 -0
  416. /package/dist/{src/render → render}/svgElement/TextElement/index.d.ts +0 -0
  417. /package/dist/{src/render → render}/svgElement/TransformWrapper/DoodleTransformWrapper/DoodleTransformWrapper.d.ts +0 -0
  418. /package/dist/{src/render → render}/svgElement/TransformWrapper/DoodleTransformWrapper/useDoodleTransform.d.ts +0 -0
  419. /package/dist/{src/render → render}/svgElement/TransformWrapper/HandleIcon/index.d.ts +0 -0
  420. /package/dist/{src/render → render}/svgElement/TransformWrapper/VisionOffTransformWrapper/VisionOffTransformWrapper.d.ts +0 -0
  421. /package/dist/{src/render → render}/svgElement/TransformWrapper/VisionOffTransformWrapper/useVisionOffTransform.d.ts +0 -0
  422. /package/dist/{src/render → render}/svgElement/VisionOffElement/index.d.ts +0 -0
  423. /package/dist/{src/render → render}/svgElement/index.d.ts +0 -0
  424. /package/dist/{src/render → render}/svgMap/index.d.ts +0 -0
  425. /package/dist/{src/render → render}/svgMap/useSvgMapView.d.ts +0 -0
  426. /package/dist/{src/store → store}/useCurrentMowingDataStore.d.ts +0 -0
  427. /package/dist/{src/store → store}/usePartitionDataStore.d.ts +0 -0
  428. /package/dist/{src/types → types}/antenna.d.ts +0 -0
  429. /package/dist/{src/types → types}/common.d.ts +0 -0
  430. /package/dist/{src/types → types}/constants.d.ts +0 -0
  431. /package/dist/{src/types → types}/edit.d.ts +0 -0
  432. /package/dist/{src/types → types}/elements.d.ts +0 -0
  433. /package/dist/{src/types → types}/index.d.ts +0 -0
  434. /package/dist/{src/types → types}/layers.d.ts +0 -0
  435. /package/dist/{src/types → types}/map.d.ts +0 -0
  436. /package/dist/{src/types → types}/path.d.ts +0 -0
  437. /package/dist/{src/types → types}/processor.d.ts +0 -0
  438. /package/dist/{src/types → types}/realTime.d.ts +0 -0
  439. /package/dist/{src/types → types}/store.d.ts +0 -0
  440. /package/dist/{src/types → types}/ui.d.ts +0 -0
  441. /package/dist/{src/types → types}/utils.d.ts +0 -0
  442. /package/dist/{src/utils → utils}/boundaryUtils.d.ts +0 -0
  443. /package/dist/{src/utils → utils}/common.d.ts +0 -0
  444. /package/dist/{src/utils → utils}/coordinates.d.ts +0 -0
  445. /package/dist/{src/utils → utils}/dateTimeUtils.d.ts +0 -0
  446. /package/dist/{src/utils → utils}/display.d.ts +0 -0
  447. /package/dist/{src/utils → utils}/formatUtils.d.ts +0 -0
  448. /package/dist/{src/utils → utils}/geometryUtils.d.ts +0 -0
  449. /package/dist/{src/utils → utils}/handleRealTime.d.ts +0 -0
  450. /package/dist/{src/utils → utils}/index.d.ts +0 -0
  451. /package/dist/{src/utils → utils}/mapBounds.d.ts +0 -0
  452. /package/dist/{src/utils → utils}/math.d.ts +0 -0
  453. /package/dist/{src/utils → utils}/mower.d.ts +0 -0
  454. /package/dist/{src/utils → utils}/pathSegments.d.ts +0 -0
  455. /package/dist/{src/utils → utils}/pointInBoundary.d.ts +0 -0
  456. /package/dist/{src/utils → utils}/sleep.d.ts +0 -0
  457. /package/dist/{src/utils → utils}/svgParserNative.d.ts +0 -0
  458. /package/dist/{src/utils → utils}/svgTransform.d.ts +0 -0
  459. /package/dist/{src/utils → utils}/touchEvents.d.ts +0 -0
  460. /package/dist/{src/utils → utils}/unionFind.d.ts +0 -0
package/dist/index.esm.js CHANGED
@@ -2,7 +2,6 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import React__default, { memo, useMemo, useEffect, useState, useRef, useCallback, createContext, useContext, forwardRef, useImperativeHandle, useLayoutEffect } from 'react';
4
4
  import ReactDOM from 'react-dom';
5
- import { Modal, message, Popover, Input, Switch, Slider, Radio, Button, DatePicker, Select, Space } from 'antd';
6
5
 
7
6
  /**
8
7
  * 常量和枚举类型定义
@@ -1315,60 +1314,6 @@ function calculatePerpendicularFoot(point, lineStart, lineEnd) {
1315
1314
  function isFootOnSegment(foot) {
1316
1315
  return foot.param >= 0 && foot.param <= 1;
1317
1316
  }
1318
- /**
1319
- * 计算多边形的面积和周长
1320
- * @param coordinates 多边形顶点坐标数组 [[x1, y1], [x2, y2], ...]
1321
- * @returns 包含面积和周长的对象
1322
- */
1323
- function calculatePolygonAreaAndPerimeter(coordinates) {
1324
- if (!coordinates || coordinates.length < 3) {
1325
- return { area: 0, perimeter: 0 };
1326
- }
1327
- let area = 0;
1328
- let perimeter = 0;
1329
- const n = coordinates.length;
1330
- // 使用鞋带公式(Shoelace formula)计算面积
1331
- for (let i = 0; i < n; i++) {
1332
- const j = (i + 1) % n;
1333
- const [x1, y1] = coordinates[i];
1334
- const [x2, y2] = coordinates[j];
1335
- // 面积计算(鞋带公式)
1336
- area += x1 * y2 - x2 * y1;
1337
- // 周长计算(累加每条边的长度)
1338
- const dx = x2 - x1;
1339
- const dy = y2 - y1;
1340
- perimeter += Math.sqrt(dx * dx + dy * dy);
1341
- }
1342
- // 面积取绝对值并除以2
1343
- area = Math.abs(area) / 2;
1344
- return {
1345
- area,
1346
- perimeter
1347
- };
1348
- }
1349
- /**
1350
- * 计算矩形的长和宽
1351
- * @param points 矩形的4个顶点坐标 [[x1, y1], [x2, y2], [x3, y3], [x4, y4]]
1352
- * @returns 包含宽和高的数组 [width, height]
1353
- */
1354
- function calculateRectangleDimensions(points) {
1355
- if (!points || points.length !== 4) {
1356
- return [0, 0];
1357
- }
1358
- // 计算每条边的长度
1359
- const sides = [
1360
- Math.sqrt(Math.pow(points[1][0] - points[0][0], 2) + Math.pow(points[1][1] - points[0][1], 2)), // 0->1
1361
- Math.sqrt(Math.pow(points[2][0] - points[1][0], 2) + Math.pow(points[2][1] - points[1][1], 2)), // 1->2
1362
- Math.sqrt(Math.pow(points[3][0] - points[2][0], 2) + Math.pow(points[3][1] - points[2][1], 2)), // 2->3
1363
- Math.sqrt(Math.pow(points[0][0] - points[3][0], 2) + Math.pow(points[0][1] - points[3][1], 2)) // 3->0
1364
- ];
1365
- // 矩形的对边应该相等,所以我们取相邻的两条边作为宽和高
1366
- // sides[0] 和 sides[2] 是对边,sides[1] 和 sides[3] 是对边
1367
- const width = sides[0]; // 第一条边
1368
- const height = sides[1]; // 相邻的第二条边
1369
- // 返回宽和高的数组 [width, height] - 小的作为宽,大的作为高
1370
- return width <= height ? [width, height] : [height, width];
1371
- }
1372
1317
 
1373
1318
  /**
1374
1319
  * 按Python逻辑创建路径段:根据连续的两点之间的关系确定线段类型
@@ -2116,52 +2061,6 @@ function convertHeightsetToParams(value) {
2116
2061
  cuttingHeight: value,
2117
2062
  };
2118
2063
  }
2119
- function getDefaultAngle(recBaseAngle) {
2120
- if (recBaseAngle > -15 && recBaseAngle <= 15) {
2121
- return recBaseAngle;
2122
- }
2123
- else if (recBaseAngle > 15 && recBaseAngle <= 45) {
2124
- return recBaseAngle - 30;
2125
- }
2126
- else if (recBaseAngle > 45 && recBaseAngle <= 75) {
2127
- return recBaseAngle - 60;
2128
- }
2129
- else if (recBaseAngle > 75 && recBaseAngle <= 90) {
2130
- return recBaseAngle - 90;
2131
- }
2132
- else if (recBaseAngle > -90 && recBaseAngle <= -75) {
2133
- return recBaseAngle + 90;
2134
- }
2135
- else if (recBaseAngle > -75 && recBaseAngle <= -45) {
2136
- return recBaseAngle + 60;
2137
- }
2138
- else if (recBaseAngle > -45 && recBaseAngle <= -15) {
2139
- return recBaseAngle + 30;
2140
- }
2141
- }
2142
- function getSelectAngles(value) {
2143
- const A = 1 << 0; // bit0 = 1
2144
- const B = 1 << 1; // bit1 = 2
2145
- const C = 1 << 2; // bit2 = 4
2146
- const D = 1 << 3; // bit3 = 8
2147
- const E = 1 << 4; // bit4 = 16
2148
- const F = 1 << 5; // bit5 = 32
2149
- const directions = [];
2150
- // 检查每个位标志是否被设置
2151
- if (value & A)
2152
- directions.push(0, 180);
2153
- if (value & B)
2154
- directions.push(30, -150);
2155
- if (value & C)
2156
- directions.push(60, -120);
2157
- if (value & D)
2158
- directions.push(90, -90);
2159
- if (value & E)
2160
- directions.push(120, -60);
2161
- if (value & F)
2162
- directions.push(150, -30);
2163
- return directions;
2164
- }
2165
2064
 
2166
2065
  /** Detect free variable `global` from Node.js. */
2167
2066
  var freeGlobal$2 = typeof global == 'object' && global && global.Object === Object && global;
@@ -5074,18 +4973,6 @@ function convertAreaByUnits(area, type = UnitsType.Metric) {
5074
4973
  unit: UnitsAreaType.ACRE,
5075
4974
  };
5076
4975
  }
5077
- // 割草高度的转化
5078
- function convertCutHeightFormatted(value) {
5079
- return (Math.ceil(value * 0.03937 * 10) * 0.1).toFixed(1);
5080
- }
5081
- function getHeightUnit(unit) {
5082
- return unit === UnitsType.Metric ? 'mm' : 'inch';
5083
- }
5084
- function generateHeightStr(value, unit, hasUnit = false) {
5085
- const unitStr = getHeightUnit(unit);
5086
- const height = unit === UnitsType.Metric ? value : convertCutHeightFormatted(value || 0);
5087
- return hasUnit ? `${height} ${unitStr}` : value;
5088
- }
5089
4976
 
5090
4977
  /**
5091
4978
  * 日期时间格式化工具函数
@@ -8692,12 +8579,12 @@ function styleInject(css, ref) {
8692
8579
  }
8693
8580
  }
8694
8581
 
8695
- var css_248z$i = ".index-module_edit__-5VvX {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n pointer-events: auto;\n z-index: 1000;\n cursor: move;\n touch-action: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n.index-module_edit__-5VvX .index-module_border__JdNLM {\n position: absolute;\n inset: -10px;\n border: 2px dashed rgb(241, 102, 41);\n border-radius: 2px;\n pointer-events: none;\n}\n.index-module_edit__-5VvX .index-module_drag__uvdPG {\n position: absolute;\n inset: -10px;\n border-radius: 2px;\n}\n.index-module_edit__-5VvX .index-module_rotate__H-KIZ {\n position: absolute;\n top: -20px;\n right: -20px;\n width: 20px;\n height: 20px;\n cursor: grab;\n z-index: 1001;\n pointer-events: auto;\n}\n.index-module_edit__-5VvX .index-module_move__mZF8s {\n position: absolute;\n bottom: -20px;\n left: -20px;\n width: 20px;\n height: 20px;\n cursor: move;\n z-index: 1001;\n pointer-events: auto;\n}";
8696
- var styles$i = {"edit":"index-module_edit__-5VvX","border":"index-module_border__JdNLM","drag":"index-module_drag__uvdPG","rotate":"index-module_rotate__H-KIZ","move":"index-module_move__mZF8s"};
8697
- styleInject(css_248z$i);
8582
+ var css_248z$6 = ".index-module_edit__-5VvX {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n pointer-events: auto;\n z-index: 1000;\n cursor: move;\n touch-action: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n.index-module_edit__-5VvX .index-module_border__JdNLM {\n position: absolute;\n inset: -10px;\n border: 2px dashed rgb(241, 102, 41);\n border-radius: 2px;\n pointer-events: none;\n}\n.index-module_edit__-5VvX .index-module_drag__uvdPG {\n position: absolute;\n inset: -10px;\n border-radius: 2px;\n}\n.index-module_edit__-5VvX .index-module_rotate__H-KIZ {\n position: absolute;\n top: -20px;\n right: -20px;\n width: 20px;\n height: 20px;\n cursor: grab;\n z-index: 1001;\n pointer-events: auto;\n}\n.index-module_edit__-5VvX .index-module_move__mZF8s {\n position: absolute;\n bottom: -20px;\n left: -20px;\n width: 20px;\n height: 20px;\n cursor: move;\n z-index: 1001;\n pointer-events: auto;\n}";
8583
+ var styles$6 = {"edit":"index-module_edit__-5VvX","border":"index-module_border__JdNLM","drag":"index-module_drag__uvdPG","rotate":"index-module_rotate__H-KIZ","move":"index-module_move__mZF8s"};
8584
+ styleInject(css_248z$6);
8698
8585
 
8699
8586
  const RotateHandle = ({ onRotateStart, isRotating }) => {
8700
- return (jsx("div", { className: styles$i.rotate, onMouseDown: (e) => onRotateStart(e), onTouchStart: (e) => onRotateStart(e), style: { cursor: isRotating ? 'grabbing' : 'grab' }, dangerouslySetInnerHTML: { __html: DEFAULT_ROTATE_ICON } }));
8587
+ return (jsx("div", { className: styles$6.rotate, onMouseDown: (e) => onRotateStart(e), onTouchStart: (e) => onRotateStart(e), style: { cursor: isRotating ? 'grabbing' : 'grab' }, dangerouslySetInnerHTML: { __html: DEFAULT_ROTATE_ICON } }));
8701
8588
  };
8702
8589
 
8703
8590
  /**
@@ -8769,7 +8656,7 @@ const DragHandle = ({ onDragStart, isDragging }) => {
8769
8656
  if (!isMobileDevice()) {
8770
8657
  return null;
8771
8658
  }
8772
- return (jsx("div", { className: styles$i.move, onMouseDown: (e) => {
8659
+ return (jsx("div", { className: styles$6.move, onMouseDown: (e) => {
8773
8660
  console.log('down');
8774
8661
  onDragStart(e);
8775
8662
  }, onTouchStart: (e) => onDragStart(e), onMouseUp: (e) => {
@@ -8803,7 +8690,7 @@ const MapDrag = ({ map: _map, dragCallbacks, onBoundaryLabelsCollapse, onTransfo
8803
8690
  if (!isDragMap) {
8804
8691
  return null;
8805
8692
  }
8806
- return (jsxs("div", { ref: containerRef, className: styles$i.edit, style: { cursor: isDragging ? 'grabbing' : 'move' }, children: [jsx("div", { className: styles$i.border }), jsx(RotateHandle, { onRotateStart: handleRotateStart, isRotating: isRotating }), jsx("div", { className: styles$i.drag, onMouseDown: handleDragStartEvent, onTouchStart: handleDragStartEvent }), jsx(DragHandle, { onDragStart: handleDragStartEvent, isDragging: isDragging })] }));
8693
+ return (jsxs("div", { ref: containerRef, className: styles$6.edit, style: { cursor: isDragging ? 'grabbing' : 'move' }, children: [jsx("div", { className: styles$6.border }), jsx(RotateHandle, { onRotateStart: handleRotateStart, isRotating: isRotating }), jsx("div", { className: styles$6.drag, onMouseDown: handleDragStartEvent, onTouchStart: handleDragStartEvent }), jsx(DragHandle, { onDragStart: handleDragStartEvent, isDragging: isDragging })] }));
8807
8694
  };
8808
8695
 
8809
8696
  /**
@@ -14527,9 +14414,9 @@ const SvgMapComponent = forwardRef(({ editMap, rotate, mapData, pathData, modelT
14527
14414
  // 设置显示名称以便调试
14528
14415
  SvgMapComponent.displayName = 'SvgMapComponent';
14529
14416
 
14530
- var css_248z$h = ".index-module_mowerPosition__yLpIU {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n width: 100%;\n height: 100%;\n}";
14531
- var styles$h = {"mowerPosition":"index-module_mowerPosition__yLpIU"};
14532
- styleInject(css_248z$h);
14417
+ var css_248z$5 = ".index-module_mowerPosition__yLpIU {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n width: 100%;\n height: 100%;\n}";
14418
+ var styles$5 = {"mowerPosition":"index-module_mowerPosition__yLpIU"};
14419
+ styleInject(css_248z$5);
14533
14420
 
14534
14421
  const usePosition = ({ mowerPositionData, viewBox, modelType, hasEdger, mapData, realTimeData, onMowingPositionChange, }) => {
14535
14422
  // DOM 元素引用,用于直接操作
@@ -14755,7 +14642,7 @@ const MowerPosition = React__default.memo(({ editMap, mowerPositionData, viewBox
14755
14642
  pointerEvents: 'none',
14756
14643
  zIndex: 1000,
14757
14644
  }), []);
14758
- return (jsx("div", { className: styles$h.mowerPosition, style: containerStyle, children: jsx("div", { ref: elementRef, className: "mower-position", style: {
14645
+ return (jsx("div", { className: styles$5.mowerPosition, style: containerStyle, children: jsx("div", { ref: elementRef, className: "mower-position", style: {
14759
14646
  position: 'absolute',
14760
14647
  width: 30,
14761
14648
  height: 30,
@@ -14824,9 +14711,9 @@ const CharginPile = React__default.memo(({ mapData, mapConfig = {}, viewBox, rot
14824
14711
  }, children: jsx("img", { src: item.imageSrc, style: { width: '100%', height: '100%', objectFit: 'contain', opacity: 1 } }) }, `pile-${idx}`))) }));
14825
14712
  });
14826
14713
 
14827
- var css_248z$g = ".index-module_container__7IatW {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n\n.index-module_boundaryLabel__GDHFn {\n position: absolute;\n background-color: rgba(30, 30, 31, 0.6);\n color: rgb(255, 255, 255);\n padding: 6px;\n border-radius: 12px;\n font-size: 12px;\n font-weight: bold;\n max-width: 220px;\n pointer-events: auto;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n}\n\n.index-module_base__qy2SG {\n font-size: 14px;\n}\n\n.index-module_extended__0TMAt {\n margin-top: 6px;\n font-size: 11px;\n opacity: 0.9;\n border-top: 1px solid rgba(255, 255, 255, 0.2);\n padding-top: 6px;\n}";
14828
- var styles$g = {"container":"index-module_container__7IatW","boundaryLabel":"index-module_boundaryLabel__GDHFn","base":"index-module_base__qy2SG","extended":"index-module_extended__0TMAt"};
14829
- styleInject(css_248z$g);
14714
+ var css_248z$4 = ".index-module_container__7IatW {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n\n.index-module_boundaryLabel__GDHFn {\n position: absolute;\n background-color: rgba(30, 30, 31, 0.6);\n color: rgb(255, 255, 255);\n padding: 6px;\n border-radius: 12px;\n font-size: 12px;\n font-weight: bold;\n max-width: 220px;\n pointer-events: auto;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n}\n\n.index-module_base__qy2SG {\n font-size: 14px;\n}\n\n.index-module_extended__0TMAt {\n margin-top: 6px;\n font-size: 11px;\n opacity: 0.9;\n border-top: 1px solid rgba(255, 255, 255, 0.2);\n padding-top: 6px;\n}";
14715
+ var styles$4 = {"container":"index-module_container__7IatW","boundaryLabel":"index-module_boundaryLabel__GDHFn","base":"index-module_base__qy2SG","extended":"index-module_extended__0TMAt"};
14716
+ styleInject(css_248z$4);
14830
14717
 
14831
14718
  const useBoundaryLabels = ({ mapData, pathData, unitType, viewBox, mowPartitionData, realTimeData = [], }) => {
14832
14719
  const [processStateIsMowing, updateProcessStateIsMowing] = useState(false);
@@ -14980,7 +14867,7 @@ const BoundaryLabels = React__default.memo(({ editMap, mapData, pathData, unitTy
14980
14867
  zIndex: expandedId != null ? 9999 : containerZIndex,
14981
14868
  display: editMap ? 'none' : 'block',
14982
14869
  }), [containerZIndex, expandedId, editMap]);
14983
- return (jsx("div", { className: styles$g.container, style: containerStyle, children: items.map((item) => (jsxs("div", { className: `${styles$g.boundaryLabel} boundary-label`, "data-boundary-id": item.id, style: {
14870
+ return (jsx("div", { className: styles$4.container, style: containerStyle, children: items.map((item) => (jsxs("div", { className: `${styles$4.boundaryLabel} boundary-label`, "data-boundary-id": item.id, style: {
14984
14871
  transform: `translate(-50%, -50%) rotate(${-rotation}deg)`,
14985
14872
  left: `${item.leftPct}%`,
14986
14873
  top: `${item.topPct}%`,
@@ -14990,12 +14877,12 @@ const BoundaryLabels = React__default.memo(({ editMap, mapData, pathData, unitTy
14990
14877
  if (onlyRead)
14991
14878
  return;
14992
14879
  handleClick(item.id);
14993
- }, children: [jsx("div", { className: styles$g.base, children: item.baseText }), jsxs("div", { className: styles$g.extended, style: { display: expandedId === item.id ? 'block' : 'none' }, children: [jsx("div", { style: { marginBottom: 3, fontWeight: 'bold' }, children: item.coverageText }), jsx("div", { children: item.dateText })] })] }, item.id))) }));
14880
+ }, children: [jsx("div", { className: styles$4.base, children: item.baseText }), jsxs("div", { className: styles$4.extended, style: { display: expandedId === item.id ? 'block' : 'none' }, children: [jsx("div", { style: { marginBottom: 3, fontWeight: 'bold' }, children: item.coverageText }), jsx("div", { children: item.dateText })] })] }, item.id))) }));
14994
14881
  });
14995
14882
 
14996
- var css_248z$f = ".index-module_container__gB52e {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n\n.index-module_item__zHoZP {\n position: absolute;\n pointer-events: auto;\n}\n\n.index-module_icon__CS56A {\n position: relative;\n width: 24px;\n height: 24px;\n cursor: pointer;\n transition: transform 0.2s ease;\n}\n\n.index-module_tooltip__NMCmR {\n position: absolute;\n bottom: 40px;\n left: 0;\n background-color: rgb(247, 251, 255);\n color: rgb(65, 93, 116);\n padding: 10px;\n border-radius: 16px;\n font-size: 14px;\n text-align: left;\n}";
14997
- var styles$f = {"container":"index-module_container__gB52e","item":"index-module_item__zHoZP","icon":"index-module_icon__CS56A","tooltip":"index-module_tooltip__NMCmR"};
14998
- styleInject(css_248z$f);
14883
+ var css_248z$3 = ".index-module_container__gB52e {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n\n.index-module_item__zHoZP {\n position: absolute;\n pointer-events: auto;\n}\n\n.index-module_icon__CS56A {\n position: relative;\n width: 24px;\n height: 24px;\n cursor: pointer;\n transition: transform 0.2s ease;\n}\n\n.index-module_tooltip__NMCmR {\n position: absolute;\n bottom: 40px;\n left: 0;\n background-color: rgb(247, 251, 255);\n color: rgb(65, 93, 116);\n padding: 10px;\n border-radius: 16px;\n font-size: 14px;\n text-align: left;\n}";
14884
+ var styles$3 = {"container":"index-module_container__gB52e","item":"index-module_item__zHoZP","icon":"index-module_icon__CS56A","tooltip":"index-module_tooltip__NMCmR"};
14885
+ styleInject(css_248z$3);
14999
14886
 
15000
14887
  const useAntennaInfo = (data = [], options = {}) => {
15001
14888
  const { viewBox } = options;
@@ -15104,13 +14991,13 @@ const Antennas = React__default.memo(({ editMap, antennaConfig = [], viewBox, ro
15104
14991
  document.addEventListener('pointerdown', handleOutside);
15105
14992
  return () => document.removeEventListener('pointerdown', handleOutside);
15106
14993
  }, []);
15107
- return (jsx("div", { className: styles$f.container, style: containerStyle, children: items.map((item) => (jsxs("div", { className: `antenna-container-item ${styles$f.item}`, style: {
14994
+ return (jsx("div", { className: styles$3.container, style: containerStyle, children: items.map((item) => (jsxs("div", { className: `antenna-container-item ${styles$3.item}`, style: {
15108
14995
  left: `${item.leftPct}%`,
15109
14996
  top: `${item.topPct}%`,
15110
14997
  transform: `translate(calc(-50% + ${item.offsetX || 0}px), calc(-50% + ${item.offsetY || 0}px)) rotate(${-rotation}deg)`,
15111
14998
  zIndex: openType === item.type ? 10000 : containerZIndex,
15112
14999
  pointerEvents: onlyRead ? 'none' : 'auto',
15113
- }, children: [jsx("div", { className: `antenna vector-antenna antenna-${item.type} ${item.isOnline ? 'antenna-online' : 'antenna-offline'} ${styles$f.icon}`, style: {}, onClick: (e) => {
15000
+ }, children: [jsx("div", { className: `antenna vector-antenna antenna-${item.type} ${item.isOnline ? 'antenna-online' : 'antenna-offline'} ${styles$3.icon}`, style: {}, onClick: (e) => {
15114
15001
  e.stopPropagation();
15115
15002
  if (onlyRead)
15116
15003
  return;
@@ -15125,7 +15012,7 @@ const Antennas = React__default.memo(({ editMap, antennaConfig = [], viewBox, ro
15125
15012
  return;
15126
15013
  e.currentTarget.style.transform =
15127
15014
  'scale(1)';
15128
- }, children: jsx("img", { src: item.imageSrc, style: { width: '100%', height: '100%', objectFit: 'contain', opacity: 1 } }) }), jsxs("div", { className: styles$f.tooltip, style: {
15015
+ }, children: jsx("img", { src: item.imageSrc, style: { width: '100%', height: '100%', objectFit: 'contain', opacity: 1 } }) }), jsxs("div", { className: styles$3.tooltip, style: {
15129
15016
  display: openType === item.type ? 'block' : 'none',
15130
15017
  minWidth: item.tooltip.minWidth,
15131
15018
  }, children: [jsx("div", { style: { marginBottom: 4, fontWeight: 600 }, children: item.tooltip.title }), jsxs("div", { style: { color: 'rgba(65, 93, 116, 1)', fontWeight: 400 }, children: [item.tooltip.statusText, item.tooltip.syncText || ''] })] })] }, `antenna-${item.type}`))) }));
@@ -15189,15 +15076,15 @@ const VertexElement = React__default.memo(({ r, stroke, ...props }) => {
15189
15076
  return (jsx("circle", { r: radius * overlayScale, stroke: stroke || '#fff', fill: '#fff', strokeWidth: 2 * overlayScale, ...props }));
15190
15077
  });
15191
15078
 
15192
- var _path$b;
15193
- function _extends$j() { return _extends$j = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$j.apply(null, arguments); }
15194
- var SvgDelete$1 = function SvgDelete(props) {
15195
- return /*#__PURE__*/React.createElement("svg", _extends$j({
15079
+ var _path$2;
15080
+ function _extends$6() { return _extends$6 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$6.apply(null, arguments); }
15081
+ var SvgDelete = function SvgDelete(props) {
15082
+ return /*#__PURE__*/React.createElement("svg", _extends$6({
15196
15083
  xmlns: "http://www.w3.org/2000/svg",
15197
15084
  width: 16,
15198
15085
  height: 16,
15199
15086
  fill: "none"
15200
- }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
15087
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
15201
15088
  fill: "#FD494D",
15202
15089
  d: "M6.667 12a.667.667 0 0 0 .666-.667v-4a.667.667 0 1 0-1.333 0v4a.667.667 0 0 0 .667.667m6.666-8h-2.666v-.667a2 2 0 0 0-2-2H7.333a2 2 0 0 0-2 2V4H2.667a.667.667 0 0 0 0 1.333h.666v7.334a2 2 0 0 0 2 2h5.334a2 2 0 0 0 2-2V5.333h.666a.667.667 0 1 0 0-1.333m-6.666-.667a.667.667 0 0 1 .666-.666h1.334a.667.667 0 0 1 .666.666V4H6.667zm4.666 9.334a.667.667 0 0 1-.666.666H5.333a.667.667 0 0 1-.666-.666V5.333h6.666zm-2-.667a.667.667 0 0 0 .667-.667v-4a.667.667 0 0 0-1.333 0v4a.667.667 0 0 0 .666.667"
15203
15090
  })));
@@ -15342,9 +15229,9 @@ const DistanceLabels = ({ coordinates, createMode = false, editMode = false, com
15342
15229
  }), ghostLastDistance && ghostLastMidpoint && (jsx(TextElement, { x: ghostLastMidpoint[0], y: ghostLastMidpoint[1], text: ghostLastDistance })), ghostFirstDistance && ghostFirstMidpoint && (jsx(TextElement, { x: ghostFirstMidpoint[0], y: ghostFirstMidpoint[1], text: ghostFirstDistance }))] }));
15343
15230
  };
15344
15231
 
15345
- var css_248z$e = ".index-module_polygonPathG__S-Bpl {\n pointer-events: stroke;\n cursor: pointer;\n}\n\n.index-module_vertex__-Qb1u {\n cursor: pointer;\n}\n\n.index-module_dragging__xSFdO {\n cursor: grabbing;\n}\n\n.index-module_createVertex__ldz2E {\n cursor: crosshair;\n}\n\n.index-module_addVertex__hrF71 {\n cursor: pointer;\n}\n\n.index-module_polygonPath__PynOn {\n pointer-events: stroke;\n cursor: pointer;\n}\n\n.index-module_notCreate__bFnkV {\n cursor: no-drop;\n}";
15346
- var styles$e = {"polygonPathG":"index-module_polygonPathG__S-Bpl","vertex":"index-module_vertex__-Qb1u","dragging":"index-module_dragging__xSFdO","addVertex":"index-module_addVertex__hrF71","polygonPath":"index-module_polygonPath__PynOn","notCreate":"index-module_notCreate__bFnkV"};
15347
- styleInject(css_248z$e);
15232
+ var css_248z$2 = ".index-module_polygonPathG__S-Bpl {\n pointer-events: stroke;\n cursor: pointer;\n}\n\n.index-module_vertex__-Qb1u {\n cursor: pointer;\n}\n\n.index-module_dragging__xSFdO {\n cursor: grabbing;\n}\n\n.index-module_createVertex__ldz2E {\n cursor: crosshair;\n}\n\n.index-module_addVertex__hrF71 {\n cursor: pointer;\n}\n\n.index-module_polygonPath__PynOn {\n pointer-events: stroke;\n cursor: pointer;\n}\n\n.index-module_notCreate__bFnkV {\n cursor: no-drop;\n}";
15233
+ var styles$2 = {"polygonPathG":"index-module_polygonPathG__S-Bpl","vertex":"index-module_vertex__-Qb1u","dragging":"index-module_dragging__xSFdO","addVertex":"index-module_addVertex__hrF71","polygonPath":"index-module_polygonPath__PynOn","notCreate":"index-module_notCreate__bFnkV"};
15234
+ styleInject(css_248z$2);
15348
15235
 
15349
15236
  var CreateStatus;
15350
15237
  (function (CreateStatus) {
@@ -16067,8 +15954,8 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
16067
15954
  }, [dragState.currentPosition, checkCanNotCreateAtPosition]);
16068
15955
  const generateVertexClassName = useMemo(() => {
16069
15956
  if (!dragState.isDragging)
16070
- return styles$e.vertex;
16071
- return showNotCreateCursor ? styles$e.notCreate : styles$e.dragging;
15957
+ return styles$2.vertex;
15958
+ return showNotCreateCursor ? styles$2.notCreate : styles$2.dragging;
16072
15959
  }, [dragState.isDragging, showNotCreateCursor]);
16073
15960
  // 使用 useRef 来存储 requestAnimationFrame ID
16074
15961
  const rafIdRef = useRef(null);
@@ -16246,24 +16133,24 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
16246
16133
  const nextIndex = (dragState.dragIndex + 1) % coordinates.length;
16247
16134
  return (jsxs(Fragment, { children: [jsx("line", { x1: coordinates[prevIndex][0], y1: coordinates[prevIndex][1], x2: dragState.originalPosition[0], y2: dragState.originalPosition[1], stroke: strokeColor, strokeWidth: strokeWidth, strokeOpacity: 0.5, strokeDasharray: "5,5", pointerEvents: "none" }), jsx("line", { x1: dragState.originalPosition[0], y1: dragState.originalPosition[1], x2: coordinates[nextIndex][0], y2: coordinates[nextIndex][1], stroke: strokeColor, strokeWidth: strokeWidth, strokeOpacity: 0.5, strokeDasharray: "5,5", pointerEvents: "none" })] }));
16248
16135
  })()] })), renderCoordinates.length >= 3 && (jsx("polygon", { className: "vector-boundary-fill", points: polygonPoints, fill: fillColor, fillOpacity: fillOpacity, stroke: "none" // 边框透明
16249
- , onClick: onPolygonClick })), jsxs("g", { className: styles$e.polygonPathG, children: [renderCoordinates.length >= 2 &&
16136
+ , onClick: onPolygonClick })), jsxs("g", { className: styles$2.polygonPathG, children: [renderCoordinates.length >= 2 &&
16250
16137
  pathSegments.map((segment, index) => {
16251
16138
  if (segment.points.length < 2)
16252
16139
  return null;
16253
16140
  const pathData = createPathData(segment.points);
16254
16141
  const isDash = segment.type === 1;
16255
- return (jsx("path", { d: pathData, fill: "none", stroke: isDash ? 'none' : strokeColor, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", className: styles$e.polygonPath, vectorEffect: "non-scaling-stroke", onClick: onPathClick }, index));
16142
+ return (jsx("path", { d: pathData, fill: "none", stroke: isDash ? 'none' : strokeColor, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", className: styles$2.polygonPath, vectorEffect: "non-scaling-stroke", onClick: onPathClick }, index));
16256
16143
  }), renderCoordinates.length >= 2 &&
16257
16144
  dashPaths.map((segment, index) => {
16258
16145
  if (segment.points.length < 2)
16259
16146
  return null;
16260
- return (jsx(DashPath, { className: styles$e.polygonPath, points: segment.points, stroke: strokeColor, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity }, index));
16147
+ return (jsx(DashPath, { className: styles$2.polygonPath, points: segment.points, stroke: strokeColor, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity }, index));
16261
16148
  })] }), (editMode || (createMode && completed)) &&
16262
16149
  renderCoordinates.length >= 2 &&
16263
16150
  renderCoordinates.map((coord, index) => {
16264
16151
  const nextCoord = renderCoordinates[(index + 1) % renderCoordinates.length];
16265
16152
  const isDashPath = coord[2] === 1;
16266
- return (jsx("line", { x1: coord[0], y1: coord[1], x2: nextCoord[0], y2: nextCoord[1], stroke: isDashPath ? 'transparent' : strokeColor, strokeWidth: strokeWidth, className: styles$e.addVertex, vectorEffect: "non-scaling-stroke", ...(platform === PlatformType.H5
16153
+ return (jsx("line", { x1: coord[0], y1: coord[1], x2: nextCoord[0], y2: nextCoord[1], stroke: isDashPath ? 'transparent' : strokeColor, strokeWidth: strokeWidth, className: styles$2.addVertex, vectorEffect: "non-scaling-stroke", ...(platform === PlatformType.H5
16267
16154
  ? {
16268
16155
  onTouchStart: createReactEventHandler((e) => handleEdgeClick(e, index)),
16269
16156
  }
@@ -16364,7 +16251,7 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
16364
16251
  onVertexDelete(renderCoordinates?.length - 1 - idx);
16365
16252
  }
16366
16253
  setTooltipIndex(null);
16367
- }, style: { cursor: 'pointer' }, children: [jsx("rect", { x: 0, y: -24, width: 20, height: 20, rx: 2, ry: 2, fill: "#fff", strokeWidth: 1, filter: "url(#vertex-tooltip-shadow)" }), jsx("g", { transform: `translate(2, -22)`, children: jsx(SvgDelete$1, {}) })] })), canComplete && (jsx("g", { style: { pointerEvents: 'none' }, transform: `translate(${coord[0] - 5 * overlayScale * 3}, ${coord[1] - 2.5 * overlayScale * 3}) scale(${overlayScale * 3})`, children: jsx("svg", { width: "10", height: "5", viewBox: "0 0 6 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M0.5 2.5L1.3452 3.3452C1.71469 3.71469 2.30636 3.73741 2.7031 3.39735L5.5 1", stroke: "#FF7A33", "stroke-linecap": "round" }) }) })
16254
+ }, style: { cursor: 'pointer' }, children: [jsx("rect", { x: 0, y: -24, width: 20, height: 20, rx: 2, ry: 2, fill: "#fff", strokeWidth: 1, filter: "url(#vertex-tooltip-shadow)" }), jsx("g", { transform: `translate(2, -22)`, children: jsx(SvgDelete, {}) })] })), canComplete && (jsx("g", { style: { pointerEvents: 'none' }, transform: `translate(${coord[0] - 5 * overlayScale * 3}, ${coord[1] - 2.5 * overlayScale * 3}) scale(${overlayScale * 3})`, children: jsx("svg", { width: "10", height: "5", viewBox: "0 0 6 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M0.5 2.5L1.3452 3.3452C1.71469 3.71469 2.30636 3.73741 2.7031 3.39735L5.5 1", stroke: "#FF7A33", "stroke-linecap": "round" }) }) })
16368
16255
  // <rect
16369
16256
  // x={coord[0]}
16370
16257
  // y={coord[1]}
@@ -16382,7 +16269,7 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
16382
16269
 
16383
16270
  const BoundaryElement = ({ data }) => {
16384
16271
  const style = data.style || {};
16385
- const { editMapInfo, setEditMapInfo } = useMapEditContext();
16272
+ const { editMapInfo, setEditMapInfo, onSelectElement } = useMapEditContext();
16386
16273
  const { platform } = useCommonContext();
16387
16274
  const currentPoints = useMemo(() => {
16388
16275
  if (editMapInfo?.selectElement?.id === data.id) {
@@ -16404,6 +16291,7 @@ const BoundaryElement = ({ data }) => {
16404
16291
  * 点击边界的回调
16405
16292
  */
16406
16293
  const onPathClick = useCallback(() => {
16294
+ onSelectElement?.(DataType.BOUNDARY);
16407
16295
  if (platform === PlatformType.H5) {
16408
16296
  // 对于地块来说,如果当前有元素是在编辑和创建模式下,则不进行选中
16409
16297
  if (editMapInfo.mobileMode === MobileEditMode.EDIT ||
@@ -17052,15 +16940,15 @@ const useVisionOffTransform = (data, scaleConstraints
17052
16940
  };
17053
16941
  };
17054
16942
 
17055
- var _g$7, _defs$7;
17056
- function _extends$i() { return _extends$i = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$i.apply(null, arguments); }
16943
+ var _g$3, _defs$3;
16944
+ function _extends$5() { return _extends$5 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$5.apply(null, arguments); }
17057
16945
  var SvgTransformDelete = function SvgTransformDelete(props) {
17058
- return /*#__PURE__*/React.createElement("svg", _extends$i({
16946
+ return /*#__PURE__*/React.createElement("svg", _extends$5({
17059
16947
  xmlns: "http://www.w3.org/2000/svg",
17060
16948
  width: 20,
17061
16949
  height: 20,
17062
16950
  fill: "none"
17063
- }, props), _g$7 || (_g$7 = /*#__PURE__*/React.createElement("g", {
16951
+ }, props), _g$3 || (_g$3 = /*#__PURE__*/React.createElement("g", {
17064
16952
  clipPath: "url(#transform-delete_svg__a)"
17065
16953
  }, /*#__PURE__*/React.createElement("circle", {
17066
16954
  cx: 10,
@@ -17083,7 +16971,7 @@ var SvgTransformDelete = function SvgTransformDelete(props) {
17083
16971
  fill: "#fff",
17084
16972
  rx: 0.8,
17085
16973
  transform: "rotate(45 6.323 5.191)"
17086
- }))), _defs$7 || (_defs$7 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
16974
+ }))), _defs$3 || (_defs$3 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
17087
16975
  id: "transform-delete_svg__b",
17088
16976
  x1: 17.727,
17089
16977
  x2: -1.215,
@@ -17103,15 +16991,15 @@ var SvgTransformDelete = function SvgTransformDelete(props) {
17103
16991
  })))));
17104
16992
  };
17105
16993
 
17106
- var _g$6, _defs$6;
17107
- function _extends$h() { return _extends$h = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$h.apply(null, arguments); }
16994
+ var _g$2, _defs$2;
16995
+ function _extends$4() { return _extends$4 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$4.apply(null, arguments); }
17108
16996
  var SvgTransformRotate = function SvgTransformRotate(props) {
17109
- return /*#__PURE__*/React.createElement("svg", _extends$h({
16997
+ return /*#__PURE__*/React.createElement("svg", _extends$4({
17110
16998
  xmlns: "http://www.w3.org/2000/svg",
17111
16999
  width: 21,
17112
17000
  height: 20,
17113
17001
  fill: "none"
17114
- }, props), _g$6 || (_g$6 = /*#__PURE__*/React.createElement("g", {
17002
+ }, props), _g$2 || (_g$2 = /*#__PURE__*/React.createElement("g", {
17115
17003
  clipPath: "url(#transform-rotate_svg__a)"
17116
17004
  }, /*#__PURE__*/React.createElement("path", {
17117
17005
  fill: "url(#transform-rotate_svg__b)",
@@ -17119,7 +17007,7 @@ var SvgTransformRotate = function SvgTransformRotate(props) {
17119
17007
  }), /*#__PURE__*/React.createElement("path", {
17120
17008
  fill: "#fff",
17121
17009
  d: "M11.602 14.719a5.447 5.447 0 0 1-6.608-5.116l-.004-.205a.818.818 0 0 1 1.633-.084l.004.084.01.285a3.81 3.81 0 0 0 2.127 3.137l.26.115a3.8 3.8 0 0 0 2.227.184l.276-.071q.29-.088.561-.219l-1.147-.441a.817.817 0 0 1 .587-1.525l2.54.977a.817.817 0 0 1 .316 1.308l.001.001a5.45 5.45 0 0 1-2.783 1.57M8.623 4.548a5.447 5.447 0 0 1 6.608 5.116l.004.204a.818.818 0 0 1-1.633.084l-.004-.084-.01-.284a3.81 3.81 0 0 0-2.127-3.138l-.26-.115a3.8 3.8 0 0 0-2.227-.184l-.276.072q-.29.087-.561.218l1.147.442a.817.817 0 0 1-.586 1.524l-2.542-.976a.817.817 0 0 1-.315-1.309 5.45 5.45 0 0 1 2.782-1.57"
17122
- }))), _defs$6 || (_defs$6 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
17010
+ }))), _defs$2 || (_defs$2 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
17123
17011
  id: "transform-rotate_svg__b",
17124
17012
  x1: 17.84,
17125
17013
  x2: -1.103,
@@ -17139,15 +17027,15 @@ var SvgTransformRotate = function SvgTransformRotate(props) {
17139
17027
  })))));
17140
17028
  };
17141
17029
 
17142
- var _g$5, _defs$5;
17143
- function _extends$g() { return _extends$g = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$g.apply(null, arguments); }
17030
+ var _g$1, _defs$1;
17031
+ function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
17144
17032
  var SvgTransformScale = function SvgTransformScale(props) {
17145
- return /*#__PURE__*/React.createElement("svg", _extends$g({
17033
+ return /*#__PURE__*/React.createElement("svg", _extends$3({
17146
17034
  xmlns: "http://www.w3.org/2000/svg",
17147
17035
  width: 21,
17148
17036
  height: 20,
17149
17037
  fill: "none"
17150
- }, props), _g$5 || (_g$5 = /*#__PURE__*/React.createElement("g", {
17038
+ }, props), _g$1 || (_g$1 = /*#__PURE__*/React.createElement("g", {
17151
17039
  clipPath: "url(#transform-scale_svg__a)"
17152
17040
  }, /*#__PURE__*/React.createElement("path", {
17153
17041
  fill: "url(#transform-scale_svg__b)",
@@ -17155,7 +17043,7 @@ var SvgTransformScale = function SvgTransformScale(props) {
17155
17043
  }), /*#__PURE__*/React.createElement("path", {
17156
17044
  fill: "#fff",
17157
17045
  d: "M5.078 8.265a.8.8 0 0 0 1.6.001v-.544l5.69 5.69h-.494a.8.8 0 0 0 0 1.6l2.474-.002a.8.8 0 0 0 .311-.062.8.8 0 0 0 .49-.738v-2.474a.8.8 0 1 0-1.6 0v.594L7.81 6.59h.544a.8.8 0 0 0 0-1.6H5.879a.8.8 0 0 0-.8.8z"
17158
- }))), _defs$5 || (_defs$5 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
17046
+ }))), _defs$1 || (_defs$1 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
17159
17047
  id: "transform-scale_svg__b",
17160
17048
  x1: 17.84,
17161
17049
  x2: -1.103,
@@ -17175,15 +17063,15 @@ var SvgTransformScale = function SvgTransformScale(props) {
17175
17063
  })))));
17176
17064
  };
17177
17065
 
17178
- var _g$4, _defs$4;
17179
- function _extends$f() { return _extends$f = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$f.apply(null, arguments); }
17066
+ var _g, _defs;
17067
+ function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
17180
17068
  var SvgTransformTranslate = function SvgTransformTranslate(props) {
17181
- return /*#__PURE__*/React.createElement("svg", _extends$f({
17069
+ return /*#__PURE__*/React.createElement("svg", _extends$2({
17182
17070
  xmlns: "http://www.w3.org/2000/svg",
17183
17071
  width: 20,
17184
17072
  height: 20,
17185
17073
  fill: "none"
17186
- }, props), _g$4 || (_g$4 = /*#__PURE__*/React.createElement("g", {
17074
+ }, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
17187
17075
  clipPath: "url(#transform-translate_svg__a)"
17188
17076
  }, /*#__PURE__*/React.createElement("circle", {
17189
17077
  cx: 10,
@@ -17193,7 +17081,7 @@ var SvgTransformTranslate = function SvgTransformTranslate(props) {
17193
17081
  }), /*#__PURE__*/React.createElement("path", {
17194
17082
  fill: "#fff",
17195
17083
  d: "M16.18 10.758a.8.8 0 0 0-.105-1.218l-1.66-1.66a.801.801 0 0 0-1.132 1.132l.383.381h-2.96V6.418l.385.386a.8.8 0 1 0 1.131-1.13l-1.75-1.75a.8.8 0 0 0-1.222.11L7.594 5.689a.8.8 0 0 0 1.131 1.13l.381-.38v2.954H6.137l.381-.38a.8.8 0 1 0-1.13-1.132l-1.752 1.75a.8.8 0 0 0 .106 1.22l1.66 1.66a.801.801 0 0 0 1.132-1.133l-.386-.385h2.958v2.972l-.38-.38a.8.8 0 0 0-1.132 1.131l1.751 1.75a.8.8 0 0 0 1.223-.11l1.654-1.655a.8.8 0 1 0-1.13-1.131l-.386.386v-2.963h2.978l-.385.384a.8.8 0 1 0 1.131 1.131z"
17196
- }))), _defs$4 || (_defs$4 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
17084
+ }))), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
17197
17085
  id: "transform-translate_svg__b",
17198
17086
  x1: 17.727,
17199
17087
  x2: -1.215,
@@ -17868,15 +17756,15 @@ const useDoodleTransform = (data, onTransformChange, options) => {
17868
17756
  };
17869
17757
  };
17870
17758
 
17871
- var _path$a;
17872
- function _extends$e() { return _extends$e = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$e.apply(null, arguments); }
17759
+ var _path$1;
17760
+ function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
17873
17761
  var SvgTransformArrow = function SvgTransformArrow(props) {
17874
- return /*#__PURE__*/React.createElement("svg", _extends$e({
17762
+ return /*#__PURE__*/React.createElement("svg", _extends$1({
17875
17763
  xmlns: "http://www.w3.org/2000/svg",
17876
17764
  width: 7,
17877
17765
  height: 11,
17878
17766
  fill: "none"
17879
- }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
17767
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
17880
17768
  fill: "#fff",
17881
17769
  d: "M2.156 1.032a.777.777 0 0 0-1.061 0 .69.69 0 0 0-.062.943l.062.068 3.97 3.78-3.97 3.78a.69.69 0 0 0-.062.944l.062.067c.27.257.696.277.99.06l.07-.06 4.5-4.286a.69.69 0 0 0 .063-.943l-.062-.067z",
17882
17770
  opacity: 0.5
@@ -18353,7 +18241,6 @@ const DoodleElement = ({ data }) => {
18353
18241
  },
18354
18242
  });
18355
18243
  }, [transformedElements]);
18356
- console.log('originData--->', originData, minScale);
18357
18244
  return (jsx(DoodleTransformWrapper, { data: originData, onTransformChange: handleTransformChange, isSelected: isSelected, isSelectedWithoutOperation: isSelectedWithoutOperation, onSelect: handleSelect, onCancel: handleCancel, onDragEnd: handleDragEnd, showInfo: platform === PlatformType.H5, onClickInfo: handleClickInfo, minScale: minScale }));
18358
18245
  };
18359
18246
 
@@ -18399,9 +18286,9 @@ const GElement = ({ type, children }) => {
18399
18286
  return jsx("g", { id: `layer-${type}`, children: children }, type);
18400
18287
  };
18401
18288
 
18402
- var css_248z$d = ".index-module_mapEdit__XC5Gw {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n height: 100%;\n cursor: default;\n}\n.index-module_mapEdit__XC5Gw.index-module_createMode__14EPH {\n cursor: crosshair;\n}\n.index-module_mapEdit__XC5Gw.index-module_notCreateCursor__1-OjF {\n cursor: no-drop;\n}";
18403
- var styles$d = {"mapEdit":"index-module_mapEdit__XC5Gw","createMode":"index-module_createMode__14EPH","notCreateCursor":"index-module_notCreateCursor__1-OjF"};
18404
- styleInject(css_248z$d);
18289
+ var css_248z$1 = ".index-module_mapEdit__XC5Gw {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n height: 100%;\n cursor: default;\n}\n.index-module_mapEdit__XC5Gw.index-module_createMode__14EPH {\n cursor: crosshair;\n}\n.index-module_mapEdit__XC5Gw.index-module_notCreateCursor__1-OjF {\n cursor: no-drop;\n}";
18290
+ var styles$1 = {"mapEdit":"index-module_mapEdit__XC5Gw","createMode":"index-module_createMode__14EPH","notCreateCursor":"index-module_notCreateCursor__1-OjF"};
18291
+ styleInject(css_248z$1);
18405
18292
 
18406
18293
  var classnames = {exports: {}};
18407
18294
 
@@ -19400,7 +19287,7 @@ function usePolygonDrawing(options = {}) {
19400
19287
  const [mousePos, setMousePos] = useState(null);
19401
19288
  const { editMapInfo, setEditMapInfo } = useMapEditContext();
19402
19289
  const { checkCanNotCreateAtPosition } = useCheckElement();
19403
- const { addHistory, clearHistory } = useHistoryHandle();
19290
+ const { addHistory} = useHistoryHandle();
19404
19291
  const points = useMemo(() => {
19405
19292
  console.log('points->', editMapInfo?.selectElement?.points);
19406
19293
  return editMapInfo?.selectElement?.points?.map((item) => ({ x: item[0], y: item[1] })) || [];
@@ -19454,8 +19341,13 @@ function usePolygonDrawing(options = {}) {
19454
19341
  setEditMapInfo({
19455
19342
  ...editMapInfo,
19456
19343
  createMode: CreateStatus.COMPLETED,
19344
+ historyList: [
19345
+ {
19346
+ selectElement: editMapInfo.selectElement,
19347
+ },
19348
+ ],
19349
+ currentHistoryIndex: 0,
19457
19350
  });
19458
- clearHistory();
19459
19351
  }
19460
19352
  }, [points.length, editMapInfo]);
19461
19353
  const reset = useCallback(() => {
@@ -19705,7 +19597,7 @@ const useCreateVisionOffElement = () => {
19705
19597
 
19706
19598
  const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChange }, ref) => {
19707
19599
  const pointManagerRef = useRef(null);
19708
- const { editMapInfo, setEditMapInfo } = useMapEditContext();
19600
+ const { editMapInfo, setEditMapInfo, onSelectElement } = useMapEditContext();
19709
19601
  const { getVisionOffPoints, centerPoint } = useCreateVisionOffElement();
19710
19602
  const { svgElementDatas } = useSvgEditContext();
19711
19603
  const { checkCanNotCreateAtPosition, checkDoodle } = useCheckElement();
@@ -19723,6 +19615,24 @@ const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChang
19723
19615
  const isCreating = useMemo(() => {
19724
19616
  return editMapInfo.createMode === CreateStatus.CREATING;
19725
19617
  }, [editMapInfo.createMode]);
19618
+ const centerBounds = useMemo(() => {
19619
+ if (!svgRef || !centerPoint)
19620
+ return null;
19621
+ const elementWidth = 50 * 10;
19622
+ const [minX, minY, maxX, maxY] = [
19623
+ centerPoint[0] - elementWidth / 2,
19624
+ centerPoint[1] - elementWidth / 2,
19625
+ centerPoint[0] + elementWidth / 2,
19626
+ centerPoint[1] + elementWidth / 2,
19627
+ ];
19628
+ const elementPoints = [
19629
+ [minX, minY],
19630
+ [minX, maxY],
19631
+ [maxX, maxY],
19632
+ [maxX, minY],
19633
+ ];
19634
+ return elementPoints;
19635
+ }, [centerPoint]);
19726
19636
  // 调整SVG大小的函数
19727
19637
  const adjustSvgSize = (layoutData) => {
19728
19638
  const padding = 20; // 添加一些边距以避免内容贴边
@@ -19812,23 +19722,73 @@ const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChang
19812
19722
  const svg = selectedDoodle?.svgStr;
19813
19723
  const minLength = selectedDoodle.minLength;
19814
19724
  const parseSvg = SvgParserNative.parseSvg(svg);
19815
- const svgMinLength = Math.min(parseSvg.width, parseSvg.height) / SCALE_FACTOR;
19725
+ const svgMinLength = parseSvg.height / SCALE_FACTOR;
19816
19726
  // 使用获取到的 SVG 内容,如果没有获取到则使用 URL
19817
19727
  newDoodle.svg = svg;
19818
19728
  newDoodle.scale = minLength / svgMinLength;
19819
19729
  newDoodle.direction = 0;
19820
19730
  newDoodle.center = restorePoint(centerPoint);
19821
- setEditMapInfo((prev) => ({
19822
- ...prev,
19731
+ if (platform === PlatformType.H5) {
19732
+ setEditMapInfo((prev) => ({
19733
+ ...prev,
19734
+ currentHistoryIndex: 0,
19735
+ mobileMode: MobileEditMode.CREATE,
19736
+ elementType: DataType.DOODLE,
19737
+ selectElement: newDoodle,
19738
+ }));
19739
+ addHistory({
19740
+ selectElement: newDoodle,
19741
+ });
19742
+ }
19743
+ else {
19744
+ setEditMapInfo({
19745
+ ...editMapInfo,
19746
+ historyList: [
19747
+ {
19748
+ selectElement: newDoodle,
19749
+ },
19750
+ ],
19751
+ currentHistoryIndex: 0,
19752
+ createMode: CreateStatus.COMPLETED,
19753
+ elementType: DataType.DOODLE,
19754
+ selectElement: newDoodle,
19755
+ isShowDrag: true,
19756
+ });
19757
+ }
19758
+ };
19759
+ const addElement = (type, item) => {
19760
+ let newElement = null;
19761
+ if (type === DataType.BOUNDARY) {
19762
+ newElement = initBoundary();
19763
+ }
19764
+ else if (type === DataType.OBSTACLE) {
19765
+ newElement = initObstacle();
19766
+ }
19767
+ else if (type === DataType.CHANNEL) {
19768
+ newElement = initChannel();
19769
+ }
19770
+ else if (type === DataType.VISION_OFF) {
19771
+ newElement = initVisionOff();
19772
+ newElement.points = centerBounds;
19773
+ }
19774
+ else if (type === DataType.DOODLE) {
19775
+ addDoodle(item);
19776
+ return;
19777
+ }
19778
+ setEditMapInfo({
19779
+ ...editMapInfo,
19780
+ historyList: [
19781
+ {
19782
+ selectElement: newElement,
19783
+ },
19784
+ ],
19823
19785
  currentHistoryIndex: 0,
19824
- mobileMode: MobileEditMode.CREATE,
19825
- elementType: DataType.DOODLE,
19826
- selectElement: newDoodle,
19827
- }));
19828
- addHistory({
19829
- selectElement: newDoodle,
19786
+ createMode: type === DataType.VISION_OFF ? CreateStatus.COMPLETED : CreateStatus.CREATING,
19787
+ elementType: type,
19788
+ selectElement: newElement,
19830
19789
  });
19831
19790
  };
19791
+ const saveElement = (type, item) => { };
19832
19792
  useEffect(() => {
19833
19793
  onEditInfoMapChange?.(editMapInfo);
19834
19794
  }, [editMapInfo]);
@@ -19865,6 +19825,8 @@ const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChang
19865
19825
  addHistory,
19866
19826
  addDoodle,
19867
19827
  checkDoodle: () => checkDoodle?.(),
19828
+ addElement,
19829
+ saveElement,
19868
19830
  }));
19869
19831
  // 初始化多边形绘制 Hook
19870
19832
  const { onSvgClick, onSvgMouseMove, onPointClick, points, completed, mousePos, updatePoints } = usePolygonDrawing({ createMode: isCreating });
@@ -19879,10 +19841,9 @@ const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChang
19879
19841
  return false;
19880
19842
  return checkCanNotCreateAtPosition(mousePos);
19881
19843
  }, [mousePos, checkCanNotCreateAtPosition]);
19882
- console.log('editMapInfo--->', editMapInfo);
19883
- return (jsx("div", { ref: containerRef, className: classNames(styles$d.mapEdit, {
19884
- [styles$d.createMode]: isCreating,
19885
- [styles$d.notCreateCursor]: showNotCreateCursor,
19844
+ return (jsx("div", { ref: containerRef, className: classNames(styles$1.mapEdit, {
19845
+ [styles$1.createMode]: isCreating,
19846
+ [styles$1.notCreateCursor]: showNotCreateCursor,
19886
19847
  }), style: {
19887
19848
  display: editMap ? 'block' : 'none',
19888
19849
  }, children: jsxs("svg", { style: {
@@ -19980,1766 +19941,72 @@ const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChang
19980
19941
  });
19981
19942
  SvgEditMap.displayName = 'SvgEditMap';
19982
19943
 
19983
- var css_248z$c = ".index-module_addEntry__QsQHD {\n position: absolute;\n right: 8px;\n top: 8px;\n cursor: pointer;\n z-index: 10;\n}\n.index-module_addEntry__QsQHD .index-module_icon__qIgA4 {\n padding: 6px;\n border-radius: 8px;\n background: #fff;\n box-shadow: 2px 2px 12px 0px rgba(0, 0, 0, 0.2);\n}\n\n.index-module_addItem__mglwZ {\n display: flex;\n align-items: center;\n padding: 4px;\n justify-content: flex-start;\n cursor: pointer;\n}\n.index-module_addItem__mglwZ:hover {\n box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.25);\n border-radius: 4px;\n}\n.index-module_addItem__mglwZ:not(:last-child) {\n margin-bottom: 6px;\n}\n.index-module_addItem__mglwZ .index-module_icon__qIgA4 {\n width: 16px;\n height: 16px;\n}\n.index-module_addItem__mglwZ .index-module_label__QqZ-9 {\n font-weight: 500;\n font-size: 14px;\n line-height: 16px;\n color: rgb(158, 158, 158);\n margin-left: 4px;\n}";
19984
- var styles$c = {"addEntry":"index-module_addEntry__QsQHD","icon":"index-module_icon__qIgA4","addItem":"index-module_addItem__mglwZ","label":"index-module_label__QqZ-9"};
19985
- styleInject(css_248z$c);
19986
-
19987
- var _rect$2, _path$9, _defs$3;
19988
- function _extends$d() { return _extends$d = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$d.apply(null, arguments); }
19989
- var SvgAddEntry = function SvgAddEntry(props) {
19990
- return /*#__PURE__*/React.createElement("svg", _extends$d({
19991
- xmlns: "http://www.w3.org/2000/svg",
19992
- width: 24,
19993
- height: 24,
19994
- fill: "none"
19995
- }, props), _rect$2 || (_rect$2 = /*#__PURE__*/React.createElement("rect", {
19996
- width: 10.95,
19997
- height: 10.95,
19998
- x: 10.613,
19999
- y: 3.15,
20000
- fill: "#1F1F1F",
20001
- stroke: "url(#add-entry_svg__a)",
20002
- strokeWidth: 0.3,
20003
- opacity: 0.795,
20004
- rx: 1.05
20005
- })), /*#__PURE__*/React.createElement("foreignObject", {
20006
- width: 23.468,
20007
- height: 20.501,
20008
- x: -1.543,
20009
- y: 3.499
20010
- }, /*#__PURE__*/React.createElement("div", {
20011
- xmlns: "http://www.w3.org/1999/xhtml",
20012
- style: {
20013
- backdropFilter: "blur(1.63px)",
20014
- clipPath: "url(#add-entry_svg__b)",
20015
- height: "100%",
20016
- width: "100%"
20017
- }
20018
- })), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
20019
- fill: "#1F1F1F",
20020
- stroke: "url(#add-entry_svg__c)",
20021
- strokeWidth: 0.3,
20022
- d: "M9.302 7.402a1.05 1.05 0 0 1 1.778 0l7.27 11.578a1.05 1.05 0 0 1-.89 1.608H2.92a1.05 1.05 0 0 1-.889-1.608z",
20023
- "data-figma-bg-blur-radius": 3.262
20024
- })), _defs$3 || (_defs$3 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
20025
- id: "add-entry_svg__a",
20026
- x1: 16.851,
20027
- x2: 20.384,
20028
- y1: 10.392,
20029
- y2: 4.767,
20030
- gradientUnits: "userSpaceOnUse"
20031
- }, /*#__PURE__*/React.createElement("stop", {
20032
- stopColor: "#fff",
20033
- stopOpacity: 0.01
20034
- }), /*#__PURE__*/React.createElement("stop", {
20035
- offset: 1,
20036
- stopColor: "#fff"
20037
- })), /*#__PURE__*/React.createElement("linearGradient", {
20038
- id: "add-entry_svg__c",
20039
- x1: 21.47,
20040
- x2: 12.314,
20041
- y1: 15.036,
20042
- y2: 5.769,
20043
- gradientUnits: "userSpaceOnUse"
20044
- }, /*#__PURE__*/React.createElement("stop", {
20045
- stopColor: "#fff",
20046
- stopOpacity: 0.01
20047
- }), /*#__PURE__*/React.createElement("stop", {
20048
- offset: 1,
20049
- stopColor: "#fff"
20050
- })), /*#__PURE__*/React.createElement("clipPath", {
20051
- id: "add-entry_svg__b",
20052
- transform: "translate(1.543 -3.499)"
20053
- }, /*#__PURE__*/React.createElement("path", {
20054
- d: "M9.302 7.402a1.05 1.05 0 0 1 1.778 0l7.27 11.578a1.05 1.05 0 0 1-.89 1.608H2.92a1.05 1.05 0 0 1-.889-1.608z"
20055
- })))));
20056
- };
20057
-
20058
- var _path$8, _path2$3, _path3;
20059
- function _extends$c() { return _extends$c = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$c.apply(null, arguments); }
20060
- var SvgBoundary = function SvgBoundary(props) {
20061
- return /*#__PURE__*/React.createElement("svg", _extends$c({
20062
- xmlns: "http://www.w3.org/2000/svg",
20063
- width: 16,
20064
- height: 16,
20065
- fill: "none"
20066
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
20067
- fill: "#1DBEAC",
20068
- fillRule: "evenodd",
20069
- d: "M3.385 2h9.23C13.38 2 14 2.62 14 3.385v9.23C14 13.38 13.38 14 12.615 14h-9.23C2.62 14 2 13.38 2 12.615v-9.23C2 2.62 2.62 2 3.385 2m9.692 1.385a.46.46 0 0 0-.462-.462h-9.23a.46.46 0 0 0-.462.462v9.23c0 .255.207.462.462.462h9.23a.46.46 0 0 0 .462-.462z",
20070
- clipRule: "evenodd",
20071
- opacity: 0.602
20072
- })), _path2$3 || (_path2$3 = /*#__PURE__*/React.createElement("path", {
20073
- fill: "#1DBEAC",
20074
- d: "M12.615 2.923c.255 0 .462.207.462.462v9.23a.46.46 0 0 1-.462.462h-9.23a.46.46 0 0 1-.462-.462v-9.23c0-.255.207-.462.462-.462z",
20075
- opacity: 0.152
20076
- })), _path3 || (_path3 = /*#__PURE__*/React.createElement("path", {
20077
- fill: "#1DBEAC",
20078
- fillRule: "evenodd",
20079
- d: "M2.833 2a.833.833 0 1 0 0 1.667.833.833 0 0 0 0-1.667m0 10.333a.833.833 0 1 0 0 1.667.833.833 0 0 0 0-1.667m9.5-9.5a.833.833 0 1 1 1.667 0 .833.833 0 0 1-1.667 0m.834 9.5a.833.833 0 1 0 0 1.667.833.833 0 0 0 0-1.667M6.49 10.333s.335-4.388 3.451-5.666c-1.725 2.439-1.725 5.666-1.725 5.666zm2.305 0s.548-4.108 2.872-4.816c-1.071 1.7-1.071 4.816-1.071 4.816zM6.87 5.517c-2.384 1.42-2.537 4.816-2.537 4.816h1.582s-.21-2.698.955-4.816",
20080
- clipRule: "evenodd"
20081
- })));
20082
- };
20083
-
20084
- var _path$7, _path2$2, _rect$1, _rect2$1;
20085
- function _extends$b() { return _extends$b = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$b.apply(null, arguments); }
20086
- var SvgLimitIsland = function SvgLimitIsland(props) {
20087
- return /*#__PURE__*/React.createElement("svg", _extends$b({
19944
+ var _path;
19945
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
19946
+ var SvgMobileAddPoint = function SvgMobileAddPoint(props) {
19947
+ return /*#__PURE__*/React.createElement("svg", _extends({
20088
19948
  xmlns: "http://www.w3.org/2000/svg",
20089
- width: 16,
20090
- height: 16,
19949
+ width: 36,
19950
+ height: 36,
20091
19951
  fill: "none"
20092
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
20093
- fill: "#FFA077",
20094
- d: "M11.725 6.714c-1.019-.137-2.516-1.488-1.9-2.14.588-.621 1.91.344 1.9 2.14"
20095
- })), _path2$2 || (_path2$2 = /*#__PURE__*/React.createElement("path", {
20096
- fill: "#FF5D17",
20097
- d: "M11.195 3.637c-.863.109-.623 2.341.354 3.024 1.603.79 2.575-.099 2.517-.459-.072-.445-.983-1.014-2.029-.274.455-.92-.08-2.387-.842-2.291M10.004 9.084l.308.87c1.202.178 2.002.494 2.002.856 0 .556-1.887 1.007-4.215 1.007-2.329 0-4.216-.451-4.217-1.007 0-.334.683-.63 1.733-.812l.593-1.679zm-.777-2.197.518 1.463-3.312-.667.443-1.253zM7.467 4.76a.535.535 0 0 1 1.01 0l.493 1.398L7.1 5.794z"
20098
- })), _rect$1 || (_rect$1 = /*#__PURE__*/React.createElement("rect", {
20099
- width: 14.237,
20100
- height: 10.667,
20101
- x: 0.882,
20102
- y: 2.667,
20103
- fill: "#F50",
20104
- opacity: 0.15,
20105
- rx: 2
20106
- })), _rect2$1 || (_rect2$1 = /*#__PURE__*/React.createElement("rect", {
20107
- width: 14.237,
20108
- height: 10.667,
20109
- x: 0.882,
20110
- y: 2.667,
20111
- stroke: "#FF5D17",
20112
- strokeWidth: 0.867,
20113
- rx: 2
19952
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
19953
+ stroke: "#fff",
19954
+ strokeLinecap: "round",
19955
+ strokeLinejoin: "round",
19956
+ strokeWidth: 3,
19957
+ d: "M6 12V9a3 3 0 0 1 3-3h3M6 24v3a3 3 0 0 0 3 3h3M24 6h3a3 3 0 0 1 3 3v3m-6 18h3a3 3 0 0 0 3-3v-3m-16.5-6h9M18 13.5v9"
20114
19958
  })));
20115
19959
  };
20116
19960
 
20117
- var _rect, _rect2, _rect3, _rect4, _g$3;
20118
- function _extends$a() { return _extends$a = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$a.apply(null, arguments); }
20119
- var SvgVisionFence = function SvgVisionFence(props) {
20120
- return /*#__PURE__*/React.createElement("svg", _extends$a({
20121
- xmlns: "http://www.w3.org/2000/svg",
20122
- width: 16,
20123
- height: 16,
20124
- fill: "none"
20125
- }, props), _rect || (_rect = /*#__PURE__*/React.createElement("rect", {
20126
- width: 14.333,
20127
- height: 10.667,
20128
- x: 0.833,
20129
- y: 2.667,
20130
- fill: "#B1D9FF",
20131
- rx: 2.667
20132
- })), _rect2 || (_rect2 = /*#__PURE__*/React.createElement("rect", {
20133
- width: 13.333,
20134
- height: 9.667,
20135
- x: 1.333,
20136
- y: 3.167,
20137
- stroke: "#5C9DFF",
20138
- strokeDasharray: "6.33 6.33",
20139
- rx: 1.333
20140
- })), _rect3 || (_rect3 = /*#__PURE__*/React.createElement("rect", {
20141
- width: 6,
20142
- height: 6,
20143
- x: 5,
20144
- y: 4.833,
20145
- fill: "#B1D9FF",
20146
- rx: 3
20147
- })), /*#__PURE__*/React.createElement("mask", {
20148
- id: "visionFence_svg__a",
20149
- width: 6,
20150
- height: 6,
20151
- x: 5,
20152
- y: 5,
20153
- maskUnits: "userSpaceOnUse",
20154
- style: {
20155
- maskType: "alpha"
20156
- }
20157
- }, _rect4 || (_rect4 = /*#__PURE__*/React.createElement("rect", {
20158
- width: 5.333,
20159
- height: 5.333,
20160
- x: 5.333,
20161
- y: 5.5,
20162
- fill: "#B1D9FF",
20163
- rx: 2.667
20164
- }))), _g$3 || (_g$3 = /*#__PURE__*/React.createElement("g", {
20165
- fill: "#5C9DFF",
20166
- mask: "url(#visionFence_svg__a)"
20167
- }, /*#__PURE__*/React.createElement("path", {
20168
- d: "m8.838 3.395.636.636-5.42 5.421-.637-.636zM9.896 4.452l.637.637-5.422 5.42-.636-.635zM10.954 5.51l.636.637-5.421 5.421-.636-.636zM12.172 6.547l.636.637-5.421 5.42-.636-.635z"
20169
- }))));
20170
- };
19961
+ var css_248z = ".index-module_crosshair__etey6 {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 40px;\n height: 40px;\n pointer-events: none;\n z-index: 99999;\n display: flex;\n justify-content: center;\n align-items: center;\n}";
19962
+ var styles = {"crosshair":"index-module_crosshair__etey6"};
19963
+ styleInject(css_248z);
20171
19964
 
20172
- var _g$2, _defs$2;
20173
- function _extends$9() { return _extends$9 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$9.apply(null, arguments); }
20174
- var SvgDoodle = function SvgDoodle(props) {
20175
- return /*#__PURE__*/React.createElement("svg", _extends$9({
20176
- xmlns: "http://www.w3.org/2000/svg",
20177
- width: 16,
20178
- height: 16,
20179
- fill: "none"
20180
- }, props), _g$2 || (_g$2 = /*#__PURE__*/React.createElement("g", {
20181
- clipPath: "url(#doodle_svg__a)"
20182
- }, /*#__PURE__*/React.createElement("g", {
20183
- clipPath: "url(#doodle_svg__b)"
20184
- }, /*#__PURE__*/React.createElement("rect", {
20185
- width: 14.237,
20186
- height: 10.667,
20187
- x: 0.333,
20188
- y: 4.332,
20189
- fill: "#CBFCF7",
20190
- stroke: "#9AEEE5",
20191
- strokeWidth: 0.867,
20192
- rx: 2
20193
- }), /*#__PURE__*/React.createElement("path", {
20194
- fill: "#F2FFFD",
20195
- d: "M1.374 9.88a4 4 0 0 0 4 4h.546l.514-1.524c.073-.216-.087-.443-.312-.48-1.415-.229-3.6-1.485-4.399-4.639a.35.35 0 0 0-.135-.197c-.138.405-.214.84-.214 1.293z"
20196
- }), /*#__PURE__*/React.createElement("path", {
20197
- fill: "#50D0C2",
20198
- d: "M15.814 2.13c-.352 2.267-6.501 9.305-8.003 9.43a.282.282 0 0 1-.238-.455L15.565.828c.398.332.293 1.015.249 1.303"
20199
- }), /*#__PURE__*/React.createElement("path", {
20200
- fill: "#50D0C2",
20201
- d: "M14.208.95c-2.147.946-7.434 8.618-7.15 10.058a.2.2 0 0 0 .017.047.295.295 0 0 0 .498.051L15.565.826c-.437-.28-1.084.003-1.357.123"
20202
- }), /*#__PURE__*/React.createElement("path", {
20203
- fill: "#9CE7DE",
20204
- d: "M7.76 11.558a.282.282 0 0 1-.187-.453.295.295 0 0 1-.498-.05.2.2 0 0 1-.016-.048c-.108-.55.598-2.01 1.63-3.658l2.297 1.689c-1.348 1.415-2.6 2.473-3.174 2.522a.2.2 0 0 1-.053-.002"
20205
- }), /*#__PURE__*/React.createElement("path", {
20206
- fill: "#50D0C2",
20207
- d: "M5.602 11.02c.658-.873 1.769-1.145 2.482-.607.714.537.759 1.68.1 2.553-.657.873-2.733.94-2.733.94s-.507-2.013.15-2.886"
20208
- })))), _defs$2 || (_defs$2 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
20209
- id: "doodle_svg__a"
20210
- }, /*#__PURE__*/React.createElement("path", {
20211
- fill: "#fff",
20212
- d: "M0 0h16v16H0z"
20213
- })), /*#__PURE__*/React.createElement("clipPath", {
20214
- id: "doodle_svg__b"
20215
- }, /*#__PURE__*/React.createElement("path", {
20216
- fill: "#fff",
20217
- d: "M0 0h16v16H0z"
20218
- })))));
19965
+ /**
19966
+ * 十字准心组件
19967
+ * 相对于父容器居中显示
19968
+ */
19969
+ const Crosshair = () => {
19970
+ const { platform } = useCommonContext();
19971
+ const { editMapInfo } = useMapEditContext();
19972
+ const isVisible = useMemo(() => {
19973
+ if (platform === PlatformType.H5 &&
19974
+ editMapInfo?.mobileMode === MobileEditMode.CREATE &&
19975
+ editMapInfo?.elementType === DataType.OBSTACLE) {
19976
+ return true;
19977
+ }
19978
+ return false;
19979
+ }, [platform, editMapInfo]);
19980
+ return isVisible ? (jsx("div", { className: styles.crosshair, children: jsx(SvgMobileAddPoint, {}) })) : null;
20219
19981
  };
20220
19982
 
20221
- var HandleElementMapType;
20222
- (function (HandleElementMapType) {
20223
- HandleElementMapType["name"] = "name";
20224
- HandleElementMapType["focus"] = "focus";
20225
- HandleElementMapType["delete"] = "delete";
20226
- HandleElementMapType["timePeriod"] = "timePeriod";
20227
- HandleElementMapType["area"] = "area";
20228
- HandleElementMapType["dooleExist"] = "dooleExist";
20229
- })(HandleElementMapType || (HandleElementMapType = {}));
20230
- const DATE_TYPE_MAP = [
20231
- { type: DataType.BOUNDARY, label: 'Boundary', icon: jsx(SvgBoundary, {}) },
20232
- {
20233
- type: DataType.OBSTACLE,
20234
- paramType: RecordTypeEnum.OBSTACLE,
20235
- label: 'Off-limit island',
20236
- icon: jsx(SvgLimitIsland, {}),
20237
- },
20238
- // { type: DataType.CHANNEL, label: 'Channel', icon: <ChannelIcon /> },
20239
- {
20240
- type: DataType.VISION_OFF,
20241
- paramType: RecordTypeEnum.VISI_OFF,
20242
- label: 'VisionFence-off zone',
20243
- icon: jsx(SvgVisionFence, {}),
20244
- },
20245
- {
20246
- type: DataType.DOODLE,
20247
- paramType: RecordTypeEnum.DOODLE,
20248
- label: 'Doodle',
20249
- icon: jsx(SvgDoodle, {}),
20250
- },
20251
- ];
20252
- ({
20253
- [DataType.BOUNDARY]: {
20254
- },
20255
- [DataType.OBSTACLE]: {
20256
- },
20257
- [DataType.CHANNEL]: {
20258
- },
20259
- [DataType.VISION_OFF]: {
20260
- },
20261
- [DataType.DOODLE]: {
20262
- },
20263
- [DataType.PATH]: undefined,
20264
- [DataType.ANTENNA]: undefined,
20265
- [DataType.CHARGING_PILE]: undefined,
20266
- });
20267
-
20268
- var css_248z$b = ".ant-modal .ant-modal-body .ant-modal-confirm-title {\n text-align: center;\n}\n.ant-modal .ant-modal-body .ant-modal-confirm-btns {\n margin-top: 24px;\n}\n.ant-modal .ant-modal-body .ant-modal-confirm-btns .ant-btn + .ant-btn {\n margin-left: 24px;\n}\n\n.index-module_modal__fkxhn.index-module_center__d461v .ant-modal-title {\n text-align: center;\n padding: 10px 20px 0;\n font-size: 18px;\n}\n.index-module_modal__fkxhn.index-module_center__d461v .ant-modal-header {\n margin-bottom: 24px;\n}\n.index-module_modal__fkxhn.index-module_center__d461v .ant-modal .ant-modal-footer {\n margin-top: 24px;\n}\n.index-module_modal__fkxhn.index-module_center__d461v .ant-modal .ant-modal-footer .ant-btn + .ant-btn {\n margin-left: 24px;\n}";
20269
- var styles$b = {"modal":"index-module_modal__fkxhn","center":"index-module_center__d461v"};
20270
- styleInject(css_248z$b);
20271
-
20272
- const CustomModal = ({ children, titleCenter, hasMinHeight, height, ...props }) => {
20273
- return (jsx(Modal, { centered: true, styles: {
20274
- body: {
20275
- maxHeight: height ? `${height}px` : 'calc(100vh - 200px)',
20276
- minHeight: hasMinHeight ? '520px' : undefined,
20277
- overflow: 'auto',
20278
- },
20279
- }, wrapClassName: classNames(styles$b.modal, {
20280
- [styles$b.center]: titleCenter,
20281
- }), cancelButtonProps: { color: 'primary', variant: 'outlined' }, cancelText: 'Cancel', ...props, children: children }));
19983
+ // 验证GPS坐标是否有效
19984
+ const isValidGpsCoordinate = (coordinate) => {
19985
+ if (!coordinate || coordinate.length < 2)
19986
+ return false;
19987
+ const [lng, lat] = coordinate;
19988
+ // 检查是否为有效的GPS坐标范围,且不是原点(0,0)
19989
+ return (lng >= -180 &&
19990
+ lng <= 180 &&
19991
+ lat >= -90 &&
19992
+ lat <= 90 &&
19993
+ !(Math.abs(lng) < 0.001 && Math.abs(lat) < 0.001) // 排除接近(0,0)的坐标
19994
+ );
20282
19995
  };
20283
-
20284
- var css_248z$a = ".index-module_doodleModal__EGNPW .index-module_title__ViZuB {\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: rgb(29, 29, 29);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n max-height: 230px;\n overflow-y: auto;\n width: 470px;\n margin: 20px auto 0;\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7 {\n width: 70px;\n height: 70px;\n padding: 10px;\n border-radius: 8px;\n cursor: pointer;\n border: 2px solid transparent;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n position: relative;\n background: rgb(233, 242, 241);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7:hover {\n background-color: rgba(0, 0, 0, 0.05);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7.index-module_active__1OHfd {\n border: 2px solid #ff5a00;\n background-color: rgba(110, 220, 207, 0.1);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7.index-module_active__1OHfd .index-module_selectIcon__EFQF- {\n display: block;\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7 .index-module_svgImage__2OT8- {\n width: 100%;\n height: 100%;\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7 .index-module_svgImage__2OT8- svg {\n width: 100%;\n height: 100%;\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7 .index-module_selectIcon__EFQF- {\n position: absolute;\n bottom: 4px;\n right: 4px;\n display: none;\n}";
20285
- var styles$a = {"doodleModal":"index-module_doodleModal__EGNPW","title":"index-module_title__ViZuB","content":"index-module_content__h-60T","item":"index-module_item__dvoq7","active":"index-module_active__1OHfd","svgImage":"index-module_svgImage__2OT8-"};
20286
- styleInject(css_248z$a);
20287
-
20288
- const DoodleModal = ({ open, onSelect, setOpen, doodleList, centerPoint }) => {
20289
- const { editMapInfo, setEditMapInfo, onHandleEnterRecord } = useMapEditContext();
20290
- const [selectedDoodle, setSelectedDoodle] = useState(null);
20291
- const noNeed = useMemo(() => {
20292
- return '1234567890QWERTYUIOPASDFGHJKLZXCVBNM';
20293
- }, []);
20294
- // 选择 Doodle
20295
- const handleSelectDoodle = useCallback((item) => {
20296
- setSelectedDoodle(item);
20297
- }, []);
20298
- // 确认选择
20299
- const handleConfirm = useCallback(() => {
20300
- if (selectedDoodle) {
20301
- const newDoodle = initDoodle();
20302
- const svg = selectedDoodle?.svgStr;
20303
- const minLength = selectedDoodle.minLength;
20304
- const parseSvg = SvgParserNative.parseSvg(svg);
20305
- const svgMinLength = parseSvg.height / SCALE_FACTOR;
20306
- // 使用获取到的 SVG 内容,如果没有获取到则使用 URL
20307
- newDoodle.svg = svg;
20308
- newDoodle.scale = minLength / svgMinLength;
20309
- newDoodle.direction = 0;
20310
- newDoodle.center = restorePoint(centerPoint);
20311
- onHandleEnterRecord?.({
20312
- type: 1,
20313
- function: 0,
20314
- })?.then(() => {
20315
- setEditMapInfo({
20316
- ...editMapInfo,
20317
- historyList: [
20318
- {
20319
- selectElement: newDoodle,
20320
- },
20321
- ],
20322
- currentHistoryIndex: 0,
20323
- createMode: CreateStatus.COMPLETED,
20324
- elementType: DataType.DOODLE,
20325
- selectElement: newDoodle,
20326
- isShowDrag: true,
20327
- });
20328
- setOpen(false);
20329
- onSelect?.(svg);
20330
- }, (error) => {
20331
- message.error('Save failed, please try again');
20332
- });
20333
- }
20334
- }, [selectedDoodle, setEditMapInfo, editMapInfo, setOpen, onSelect, centerPoint]);
20335
- return (jsx(CustomModal, { width: 560, title: "Create doodle", titleCenter: true, open: open, onOk: handleConfirm, onCancel: () => setOpen(false), okButtonProps: { disabled: !selectedDoodle }, afterClose: () => setSelectedDoodle(null), okText: "Create", cancelText: "Cancel", children: jsxs("div", { className: styles$a.doodleModal, children: [jsx("div", { className: styles$a.title, children: "Select the doodle that you want to create" }), jsx("div", { className: styles$a.content, children: doodleList
20336
- ?.filter((item) => !noNeed.includes(item.name))
20337
- .map((item) => {
20338
- return (jsx("div", { className: classNames(styles$a.item, {
20339
- [styles$a.active]: selectedDoodle?.svg === item.svg,
20340
- }), onClick: () => handleSelectDoodle(item), children: jsx("div", { className: styles$a.svgImage, dangerouslySetInnerHTML: { __html: item?.svgStr } }) }, item.id));
20341
- }) })] }) }));
20342
- };
20343
-
20344
- const AddEntry = ({ doodleList, disabledObstacles, editMap }) => {
20345
- const { svgRef } = useSvgEditContext();
20346
- const { editMapInfo, setEditMapInfo, onHandleEnterRecord } = useMapEditContext();
20347
- const divRef = useRef(null);
20348
- const [open, setOpen] = useState(false);
20349
- const [doodleOpen, setDoodleOpen] = useState(false);
20350
- const centerPoint = useMemo(() => {
20351
- if (!svgRef)
20352
- return null;
20353
- const baseVal = svgRef?.viewBox.baseVal;
20354
- const center = [
20355
- baseVal?.x + (baseVal?.width || 0) / 2,
20356
- baseVal?.y + (baseVal?.height || 0) / 2,
20357
- ];
20358
- return center;
20359
- }, [svgRef?.viewBox?.baseVal?.x]);
20360
- const centerBounds = useMemo(() => {
20361
- if (!svgRef)
20362
- return null;
20363
- const elementWidth = 50 * 10;
20364
- const [minX, minY, maxX, maxY] = [
20365
- centerPoint[0] - elementWidth / 2,
20366
- centerPoint[1] - elementWidth / 2,
20367
- centerPoint[0] + elementWidth / 2,
20368
- centerPoint[1] + elementWidth / 2,
20369
- ];
20370
- const elementPoints = [
20371
- [minX, minY],
20372
- [minX, maxY],
20373
- [maxX, maxY],
20374
- [maxX, minY],
20375
- ];
20376
- return elementPoints;
20377
- }, [centerPoint]);
20378
- const addNewElement = useCallback((type, item) => {
20379
- setOpen(false);
20380
- let newElement = null;
20381
- if (type === DataType.BOUNDARY) {
20382
- newElement = initBoundary();
20383
- }
20384
- else if (type === DataType.OBSTACLE) {
20385
- newElement = initObstacle();
20386
- }
20387
- else if (type === DataType.CHANNEL) {
20388
- newElement = initChannel();
20389
- }
20390
- else if (type === DataType.VISION_OFF) {
20391
- newElement = initVisionOff();
20392
- newElement.points = centerBounds;
20393
- }
20394
- else if (type === DataType.DOODLE) {
20395
- return setDoodleOpen(true);
20396
- }
20397
- onHandleEnterRecord?.({
20398
- type: item?.paramType,
20399
- function: item?.type === DataType.OBSTACLE ? 0 : undefined,
20400
- })?.then(() => {
20401
- setEditMapInfo({
20402
- ...editMapInfo,
20403
- historyList: [
20404
- {
20405
- selectElement: newElement,
20406
- },
20407
- ],
20408
- currentHistoryIndex: 0,
20409
- createMode: type === DataType.VISION_OFF ? CreateStatus.COMPLETED : CreateStatus.CREATING,
20410
- elementType: type,
20411
- selectElement: newElement,
20412
- });
20413
- }, (errorText) => {
20414
- message.error('Save failed, please try again');
20415
- });
20416
- }, [centerBounds]);
20417
- const addItems = useMemo(() => {
20418
- return DATE_TYPE_MAP?.filter((item) => {
20419
- if (item.type === DataType.OBSTACLE) {
20420
- return !disabledObstacles;
20421
- }
20422
- return item.type !== DataType.BOUNDARY;
20423
- });
20424
- }, [disabledObstacles]);
20425
- // console.log('addEntry->', editMapInfo, editMap);
20426
- if (editMapInfo.createMode || editMapInfo.editMap || !editMap) {
20427
- return null;
20428
- }
20429
- return (jsxs("div", { ref: divRef, className: styles$c.addEntry, children: [jsx(Popover, { open: open, onOpenChange: setOpen, arrow: false, placement: "leftTop", content: addItems?.map((item) => {
20430
- return (jsxs("div", { className: styles$c.addItem, onClick: () => {
20431
- addNewElement(item.type, item);
20432
- }, children: [jsx("div", { className: styles$c.icon, children: item?.icon }), jsx("div", { className: styles$c.label, children: item?.label })] }, item.label));
20433
- }), children: jsx("div", { className: styles$c.icon, children: jsx(SvgAddEntry, {}) }) }), jsx(DoodleModal, { centerPoint: centerPoint, doodleList: doodleList, open: doodleOpen, onOk: () => setDoodleOpen(false), setOpen: setDoodleOpen })] }));
20434
- };
20435
-
20436
- var css_248z$9 = ".index-module_handleElementInfo__vWIaf {\n position: absolute;\n right: 0;\n top: 0;\n border-radius: 8px;\n padding: 8px;\n background: #fff;\n width: 265px;\n user-select: none;\n}\n.index-module_handleElementInfo__vWIaf .index-module_border__iPL-- {\n margin: 8px 0;\n border-top: 1px solid #c5c5c5;\n}\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 {\n position: absolute;\n left: -96px;\n top: 0;\n display: flex;\n gap: 12px;\n}\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 .index-module_undo__lPY1X,\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 .index-module_redo__EU5u- {\n background: #fff;\n border-radius: 8px;\n padding: 6px;\n}\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 .index-module_undo__lPY1X:not(.index-module_disabled__w6gCJ):hover,\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 .index-module_redo__EU5u-:not(.index-module_disabled__w6gCJ):hover {\n opacity: 0.8;\n cursor: pointer;\n}\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 .index-module_undo__lPY1X.index-module_disabled__w6gCJ,\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 .index-module_redo__EU5u-.index-module_disabled__w6gCJ {\n color: #d8d8d8;\n}\n.index-module_handleElementInfo__vWIaf .index-module_nameEdit__eVzQ- {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n}\n.index-module_handleElementInfo__vWIaf .index-module_nameEdit__eVzQ- input {\n padding: 2px 0;\n}\n.index-module_handleElementInfo__vWIaf .index-module_nameEdit__eVzQ- .index-module_edit__b0r9I {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n cursor: pointer;\n}\n.index-module_handleElementInfo__vWIaf .index-module_boundaryOther__FyJvt {\n padding-top: 4px;\n border-top: 1px solid rgb(197, 197, 197);\n}\n.index-module_handleElementInfo__vWIaf .index-module_handle__4mIxr {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n padding: 0px 0 4px 0;\n}\n\n.index-module_doodleInfo__bd2ua .index-module_time__1bUFf {\n width: 100%;\n}\n.index-module_doodleInfo__bd2ua .index-module_exist__gWtNo {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n}\n.index-module_doodleInfo__bd2ua .index-module_tip__1HNmj {\n color: #ff3f33;\n margin-top: 10px;\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n}\n\n.index-module_areaInfo__-WJPL {\n color: #9e9e9e;\n width: 100%;\n font-size: 14px;\n font-weight: 400;\n line-height: 16px; /* 114.286% */\n}\n.index-module_areaInfo__-WJPL .index-module_areaItem__fk-i2 {\n display: flex;\n justify-content: space-between;\n padding: 6px 0;\n}\n.index-module_areaInfo__-WJPL .index-module_areaItem__fk-i2:not(:last-child) {\n margin-bottom: 4px;\n}\n\n.index-module_boundaryInfo__VfR-N .index-module_otherEdit__17SuM {\n color: #1f1f1f;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px;\n}\n.index-module_boundaryInfo__VfR-N .index-module_otherEdit__17SuM .index-module_otherItem__ATLFZ {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n}\n.index-module_boundaryInfo__VfR-N .index-module_otherEdit__17SuM .index-module_otherItem__ATLFZ .index-module_value__x3-se {\n margin-left: auto;\n}\n.index-module_boundaryInfo__VfR-N .index-module_otherEdit__17SuM .index-module_otherItem__ATLFZ .index-module_icon__167WB {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}";
20437
- var styles$9 = {"handleElementInfo":"index-module_handleElementInfo__vWIaf","border":"index-module_border__iPL--","undoAndRedo":"index-module_undoAndRedo__EKeA8","undo":"index-module_undo__lPY1X","redo":"index-module_redo__EU5u-","disabled":"index-module_disabled__w6gCJ","nameEdit":"index-module_nameEdit__eVzQ-","handle":"index-module_handle__4mIxr","doodleInfo":"index-module_doodleInfo__bd2ua","time":"index-module_time__1bUFf","exist":"index-module_exist__gWtNo","tip":"index-module_tip__1HNmj","areaInfo":"index-module_areaInfo__-WJPL","areaItem":"index-module_areaItem__fk-i2","boundaryInfo":"index-module_boundaryInfo__VfR-N","otherEdit":"index-module_otherEdit__17SuM","otherItem":"index-module_otherItem__ATLFZ","value":"index-module_value__x3-se","icon":"index-module_icon__167WB"};
20438
- styleInject(css_248z$9);
20439
-
20440
- var css_248z$8 = ".index-module_infoHeader__l9F6q {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 6px 0;\n}\n.index-module_infoHeader__l9F6q .index-module_headerIcon__sK1hg {\n width: 16px;\n height: 16px;\n}\n.index-module_infoHeader__l9F6q .index-module_headerName__UGnrH {\n margin-left: 4px;\n color: rgb(158, 158, 158);\n font-weight: 500;\n font-size: 14px;\n line-height: 16px;\n pointer-events: none;\n}\n.index-module_infoHeader__l9F6q .index-module_headerHandle__ymh7f {\n margin-left: auto;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n}\n.index-module_infoHeader__l9F6q .index-module_headerHandle__ymh7f .index-module_focus__llcox {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}\n.index-module_infoHeader__l9F6q .index-module_headerHandle__ymh7f .index-module_delete__hD4-Q {\n width: 16px;\n height: 16px;\n margin-left: 8px;\n cursor: pointer;\n}";
20441
- var styles$8 = {"infoHeader":"index-module_infoHeader__l9F6q","headerIcon":"index-module_headerIcon__sK1hg","headerName":"index-module_headerName__UGnrH","headerHandle":"index-module_headerHandle__ymh7f","focus":"index-module_focus__llcox","delete":"index-module_delete__hD4-Q"};
20442
- styleInject(css_248z$8);
20443
-
20444
- var _path$6;
20445
- function _extends$8() { return _extends$8 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$8.apply(null, arguments); }
20446
- var SvgFocus = function SvgFocus(props) {
20447
- return /*#__PURE__*/React.createElement("svg", _extends$8({
20448
- xmlns: "http://www.w3.org/2000/svg",
20449
- width: 16,
20450
- height: 16,
20451
- fill: "none"
20452
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
20453
- fill: "#FF5A00",
20454
- d: "M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5m-1.733-4h-.022c-.728 0-1.306 0-1.77.038-.476.039-.878.12-1.246.307a3.17 3.17 0 0 0-1.384 1.384c-.187.367-.268.77-.307 1.246-.038.464-.038 1.042-.038 1.77v.022a.5.5 0 0 0 1 0c0-.755 0-1.292.035-1.711.033-.413.098-.67.201-.873.208-.408.54-.74.947-.947.203-.103.46-.167.873-.201.42-.034.956-.035 1.71-.035a.5.5 0 0 0 0-1m3.466 1c.756 0 1.292 0 1.711.035.413.033.67.098.873.201.408.208.74.54.947.947.103.203.167.46.201.873.034.42.035.956.035 1.71a.5.5 0 0 0 1 0v-.021c0-.728 0-1.306-.038-1.77-.039-.476-.12-.878-.307-1.246a3.17 3.17 0 0 0-1.384-1.384c-.368-.187-.77-.268-1.246-.307-.464-.038-1.042-.038-1.77-.038h-.022a.5.5 0 0 0 0 1M2.5 9.733a.5.5 0 0 0-1 0v.022c0 .728 0 1.306.038 1.77.039.476.12.878.307 1.246.304.596.788 1.08 1.384 1.384.367.187.77.268 1.246.307.464.038 1.042.038 1.77.038h.022a.5.5 0 0 0 0-1c-.755 0-1.292 0-1.711-.035-.413-.033-.67-.098-.873-.201a2.17 2.17 0 0 1-.947-.947c-.103-.203-.167-.46-.201-.873-.034-.42-.035-.956-.035-1.71m12 0a.5.5 0 0 0-1 0c0 .756 0 1.292-.035 1.711-.033.413-.098.67-.201.873-.208.408-.54.74-.947.947-.203.103-.46.167-.873.201-.42.034-.956.035-1.71.035a.5.5 0 0 0 0 1h.021c.728 0 1.306 0 1.77-.038.476-.039.878-.12 1.246-.307a3.17 3.17 0 0 0 1.384-1.384c.187-.368.268-.77.307-1.246.038-.464.038-1.042.038-1.77z"
20455
- })));
20456
- };
20457
-
20458
- var _path$5;
20459
- function _extends$7() { return _extends$7 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$7.apply(null, arguments); }
20460
- var SvgDelete = function SvgDelete(props) {
20461
- return /*#__PURE__*/React.createElement("svg", _extends$7({
20462
- xmlns: "http://www.w3.org/2000/svg",
20463
- width: 16,
20464
- height: 16,
20465
- fill: "none"
20466
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
20467
- fill: "#FF5A00",
20468
- d: "M4.667 14q-.55 0-.942-.391a1.29 1.29 0 0 1-.392-.942V4h-.666V2.667H6V2h4v.667h3.333V4h-.666v8.667q0 .549-.392.942-.39.391-.942.391zM6 11.333h1.333v-6H6zm2.667 0H10v-6H8.667z"
20469
- })));
20470
- };
20471
-
20472
- const Header = ({ handleDelete, handleFocus, showFocus = false, showDelete = true, type, }) => {
20473
- const currentType = useMemo(() => {
20474
- return DATE_TYPE_MAP.find((item) => item.type === type);
20475
- }, [type]);
20476
- return (jsxs("div", { className: styles$8.infoHeader, children: [jsx("div", { className: styles$8.headerIcon, children: currentType?.icon }), jsx("div", { className: styles$8.headerName, children: currentType?.label }), jsxs("div", { className: styles$8.headerHandle, children: [showFocus && (jsx("div", { className: styles$8.focus, onClick: handleFocus, children: jsx(SvgFocus, {}) })), showDelete && (jsx("div", { className: styles$8.delete, onClick: handleDelete, children: jsx(SvgDelete, {}) }))] })] }));
20477
- };
20478
-
20479
- var css_248z$7 = ".index-module_nameEdit__O5bL0 {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n width: 100%;\n}\n.index-module_nameEdit__O5bL0 .index-module_content__Bi2fa {\n flex: 1;\n line-height: 28px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.index-module_nameEdit__O5bL0 .index-module_edit__3yRM0 {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}";
20480
- var styles$7 = {"nameEdit":"index-module_nameEdit__O5bL0","content":"index-module_content__Bi2fa","edit":"index-module_edit__3yRM0"};
20481
- styleInject(css_248z$7);
20482
-
20483
- var _path$4;
20484
- function _extends$6() { return _extends$6 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$6.apply(null, arguments); }
20485
- var SvgEdit = function SvgEdit(props) {
20486
- return /*#__PURE__*/React.createElement("svg", _extends$6({
20487
- xmlns: "http://www.w3.org/2000/svg",
20488
- width: 16,
20489
- height: 16,
20490
- fill: "none"
20491
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
20492
- fill: "#FF5A00",
20493
- d: "M9.068 1.916a.751.751 0 0 1 0 1.501h-4.9a.75.75 0 0 0-.75.75v7.667c0 .414.336.75.75.75h7.667c.414 0 .75-.336.75-.75v-4.9a.75.75 0 0 1 1.5 0v4.9a2.25 2.25 0 0 1-2.25 2.25H4.168a2.25 2.25 0 0 1-2.25-2.25V4.167a2.25 2.25 0 0 1 2.25-2.251zm3.735.22a.75.75 0 0 1 1.06 1.061L8.53 8.53a.75.75 0 0 1-1.06-1.06z"
20494
- })));
20495
- };
20496
-
20497
- const NameModal = ({ title, name, open, setOpen, onOk }) => {
20498
- const [nameValue, setNameValue] = useState('');
20499
- useEffect(() => {
20500
- if (open) {
20501
- setNameValue(name || '');
20502
- }
20503
- }, [name, open]);
20504
- return (jsx(CustomModal, { title: `${title}`, titleCenter: true, open: open, onOk: () => {
20505
- onOk?.(nameValue);
20506
- setOpen(false);
20507
- }, onCancel: () => setOpen(false), okText: "Confirm", afterClose: () => {
20508
- setNameValue('');
20509
- }, children: jsx(Input, { maxLength: 12, showCount: true, placeholder: "Please enter boundary name", value: nameValue, onChange: (e) => setNameValue(e.target.value) }) }));
20510
- };
20511
-
20512
- const NameEdit = ({ title, name, onChange }) => {
20513
- const [open, setOpen] = React__default.useState(false);
20514
- return (jsxs(Fragment, { children: [jsxs("div", { className: styles$7.nameEdit, children: [jsx("div", { className: styles$7.content, children: name }), jsx("div", { className: styles$7.edit, onClick: () => setOpen(true), children: jsx(SvgEdit, {}) })] }), jsx(NameModal, { title: title, name: name, open: open, setOpen: setOpen, onOk: onChange })] }));
20515
- };
20516
-
20517
- var _path$3;
20518
- function _extends$5() { return _extends$5 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$5.apply(null, arguments); }
20519
- var SvgArrow = function SvgArrow(props) {
20520
- return /*#__PURE__*/React.createElement("svg", _extends$5({
20521
- xmlns: "http://www.w3.org/2000/svg",
20522
- width: 16,
20523
- height: 16,
20524
- fill: "none"
20525
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
20526
- fill: "#1F1F1F",
20527
- d: "M11.523 7.704c.005.014.015.026.02.04.049.125.065.268.046.406a.73.73 0 0 1-.152.363l-3.88 4.638a.47.47 0 0 1-.377.182.49.49 0 0 1-.369-.208.77.77 0 0 1-.144-.477.76.76 0 0 1 .164-.466l3.483-4.162-3.468-4.224a.77.77 0 0 1-.15-.462c0-.172.053-.338.148-.463a.49.49 0 0 1 .36-.204.47.47 0 0 1 .371.17l3.845 4.682q.007.017.017.032.008.01.018.019c.032.04.046.09.067.134"
20528
- })));
20529
- };
20530
-
20531
- var css_248z$6 = ".index-module_item__wwHEt {\n font-weight: 400;\n font-size: 14px;\n line-height: 16px;\n display: flex;\n align-items: center;\n padding: 6px 0;\n}\n.index-module_item__wwHEt:not(:last-child) {\n margin-bottom: 4px;\n}";
20532
- var styles$6 = {"item":"index-module_item__wwHEt"};
20533
- styleInject(css_248z$6);
20534
-
20535
- const Item = ({ children }) => {
20536
- return (jsx("div", { className: styles$6.item, children: children }));
20537
- };
20538
-
20539
- var css_248z$5 = ".index-module_edgeMowing__kmHPN .index-module_item__O2omj {\n border-bottom: 1px solid #C5C5C5;\n margin-bottom: 20px;\n}\n.index-module_edgeMowing__kmHPN .index-module_item__O2omj .index-module_content__ENa5I {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 4px 0;\n}\n.index-module_edgeMowing__kmHPN .index-module_item__O2omj .index-module_tip__BoRNQ {\n color: #9E9E9E;\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n padding: 10px 0;\n}";
20540
- var styles$5 = {"edgeMowing":"index-module_edgeMowing__kmHPN","item":"index-module_item__O2omj","content":"index-module_content__ENa5I","tip":"index-module_tip__BoRNQ"};
20541
- styleInject(css_248z$5);
20542
-
20543
- const MowingEdgeModal = ({ open, setOpen, onChange, value }) => {
20544
- const [currentValue, setCurrentValue] = useState({});
20545
- const handleOk = () => {
20546
- onChange(currentValue);
20547
- setOpen(false);
20548
- };
20549
- useEffect(() => {
20550
- if (!open)
20551
- return;
20552
- setCurrentValue(value);
20553
- }, [open]);
20554
- return (jsx(CustomModal, { title: "Edge Mowing", titleCenter: true, open: open, onCancel: () => setOpen(false), onOk: handleOk, afterClose: () => {
20555
- setCurrentValue({});
20556
- }, children: jsxs("div", { className: styles$5.edgeMowing, children: [jsxs("div", { className: styles$5.item, children: [jsxs("div", { className: styles$5.content, children: [jsx("div", { className: styles$5.label, children: "Mow along boundary" }), jsx("div", { className: styles$5.value, children: jsx(Switch, { checked: currentValue['edgeMowing'], onChange: (val) => setCurrentValue({
20557
- obstacleMowEdge: currentValue?.obstacleMowEdge,
20558
- edgeMowing: val,
20559
- }) }) })] }), jsx("div", { className: styles$5.tip, children: "When enabled, the mower will mow along the selected boundary." })] }), jsxs("div", { className: styles$5.item, children: [jsxs("div", { className: styles$5.content, children: [jsx("div", { className: styles$5.label, children: "Mow around off-limit island" }), jsx("div", { className: styles$5.value, children: jsx(Switch, { value: currentValue['obstacleMowEdge'], onChange: (val) => setCurrentValue({
20560
- obstacleMowEdge: val,
20561
- edgeMowing: currentValue?.edgeMowing,
20562
- }) }) })] }), jsx("div", { className: styles$5.tip, children: "When enabled, the mower will mow around the off-limit islands within the selected mowing zone." })] })] }) }));
20563
- };
20564
-
20565
- var css_248z$4 = ".index-module_zoneHeightModal__ehNMQ {\n padding: 0 10px;\n}\n.index-module_zoneHeightModal__ehNMQ .ant-radio-group {\n display: block;\n}\n.index-module_zoneHeightModal__ehNMQ .index-module_item__wQUzZ {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 14px;\n opacity: 0.4;\n}\n.index-module_zoneHeightModal__ehNMQ .index-module_item__wQUzZ.index-module_checked__xbxQ4 {\n opacity: 1;\n}\n.index-module_zoneHeightModal__ehNMQ .index-module_item__wQUzZ:not(:last-child) {\n margin-bottom: 20px;\n}\n.index-module_zoneHeightModal__ehNMQ .index-module_item__wQUzZ .index-module_right__IuIfk {\n text-align: right;\n width: 300px;\n margin-left: auto;\n}";
20566
- var styles$4 = {"zoneHeightModal":"index-module_zoneHeightModal__ehNMQ","item":"index-module_item__wQUzZ","checked":"index-module_checked__xbxQ4","right":"index-module_right__IuIfk"};
20567
- styleInject(css_248z$4);
20568
-
20569
- const CutHeightSlider = ({ units, value, onChange, heightOptions, ...rest }) => {
20570
- const converteOptions = useCallback((options) => {
20571
- return options.map((item) => ({
20572
- label: units === UnitsType.Metric
20573
- ? `${item}`
20574
- : `${convertCutHeightFormatted(item)}`,
20575
- value: item,
20576
- }));
20577
- }, [units, convertCutHeightFormatted]);
20578
- const options = useMemo(() => {
20579
- if (heightOptions && heightOptions?.length > 0) {
20580
- return converteOptions(heightOptions);
20581
- }
20582
- return [];
20583
- }, [heightOptions, converteOptions]);
20584
- return (jsx(Slider, { value: value, ...rest, tooltip: {
20585
- open: false,
20586
- }, step: null, min: options?.[0]?.value, max: options?.[options?.length - 1]?.value, marks: options?.reduce((acc, item) => {
20587
- acc[item?.value] = {
20588
- label: item?.label,
20589
- style: {
20590
- color: item?.value === Number(value)
20591
- ? 'rgba(241, 102, 41, 1)'
20592
- : 'rgba(0, 0, 0, 0.20)',
20593
- fontWeight: item?.value === Number(value) ? 'bold' : 'normal',
20594
- },
20595
- };
20596
- return acc;
20597
- }, {}), onChange: onChange }));
20598
- };
20599
-
20600
- var ZoneHeightModalTypeEnum;
20601
- (function (ZoneHeightModalTypeEnum) {
20602
- ZoneHeightModalTypeEnum[ZoneHeightModalTypeEnum["GLOBAL"] = 1] = "GLOBAL";
20603
- ZoneHeightModalTypeEnum[ZoneHeightModalTypeEnum["RADIO"] = 0] = "RADIO";
20604
- })(ZoneHeightModalTypeEnum || (ZoneHeightModalTypeEnum = {}));
20605
- const HeightModal = ({ zoneName, open, setOpen, onChange, value, heightOptions, globalHeight, }) => {
20606
- const { unitType } = useCommonContext();
20607
- const [currentValue, setCurrentValue] = useState(value);
20608
- const handleOk = useCallback(() => {
20609
- setOpen(false);
20610
- onChange?.(currentValue);
20611
- }, [currentValue, setOpen, onChange]);
20612
- const onHeightChange = useCallback((value) => {
20613
- console.log('change->', value);
20614
- setCurrentValue({
20615
- cuttingHeight: value,
20616
- isFlowGlobal: ZoneHeightModalTypeEnum.RADIO,
20617
- });
20618
- }, []);
20619
- console.log('globalHeight', globalHeight, heightOptions);
20620
- useEffect(() => {
20621
- if (!open)
20622
- return;
20623
- setCurrentValue(value);
20624
- }, [value, open]);
20625
- return (jsx(CustomModal, { title: `${zoneName} cutting height`, titleCenter: true, width: 600, open: open, onCancel: () => setOpen(false), onOk: handleOk, okText: "Confirm", afterClose: () => { }, children: jsx("div", { className: styles$4.zoneHeightModal, children: jsxs(Radio.Group, { value: currentValue?.isFlowGlobal, onChange: (e) => setCurrentValue({
20626
- isFlowGlobal: e.target.value,
20627
- cuttingHeight: currentValue?.cuttingHeight,
20628
- }), children: [jsxs("div", { className: classNames(styles$4.item, {
20629
- [styles$4.checked]: currentValue?.isFlowGlobal === ZoneHeightModalTypeEnum.GLOBAL,
20630
- }), children: [jsx("div", { className: styles$4.left, children: jsx(Radio, { value: ZoneHeightModalTypeEnum.GLOBAL, children: "Global" }) }), jsx("div", { className: styles$4.right, children: jsx("span", { style: { color: 'rgba(241, 102, 41, 1)' }, children: generateHeightStr(globalHeight, unitType, true) }) })] }), jsxs("div", { className: classNames(styles$4.item, {
20631
- [styles$4.checked]: currentValue?.isFlowGlobal === ZoneHeightModalTypeEnum.RADIO,
20632
- }), children: [jsx("div", { className: styles$4.left, children: jsxs(Radio, { value: ZoneHeightModalTypeEnum.RADIO, children: ["Customize zone height (", getHeightUnit(unitType), ")"] }) }), jsx("div", { className: styles$4.right, children: jsx(CutHeightSlider, { units: unitType, value: currentValue?.cuttingHeight, heightOptions: heightOptions, onChange: onHeightChange }) })] })] }) }) }));
20633
- };
20634
-
20635
- var css_248z$3 = ".index-module_directions__Hv0zx {\n color: #1d1d1d;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n}\n.index-module_directions__Hv0zx .index-module_default__sSWp4 {\n position: absolute;\n bottom: 20px;\n left: 9px;\n}\n.index-module_directions__Hv0zx .index-module_tips__VVEuO {\n line-height: 16px;\n}\n.index-module_directions__Hv0zx .index-module_optimal__07le4 {\n color: rgb(255, 113, 51);\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 6px;\n margin: 4px 0 12px;\n}\n.index-module_directions__Hv0zx .index-module_content__PiCFf {\n position: relative;\n width: 100%;\n margin-bottom: 12px;\n}\n.index-module_directions__Hv0zx .index-module_background__WM4u- {\n position: absolute;\n width: 100%;\n height: 300px;\n background: #f5f5f5;\n border-radius: 8px;\n z-index: 0;\n overflow: hidden;\n}\n.index-module_directions__Hv0zx .index-module_luppan__nGfH2 {\n inset: 0;\n z-index: 1;\n}\n.index-module_directions__Hv0zx .index-module_slideTip__RGnd1 {\n margin: 20px 0;\n}\n.index-module_directions__Hv0zx .index-module_slider__VDKnB {\n padding: 0 24px;\n}";
20636
- var styles$3 = {"directions":"index-module_directions__Hv0zx","default":"index-module_default__sSWp4","tips":"index-module_tips__VVEuO","optimal":"index-module_optimal__07le4","content":"index-module_content__PiCFf","background":"index-module_background__WM4u-","luppan":"index-module_luppan__nGfH2","slideTip":"index-module_slideTip__RGnd1","slider":"index-module_slider__VDKnB"};
20637
- styleInject(css_248z$3);
20638
-
20639
- var css_248z$2 = ".style-module_commonModalContainer__WHZnl {\n width: inherit;\n height: inherit;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh {\n display: flex;\n flex-direction: column;\n width: 300px;\n height: 100%;\n position: relative;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directText__b7QUs {\n padding-top: 15px;\n color: #1d1d1d;\n text-align: center;\n font-size: 16px;\n font-weight: 600;\n line-height: 24px;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directOption__IFsis {\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n pointer-events: none;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directOption__IFsis .style-module_leftTop__H39Uk {\n width: 22px;\n height: 18px;\n position: absolute;\n top: -5px;\n left: 50%;\n transform: translate(-50%, 0) rotate(90deg);\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directOption__IFsis .style-module_rightBottom__f3c7n {\n width: 22px;\n height: 18px;\n position: absolute;\n bottom: -5px;\n left: 50%;\n transform: translate(-50%, 0) rotate(-90deg);\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n {\n flex: 1;\n min-height: 293px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk {\n position: relative;\n width: 293px;\n height: 293px;\n border-radius: 50%;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk .style-module_directLineMain__p60DH {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk .style-module_directLineMain__p60DH .style-module_directLineContent__D9N62 {\n position: absolute;\n left: 50%;\n top: 50%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 224px;\n cursor: pointer;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk .style-module_directLineMain__p60DH .style-module_directLineContent__D9N62 .style-module_directLineText__DOhL4 {\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 12px;\n font-weight: 600;\n line-height: 1;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk .style-module_directLineMain__p60DH .style-module_directLineContent__D9N62 .style-module_directLine__ngnPh {\n width: 100%;\n height: 186px;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk .style-module_directCenterCircle__YUrtv {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 28px;\n height: 28px;\n border: 6px solid #e0e0e6;\n background: #f2f3f6;\n border-radius: 50%;\n box-sizing: border-box;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk .style-module_directCenterCircle__YUrtv.style-module_active__ga2w0 {\n border-color: rgb(254, 226, 213);\n}";
20640
- var styles$2 = {"commonModalContainer":"style-module_commonModalContainer__WHZnl","commonModalContent":"style-module_commonModalContent__UQ98C","content":"style-module_content__tR9Fh","directOption":"style-module_directOption__IFsis","leftTop":"style-module_leftTop__H39Uk","rightBottom":"style-module_rightBottom__f3c7n","directDialPlateBox":"style-module_directDialPlateBox__tie9n","directDialPlate":"style-module_directDialPlate__zkFHk","directLineMain":"style-module_directLineMain__p60DH","directLineContent":"style-module_directLineContent__D9N62","directLineText":"style-module_directLineText__DOhL4","directLine":"style-module_directLine__ngnPh","directCenterCircle":"style-module_directCenterCircle__YUrtv","active":"style-module_active__ga2w0"};
20641
- styleInject(css_248z$2);
20642
-
20643
- const DirectionLine = (props) => {
20644
- const { selected = false, ...svgProps } = props;
20645
- const colorMap = useMemo(() => {
20646
- if (selected) {
20647
- return {
20648
- circleFill: '#FEE2D5',
20649
- circleStroke: '#FF7133',
20650
- line: '#FF7133',
20651
- };
20652
- }
20653
- return {
20654
- circleFill: '#E0E0E6',
20655
- circleStroke: '#B3B4C3',
20656
- line: '#D2D2E0',
20657
- };
20658
- }, [selected]);
20659
- return (jsxs("svg", { width: "16", height: "186", viewBox: "0 0 16 186", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...svgProps, children: [jsx("path", { d: "M8.54148 10.4062L7.98535 175.173", stroke: colorMap.line, strokeWidth: "2", strokeDasharray: "5 5" }), jsx("circle", { cx: "8.26392", cy: "177.535", r: "6.67359", fill: colorMap.circleFill, stroke: colorMap.circleStroke, strokeWidth: "2" }), jsx("circle", { cx: "8.26344", cy: "8.47047", r: "6.67359", fill: colorMap.circleFill, stroke: colorMap.circleStroke, strokeWidth: "2" })] }));
20660
- };
20661
-
20662
- var _g$1, _defs$1;
20663
- function _extends$4() { return _extends$4 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$4.apply(null, arguments); }
20664
- var SvgDirectDialPlate = function SvgDirectDialPlate(props) {
20665
- return /*#__PURE__*/React.createElement("svg", _extends$4({
20666
- xmlns: "http://www.w3.org/2000/svg",
20667
- width: 293,
20668
- height: 293,
20669
- fill: "none"
20670
- }, props), _g$1 || (_g$1 = /*#__PURE__*/React.createElement("g", {
20671
- clipPath: "url(#direct-dial-plate_svg__a)"
20672
- }, /*#__PURE__*/React.createElement("g", {
20673
- opacity: 0.55
20674
- }, /*#__PURE__*/React.createElement("g", {
20675
- filter: "url(#direct-dial-plate_svg__b)",
20676
- shapeRendering: "crispEdges"
20677
- }, /*#__PURE__*/React.createElement("circle", {
20678
- cx: 146.549,
20679
- cy: 146.553,
20680
- r: 133.643,
20681
- fill: "#fff",
20682
- fillOpacity: 0.65
20683
- }), /*#__PURE__*/React.createElement("circle", {
20684
- cx: 146.549,
20685
- cy: 146.553,
20686
- r: 133.643,
20687
- stroke: "#C1C2D1"
20688
- })), /*#__PURE__*/React.createElement("g", {
20689
- filter: "url(#direct-dial-plate_svg__c)",
20690
- shapeRendering: "crispEdges"
20691
- }, /*#__PURE__*/React.createElement("circle", {
20692
- cx: 146.549,
20693
- cy: 146.553,
20694
- r: 140,
20695
- fill: "#fff",
20696
- fillOpacity: 0.65
20697
- }), /*#__PURE__*/React.createElement("circle", {
20698
- cx: 146.549,
20699
- cy: 146.553,
20700
- r: 140,
20701
- stroke: "#fff"
20702
- })), /*#__PURE__*/React.createElement("circle", {
20703
- cx: 146.549,
20704
- cy: 146.553,
20705
- r: 112,
20706
- fill: "#fff",
20707
- transform: "rotate(90 146.549 146.553)"
20708
- })), /*#__PURE__*/React.createElement("circle", {
20709
- cx: 146.549,
20710
- cy: 146.553,
20711
- r: 115,
20712
- stroke: "#E0E0E6",
20713
- strokeWidth: 6
20714
- }), /*#__PURE__*/React.createElement("path", {
20715
- fill: "#E0E0E7",
20716
- d: "m24.863 157.648-.078-.895 6.163-.54q.037.449.075.896zm6.162-21.672-.076.894-6.159-.539.078-.894zm1.346-10.014q-.079.442-.153.886l-6.08-1.071.157-.885zm-6.074 42.25-.156-.885 6.077-1.072q.074.444.153.886zm2.344 10.398-.234-.868 5.954-1.595q.114.434.23.868zm5.95-62.523q-.117.434-.23.869l-5.953-1.594.233-.869zm3.08-9.641-.307.843-5.788-2.105.308-.844zm-5.788 82.319-.307-.845 5.788-2.107q.152.423.307.844zm4.114 9.833-.38-.815 5.587-2.605q.189.408.381.814zM41.585 97.11q-.191.405-.38.814l-5.587-2.604.38-.815zm-.63 110.924-.45-.778 5.345-3.086q.224.39.45.777zm5.347-119.88q-.228.388-.451.777l-5.344-3.084.45-.778zm.412 128.85-.515-.736 5.064-3.546q.256.369.515.735zm4.55-136.626-5.062-3.543.515-.735 5.062 3.544q-.259.366-.515.734m6.713-8.735q-.29.343-.577.688l-4.74-3.977.576-.688zm-4.74 153.795-.577-.689 4.74-3.977q.287.346.577.688zM72.33 57.402q-.345.286-.69.577l-3.977-4.74.689-.578zm-3.977 183.041-.689-.578 3.978-4.74q.342.29.688.577zm11.29-188.662-3.546-5.063.736-.515 3.545 5.062q-.368.256-.735.517M76.834 246.9l-.735-.516 3.545-5.062q.366.26.734.516zM88.93 45.853q-.39.224-.778.451l-3.087-5.346.779-.449zm-3.084 206.741-.779-.449 3.086-5.345q.388.227.778.451zM97.923 41.206q-.408.188-.814.38l-2.605-5.585.813-.38zm-2.604 216.276-.814-.38 2.604-5.585q.407.191.815.38zm9.86 4.043-.844-.307 2.107-5.788q.422.154.844.306zm2.109-224.158q-.423.15-.845.306l-2.107-5.787.845-.308zm8.07 227.327-.868-.233 1.595-5.951q.434.116.869.229zm1.598-230.331q-.435.113-.869.23l-1.595-5.95.868-.233zm8.817 232.599-.884-.156 1.072-6.076q.441.078.885.153zm1.075-234.742q-.444.075-.885.152l-1.072-6.075.884-.156zm10.037-1.27q-.448.037-.895.076l-.539-6.158.895-.078zm-.535 237.365-.895-.079.539-6.159q.447.04.896.077zm20.4 0-.538-6.162q.448-.036.894-.076l.539 6.16zm.36-237.288q-.446-.04-.894-.077l.538-6.16.894.078zm10.029 1.346q-.443-.077-.886-.153l1.071-6.078.885.156zm.187 234.589-1.071-6.08q.443-.075.886-.152l1.071 6.076zm9.688-232.369q-.434-.116-.868-.23l1.594-5.953.867.234zm.728 230.1-1.595-5.954q.435-.113.87-.23l1.593 5.951zm8.912-227.02q-.42-.154-.843-.306l2.106-5.789.844.307zm1.264 223.853-2.106-5.789.844-.307 2.107 5.788zm9.863-4.044-2.603-5.586q.407-.189.813-.38l2.605 5.587zm-1.788-215.894q-.406-.192-.814-.38l2.604-5.587.815.38zm8.954 4.716a98 98 0 0 0-.777-.451l3.086-5.345.778.45zm2.308 206.291-3.085-5.345q.39-.224.776-.451l3.086 5.347zm6.202-200.813q-.367-.26-.735-.516l3.546-5.064.735.515zm2.809 195.119-3.544-5.064.735-.515 3.545 5.063zm5.192-188.922q-.344-.29-.689-.577l3.977-4.74.689.578zm3.288 182.465-3.977-4.742q.345-.287.688-.578l3.978 4.741zM235.7 72.334q-.287-.345-.577-.69l4.741-3.978.577.689zm4.162 153.103-4.739-3.978q.29-.344.577-.689l4.74 3.978zm1.973-145.059q-.257-.368-.517-.734l5.063-3.545.515.735zm4.549 136.626-5.064-3.547q.26-.366.516-.735l5.063 3.547zm.863-128.074q-.224-.39-.45-.776l5.345-3.086.449.777zm4.897 119.105-5.346-3.087q.226-.387.45-.777l5.345 3.087zm-.25-110.112q-.19-.408-.38-.813l5.585-2.605.38.815zm5.205 100.675-5.585-2.606q.191-.405.381-.813l5.584 2.604zm-1.365-91.309q-.151-.423-.306-.844l5.788-2.107.306.845zm5.482 81.477-5.788-2.108q.155-.421.306-.844l5.789 2.108zm-2.479-71.811q-.114-.435-.23-.869l5.951-1.594.232.869zm5.722 61.656-5.951-1.596q.116-.434.229-.867l5.954 1.595zm-3.578-51.762q-.076-.444-.153-.886l6.078-1.071.156.885zm5.923 41.363-6.076-1.072.153-.885 6.079 1.072zm-4.654-31.325q-.035-.447-.075-.894l6.156-.538.079.894zm6.084 20.762-6.159-.54q.04-.447.075-.895l6.162.54z"
20717
- }), /*#__PURE__*/React.createElement("path", {
20718
- fill: "#B3B4C3",
20719
- d: "M142.291 27.432v-11h1.684l5.82 8.27-1.339-.693h.97v-7.577h1.865v11h-1.677l-5.819-8.279 1.338.694h-.97v7.585zM57.438 66.693l-4.982-4.982.466-.466 7.337 1.287-.497.152.248-.248-4.14-4.14.463-.463 4.983 4.983-.453.452-7.354-1.278.5-.155-.248.249 4.143 4.143zM63.66 60.471l-6.353-3.611.49-.49 5.342 3.159.034-.035-3.052-5.448.466-.466 5.452 3.048.031-.03-3.156-5.346.487-.486 3.612 6.352-.435.436-5.387-2.942-.034.034 2.942 5.387zM52.28 232.95q-.53-.53-.753-1.105a2.3 2.3 0 0 1-.152-1.119q.07-.546.428-.98l.035-.042.47.47-.035.041a1.2 1.2 0 0 0-.27.698q-.024.396.163.818.189.424.573.808.376.376.79.542.419.162.801.11.387-.055.667-.335l.003-.003a1.07 1.07 0 0 0 .325-.843q-.022-.497-.466-1.204l-.398-.625q-.583-.922-.593-1.582-.007-.663.507-1.177l.004-.004q.397-.397.922-.486a2.1 2.1 0 0 1 1.09.11 2.9 2.9 0 0 1 1.064.704q.487.487.687 1.033.203.549.135 1.06-.063.51-.394.897l-.038.045-.47-.469.032-.045a1.2 1.2 0 0 0 .234-.628q.032-.357-.124-.739a2.15 2.15 0 0 0-.51-.732 2.2 2.2 0 0 0-.736-.501 1.47 1.47 0 0 0-.76-.11q-.367.048-.646.328l-.003.003a.98.98 0 0 0-.297.794q.03.467.47 1.16l.393.629q.405.638.539 1.139.138.504.028.911a1.7 1.7 0 0 1-.456.753l-.004.004a1.9 1.9 0 0 1-.994.545q-.552.103-1.14-.117-.586-.222-1.122-.756M56.209 236.672l3.611-6.353.49.49-3.159 5.341.035.035 5.448-3.052.466.466-3.049 5.452.032.031 5.344-3.156.487.487-6.353 3.611-.435-.435 2.942-5.386-.035-.035-5.386 2.942zM235.144 238.465q-.529.528-1.105.753a2.3 2.3 0 0 1-1.119.151 1.9 1.9 0 0 1-.98-.428l-.042-.034.47-.47.041.035q.301.245.698.269a1.75 1.75 0 0 0 .818-.162 2.7 2.7 0 0 0 .808-.573q.377-.377.542-.791.162-.417.111-.801a1.15 1.15 0 0 0-.335-.666l-.004-.004a1.07 1.07 0 0 0-.842-.324q-.498.02-1.205.466l-.625.397q-.922.583-1.581.594-.663.006-1.178-.508l-.003-.003a1.7 1.7 0 0 1-.487-.922 2.1 2.1 0 0 1 .11-1.091q.208-.566.705-1.064a2.9 2.9 0 0 1 1.032-.687q.549-.203 1.06-.134.511.061.898.393l.045.038-.47.47-.045-.031a1.18 1.18 0 0 0-.628-.235 1.6 1.6 0 0 0-.739.124 2.2 2.2 0 0 0-.732.511q-.345.346-.501.736a1.5 1.5 0 0 0-.11.759q.048.366.328.646l.003.003a.98.98 0 0 0 .794.297q.466-.03 1.161-.469l.628-.394q.64-.404 1.139-.539.504-.138.912-.027.406.11.753.456l.003.003q.442.442.545.994.104.553-.117 1.14-.22.587-.756 1.122M237.875 235.527l-4.982-4.983 3.007-3.007.425.425-2.538 2.538 1.796 1.795 2.413-2.414.421.422-2.413 2.413 1.916 1.916 2.538-2.537.424.424zM226.781 57.137l4.982-4.983.467.466-1.288 7.337-.152-.497.248.249 4.14-4.14.463.463-4.982 4.982-.453-.452 1.278-7.355.155.501-.248-.249-4.144 4.144zM231.943 62.298l4.982-4.982 3.008 3.007-.425.425-2.538-2.538-1.795 1.796 2.413 2.413-.421.421-2.413-2.413-1.917 1.916 2.538 2.538-.425.425zM266.486 152.604l-.197-11.065 6.803-.135.03 1.664-4.924.098.053 2.998 4.655-.092.028 1.572-4.655.092.057 3.167 4.923-.097.03 1.664zM146.805 276.672q-1.278 0-2.222-.378-.936-.377-1.476-1.052a2.8 2.8 0 0 1-.609-1.576l-.008-.102h1.903l.007.073q.047.443.366.77.327.326.867.515.541.182 1.233.182.663 0 1.172-.196.51-.196.799-.538.29-.348.29-.798v-.008a1.11 1.11 0 0 0-.465-.922q-.464-.363-1.529-.581l-1.18-.232q-1.69-.342-2.458-1.089-.762-.756-.761-1.924v-.007q0-.937.517-1.641.525-.705 1.439-1.097.92-.399 2.108-.399 1.218 0 2.108.392.89.384 1.4 1.053.51.667.571 1.51l.008.094h-1.872l-.016-.087a1.34 1.34 0 0 0-.357-.719 1.9 1.9 0 0 0-.754-.493 3.1 3.1 0 0 0-1.103-.182q-.602 0-1.073.182-.473.174-.746.493-.267.32-.267.77v.007q0 .552.449.915.457.363 1.484.567l1.18.239q1.157.233 1.88.617.723.385 1.058.959.342.565.342 1.365v.007q0 1.016-.525 1.757-.518.74-1.484 1.147-.959.407-2.276.407M16.514 152.004l-2.706-10h1.874l1.734 7.505h.098l1.993-7.505h1.601l2.014 7.505h.098l1.728-7.505h1.86l-2.7 10h-1.692l-2.056-7.159h-.105l-2.042 7.159z"
20720
- }))), _defs$1 || (_defs$1 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("filter", {
20721
- id: "direct-dial-plate_svg__b",
20722
- width: 276.285,
20723
- height: 276.285,
20724
- x: 8.406,
20725
- y: 8.41,
20726
- colorInterpolationFilters: "sRGB",
20727
- filterUnits: "userSpaceOnUse"
20728
- }, /*#__PURE__*/React.createElement("feFlood", {
20729
- floodOpacity: 0,
20730
- result: "BackgroundImageFix"
20731
- }), /*#__PURE__*/React.createElement("feColorMatrix", {
20732
- "in": "SourceAlpha",
20733
- result: "hardAlpha",
20734
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
20735
- }), /*#__PURE__*/React.createElement("feOffset", null), /*#__PURE__*/React.createElement("feGaussianBlur", {
20736
- stdDeviation: 2
20737
- }), /*#__PURE__*/React.createElement("feComposite", {
20738
- in2: "hardAlpha",
20739
- operator: "out"
20740
- }), /*#__PURE__*/React.createElement("feColorMatrix", {
20741
- values: "0 0 0 0 0.0683333 0 0 0 0 0.103468 0 0 0 0 0.133333 0 0 0 0.25 0"
20742
- }), /*#__PURE__*/React.createElement("feBlend", {
20743
- in2: "BackgroundImageFix",
20744
- result: "effect1_dropShadow_10512_51195"
20745
- }), /*#__PURE__*/React.createElement("feBlend", {
20746
- "in": "SourceGraphic",
20747
- in2: "effect1_dropShadow_10512_51195",
20748
- result: "shape"
20749
- })), /*#__PURE__*/React.createElement("filter", {
20750
- id: "direct-dial-plate_svg__c",
20751
- width: 291,
20752
- height: 291,
20753
- x: 1.049,
20754
- y: 1.053,
20755
- colorInterpolationFilters: "sRGB",
20756
- filterUnits: "userSpaceOnUse"
20757
- }, /*#__PURE__*/React.createElement("feFlood", {
20758
- floodOpacity: 0,
20759
- result: "BackgroundImageFix"
20760
- }), /*#__PURE__*/React.createElement("feColorMatrix", {
20761
- "in": "SourceAlpha",
20762
- result: "hardAlpha",
20763
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
20764
- }), /*#__PURE__*/React.createElement("feOffset", null), /*#__PURE__*/React.createElement("feGaussianBlur", {
20765
- stdDeviation: 2.5
20766
- }), /*#__PURE__*/React.createElement("feComposite", {
20767
- in2: "hardAlpha",
20768
- operator: "out"
20769
- }), /*#__PURE__*/React.createElement("feColorMatrix", {
20770
- values: "0 0 0 0 0.0683333 0 0 0 0 0.103468 0 0 0 0 0.133333 0 0 0 0.5 0"
20771
- }), /*#__PURE__*/React.createElement("feBlend", {
20772
- in2: "BackgroundImageFix",
20773
- result: "effect1_dropShadow_10512_51195"
20774
- }), /*#__PURE__*/React.createElement("feBlend", {
20775
- "in": "SourceGraphic",
20776
- in2: "effect1_dropShadow_10512_51195",
20777
- result: "shape"
20778
- })), /*#__PURE__*/React.createElement("clipPath", {
20779
- id: "direct-dial-plate_svg__a"
20780
- }, /*#__PURE__*/React.createElement("path", {
20781
- fill: "#fff",
20782
- d: "M.549 292.553v-292h292v292z"
20783
- })))));
20784
- };
20785
-
20786
- var _g, _defs;
20787
- function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
20788
- var SvgOption = function SvgOption(props) {
20789
- return /*#__PURE__*/React.createElement("svg", _extends$3({
20790
- xmlns: "http://www.w3.org/2000/svg",
20791
- width: 22,
20792
- height: 18,
20793
- fill: "none"
20794
- }, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
20795
- filter: "url(#option_svg__a)"
20796
- }, /*#__PURE__*/React.createElement("mask", {
20797
- id: "option_svg__b",
20798
- width: 18,
20799
- height: 15,
20800
- x: 2,
20801
- y: 0.612,
20802
- fill: "#000",
20803
- maskUnits: "userSpaceOnUse"
20804
- }, /*#__PURE__*/React.createElement("path", {
20805
- fill: "#fff",
20806
- d: "M2 .612h18v15H2z"
20807
- }), /*#__PURE__*/React.createElement("path", {
20808
- d: "M4 4.39a1 1 0 0 1 1.599-.801l4.419 3.302h7.27v1.992H10.32L5.6 12.412A1 1 0 0 1 4 11.61z"
20809
- })), /*#__PURE__*/React.createElement("path", {
20810
- fill: "currentColor",
20811
- d: "M4 4.39a1 1 0 0 1 1.599-.801l4.419 3.302h7.27v1.992H10.32L5.6 12.412A1 1 0 0 1 4 11.61z"
20812
- }), /*#__PURE__*/React.createElement("path", {
20813
- fill: "#F5F6F8",
20814
- d: "M5.599 3.589 4.4 5.19zm4.419 3.302L8.82 8.493l.533.398h.665zm7.27 0h2v-2h-2zm0 1.992v2h2v-2zm-6.968 0v-2h-.665l-.532.398zM5.6 12.412l1.196 1.603.001-.001zM4 11.61H2v.001zm0-7.22h2a1 1 0 0 1-1.599.8L5.6 3.59l1.197-1.602C4.818.509 2 1.919 2 4.39zm1.599-.801L4.402 5.19 8.82 8.493l1.198-1.602 1.197-1.603-4.42-3.301zm4.419 3.302v2h7.27v-4h-7.27zm7.27 0h-2v1.992h4V6.89zm0 1.992v-2H10.32v4h6.967zm-6.968 0L9.123 7.28 4.4 10.81 5.6 12.411l1.197 1.602 4.722-3.53zM5.6 12.412l-1.197-1.603a1 1 0 0 1 1.598.8l-2 .001-2 .001c0 2.466 2.815 3.882 4.795 2.404zM4 11.61h2V4.39H2v7.22z",
20815
- mask: "url(#option_svg__b)"
20816
- }))), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("filter", {
20817
- id: "option_svg__a",
20818
- width: 21.287,
20819
- height: 17.232,
20820
- x: 0,
20821
- y: 0.384,
20822
- colorInterpolationFilters: "sRGB",
20823
- filterUnits: "userSpaceOnUse"
20824
- }, /*#__PURE__*/React.createElement("feFlood", {
20825
- floodOpacity: 0,
20826
- result: "BackgroundImageFix"
20827
- }), /*#__PURE__*/React.createElement("feColorMatrix", {
20828
- "in": "SourceAlpha",
20829
- result: "hardAlpha",
20830
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
20831
- }), /*#__PURE__*/React.createElement("feOffset", {
20832
- dy: 1
20833
- }), /*#__PURE__*/React.createElement("feGaussianBlur", {
20834
- stdDeviation: 1
20835
- }), /*#__PURE__*/React.createElement("feComposite", {
20836
- in2: "hardAlpha",
20837
- operator: "out"
20838
- }), /*#__PURE__*/React.createElement("feColorMatrix", {
20839
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
20840
- }), /*#__PURE__*/React.createElement("feBlend", {
20841
- in2: "BackgroundImageFix",
20842
- result: "effect1_dropShadow_13071_1578"
20843
- }), /*#__PURE__*/React.createElement("feBlend", {
20844
- "in": "SourceGraphic",
20845
- in2: "effect1_dropShadow_13071_1578",
20846
- result: "shape"
20847
- })))));
20848
- };
20849
-
20850
- // json中返回的是多选方向的加值,所以需要拆开
20851
- function convertDirectionToParams(value) {
20852
- const A = 1 << 0; // bit0 = 1
20853
- const B = 1 << 1; // bit1 = 2
20854
- const C = 1 << 2; // bit2 = 4
20855
- const D = 1 << 3; // bit3 = 8
20856
- const E = 1 << 4; // bit4 = 16
20857
- const F = 1 << 5; // bit5 = 32
20858
- const directions = [];
20859
- // 检查每个位标志是否被设置
20860
- if (value & A)
20861
- directions.push(A);
20862
- if (value & B)
20863
- directions.push(B);
20864
- if (value & C)
20865
- directions.push(C);
20866
- if (value & D)
20867
- directions.push(D);
20868
- if (value & E)
20869
- directions.push(E);
20870
- if (value & F)
20871
- directions.push(F);
20872
- return directions;
20873
- }
20874
-
20875
- const DEFAULT_LIST = [
20876
- {
20877
- value: 1 << 0,
20878
- text: 'A',
20879
- selected: false,
20880
- },
20881
- {
20882
- value: 1 << 1,
20883
- text: 'B',
20884
- selected: false,
20885
- },
20886
- {
20887
- value: 1 << 2,
20888
- text: 'C',
20889
- selected: false,
20890
- },
20891
- {
20892
- value: 1 << 3,
20893
- text: 'D',
20894
- selected: false,
20895
- },
20896
- {
20897
- value: 1 << 4,
20898
- text: 'E',
20899
- selected: false,
20900
- },
20901
- {
20902
- value: 1 << 5,
20903
- text: 'F',
20904
- selected: false,
20905
- },
20906
- ];
20907
- const MowDirection_L = (props) => {
20908
- const { value, angleValue, optionAngle = 45, zIndex = 10000, onChange,
20909
- // children,
20910
- } = props;
20911
- const [angle, setAngle] = useState(0);
20912
- const lineList = useMemo(() => {
20913
- return DEFAULT_LIST.map((item) => ({
20914
- ...item,
20915
- selected: convertDirectionToParams(value).includes(item.value),
20916
- }));
20917
- }, [value]);
20918
- // const [lineList, setLineList] = useState<LineItem[]>([
20919
- // {
20920
- // value: 1 << 0,
20921
- // text: 'A',
20922
- // selected: false,
20923
- // },
20924
- // {
20925
- // value: 1 << 1,
20926
- // text: 'B',
20927
- // selected: false,
20928
- // },
20929
- // {
20930
- // value: 1 << 2,
20931
- // text: 'C',
20932
- // selected: false,
20933
- // },
20934
- // {
20935
- // value: 1 << 3,
20936
- // text: 'D',
20937
- // selected: false,
20938
- // },
20939
- // {
20940
- // value: 1 << 4,
20941
- // text: 'E',
20942
- // selected: false,
20943
- // },
20944
- // {
20945
- // value: 1 << 5,
20946
- // text: 'F',
20947
- // selected: false,
20948
- // },
20949
- // ]);
20950
- const hitRectAngle = useMemo(() => {
20951
- const direction = lineList
20952
- ?.filter((item) => item?.selected)
20953
- ?.reduce((pre, line) => {
20954
- return pre + line.value;
20955
- }, 0);
20956
- const angles = getSelectAngles(direction)?.map((item) => item + angleValue);
20957
- return angles?.includes(optionAngle);
20958
- }, [lineList, angleValue, optionAngle]);
20959
- const allSelect = useMemo(() => {
20960
- return lineList?.every((item) => item?.selected);
20961
- }, [lineList]);
20962
- useEffect(() => {
20963
- setAngle(angleValue);
20964
- }, [angleValue]);
20965
- console.log('hitRectAngle-->', hitRectAngle);
20966
- const onLineClick = (index) => {
20967
- const newLine = lineList.map((line, i) => {
20968
- if (i === index) {
20969
- return {
20970
- ...line,
20971
- selected: !line.selected,
20972
- };
20973
- }
20974
- return { ...line };
20975
- });
20976
- onChange?.(newLine
20977
- ?.filter((item) => item?.selected)
20978
- .reduce((pre, line) => {
20979
- return pre + line.value;
20980
- }, 0));
20981
- };
20982
- return (jsx("div", { className: styles$2.commonModalContainer, style: { zIndex }, children: jsx("div", { className: styles$2.commonModalContent, children: jsxs("div", { className: styles$2.content, children: [jsx("div", { className: styles$2.directDialPlateBox, children: jsxs("div", { className: styles$2.directDialPlate, children: [jsx(SvgDirectDialPlate, {}), jsx("div", { className: styles$2.directLineMain, style: {
20983
- transform: `rotate(${angle}deg)`,
20984
- }, children: lineList.map((line, index) => (jsxs("div", { className: styles$2.directLineContent, style: {
20985
- transform: `translate(-50%, -50%) rotate(${30 * index}deg)`,
20986
- }, children: [jsx("div", { className: styles$2.directLineText, style: {
20987
- color: line.selected ? '#FF996C' : '#B3B4C3',
20988
- }, children: line.text }), jsx(DirectionLine, { className: styles$2.directLine, selected: line.selected, onClick: () => onLineClick(index) }), jsx("div", { className: styles$2.directLineText, style: {
20989
- transform: 'rotate(180deg)',
20990
- color: line.selected ? '#FF996C' : '#B3B4C3',
20991
- }, children: line.text })] }, line.value))) }), jsx("div", { className: classNames(styles$2.directCenterCircle, {
20992
- [styles$2.active]: allSelect && hitRectAngle,
20993
- }) })] }) }), jsxs("div", { className: styles$2.directOption, style: {
20994
- transform: `rotate(${optionAngle}deg)`,
20995
- color: hitRectAngle ? '#FF996C' : '#B3B4C3',
20996
- }, children: [jsx("div", { className: styles$2.leftTop, children: jsx(SvgOption, {}) }), jsx("div", { className: styles$2.rightBottom, children: jsx(SvgOption, {}) })] })] }) }) }));
20997
- };
20998
-
20999
- const BoundarySvgRender = React__default.memo(({ mapJson, id, maxWidth = 300 }) => {
21000
- const svgElementData = useMemo(() => {
21001
- const data = UnifiedMapDataProcessor.processMapData(mapJson, DEFAULT_STYLES) || {};
21002
- return data;
21003
- }, [mapJson, DEFAULT_STYLES]);
21004
- const boundaryInfo = useMemo(() => {
21005
- const boundary = svgElementData.boundary.find((item) => item.id === id);
21006
- return boundary;
21007
- }, [id, svgElementData]);
21008
- // 计算当前boundary的viewBox
21009
- const boundaryViewBox = useMemo(() => {
21010
- if (!boundaryInfo?.points || boundaryInfo.points.length === 0) {
21011
- return null;
21012
- }
21013
- // 计算边界
21014
- let minX = Infinity;
21015
- let minY = Infinity;
21016
- let maxX = -Infinity;
21017
- let maxY = -Infinity;
21018
- boundaryInfo.points.forEach((point) => {
21019
- minX = Math.min(minX, point[0]);
21020
- minY = Math.min(minY, point[1]);
21021
- maxX = Math.max(maxX, point[0]);
21022
- maxY = Math.max(maxY, point[1]);
21023
- });
21024
- // 添加边距
21025
- const padding = 50;
21026
- const width = maxX - minX + padding * 2;
21027
- const height = maxY - minY + padding * 2;
21028
- return {
21029
- x: minX - padding,
21030
- y: minY - padding,
21031
- width,
21032
- height,
21033
- };
21034
- }, [boundaryInfo]);
21035
- const style = useMemo(() => {
21036
- if (boundaryViewBox?.width > boundaryViewBox?.height) {
21037
- return {
21038
- width: maxWidth,
21039
- height: maxWidth * (boundaryViewBox.height / boundaryViewBox.width),
21040
- };
21041
- }
21042
- return {
21043
- width: maxWidth * (boundaryViewBox.height / boundaryViewBox.width),
21044
- height: maxWidth,
21045
- };
21046
- }, [boundaryViewBox, maxWidth]);
21047
- return (jsxs("div", { style: {
21048
- position: 'relative',
21049
- width: style.width,
21050
- height: style.height,
21051
- margin: '0 auto',
21052
- }, children: [jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: `${boundaryViewBox.x} ${boundaryViewBox.y} ${boundaryViewBox.width} ${boundaryViewBox.height}`, width: `${style.width}px`, height: `${style.height}px`, style: { position: 'absolute', inset: 0, pointerEvents: 'none' }, children: Object.keys(svgElementData)?.map((key) => {
21053
- return svgElementData[key]?.map((element) => {
21054
- if (key === DataType.VISION_OFF)
21055
- return null;
21056
- return (jsx(GElement, { type: key, data: svgElementData[key], children: jsx(SvgElement, { type: key, data: element, onSelect: () => { }, onCancel: () => { } }, element.id) }, key));
21057
- });
21058
- }) }), jsx(CharginPile, { mapData: mapJson, mapConfig: DEFAULT_STYLES, viewBox: boundaryViewBox || null, rotation: 0 })] }));
21059
- });
21060
-
21061
- const DirectionModal = ({ directionInfo, open, setOpen, zoneName, optionAngle, onChange, }) => {
21062
- const { mapJson, mapConfig } = useCommonContext();
21063
- const { editMapInfo } = useMapEditContext();
21064
- const [directions, setDirections] = useState(ALL_DIRECTION_SELECTED);
21065
- const [angle, setAngle] = useState(MIN_DIRECTION_ANGLE);
21066
- const canSetDefault = useMemo(() => {
21067
- const angles = getSelectAngles(directions)?.map((item) => item + angle);
21068
- const hitRectAngle = angles?.includes(optionAngle);
21069
- return directions !== ALL_DIRECTION_SELECTED || !hitRectAngle;
21070
- }, [directions, angle]);
21071
- const canSave = useMemo(() => {
21072
- return directions !== directionInfo?.direction || angle !== directionInfo?.angle;
21073
- }, [directions, angle, directionInfo]);
21074
- useEffect(() => {
21075
- if (!open)
21076
- return;
21077
- setDirections(directionInfo.direction);
21078
- setAngle(directionInfo.angle);
21079
- }, [directionInfo, open]);
21080
- const resetDirection = () => {
21081
- setDirections(ALL_DIRECTION_SELECTED);
21082
- const defaultAngle = getDefaultAngle(optionAngle);
21083
- console.log('defaultAngle=>', defaultAngle, optionAngle);
21084
- if (defaultAngle) {
21085
- setAngle(defaultAngle);
21086
- }
21087
- };
21088
- const handleCancel = useCallback(() => {
21089
- if (!canSave) {
21090
- setOpen(false);
21091
- return;
21092
- }
21093
- Modal.confirm({
21094
- icon: null,
21095
- centered: true,
21096
- title: 'Exit editing',
21097
- content: 'Changes you made will not be saved. Are you sure you want to exit editing the mowing direction?',
21098
- onOk: () => {
21099
- setOpen(false);
21100
- },
21101
- okText: 'Exit',
21102
- cancelText: 'Continue editing',
21103
- });
21104
- }, [canSave, setOpen]);
21105
- console.log('directionInfo=>', directionInfo, mapJson);
21106
- return (jsx(CustomModal, { maskClosable: false, titleCenter: true, title: `${zoneName} mowing direction`, open: open, width: 600, onCancel: handleCancel, onOk: () => {
21107
- onChange?.(directions, angle);
21108
- setOpen(false);
21109
- }, okText: "Confirm", cancelText: "Cancel", okButtonProps: { disabled: !canSave }, afterClose: () => {
21110
- setDirections(ALL_DIRECTION_SELECTED);
21111
- setAngle(MIN_DIRECTION_ANGLE);
21112
- }, children: jsxs("div", { className: styles$3.directions, children: [jsx("div", { className: styles$3.default, children: jsx(Button, { disabled: !canSetDefault, variant: "link", color: "primary", onClick: resetDirection, children: "Default" }) }), jsx("div", { className: styles$3.tips, children: "\u4E00\u4E2A\u7B80\u77ED\u7684\u8BF4\u660E\uFF0C\u5E0C\u671B\u80FD\u5145\u5F53\u7B80\u5355\u7684\u6559\u7A0B\uFF0C\u9700\u8981\u53EF\u5FC3\u6839\u636EC\u7AEF\u5DF2\u6709\u7684\u6574\u5408\u4E00\u4E0B" }), jsxs("div", { className: styles$3.optimal, children: [jsx("div", { children: "*" }), jsx(SvgOption, {}), jsx("div", { className: styles$3.text, children: "Optimal direction" })] }), jsxs("div", { className: styles$3.content, children: [jsx("div", { className: styles$3.background, children: jsx(BoundarySvgRender, { mapJson: mapJson, id: editMapInfo.selectElement.id }) }), jsx("div", { className: styles$3.luppan, children: jsx(MowDirection_L, { value: directions, angleValue: angle, optionAngle: optionAngle, onChange: (value) => {
21113
- console.log('valie=>', value);
21114
- if (!value)
21115
- return message.warning('Choose at least one mowing direction');
21116
- setDirections(value);
21117
- } }) })] }), jsx("div", { className: styles$3.slideTip, children: "\u7528\u6237\u8FD8\u53EF\u4EE5\u901A\u8FC7\u6ED1\u8F68\u5FAE\u8C03\u5272\u8349\u65B9\u5411\uFF08\u975E\u5FC5\u987B\uFF09" }), jsx("div", { className: styles$3.slider, children: jsx(Slider, { tooltip: {
21118
- formatter: (value) => `${value}°`,
21119
- }, min: MIN_DIRECTION_ANGLE, max: MAX_DIRECTION_ANGLE, value: angle, onChange: (value) => setAngle(value) }) })] }) }));
21120
- };
21121
-
21122
- const BoundaryInfo = ({ onHandleDelete }) => {
21123
- const { unitType, heightOptions, globalHeight } = useCommonContext();
21124
- const { editMapInfo, setEditMapInfo } = useMapEditContext();
21125
- const nameValue = editMapInfo.selectElement?.name;
21126
- const onHandleFocus = () => { };
21127
- const [open, setOpen] = useState(false);
21128
- const [heightOpen, setHeightOpen] = useState(false);
21129
- const [directionOpen, setDirectionOpen] = useState(false);
21130
- const sizeValue = useMemo(() => {
21131
- const points = editMapInfo.selectElement?.points?.map((item) => [
21132
- item[0] / SCALE_FACTOR,
21133
- item[1] / SCALE_FACTOR,
21134
- ]);
21135
- const { area: areaValue, perimeter: perimeterValue } = calculatePolygonAreaAndPerimeter(points) || {};
21136
- const formatArea = convertAreaByUnits(areaValue);
21137
- const formatPerimeter = convertDistanceByUnits(perimeterValue);
21138
- return {
21139
- area: formatArea.value,
21140
- perimeter: formatPerimeter.value,
21141
- };
21142
- }, [editMapInfo.selectElement]);
21143
- const edgeMowingValue = useMemo(() => {
21144
- return {
21145
- edgeMowing: editMapInfo?.selectElement?.edgeMowing,
21146
- obstacleMowEdge: editMapInfo?.selectElement?.obstacleMowEdge,
21147
- };
21148
- }, [editMapInfo.selectElement]);
21149
- const heightValue = useMemo(() => {
21150
- return {
21151
- isFlowGlobal: editMapInfo?.selectElement?.isFlowGlobal,
21152
- cuttingHeight: editMapInfo?.selectElement?.cuttingHeight,
21153
- };
21154
- }, [editMapInfo.selectElement]);
21155
- const directionInfo = useMemo(() => {
21156
- return {
21157
- direction: editMapInfo?.selectElement?.direction,
21158
- angle: editMapInfo?.selectElement?.angle,
21159
- };
21160
- }, [editMapInfo.selectElement?.direction, editMapInfo.selectElement?.angle]);
21161
- const optionAngle = useMemo(() => {
21162
- return editMapInfo?.selectElement?.recBaseAngle;
21163
- }, [editMapInfo.selectElement?.recBaseAngle]);
21164
- console.log('height---->', editMapInfo?.selectElement, heightValue, edgeMowingValue);
21165
- return (jsxs("div", { className: styles$9.boundaryInfo, children: [jsx(Header, { handleDelete: onHandleDelete, handleFocus: onHandleFocus, type: editMapInfo.elementType }), jsx("div", { className: styles$9.nameEdit, children: jsx(NameEdit, { title: "Boundary name", name: nameValue, onChange: (name) => {
21166
- setEditMapInfo({
21167
- ...editMapInfo,
21168
- isShowDrag: false,
21169
- selectElement: {
21170
- ...editMapInfo.selectElement,
21171
- name: name,
21172
- },
21173
- });
21174
- } }) }), jsx("div", { className: styles$9.border }), jsxs("div", { className: styles$9.otherEdit, children: [jsx(Item, { children: jsxs("div", { className: styles$9.otherItem, children: [jsx("div", { className: styles$9.label, children: "Cutting height" }), jsx("div", { className: styles$9.value, children: generateHeightStr(heightValue?.cuttingHeight, unitType, true) }), jsx("div", { className: styles$9.icon, onClick: () => {
21175
- setHeightOpen(true);
21176
- }, children: jsx(SvgArrow, {}) })] }) }), jsx(Item, { children: jsxs("div", { className: styles$9.otherItem, children: [jsx("div", { className: styles$9.label, children: "Mowing direction" }), jsx("div", { className: styles$9.value }), jsx("div", { className: styles$9.icon, onClick: () => {
21177
- setDirectionOpen(true);
21178
- }, children: jsx(SvgArrow, {}) })] }) }), jsx(Item, { children: jsxs("div", { className: styles$9.otherItem, children: [jsx("div", { className: styles$9.label, children: "Edge mowing" }), jsx("div", { className: styles$9.value }), jsx("div", { className: styles$9.icon, onClick: () => {
21179
- setOpen(true);
21180
- }, children: jsx(SvgArrow, {}) })] }) })] }), jsx("div", { className: styles$9.border }), jsxs("div", { className: styles$9.areaInfo, children: [jsxs("div", { className: styles$9.areaItem, children: [jsx("div", { className: styles$9.label, children: "Area:" }), jsx("div", { className: styles$9.value, children: sizeValue?.area })] }), jsxs("div", { className: styles$9.areaItem, children: [jsx("div", { className: styles$9.label, children: "Perimeter:" }), jsx("div", { className: styles$9.value, children: sizeValue?.perimeter })] })] }), jsx(MowingEdgeModal, { value: edgeMowingValue, onChange: (value) => {
21181
- setEditMapInfo({
21182
- ...editMapInfo,
21183
- selectElement: {
21184
- ...editMapInfo.selectElement,
21185
- edgeMowing: value.edgeMowing ? 1 : 0,
21186
- obstacleMowEdge: value.obstacleMowEdge ? 1 : 0,
21187
- },
21188
- });
21189
- }, open: open, setOpen: setOpen }), jsx(HeightModal, { zoneName: editMapInfo.selectElement?.name, heightOptions: heightOptions, globalHeight: globalHeight, open: heightOpen, setOpen: setHeightOpen, value: heightValue, onChange: (value) => {
21190
- setEditMapInfo({
21191
- ...editMapInfo,
21192
- selectElement: {
21193
- ...editMapInfo.selectElement,
21194
- cuttingHeight: value.cuttingHeight,
21195
- isFlowGlobal: value.isFlowGlobal,
21196
- },
21197
- });
21198
- } }), jsx(DirectionModal, { directionInfo: directionInfo, optionAngle: optionAngle, open: directionOpen, setOpen: setDirectionOpen, zoneName: editMapInfo.selectElement?.name, onChange: (direction, angle) => {
21199
- setEditMapInfo({
21200
- ...editMapInfo,
21201
- selectElement: {
21202
- ...editMapInfo.selectElement,
21203
- direction,
21204
- angle,
21205
- },
21206
- });
21207
- } })] }));
21208
- };
21209
-
21210
- var css_248z$1 = ".index-module_timePeriod__EkVZl {\n display: flex;\n flex-direction: column;\n}\n.index-module_timePeriod__EkVZl .index-module_timePeriodHeader__CgJGW {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 4px 0;\n}\n.index-module_timePeriod__EkVZl .index-module_timePeriodHeader__CgJGW .index-module_timePeriodTitle__lnYno {\n font-weight: 400;\n font-size: 14px;\n line-height: 16px;\n color: rgb(0, 0, 0);\n}\n.index-module_timePeriod__EkVZl .index-module_timePeriodHeader__CgJGW .index-module_timePeriodHandle__pjDTA {\n margin-left: auto;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n}\n.index-module_timePeriod__EkVZl .index-module_timePeriodContent__pTqdW {\n margin-top: 4px;\n}\n.index-module_timePeriod__EkVZl .index-module_timePeriodContent__pTqdW .index-module_timePeriodRadioItem__3rd-r {\n line-height: 28px;\n}";
21211
- var styles$1 = {"timePeriod":"index-module_timePeriod__EkVZl","timePeriodHeader":"index-module_timePeriodHeader__CgJGW","timePeriodTitle":"index-module_timePeriodTitle__lnYno","timePeriodHandle":"index-module_timePeriodHandle__pjDTA","timePeriodContent":"index-module_timePeriodContent__pTqdW","timePeriodRadioItem":"index-module_timePeriodRadioItem__3rd-r"};
21212
- styleInject(css_248z$1);
21213
-
21214
- var RadioValue;
21215
- (function (RadioValue) {
21216
- RadioValue[RadioValue["LONG_TIME"] = 0] = "LONG_TIME";
21217
- RadioValue[RadioValue["SHORT_TIME"] = 1] = "SHORT_TIME";
21218
- })(RadioValue || (RadioValue = {}));
21219
- const TimePeriod = ({ value, onChange }) => {
21220
- // eslint-disable-next-line no-undef
21221
- const [date, setDate] = useState();
21222
- const [open, setOpen] = useState(false);
21223
- const [radioValue, setRadioValue] = useState(RadioValue.LONG_TIME);
21224
- console.log('time period->', date, radioValue);
21225
- useEffect(() => {
21226
- if (!open && date?.length !== 2) {
21227
- setRadioValue(RadioValue.LONG_TIME);
21228
- }
21229
- }, [open]);
21230
- return (jsxs("div", { className: styles$1.timePeriod, children: [jsxs("div", { className: styles$1.timePeriodHeader, children: [jsx("div", { className: styles$1.timePeriodTitle, children: "Enabled" }), jsx("div", { className: styles$1.timePeriodHandle, children: jsx(Switch, { checked: value.status === 1, onChange: (checked) => {
21231
- onChange({
21232
- ...value,
21233
- status: checked ? 1 : 0,
21234
- start_timestamp: checked ? value.start_timestamp : 0,
21235
- end_timestamp: checked ? value.end_timestamp : 0,
21236
- });
21237
- } }) })] }), jsx("div", { className: styles$1.timePeriodContent, children: jsxs(Radio.Group, { value: radioValue, onChange: (e) => {
21238
- setRadioValue(e.target.value);
21239
- if (e.target.value === RadioValue.LONG_TIME) {
21240
- setDate(null);
21241
- onChange({
21242
- ...value,
21243
- start_timestamp: 0,
21244
- end_timestamp: 0,
21245
- });
21246
- }
21247
- else if (e.target.value === RadioValue.SHORT_TIME) {
21248
- setOpen(true);
21249
- // onChange({
21250
- // ...value,
21251
- // startTimestamp: dayjs().add(30, 'minute').unix(),
21252
- // endTimestamp: dayjs().add(1, 'hour').unix(),
21253
- // });
21254
- }
21255
- }, style: { display: 'flex', flexDirection: 'column', gap: '4px' }, children: [jsx(Radio, { value: RadioValue.LONG_TIME, children: jsx("div", { className: styles$1.timePeriodRadioItem, children: "Always" }) }), jsx(Radio, { value: RadioValue.SHORT_TIME, children: jsx("div", { className: styles$1.timePeriodRadioItem, children: jsx(DatePicker.RangePicker, { open: open, value: date ? date : undefined, disabled: radioValue === RadioValue.LONG_TIME, showTime: { format: 'HH:mm' }, format: "MM/DD/YYYY HH:mm", preserveInvalidOnBlur: true, onOpenChange: (open) => {
21256
- setOpen(open);
21257
- }, onChange: (dateValue, dateString) => {
21258
- setDate(dateValue);
21259
- if (dateValue?.length === 2) {
21260
- onChange({
21261
- status: RadioValue.SHORT_TIME,
21262
- start_timestamp: dateValue[0].unix(),
21263
- end_timestamp: dateValue[1].unix(),
21264
- });
21265
- }
21266
- } }) }) })] }) })] }));
21267
- };
21268
-
21269
- const ObstacleInfo = ({ onHandleDelete }) => {
21270
- const { editMapInfo, setEditMapInfo } = useMapEditContext();
21271
- const nameValue = editMapInfo.selectElement?.name;
21272
- console.log('obstacle->', editMapInfo.selectElement);
21273
- const timePeriodValue = useMemo(() => {
21274
- if (!editMapInfo.selectElement)
21275
- return null;
21276
- const status = editMapInfo.selectElement?.status;
21277
- const start_timestamp = editMapInfo.selectElement?.start_timestamp;
21278
- const end_timestamp = editMapInfo.selectElement?.end_timestamp;
21279
- return {
21280
- status,
21281
- start_timestamp,
21282
- end_timestamp,
21283
- };
21284
- }, [editMapInfo.selectElement]);
21285
- const sizeValue = useMemo(() => {
21286
- const points = editMapInfo.selectElement?.points?.map((item) => [
21287
- item[0] / SCALE_FACTOR,
21288
- item[1] / SCALE_FACTOR,
21289
- ]);
21290
- const { area: areaValue, perimeter: perimeterValue } = calculatePolygonAreaAndPerimeter(points) || {};
21291
- const formatArea = convertAreaByUnits(areaValue);
21292
- const formatPerimeter = convertDistanceByUnits(perimeterValue);
21293
- return {
21294
- area: formatArea.value,
21295
- perimeter: formatPerimeter.value,
21296
- };
21297
- }, [editMapInfo.selectElement]);
21298
- return (jsxs("div", { className: styles$9.obstacleInfo, children: [jsx(Header, { handleDelete: () => {
21299
- onHandleDelete();
21300
- }, handleFocus: () => { }, type: editMapInfo.elementType }), jsx("div", { className: styles$9.nameEdit, children: jsx(NameEdit, { title: "Obstacle name", name: nameValue, onChange: (name) => {
21301
- setEditMapInfo({
21302
- ...editMapInfo,
21303
- isShowDrag: false,
21304
- selectElement: {
21305
- ...editMapInfo.selectElement,
21306
- name: name,
21307
- },
21308
- });
21309
- } }) }), jsx("div", { className: styles$9.border }), jsx("div", { className: styles$9.timePeriod, children: jsx(TimePeriod, { value: timePeriodValue, onChange: (value) => {
21310
- setEditMapInfo({
21311
- ...editMapInfo,
21312
- isShowDrag: editMapInfo?.isShowDrag || false,
21313
- selectElement: {
21314
- ...editMapInfo.selectElement,
21315
- status: value.status,
21316
- start_timestamp: value.start_timestamp,
21317
- end_timestamp: value.end_timestamp,
21318
- },
21319
- });
21320
- } }) }), jsx("div", { className: styles$9.border }), jsxs("div", { className: styles$9.areaInfo, children: [jsxs("div", { className: styles$9.areaItem, children: [jsx("div", { className: styles$9.label, children: "Area:" }), jsx("div", { className: styles$9.value, children: sizeValue?.area })] }), jsxs("div", { className: styles$9.areaItem, children: [jsx("div", { className: styles$9.label, children: "Perimeter:" }), jsx("div", { className: styles$9.value, children: sizeValue?.perimeter })] })] })] }));
21321
- };
21322
-
21323
- const DoodleInfo = ({ onHandleDelete }) => {
21324
- const { editMapInfo, setEditMapInfo } = useMapEditContext();
21325
- const options = useMemo(() => {
21326
- return new Array(30).fill(0).map((_, index) => {
21327
- return {
21328
- label: `${index + 1}day`,
21329
- value: index + 1,
21330
- };
21331
- });
21332
- }, []);
21333
- const isCreate = useMemo(() => {
21334
- return editMapInfo?.createMode;
21335
- }, [editMapInfo?.createMode]);
21336
- const doodleInfo = useMemo(() => {
21337
- if (!editMapInfo.selectElement)
21338
- return null;
21339
- const create_ts = editMapInfo?.selectElement?.create_ts;
21340
- const expiration_ts = editMapInfo.selectElement.expiration_ts;
21341
- const diff = expiration_ts - create_ts;
21342
- const day = Math.floor(diff / (60 * 60 * 24));
21343
- return {
21344
- day: day,
21345
- };
21346
- }, [editMapInfo?.selectElement]);
21347
- const remainDay = useMemo(() => {
21348
- if (!editMapInfo.selectElement)
21349
- return null;
21350
- const expiration_ts = editMapInfo.selectElement.expiration_ts;
21351
- const diff = expiration_ts - Date.now() / 1000;
21352
- return Math.floor(diff / (60 * 60 * 24));
21353
- }, [editMapInfo?.selectElement]);
21354
- const sizeValue = useMemo(() => {
21355
- if (!editMapInfo.selectElement || !editMapInfo.selectElement.svg)
21356
- return '';
21357
- const svg = editMapInfo.selectElement?.svg;
21358
- const scale = editMapInfo.selectElement.scale;
21359
- const parseSvg = SvgParserNative.parseSvg(svg);
21360
- const width = (parseSvg.width * scale) / SCALE_FACTOR;
21361
- const height = (parseSvg.height * scale) / SCALE_FACTOR;
21362
- console.log('parseSvg->', editMapInfo, parseSvg);
21363
- return `${width.toFixed(1)} m x ${height.toFixed(1)} m`;
21364
- }, [editMapInfo.selectElement]);
21365
- const handleChange = useCallback((day) => {
21366
- setEditMapInfo((pre) => {
21367
- return {
21368
- ...pre,
21369
- selectElement: {
21370
- ...pre.selectElement,
21371
- create_ts: Date.now() / 1000,
21372
- expiration_ts: Date.now() / 1000 + day * 24 * 60 * 60,
21373
- },
21374
- };
21375
- });
21376
- }, [editMapInfo.selectElement]);
21377
- console.log('doodleInfo->', doodleInfo);
21378
- return (jsxs("div", { className: styles$9.doodleInfo, children: [jsx(Header, { handleDelete: () => {
21379
- onHandleDelete();
21380
- }, handleFocus: () => { }, type: editMapInfo.elementType }), jsx("div", { className: styles$9.border }), isCreate ? (jsxs(Fragment, { children: [jsx(Item, { children: jsxs("div", { className: styles$9.time, children: [jsxs("div", { className: styles$9.exist, children: [jsx("div", { className: styles$9.label, children: "Preserve doodle for" }), jsx("div", { className: styles$9.value, children: jsx(Select, { defaultValue: doodleInfo?.day, style: { width: 80 }, onChange: (value) => handleChange(value), options: options }) })] }), doodleInfo?.day >= 14 && (jsx("div", { className: styles$9.tip, children: "* If the doodle lasts over 14 days, the grass may grow too tall for the mower to mow later." }))] }) }), jsx("div", { className: styles$9.border }), jsx("div", { className: styles$9.areaInfo, children: jsxs("div", { className: styles$9.areaItem, children: [jsx("div", { className: styles$9.label, children: "Size:" }), jsx("div", { className: styles$9.value, children: sizeValue })] }) })] })) : (jsxs("div", { className: styles$9.areaInfo, children: [jsxs("div", { className: styles$9.areaItem, children: [jsx("div", { className: styles$9.label, children: "Remaining time:" }), jsxs("div", { className: styles$9.value, children: [remainDay, " day"] })] }), jsxs("div", { className: styles$9.areaItem, children: [jsx("div", { className: styles$9.label, children: "Size:" }), jsx("div", { className: styles$9.value, children: sizeValue })] })] }))] }));
21381
- };
21382
-
21383
- const VisionOffInfo = ({ onHandleDelete }) => {
21384
- const { editMapInfo, setEditMapInfo } = useMapEditContext();
21385
- const sizeValue = useMemo(() => {
21386
- if (!editMapInfo.selectElement)
21387
- return '';
21388
- const points = editMapInfo.selectElement?.points;
21389
- const [width, height] = calculateRectangleDimensions(points);
21390
- const formatWidth = convertDistanceByUnits(width / SCALE_FACTOR);
21391
- const formatHeight = convertDistanceByUnits(height / SCALE_FACTOR);
21392
- return `${formatWidth.value} x ${formatHeight.value}`;
21393
- }, [editMapInfo.selectElement]);
21394
- return (jsxs("div", { className: "visionOffInfo", children: [jsx(Header, { handleDelete: () => {
21395
- onHandleDelete?.();
21396
- }, handleFocus: () => { }, type: DataType.VISION_OFF }), jsx("div", { className: styles$9.border }), jsx("div", { className: styles$9.areaInfo, children: jsxs("div", { className: styles$9.areaItem, children: [jsx("div", { className: styles$9.label, children: "Size:" }), jsx("div", { className: styles$9.value, children: sizeValue })] }) })] }));
21397
- };
21398
-
21399
- var _path$2, _path2$1;
21400
- function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
21401
- var SvgUndo = function SvgUndo(props) {
21402
- return /*#__PURE__*/React.createElement("svg", _extends$2({
21403
- xmlns: "http://www.w3.org/2000/svg",
21404
- width: 24,
21405
- height: 24,
21406
- fill: "none"
21407
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
21408
- stroke: "currentColor",
21409
- strokeLinecap: "round",
21410
- strokeLinejoin: "round",
21411
- strokeWidth: 2,
21412
- d: "M4.329 7.821h10.506a5.581 5.581 0 0 1 0 11.163h-5.27"
21413
- })), _path2$1 || (_path2$1 = /*#__PURE__*/React.createElement("path", {
21414
- stroke: "currentColor",
21415
- strokeLinecap: "round",
21416
- strokeLinejoin: "round",
21417
- strokeWidth: 2,
21418
- d: "m7.293 3.607-4.39 4.215 4.39 4.316"
21419
- })));
21420
- };
21421
-
21422
- var _path$1, _path2;
21423
- function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
21424
- var SvgRedo = function SvgRedo(props) {
21425
- return /*#__PURE__*/React.createElement("svg", _extends$1({
21426
- xmlns: "http://www.w3.org/2000/svg",
21427
- width: 24,
21428
- height: 24,
21429
- fill: "none"
21430
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
21431
- stroke: "currentColor",
21432
- strokeLinecap: "round",
21433
- strokeLinejoin: "round",
21434
- strokeWidth: 2,
21435
- d: "M19.672 7.821H9.165a5.581 5.581 0 1 0 0 11.163h5.27"
21436
- })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
21437
- stroke: "currentColor",
21438
- strokeLinecap: "round",
21439
- strokeLinejoin: "round",
21440
- strokeWidth: 2,
21441
- d: "m16.708 3.607 4.389 4.215-4.39 4.315"
21442
- })));
21443
- };
21444
-
21445
- const HandleElementInfo = () => {
21446
- const { svgElementDatas } = useSvgEditContext();
21447
- const { checkDoodle } = useCheckElement();
21448
- const { undo, redo } = useHistoryHandle();
21449
- const { editMapInfo, setEditMapInfo, onHandleStopRecord, onHandleCompleteRecord, onHandleDeleteElement, onUpdateBoundary, } = useMapEditContext();
21450
- const currentType = useMemo(() => {
21451
- return DATE_TYPE_MAP.find((item) => item.type === editMapInfo.elementType);
21452
- }, [editMapInfo.elementType]);
21453
- const isUndoDisabled = useMemo(() => {
21454
- if (editMapInfo?.elementType === DataType.OBSTACLE &&
21455
- editMapInfo?.createMode === CreateStatus.CREATING) {
21456
- return !(editMapInfo?.currentHistoryIndex > 0 && editMapInfo?.historyList?.length);
21457
- }
21458
- else {
21459
- return !(editMapInfo?.currentHistoryIndex > 0 && editMapInfo?.historyList?.length);
21460
- }
21461
- }, [
21462
- editMapInfo?.currentHistoryIndex,
21463
- editMapInfo?.historyList,
21464
- editMapInfo?.createMode,
21465
- editMapInfo?.elementType,
21466
- ]);
21467
- const idRedoDisabled = useMemo(() => {
21468
- return !(editMapInfo?.currentHistoryIndex < editMapInfo?.historyList?.length - 1 &&
21469
- editMapInfo?.historyList?.length);
21470
- }, [editMapInfo?.currentHistoryIndex, editMapInfo?.historyList]);
21471
- const handleUndo = useCallback((e) => {
21472
- e.stopPropagation();
21473
- e.preventDefault();
21474
- if (isUndoDisabled)
21475
- return;
21476
- undo();
21477
- }, [undo, isUndoDisabled]);
21478
- const handleRedo = useCallback((e) => {
21479
- e.stopPropagation();
21480
- e.preventDefault();
21481
- if (idRedoDisabled)
21482
- return;
21483
- redo();
21484
- }, [redo, idRedoDisabled]);
21485
- const renderElementData = useCallback((element) => {
21486
- if (!editMapInfo.selectElement)
21487
- return null;
21488
- const data = {
21489
- doodle: undefined,
21490
- visionOffAreas: undefined,
21491
- obstacle: undefined,
21492
- boundary: undefined,
21493
- };
21494
- if (element?.type === DataType.DOODLE) {
21495
- const doodleData = {
21496
- center: element.center,
21497
- direction: element.direction,
21498
- scale: element.scale,
21499
- svg: element.svg,
21500
- expiration_ts: element.expiration_ts,
21501
- create_ts: element.create_ts,
21502
- };
21503
- if (element?.id) {
21504
- doodleData.id = element?.id;
21505
- }
21506
- data.doodle = JSON.stringify([doodleData]);
21507
- }
21508
- if (element?.type === DataType.VISION_OFF) {
21509
- const visionOffArea = svgElementDatas?.[DataType.VISION_OFF]
21510
- ?.filter((item) => item.id !== element.id)
21511
- ?.map((item) => ({
21512
- id: item.id,
21513
- points: restorePointsFormat(item.points),
21514
- })) || [];
21515
- const visionOffAreaData = [
21516
- ...visionOffArea,
21517
- {
21518
- id: element?.id,
21519
- points: restorePointsFormat(element.points),
21520
- },
21521
- ]?.map((item) => {
21522
- if (item?.id) {
21523
- return {
21524
- id: item.id,
21525
- points: item.points,
21526
- };
21527
- }
21528
- return {
21529
- points: item.points,
21530
- };
21531
- }) || [];
21532
- data.visionOffAreas = JSON.stringify(visionOffAreaData);
21533
- }
21534
- if (element?.type === DataType.OBSTACLE) {
21535
- data.obstacle = {
21536
- name: element?.name,
21537
- status: element?.status ?? 1,
21538
- end_timestamp: element?.end_timestamp,
21539
- start_timestamp: element?.start_timestamp,
21540
- points: restorePointsFormat(element.points),
21541
- };
21542
- if (element?.id) {
21543
- data.obstacle.id = element?.id;
21544
- }
21545
- }
21546
- if (element?.type === DataType.BOUNDARY) {
21547
- data.boundary = {
21548
- cuttingHeight: element?.cuttingHeight,
21549
- isFlowGlobal: element?.isFlowGlobal,
21550
- angle: element?.angle,
21551
- direction: element?.direction,
21552
- name: element?.name,
21553
- edgeMowing: element?.edgeMowing,
21554
- edgeVision: element?.edgeVision,
21555
- obstacleMowEdge: element?.obstacleMowEdge,
21556
- };
21557
- if (element?.id) {
21558
- data.boundary.id = element?.id;
21559
- }
21560
- }
21561
- return data;
21562
- }, [editMapInfo.selectElement]);
21563
- const handleSave = useCallback(() => {
21564
- const params = renderElementData(editMapInfo?.selectElement);
21565
- const isObstacle = editMapInfo?.selectElement?.type === DataType.OBSTACLE;
21566
- const hasNotEnoughPoints = params?.obstacle?.points?.length < 3;
21567
- const isDoodle = editMapInfo?.selectElement?.type === DataType.DOODLE;
21568
- const doodleResult = checkDoodle();
21569
- if (isDoodle && !doodleResult?.isValid) {
21570
- message.error('Keep more distance from boundaries, off-limit island and other doodles');
21571
- return;
21572
- }
21573
- if (isObstacle && hasNotEnoughPoints) {
21574
- message.error('Save failed, please draw a closed shape');
21575
- return;
21576
- }
21577
- console.log('save->', editMapInfo, params);
21578
- if (editMapInfo?.selectElement?.type === DataType.BOUNDARY) {
21579
- onUpdateBoundary?.(params)?.then(() => {
21580
- setEditMapInfo({
21581
- ...editMapInfo,
21582
- createMode: null,
21583
- elementType: null,
21584
- selectElement: null,
21585
- isShowDrag: false,
21586
- });
21587
- }, (errorText) => {
21588
- message.error('Save failed, please try again');
21589
- });
21590
- }
21591
- else {
21592
- onHandleCompleteRecord?.(params)?.then(() => {
21593
- setEditMapInfo({
21594
- ...editMapInfo,
21595
- createMode: null,
21596
- elementType: null,
21597
- selectElement: null,
21598
- isShowDrag: false,
21599
- });
21600
- }, (errorText) => {
21601
- message.error('Save failed, please try again');
21602
- });
21603
- }
21604
- }, [editMapInfo.selectElement, onUpdateBoundary, onHandleCompleteRecord]);
21605
- const handleCancel = useCallback(() => {
21606
- const name = DATE_TYPE_MAP.find((item) => item.type === editMapInfo.elementType)?.label;
21607
- Modal.confirm({
21608
- icon: null,
21609
- centered: true,
21610
- title: 'Quit editing',
21611
- content: `Changes you made will not be saved. Are you sure you want to quit editing the ${name}?`,
21612
- okText: 'Quit',
21613
- cancelText: 'Keep editing',
21614
- onOk: () => {
21615
- onHandleStopRecord?.()?.then(() => {
21616
- setEditMapInfo({
21617
- ...editMapInfo,
21618
- createMode: null,
21619
- elementType: null,
21620
- selectElement: null,
21621
- isShowDrag: false,
21622
- });
21623
- });
21624
- },
21625
- });
21626
- }, [editMapInfo]);
21627
- const handleDelete = useCallback(() => {
21628
- console.log('handleDelete 1->', editMapInfo);
21629
- Modal.confirm({
21630
- icon: null,
21631
- title: 'Delete',
21632
- content: 'Are you sure you want to delete this element?',
21633
- okText: 'Delete',
21634
- cancelText: 'Cancel',
21635
- onOk: () => {
21636
- onHandleStopRecord?.()?.then(() => {
21637
- console.log('handleDelete 2->', editMapInfo, onHandleDeleteElement);
21638
- if (editMapInfo?.selectElement?.id) {
21639
- onHandleDeleteElement?.({
21640
- id: editMapInfo.selectElement?.id,
21641
- type: editMapInfo.elementType,
21642
- })?.then(() => {
21643
- setEditMapInfo({
21644
- ...editMapInfo,
21645
- createMode: null,
21646
- elementType: null,
21647
- selectElement: null,
21648
- isShowDrag: false,
21649
- });
21650
- }, (errorText) => {
21651
- message.error('Save failed, please try again');
21652
- });
21653
- }
21654
- else {
21655
- setEditMapInfo({
21656
- ...editMapInfo,
21657
- createMode: null,
21658
- elementType: null,
21659
- selectElement: null,
21660
- isShowDrag: false,
21661
- });
21662
- }
21663
- }, (errorText) => {
21664
- message.error('Save failed, please try again');
21665
- });
21666
- },
21667
- });
21668
- }, [editMapInfo?.selectElement, onHandleDeleteElement, onHandleStopRecord]);
21669
- if (!editMapInfo.selectElement)
21670
- return null;
21671
- console.log('handleElementInfo->', editMapInfo, currentType);
21672
- return (jsxs("div", { className: styles$9.handleElementInfo, children: [editMapInfo?.elementType !== DataType.BOUNDARY ? (jsxs("div", { className: styles$9.undoAndRedo, children: [jsx("div", { className: classNames(styles$9.undo, { [styles$9.disabled]: isUndoDisabled }), onClick: handleUndo, children: jsx(SvgUndo, {}) }), jsx("div", { className: classNames(styles$9.redo, { [styles$9.disabled]: idRedoDisabled }), onClick: handleRedo, children: jsx(SvgRedo, {}) })] })) : null, editMapInfo?.elementType === DataType.BOUNDARY && (jsx(BoundaryInfo, { onHandleDelete: handleDelete })), editMapInfo?.elementType === DataType.OBSTACLE && (jsx(ObstacleInfo, { onHandleDelete: handleDelete })), editMapInfo?.elementType === DataType.DOODLE && jsx(DoodleInfo, { onHandleDelete: handleDelete }), editMapInfo?.elementType === DataType.VISION_OFF && (jsx(VisionOffInfo, { onHandleDelete: handleDelete })), jsx("div", { className: styles$9.border }), jsx("div", { className: styles$9.handle, children: jsxs(Space, { size: 12, children: [jsx(Button, { variant: "outlined", color: "default", onClick: () => {
21673
- handleCancel();
21674
- }, children: "Cancel" }), jsx(Button, { variant: "solid", color: "primary", onClick: handleSave, children: "Save" })] }) })] }));
21675
- };
21676
-
21677
- var _path;
21678
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
21679
- var SvgMobileAddPoint = function SvgMobileAddPoint(props) {
21680
- return /*#__PURE__*/React.createElement("svg", _extends({
21681
- xmlns: "http://www.w3.org/2000/svg",
21682
- width: 36,
21683
- height: 36,
21684
- fill: "none"
21685
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
21686
- stroke: "#fff",
21687
- strokeLinecap: "round",
21688
- strokeLinejoin: "round",
21689
- strokeWidth: 3,
21690
- d: "M6 12V9a3 3 0 0 1 3-3h3M6 24v3a3 3 0 0 0 3 3h3M24 6h3a3 3 0 0 1 3 3v3m-6 18h3a3 3 0 0 0 3-3v-3m-16.5-6h9M18 13.5v9"
21691
- })));
21692
- };
21693
-
21694
- var css_248z = ".index-module_crosshair__etey6 {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 40px;\n height: 40px;\n pointer-events: none;\n z-index: 99999;\n display: flex;\n justify-content: center;\n align-items: center;\n}";
21695
- var styles = {"crosshair":"index-module_crosshair__etey6"};
21696
- styleInject(css_248z);
21697
-
21698
- /**
21699
- * 十字准心组件
21700
- * 相对于父容器居中显示
21701
- */
21702
- const Crosshair = () => {
21703
- const { platform } = useCommonContext();
21704
- const { editMapInfo } = useMapEditContext();
21705
- const isVisible = useMemo(() => {
21706
- if (platform === PlatformType.H5 &&
21707
- editMapInfo?.mobileMode === MobileEditMode.CREATE &&
21708
- editMapInfo?.elementType === DataType.OBSTACLE) {
21709
- return true;
21710
- }
21711
- return false;
21712
- }, [platform, editMapInfo]);
21713
- return isVisible ? (jsx("div", { className: styles.crosshair, children: jsx(SvgMobileAddPoint, {}) })) : null;
21714
- };
21715
-
21716
- // 验证GPS坐标是否有效
21717
- const isValidGpsCoordinate = (coordinate) => {
21718
- if (!coordinate || coordinate.length < 2)
21719
- return false;
21720
- const [lng, lat] = coordinate;
21721
- // 检查是否为有效的GPS坐标范围,且不是原点(0,0)
21722
- return (lng >= -180 &&
21723
- lng <= 180 &&
21724
- lat >= -90 &&
21725
- lat <= 90 &&
21726
- !(Math.abs(lng) < 0.001 && Math.abs(lat) < 0.001) // 排除接近(0,0)的坐标
21727
- );
21728
- };
21729
- // 旋转坐标点
21730
- const rotateCoordinate = (point, center, angleRadians) => {
21731
- const [x, y] = point;
21732
- const [cx, cy] = center;
21733
- // 将点移动到原点
21734
- const dx = x - cx;
21735
- const dy = y - cy;
21736
- // 应用旋转矩阵
21737
- const cos = Math.cos(angleRadians);
21738
- const sin = Math.sin(angleRadians);
21739
- const rotatedX = dx * cos - dy * sin;
21740
- const rotatedY = dx * sin + dy * cos;
21741
- // 移回原位置
21742
- return [rotatedX + cx, rotatedY + cy];
19996
+ // 旋转坐标点
19997
+ const rotateCoordinate = (point, center, angleRadians) => {
19998
+ const [x, y] = point;
19999
+ const [cx, cy] = center;
20000
+ // 将点移动到原点
20001
+ const dx = x - cx;
20002
+ const dy = y - cy;
20003
+ // 应用旋转矩阵
20004
+ const cos = Math.cos(angleRadians);
20005
+ const sin = Math.sin(angleRadians);
20006
+ const rotatedX = dx * cos - dy * sin;
20007
+ const rotatedY = dx * sin + dy * cos;
20008
+ // 移回原位置
20009
+ return [rotatedX + cx, rotatedY + cy];
21743
20010
  };
21744
20011
  // 获取有效的GPS边界
21745
20012
  const getValidGpsBounds = (mapData, rotation = 0) => {
@@ -21797,7 +20064,7 @@ const defaultMapConfig = DEFAULT_STYLES;
21797
20064
  // 地图渲染器组件
21798
20065
  const MowerMapRenderer = forwardRef(({ sn, platform = PlatformType.WEB, edger = false, unitType = UnitsType.Imperial, language = 'en', onlyRead = false, mapConfig,
21799
20066
  // pathConfig,
21800
- modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, onPathLoad, onError, className, style, googleMapInstance: _googleMapInstance, dragMap = false, dragCallbacks, defaultTransform, debug: _debug = false, doodleList = [], editMap = false, unStructMapData, disabledObstacles = false, onHandleEnterRecord, onHandleCompleteRecord, onHandleStopRecord, onHandleDeleteElement, onSaveBoundaryData, onSaveMap, onEditInfoMapChange, onUpdateBoundary, heightOptions, globalHeight, onHandleEvent, }, ref) => {
20067
+ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, onPathLoad, onError, className, style, googleMapInstance: _googleMapInstance, dragMap = false, dragCallbacks, defaultTransform, debug: _debug = false, doodleList = [], editMap = false, unStructMapData, disabledObstacles = false, onHandleEnterRecord, onHandleCompleteRecord, onHandleStopRecord, onHandleDeleteElement, onSaveBoundaryData, onSaveMap, onEditInfoMapChange, onUpdateBoundary, heightOptions, globalHeight, onHandleEvent, onSelectElement, }, ref) => {
21801
20068
  const [currentError, setCurrentError] = useState(null);
21802
20069
  const overlayRef = useRef(null);
21803
20070
  // const mapRef = useMap();
@@ -21845,7 +20112,10 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
21845
20112
  return {
21846
20113
  minDistance,
21847
20114
  editMapInfo,
21848
- setEditMapInfo,
20115
+ setEditMapInfo: (editMapInfo) => {
20116
+ setEditMapInfo(editMapInfo);
20117
+ onEditInfoMapChange?.(editMapInfo);
20118
+ },
21849
20119
  onHandleEnterRecord,
21850
20120
  onHandleCompleteRecord,
21851
20121
  onHandleStopRecord,
@@ -21854,6 +20124,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
21854
20124
  onHandleDeleteElement,
21855
20125
  onUpdateBoundary,
21856
20126
  onHandleEvent,
20127
+ onSelectElement,
21857
20128
  };
21858
20129
  }, [
21859
20130
  minDistance,
@@ -21866,6 +20137,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
21866
20137
  onSaveMap,
21867
20138
  onUpdateBoundary,
21868
20139
  onHandleEvent,
20140
+ onSelectElement,
21869
20141
  ]);
21870
20142
  // 合并配置
21871
20143
  const mergedMapConfig = useMemo(() => {
@@ -22259,6 +20531,10 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
22259
20531
  addDoodle: (doodle) => svgEditMapRef.current?.addDoodle(doodle),
22260
20532
  // 检查doodle
22261
20533
  checkDoodle: () => svgEditMapRef.current?.checkDoodle?.(),
20534
+ // 增加元素(web)
20535
+ addElement: (type, item) => svgEditMapRef.current?.addElement(type, item),
20536
+ // 保存元素
20537
+ saveElement: (type, item) => svgEditMapRef.current?.saveElement(type, item),
22262
20538
  }));
22263
20539
  /**
22264
20540
  * 根据割草机的位置更新路径
@@ -22273,7 +20549,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
22273
20549
  }
22274
20550
  // console.log('mowerrender------->', svgViewBox);
22275
20551
  // 使用goole maps自定义叠加层,返回debug信息(如果启用)
22276
- return (jsx(CommonContextProvider, { value: commonValue, children: jsx(SvgEditContextProvider, { value: svgEditValue, children: jsxs(MapEditContextProvider, { value: mapEditValue, children: [platform !== PlatformType.H5 && (jsxs(Fragment, { children: [jsx(AddEntry, { disabledObstacles: disabledObstacles, doodleList: doodleList, editMap: editMap }), jsx(HandleElementInfo, { editMapInfo: editMapInfo, setEditMapInfo: setEditMapInfo })] })), platform === PlatformType.H5 && jsx(Crosshair, {}), jsxs(OverlayViewF, { onLoad: (lay) => {
20552
+ return (jsx(CommonContextProvider, { value: commonValue, children: jsx(SvgEditContextProvider, { value: svgEditValue, children: jsxs(MapEditContextProvider, { value: mapEditValue, children: [platform !== PlatformType.H5 && (jsx(Fragment, {})), platform === PlatformType.H5 && jsx(Crosshair, {}), jsxs(OverlayViewF, { onLoad: (lay) => {
22277
20553
  setOverlay(lay);
22278
20554
  }, onDraw: (style) => {
22279
20555
  const layout = Object.keys(style).reduce((pre, cur) => {
@@ -22291,4 +20567,66 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
22291
20567
  });
22292
20568
  MowerMapRenderer.displayName = 'MowerMapRenderer';
22293
20569
 
22294
- export { AntennaData, AntennaDataBuilder, BaseData, BoundaryData, BoundarySvgRender, ChannelData, ChargingPileData, DataType, DoodleData, MapDataProcessor, MowerMapRenderer, ObstacleData, PathData, PathDataProcessor, RenderType, SvgParserNative, UnifiedMapDataProcessor, VisionOffData, calculateMapGpsCenter, estimateGpsFromMapBounds, initBoundary, initChannel, initDoodle, initObstacle, initVisionOff };
20570
+ const BoundarySvgRender = React__default.memo(({ mapJson, id, maxWidth = 300 }) => {
20571
+ const svgElementData = useMemo(() => {
20572
+ const data = UnifiedMapDataProcessor.processMapData(mapJson, DEFAULT_STYLES) || {};
20573
+ return data;
20574
+ }, [mapJson, DEFAULT_STYLES]);
20575
+ const boundaryInfo = useMemo(() => {
20576
+ const boundary = svgElementData.boundary.find((item) => item.id === id);
20577
+ return boundary;
20578
+ }, [id, svgElementData]);
20579
+ // 计算当前boundary的viewBox
20580
+ const boundaryViewBox = useMemo(() => {
20581
+ if (!boundaryInfo?.points || boundaryInfo.points.length === 0) {
20582
+ return null;
20583
+ }
20584
+ // 计算边界
20585
+ let minX = Infinity;
20586
+ let minY = Infinity;
20587
+ let maxX = -Infinity;
20588
+ let maxY = -Infinity;
20589
+ boundaryInfo.points.forEach((point) => {
20590
+ minX = Math.min(minX, point[0]);
20591
+ minY = Math.min(minY, point[1]);
20592
+ maxX = Math.max(maxX, point[0]);
20593
+ maxY = Math.max(maxY, point[1]);
20594
+ });
20595
+ // 添加边距
20596
+ const padding = 50;
20597
+ const width = maxX - minX + padding * 2;
20598
+ const height = maxY - minY + padding * 2;
20599
+ return {
20600
+ x: minX - padding,
20601
+ y: minY - padding,
20602
+ width,
20603
+ height,
20604
+ };
20605
+ }, [boundaryInfo]);
20606
+ const style = useMemo(() => {
20607
+ if (boundaryViewBox?.width > boundaryViewBox?.height) {
20608
+ return {
20609
+ width: maxWidth,
20610
+ height: maxWidth * (boundaryViewBox.height / boundaryViewBox.width),
20611
+ };
20612
+ }
20613
+ return {
20614
+ width: maxWidth * (boundaryViewBox.height / boundaryViewBox.width),
20615
+ height: maxWidth,
20616
+ };
20617
+ }, [boundaryViewBox, maxWidth]);
20618
+ return (jsxs("div", { style: {
20619
+ position: 'relative',
20620
+ width: style.width,
20621
+ height: style.height,
20622
+ margin: '0 auto',
20623
+ }, children: [jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: `${boundaryViewBox.x} ${boundaryViewBox.y} ${boundaryViewBox.width} ${boundaryViewBox.height}`, width: `${style.width}px`, height: `${style.height}px`, style: { position: 'absolute', inset: 0, pointerEvents: 'none' }, children: Object.keys(svgElementData)?.map((key) => {
20624
+ return svgElementData[key]?.map((element) => {
20625
+ if (key === DataType.VISION_OFF)
20626
+ return null;
20627
+ return (jsx(GElement, { type: key, data: svgElementData[key], children: jsx(SvgElement, { type: key, data: element, onSelect: () => { }, onCancel: () => { } }, element.id) }, key));
20628
+ });
20629
+ }) }), jsx(CharginPile, { mapData: mapJson, mapConfig: DEFAULT_STYLES, viewBox: boundaryViewBox || null, rotation: 0 })] }));
20630
+ });
20631
+
20632
+ export { ALL_DIRECTION_SELECTED, AntennaData, AntennaDataBuilder, BaseData, BoundaryData, BoundarySvgRender, ChannelData, ChargingPileData, CreateStatus, DataType, DoodleData, MAX_DIRECTION_ANGLE, MIN_DIRECTION_ANGLE, MapDataProcessor, MobileEditMode, MowerMapRenderer, ObstacleData, PathData, PathDataProcessor, RecordFunctionEnum, RecordTypeEnum, RenderType, SCALE_FACTOR, SvgParserNative, UnifiedMapDataProcessor, VisionOffData, calculateMapGpsCenter, estimateGpsFromMapBounds, initBoundary, initChannel, initDoodle, initObstacle, initVisionOff, restorePointsFormat };