@fleet-frontend/mower-maps 0.2.0-beta.5 → 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.
- package/dist/config/constants.d.ts.map +1 -0
- package/dist/config/edit.d.ts.map +1 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/styles.d.ts.map +1 -0
- package/dist/context/common.d.ts.map +1 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/{src/context → context}/mapEdit.d.ts +1 -0
- package/dist/context/mapEdit.d.ts.map +1 -0
- package/dist/{src/context → context}/mapRequest.d.ts.map +1 -1
- package/dist/context/svgEdit.d.ts.map +1 -0
- package/dist/{src/index.d.ts → index.d.ts} +7 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +291 -1952
- package/dist/index.js +458 -2097
- package/dist/processor/MapDataProcessor.d.ts.map +1 -0
- package/dist/processor/PathDataProcessor.d.ts.map +1 -0
- package/dist/processor/builder/AntennaDataBuilder.d.ts.map +1 -0
- package/dist/processor/builder/BoundaryDataBuilder.d.ts.map +1 -0
- package/dist/processor/builder/ChannelDataBuilder.d.ts.map +1 -0
- package/dist/processor/builder/ChargingPileDataBuilder.d.ts.map +1 -0
- package/dist/processor/builder/ObstacleDataBuilder.d.ts.map +1 -0
- package/dist/processor/builder/PathDataBuilder.d.ts.map +1 -0
- package/dist/processor/builder/PointDataBuilder.d.ts.map +1 -0
- package/dist/processor/builder/SvgElementDataBuilder.d.ts.map +1 -0
- package/dist/processor/builder/VisionOffDataBuilder.d.ts.map +1 -0
- package/dist/processor/builder/index.d.ts.map +1 -0
- package/dist/{src/processor → processor}/index.d.ts +1 -0
- package/dist/processor/index.d.ts.map +1 -0
- package/dist/processor/unified/BaseData.d.ts.map +1 -0
- package/dist/processor/unified/UnifiedMapDataProcessor.d.ts.map +1 -0
- package/dist/processor/unified/index.d.ts.map +1 -0
- package/dist/processor/unified/initData.d.ts.map +1 -0
- package/dist/render/AntennaManager.d.ts.map +1 -0
- package/dist/render/BoundaryLabelsManager.d.ts.map +1 -0
- package/dist/render/BoundarySvgRender.d.ts.map +1 -0
- package/dist/render/ChargingPileManager.d.ts.map +1 -0
- package/dist/render/MowerMapOverlay.d.ts.map +1 -0
- package/dist/render/MowerMapRenderer.d.ts.map +1 -0
- package/dist/render/MowerPositionManager.d.ts.map +1 -0
- package/dist/render/Overlay/domHelper.d.ts.map +1 -0
- package/dist/render/Overlay/overlay.d.ts.map +1 -0
- package/dist/render/Overlay/overlayView.d.ts.map +1 -0
- package/dist/render/SvgMapView.d.ts.map +1 -0
- package/dist/render/antennas/index.d.ts.map +1 -0
- package/dist/render/antennas/useAntennaInfo.d.ts.map +1 -0
- package/dist/render/boundaryLabels/index.d.ts.map +1 -0
- package/dist/render/boundaryLabels/useBoundaryLabels.d.ts.map +1 -0
- package/dist/render/charginPile/index.d.ts.map +1 -0
- package/dist/render/charginPile/useChargingPile.d.ts.map +1 -0
- package/dist/render/components/CustomModal/index.d.ts.map +1 -0
- package/dist/render/components/CutHeightSlider/index.d.ts.map +1 -0
- package/dist/render/drag/drag.d.ts.map +1 -0
- package/dist/render/drag/index.d.ts.map +1 -0
- package/dist/render/drag/rotate.d.ts.map +1 -0
- package/dist/render/drag/useDrag.d.ts.map +1 -0
- package/dist/render/layers/AntennaLayer.d.ts.map +1 -0
- package/dist/render/layers/BaseLayer.d.ts.map +1 -0
- package/dist/render/layers/BoundaryBorderLayer.d.ts.map +1 -0
- package/dist/render/layers/BoundaryLayer.d.ts.map +1 -0
- package/dist/render/layers/ChannelLayer.d.ts.map +1 -0
- package/dist/render/layers/ChargingPileLayer.d.ts.map +1 -0
- package/dist/render/layers/DrawLayer.d.ts.map +1 -0
- package/dist/render/layers/ObstacleLayer.d.ts.map +1 -0
- package/dist/render/layers/PathLayer.d.ts.map +1 -0
- package/dist/render/layers/PointLayer.d.ts.map +1 -0
- package/dist/render/layers/SvgElementLayer.d.ts.map +1 -0
- package/dist/render/layers/VisionOffLayer.d.ts.map +1 -0
- package/dist/render/layers/index.d.ts.map +1 -0
- package/dist/render/layers/types.d.ts.map +1 -0
- package/dist/render/mowerPosition/index.d.ts.map +1 -0
- package/dist/render/mowerPosition/usePosition.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/AddEntry/components/DoodleModal/index.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/AddEntry/index.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/Crosshair/index.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/boundary.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/DirectLine.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/index.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/util.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/index.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/components/Header/index.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/components/HeightModal/index.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/components/Item/index.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/components/MowingEdgeModal/index.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/components/NameEdit/index.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/components/NameEdit/nameModal.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/components/OtherInfo/index.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/components/TimePeriod/index.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/doodle.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/index.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/obstacle.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/HandleElementInfo/visionOff.d.ts.map +1 -0
- package/dist/render/svgEditMap/components/contants.d.ts.map +1 -0
- package/dist/render/svgEditMap/hooks/useCheckElement.d.ts.map +1 -0
- package/dist/render/svgEditMap/hooks/useCreateVisionOffElement.d.ts.map +1 -0
- package/dist/render/svgEditMap/hooks/useHistoryHandle.d.ts.map +1 -0
- package/dist/render/svgEditMap/hooks/usePolygonDrawing.d.ts.map +1 -0
- package/dist/{src/render → render}/svgEditMap/index.d.ts +3 -0
- package/dist/render/svgEditMap/index.d.ts.map +1 -0
- package/dist/render/svgElement/BoundaryElement/index.d.ts.map +1 -0
- package/dist/render/svgElement/ChannelClipPath/index.d.ts.map +1 -0
- package/dist/render/svgElement/ChannelElement/index.d.ts.map +1 -0
- package/dist/render/svgElement/DoodleElement/index.d.ts.map +1 -0
- package/dist/render/svgElement/DoodleTransform/index.d.ts.map +1 -0
- package/dist/render/svgElement/Gelement/index.d.ts.map +1 -0
- package/dist/render/svgElement/Mobile/CreateObstacleElement/coordinateUtils.d.ts.map +1 -0
- package/dist/render/svgElement/Mobile/CreateObstacleElement/index.d.ts.map +1 -0
- package/dist/render/svgElement/ObstacleElement/index.d.ts.map +1 -0
- package/dist/render/svgElement/PolygonELement/components/DistanceLabels.d.ts.map +1 -0
- package/dist/render/svgElement/PolygonELement/components/DragDistanceIndicator.d.ts.map +1 -0
- package/dist/render/svgElement/PolygonELement/dashPath/index.d.ts.map +1 -0
- package/dist/render/svgElement/PolygonELement/index.d.ts.map +1 -0
- package/dist/render/svgElement/PolygonELement/vertex/index.d.ts.map +1 -0
- package/dist/render/svgElement/TextElement/index.d.ts.map +1 -0
- package/dist/render/svgElement/TransformWrapper/DoodleTransformWrapper/DoodleTransformWrapper.d.ts.map +1 -0
- package/dist/render/svgElement/TransformWrapper/DoodleTransformWrapper/useDoodleTransform.d.ts.map +1 -0
- package/dist/render/svgElement/TransformWrapper/HandleIcon/index.d.ts.map +1 -0
- package/dist/render/svgElement/TransformWrapper/VisionOffTransformWrapper/VisionOffTransformWrapper.d.ts.map +1 -0
- package/dist/render/svgElement/TransformWrapper/VisionOffTransformWrapper/useVisionOffTransform.d.ts.map +1 -0
- package/dist/render/svgElement/VisionOffElement/index.d.ts.map +1 -0
- package/dist/render/svgElement/index.d.ts.map +1 -0
- package/dist/render/svgMap/index.d.ts.map +1 -0
- package/dist/render/svgMap/useSvgMapView.d.ts.map +1 -0
- package/dist/store/useCurrentMowingDataStore.d.ts.map +1 -0
- package/dist/store/usePartitionDataStore.d.ts.map +1 -0
- package/dist/types/antenna.d.ts.map +1 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/edit.d.ts.map +1 -0
- package/dist/types/elements.d.ts.map +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/layers.d.ts.map +1 -0
- package/dist/types/map.d.ts.map +1 -0
- package/dist/types/path.d.ts.map +1 -0
- package/dist/types/processor.d.ts.map +1 -0
- package/dist/types/realTime.d.ts.map +1 -0
- package/dist/{src/types → types}/renderer.d.ts +1 -0
- package/dist/types/renderer.d.ts.map +1 -0
- package/dist/types/store.d.ts.map +1 -0
- package/dist/types/ui.d.ts.map +1 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/utils/boundaryUtils.d.ts.map +1 -0
- package/dist/utils/common.d.ts.map +1 -0
- package/dist/utils/coordinates.d.ts.map +1 -0
- package/dist/utils/dateTimeUtils.d.ts.map +1 -0
- package/dist/utils/display.d.ts.map +1 -0
- package/dist/utils/formatUtils.d.ts.map +1 -0
- package/dist/utils/geometryUtils.d.ts.map +1 -0
- package/dist/utils/handleRealTime.d.ts.map +1 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/mapBounds.d.ts.map +1 -0
- package/dist/utils/math.d.ts.map +1 -0
- package/dist/utils/mower.d.ts.map +1 -0
- package/dist/utils/pathSegments.d.ts.map +1 -0
- package/dist/utils/pointInBoundary.d.ts.map +1 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/svgParserNative.d.ts.map +1 -0
- package/dist/utils/svgTransform.d.ts.map +1 -0
- package/dist/utils/touchEvents.d.ts.map +1 -0
- package/dist/utils/unionFind.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/dev/components/AddPonit/index.d.ts +0 -35
- package/dist/dev/components/AddPonit/index.d.ts.map +0 -1
- package/dist/src/config/constants.d.ts.map +0 -1
- package/dist/src/config/edit.d.ts.map +0 -1
- package/dist/src/config/index.d.ts.map +0 -1
- package/dist/src/config/styles.d.ts.map +0 -1
- package/dist/src/context/common.d.ts.map +0 -1
- package/dist/src/context/index.d.ts.map +0 -1
- package/dist/src/context/mapEdit.d.ts.map +0 -1
- package/dist/src/context/svgEdit.d.ts.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/processor/MapDataProcessor.d.ts.map +0 -1
- package/dist/src/processor/PathDataProcessor.d.ts.map +0 -1
- package/dist/src/processor/builder/AntennaDataBuilder.d.ts.map +0 -1
- package/dist/src/processor/builder/BoundaryDataBuilder.d.ts.map +0 -1
- package/dist/src/processor/builder/ChannelDataBuilder.d.ts.map +0 -1
- package/dist/src/processor/builder/ChargingPileDataBuilder.d.ts.map +0 -1
- package/dist/src/processor/builder/ObstacleDataBuilder.d.ts.map +0 -1
- package/dist/src/processor/builder/PathDataBuilder.d.ts.map +0 -1
- package/dist/src/processor/builder/PointDataBuilder.d.ts.map +0 -1
- package/dist/src/processor/builder/SvgElementDataBuilder.d.ts.map +0 -1
- package/dist/src/processor/builder/VisionOffDataBuilder.d.ts.map +0 -1
- package/dist/src/processor/builder/index.d.ts.map +0 -1
- package/dist/src/processor/index.d.ts.map +0 -1
- package/dist/src/processor/unified/BaseData.d.ts.map +0 -1
- package/dist/src/processor/unified/UnifiedMapDataProcessor.d.ts.map +0 -1
- package/dist/src/processor/unified/index.d.ts.map +0 -1
- package/dist/src/processor/unified/initData.d.ts.map +0 -1
- package/dist/src/render/AntennaManager.d.ts.map +0 -1
- package/dist/src/render/BoundaryLabelsManager.d.ts.map +0 -1
- package/dist/src/render/BoundarySvgRender.d.ts.map +0 -1
- package/dist/src/render/ChargingPileManager.d.ts.map +0 -1
- package/dist/src/render/MowerMapOverlay.d.ts.map +0 -1
- package/dist/src/render/MowerMapRenderer.d.ts.map +0 -1
- package/dist/src/render/MowerPositionManager.d.ts.map +0 -1
- package/dist/src/render/Overlay/domHelper.d.ts.map +0 -1
- package/dist/src/render/Overlay/overlay.d.ts.map +0 -1
- package/dist/src/render/Overlay/overlayView.d.ts.map +0 -1
- package/dist/src/render/SvgMapView.d.ts.map +0 -1
- package/dist/src/render/antennas/index.d.ts.map +0 -1
- package/dist/src/render/antennas/useAntennaInfo.d.ts.map +0 -1
- package/dist/src/render/boundaryLabels/index.d.ts.map +0 -1
- package/dist/src/render/boundaryLabels/useBoundaryLabels.d.ts.map +0 -1
- package/dist/src/render/charginPile/index.d.ts.map +0 -1
- package/dist/src/render/charginPile/useChargingPile.d.ts.map +0 -1
- package/dist/src/render/components/CustomModal/index.d.ts.map +0 -1
- package/dist/src/render/components/CutHeightSlider/index.d.ts.map +0 -1
- package/dist/src/render/drag/drag.d.ts.map +0 -1
- package/dist/src/render/drag/index.d.ts.map +0 -1
- package/dist/src/render/drag/rotate.d.ts.map +0 -1
- package/dist/src/render/drag/useDrag.d.ts.map +0 -1
- package/dist/src/render/layers/AntennaLayer.d.ts.map +0 -1
- package/dist/src/render/layers/BaseLayer.d.ts.map +0 -1
- package/dist/src/render/layers/BoundaryBorderLayer.d.ts.map +0 -1
- package/dist/src/render/layers/BoundaryLayer.d.ts.map +0 -1
- package/dist/src/render/layers/ChannelLayer.d.ts.map +0 -1
- package/dist/src/render/layers/ChargingPileLayer.d.ts.map +0 -1
- package/dist/src/render/layers/DrawLayer.d.ts.map +0 -1
- package/dist/src/render/layers/ObstacleLayer.d.ts.map +0 -1
- package/dist/src/render/layers/PathLayer.d.ts.map +0 -1
- package/dist/src/render/layers/PointLayer.d.ts.map +0 -1
- package/dist/src/render/layers/SvgElementLayer.d.ts.map +0 -1
- package/dist/src/render/layers/VisionOffLayer.d.ts.map +0 -1
- package/dist/src/render/layers/index.d.ts.map +0 -1
- package/dist/src/render/layers/types.d.ts.map +0 -1
- package/dist/src/render/mowerPosition/index.d.ts.map +0 -1
- package/dist/src/render/mowerPosition/usePosition.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/AddEntry/components/DoodleModal/index.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/AddEntry/index.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/Crosshair/index.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/boundary.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/DirectLine.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/index.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/util.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/index.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/Header/index.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/HeightModal/index.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/Item/index.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/MowingEdgeModal/index.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/NameEdit/index.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/NameEdit/nameModal.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/OtherInfo/index.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/TimePeriod/index.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/doodle.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/index.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/obstacle.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/visionOff.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/components/contants.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/hooks/useCheckElement.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/hooks/useCreateVisionOffElement.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/hooks/useHistoryHandle.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/hooks/usePolygonDrawing.d.ts.map +0 -1
- package/dist/src/render/svgEditMap/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/BoundaryElement/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/ChannelClipPath/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/ChannelElement/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/DoodleElement/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/DoodleTransform/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/Gelement/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/Mobile/CreateObstacleElement/coordinateUtils.d.ts.map +0 -1
- package/dist/src/render/svgElement/Mobile/CreateObstacleElement/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/ObstacleElement/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/PolygonELement/components/DistanceLabels.d.ts.map +0 -1
- package/dist/src/render/svgElement/PolygonELement/components/DragDistanceIndicator.d.ts.map +0 -1
- package/dist/src/render/svgElement/PolygonELement/dashPath/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/PolygonELement/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/PolygonELement/vertex/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/TextElement/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/TransformWrapper/DoodleTransformWrapper/DoodleTransformWrapper.d.ts.map +0 -1
- package/dist/src/render/svgElement/TransformWrapper/DoodleTransformWrapper/useDoodleTransform.d.ts.map +0 -1
- package/dist/src/render/svgElement/TransformWrapper/HandleIcon/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/TransformWrapper/VisionOffTransformWrapper/VisionOffTransformWrapper.d.ts.map +0 -1
- package/dist/src/render/svgElement/TransformWrapper/VisionOffTransformWrapper/useVisionOffTransform.d.ts.map +0 -1
- package/dist/src/render/svgElement/VisionOffElement/index.d.ts.map +0 -1
- package/dist/src/render/svgElement/index.d.ts.map +0 -1
- package/dist/src/render/svgMap/index.d.ts.map +0 -1
- package/dist/src/render/svgMap/useSvgMapView.d.ts.map +0 -1
- package/dist/src/store/useCurrentMowingDataStore.d.ts.map +0 -1
- package/dist/src/store/usePartitionDataStore.d.ts.map +0 -1
- package/dist/src/types/antenna.d.ts.map +0 -1
- package/dist/src/types/common.d.ts.map +0 -1
- package/dist/src/types/constants.d.ts.map +0 -1
- package/dist/src/types/edit.d.ts.map +0 -1
- package/dist/src/types/elements.d.ts.map +0 -1
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/types/layers.d.ts.map +0 -1
- package/dist/src/types/map.d.ts.map +0 -1
- package/dist/src/types/path.d.ts.map +0 -1
- package/dist/src/types/processor.d.ts.map +0 -1
- package/dist/src/types/realTime.d.ts.map +0 -1
- package/dist/src/types/renderer.d.ts.map +0 -1
- package/dist/src/types/store.d.ts.map +0 -1
- package/dist/src/types/ui.d.ts.map +0 -1
- package/dist/src/types/utils.d.ts.map +0 -1
- package/dist/src/utils/boundaryUtils.d.ts.map +0 -1
- package/dist/src/utils/common.d.ts.map +0 -1
- package/dist/src/utils/coordinates.d.ts.map +0 -1
- package/dist/src/utils/dateTimeUtils.d.ts.map +0 -1
- package/dist/src/utils/display.d.ts.map +0 -1
- package/dist/src/utils/formatUtils.d.ts.map +0 -1
- package/dist/src/utils/geometryUtils.d.ts.map +0 -1
- package/dist/src/utils/handleRealTime.d.ts.map +0 -1
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/mapBounds.d.ts.map +0 -1
- package/dist/src/utils/math.d.ts.map +0 -1
- package/dist/src/utils/mower.d.ts.map +0 -1
- package/dist/src/utils/pathSegments.d.ts.map +0 -1
- package/dist/src/utils/pointInBoundary.d.ts.map +0 -1
- package/dist/src/utils/sleep.d.ts.map +0 -1
- package/dist/src/utils/svgParserNative.d.ts.map +0 -1
- package/dist/src/utils/svgTransform.d.ts.map +0 -1
- package/dist/src/utils/touchEvents.d.ts.map +0 -1
- package/dist/src/utils/unionFind.d.ts.map +0 -1
- /package/dist/{src/config → config}/constants.d.ts +0 -0
- /package/dist/{src/config → config}/edit.d.ts +0 -0
- /package/dist/{src/config → config}/index.d.ts +0 -0
- /package/dist/{src/config → config}/styles.d.ts +0 -0
- /package/dist/{src/context → context}/common.d.ts +0 -0
- /package/dist/{src/context → context}/index.d.ts +0 -0
- /package/dist/{src/context → context}/mapRequest.d.ts +0 -0
- /package/dist/{src/context → context}/svgEdit.d.ts +0 -0
- /package/dist/{src/processor → processor}/MapDataProcessor.d.ts +0 -0
- /package/dist/{src/processor → processor}/PathDataProcessor.d.ts +0 -0
- /package/dist/{src/processor → processor}/builder/AntennaDataBuilder.d.ts +0 -0
- /package/dist/{src/processor → processor}/builder/BoundaryDataBuilder.d.ts +0 -0
- /package/dist/{src/processor → processor}/builder/ChannelDataBuilder.d.ts +0 -0
- /package/dist/{src/processor → processor}/builder/ChargingPileDataBuilder.d.ts +0 -0
- /package/dist/{src/processor → processor}/builder/ObstacleDataBuilder.d.ts +0 -0
- /package/dist/{src/processor → processor}/builder/PathDataBuilder.d.ts +0 -0
- /package/dist/{src/processor → processor}/builder/PointDataBuilder.d.ts +0 -0
- /package/dist/{src/processor → processor}/builder/SvgElementDataBuilder.d.ts +0 -0
- /package/dist/{src/processor → processor}/builder/VisionOffDataBuilder.d.ts +0 -0
- /package/dist/{src/processor → processor}/builder/index.d.ts +0 -0
- /package/dist/{src/processor → processor}/unified/BaseData.d.ts +0 -0
- /package/dist/{src/processor → processor}/unified/UnifiedMapDataProcessor.d.ts +0 -0
- /package/dist/{src/processor → processor}/unified/index.d.ts +0 -0
- /package/dist/{src/processor → processor}/unified/initData.d.ts +0 -0
- /package/dist/{src/render → render}/AntennaManager.d.ts +0 -0
- /package/dist/{src/render → render}/BoundaryLabelsManager.d.ts +0 -0
- /package/dist/{src/render → render}/BoundarySvgRender.d.ts +0 -0
- /package/dist/{src/render → render}/ChargingPileManager.d.ts +0 -0
- /package/dist/{src/render → render}/MowerMapOverlay.d.ts +0 -0
- /package/dist/{src/render → render}/MowerMapRenderer.d.ts +0 -0
- /package/dist/{src/render → render}/MowerPositionManager.d.ts +0 -0
- /package/dist/{src/render → render}/Overlay/domHelper.d.ts +0 -0
- /package/dist/{src/render → render}/Overlay/overlay.d.ts +0 -0
- /package/dist/{src/render → render}/Overlay/overlayView.d.ts +0 -0
- /package/dist/{src/render → render}/SvgMapView.d.ts +0 -0
- /package/dist/{src/render → render}/antennas/index.d.ts +0 -0
- /package/dist/{src/render → render}/antennas/useAntennaInfo.d.ts +0 -0
- /package/dist/{src/render → render}/boundaryLabels/index.d.ts +0 -0
- /package/dist/{src/render → render}/boundaryLabels/useBoundaryLabels.d.ts +0 -0
- /package/dist/{src/render → render}/charginPile/index.d.ts +0 -0
- /package/dist/{src/render → render}/charginPile/useChargingPile.d.ts +0 -0
- /package/dist/{src/render → render}/components/CustomModal/index.d.ts +0 -0
- /package/dist/{src/render → render}/components/CutHeightSlider/index.d.ts +0 -0
- /package/dist/{src/render → render}/drag/drag.d.ts +0 -0
- /package/dist/{src/render → render}/drag/index.d.ts +0 -0
- /package/dist/{src/render → render}/drag/rotate.d.ts +0 -0
- /package/dist/{src/render → render}/drag/useDrag.d.ts +0 -0
- /package/dist/{src/render → render}/layers/AntennaLayer.d.ts +0 -0
- /package/dist/{src/render → render}/layers/BaseLayer.d.ts +0 -0
- /package/dist/{src/render → render}/layers/BoundaryBorderLayer.d.ts +0 -0
- /package/dist/{src/render → render}/layers/BoundaryLayer.d.ts +0 -0
- /package/dist/{src/render → render}/layers/ChannelLayer.d.ts +0 -0
- /package/dist/{src/render → render}/layers/ChargingPileLayer.d.ts +0 -0
- /package/dist/{src/render → render}/layers/DrawLayer.d.ts +0 -0
- /package/dist/{src/render → render}/layers/ObstacleLayer.d.ts +0 -0
- /package/dist/{src/render → render}/layers/PathLayer.d.ts +0 -0
- /package/dist/{src/render → render}/layers/PointLayer.d.ts +0 -0
- /package/dist/{src/render → render}/layers/SvgElementLayer.d.ts +0 -0
- /package/dist/{src/render → render}/layers/VisionOffLayer.d.ts +0 -0
- /package/dist/{src/render → render}/layers/index.d.ts +0 -0
- /package/dist/{src/render → render}/layers/types.d.ts +0 -0
- /package/dist/{src/render → render}/mowerPosition/index.d.ts +0 -0
- /package/dist/{src/render → render}/mowerPosition/usePosition.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/AddEntry/components/DoodleModal/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/AddEntry/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/Crosshair/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/boundary.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/DirectLine.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/util.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/DirectionModal/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/Header/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/HeightModal/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/Item/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/MowingEdgeModal/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/NameEdit/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/NameEdit/nameModal.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/OtherInfo/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/TimePeriod/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/doodle.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/obstacle.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/visionOff.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/components/contants.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/hooks/useCheckElement.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/hooks/useCreateVisionOffElement.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/hooks/useHistoryHandle.d.ts +0 -0
- /package/dist/{src/render → render}/svgEditMap/hooks/usePolygonDrawing.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/BoundaryElement/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/ChannelClipPath/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/ChannelElement/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/DoodleElement/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/DoodleTransform/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/Gelement/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/Mobile/CreateObstacleElement/coordinateUtils.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/Mobile/CreateObstacleElement/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/ObstacleElement/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/PolygonELement/components/DistanceLabels.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/PolygonELement/components/DragDistanceIndicator.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/PolygonELement/dashPath/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/PolygonELement/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/PolygonELement/vertex/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/TextElement/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/TransformWrapper/DoodleTransformWrapper/DoodleTransformWrapper.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/TransformWrapper/DoodleTransformWrapper/useDoodleTransform.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/TransformWrapper/HandleIcon/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/TransformWrapper/VisionOffTransformWrapper/VisionOffTransformWrapper.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/TransformWrapper/VisionOffTransformWrapper/useVisionOffTransform.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/VisionOffElement/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgElement/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgMap/index.d.ts +0 -0
- /package/dist/{src/render → render}/svgMap/useSvgMapView.d.ts +0 -0
- /package/dist/{src/store → store}/useCurrentMowingDataStore.d.ts +0 -0
- /package/dist/{src/store → store}/usePartitionDataStore.d.ts +0 -0
- /package/dist/{src/types → types}/antenna.d.ts +0 -0
- /package/dist/{src/types → types}/common.d.ts +0 -0
- /package/dist/{src/types → types}/constants.d.ts +0 -0
- /package/dist/{src/types → types}/edit.d.ts +0 -0
- /package/dist/{src/types → types}/elements.d.ts +0 -0
- /package/dist/{src/types → types}/index.d.ts +0 -0
- /package/dist/{src/types → types}/layers.d.ts +0 -0
- /package/dist/{src/types → types}/map.d.ts +0 -0
- /package/dist/{src/types → types}/path.d.ts +0 -0
- /package/dist/{src/types → types}/processor.d.ts +0 -0
- /package/dist/{src/types → types}/realTime.d.ts +0 -0
- /package/dist/{src/types → types}/store.d.ts +0 -0
- /package/dist/{src/types → types}/ui.d.ts +0 -0
- /package/dist/{src/types → types}/utils.d.ts +0 -0
- /package/dist/{src/utils → utils}/boundaryUtils.d.ts +0 -0
- /package/dist/{src/utils → utils}/common.d.ts +0 -0
- /package/dist/{src/utils → utils}/coordinates.d.ts +0 -0
- /package/dist/{src/utils → utils}/dateTimeUtils.d.ts +0 -0
- /package/dist/{src/utils → utils}/display.d.ts +0 -0
- /package/dist/{src/utils → utils}/formatUtils.d.ts +0 -0
- /package/dist/{src/utils → utils}/geometryUtils.d.ts +0 -0
- /package/dist/{src/utils → utils}/handleRealTime.d.ts +0 -0
- /package/dist/{src/utils → utils}/index.d.ts +0 -0
- /package/dist/{src/utils → utils}/mapBounds.d.ts +0 -0
- /package/dist/{src/utils → utils}/math.d.ts +0 -0
- /package/dist/{src/utils → utils}/mower.d.ts +0 -0
- /package/dist/{src/utils → utils}/pathSegments.d.ts +0 -0
- /package/dist/{src/utils → utils}/pointInBoundary.d.ts +0 -0
- /package/dist/{src/utils → utils}/sleep.d.ts +0 -0
- /package/dist/{src/utils → utils}/svgParserNative.d.ts +0 -0
- /package/dist/{src/utils → utils}/svgTransform.d.ts +0 -0
- /package/dist/{src/utils → utils}/touchEvents.d.ts +0 -0
- /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
|
* 常量和枚举类型定义
|
|
@@ -194,7 +193,7 @@ class ObstacleData extends BaseData {
|
|
|
194
193
|
const convertedPoints = convertPointsFormat(originalData?.points) || [];
|
|
195
194
|
super(originalData?.id, DataType.OBSTACLE, level, RenderType.POLYGON, convertedPoints, originalData);
|
|
196
195
|
this.area = originalData?.area;
|
|
197
|
-
this.status = originalData?.status
|
|
196
|
+
this.status = originalData?.status ?? 1;
|
|
198
197
|
this.start_timestamp = originalData?.start_timestamp;
|
|
199
198
|
this.end_timestamp = originalData?.end_timestamp;
|
|
200
199
|
this.name = originalData?.name || 'Obstacle';
|
|
@@ -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$
|
|
8696
|
-
var styles$
|
|
8697
|
-
styleInject(css_248z$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
14531
|
-
var styles$
|
|
14532
|
-
styleInject(css_248z$
|
|
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$
|
|
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$
|
|
14828
|
-
var styles$
|
|
14829
|
-
styleInject(css_248z$
|
|
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$
|
|
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$
|
|
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$
|
|
14997
|
-
var styles$
|
|
14998
|
-
styleInject(css_248z$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
15193
|
-
function _extends$
|
|
15194
|
-
var SvgDelete
|
|
15195
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
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$
|
|
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$
|
|
15346
|
-
var styles$
|
|
15347
|
-
styleInject(css_248z$
|
|
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$
|
|
16071
|
-
return showNotCreateCursor ? styles$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
|
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 ||
|
|
@@ -16578,7 +16466,7 @@ const ObstacleElement = ({ data }) => {
|
|
|
16578
16466
|
if (platform === PlatformType.H5 &&
|
|
16579
16467
|
editMapInfo?.selectElement?.id === data.id &&
|
|
16580
16468
|
editMapInfo.mobileMode === MobileEditMode.START) {
|
|
16581
|
-
return (style.lineWidth || 2) *
|
|
16469
|
+
return (style.lineWidth || 2) * 3;
|
|
16582
16470
|
}
|
|
16583
16471
|
return style.lineWidth || 2;
|
|
16584
16472
|
}, [platform, style, editMapInfo]);
|
|
@@ -17052,15 +16940,15 @@ const useVisionOffTransform = (data, scaleConstraints
|
|
|
17052
16940
|
};
|
|
17053
16941
|
};
|
|
17054
16942
|
|
|
17055
|
-
var _g$
|
|
17056
|
-
function _extends$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
17107
|
-
function _extends$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
17143
|
-
function _extends$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
|
17179
|
-
function _extends$
|
|
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$
|
|
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
|
|
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
|
|
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$
|
|
17872
|
-
function _extends$
|
|
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$
|
|
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$
|
|
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
|
|
@@ -17972,7 +17860,7 @@ const DoodleTransformWrapper = ({ data, isSelected = false, isSelectedWithoutOpe
|
|
|
17972
17860
|
return 0;
|
|
17973
17861
|
}
|
|
17974
17862
|
// 保留一位小数
|
|
17975
|
-
return ((
|
|
17863
|
+
return ((data.expiration_ts - currentTime) / (24 * 60 * 60)).toFixed(1);
|
|
17976
17864
|
}, [data]);
|
|
17977
17865
|
// 初始化变换状态
|
|
17978
17866
|
useEffect(() => {
|
|
@@ -18092,6 +17980,7 @@ const DoodleTransformWrapper = ({ data, isSelected = false, isSelectedWithoutOpe
|
|
|
18092
17980
|
alignItems: 'center',
|
|
18093
17981
|
justifyContent: 'center',
|
|
18094
17982
|
gap: '10px',
|
|
17983
|
+
color: '#325069',
|
|
18095
17984
|
}, children: jsxs("div", { children: ["Remaining Time: ", remainingTime] }) }) }) })] }));
|
|
18096
17985
|
};
|
|
18097
17986
|
useEffect(() => {
|
|
@@ -18352,7 +18241,6 @@ const DoodleElement = ({ data }) => {
|
|
|
18352
18241
|
},
|
|
18353
18242
|
});
|
|
18354
18243
|
}, [transformedElements]);
|
|
18355
|
-
console.log('originData--->', originData, minScale);
|
|
18356
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 }));
|
|
18357
18245
|
};
|
|
18358
18246
|
|
|
@@ -18398,9 +18286,9 @@ const GElement = ({ type, children }) => {
|
|
|
18398
18286
|
return jsx("g", { id: `layer-${type}`, children: children }, type);
|
|
18399
18287
|
};
|
|
18400
18288
|
|
|
18401
|
-
var css_248z$
|
|
18402
|
-
var styles$
|
|
18403
|
-
styleInject(css_248z$
|
|
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);
|
|
18404
18292
|
|
|
18405
18293
|
var classnames = {exports: {}};
|
|
18406
18294
|
|
|
@@ -19399,7 +19287,7 @@ function usePolygonDrawing(options = {}) {
|
|
|
19399
19287
|
const [mousePos, setMousePos] = useState(null);
|
|
19400
19288
|
const { editMapInfo, setEditMapInfo } = useMapEditContext();
|
|
19401
19289
|
const { checkCanNotCreateAtPosition } = useCheckElement();
|
|
19402
|
-
const { addHistory
|
|
19290
|
+
const { addHistory} = useHistoryHandle();
|
|
19403
19291
|
const points = useMemo(() => {
|
|
19404
19292
|
console.log('points->', editMapInfo?.selectElement?.points);
|
|
19405
19293
|
return editMapInfo?.selectElement?.points?.map((item) => ({ x: item[0], y: item[1] })) || [];
|
|
@@ -19453,8 +19341,13 @@ function usePolygonDrawing(options = {}) {
|
|
|
19453
19341
|
setEditMapInfo({
|
|
19454
19342
|
...editMapInfo,
|
|
19455
19343
|
createMode: CreateStatus.COMPLETED,
|
|
19344
|
+
historyList: [
|
|
19345
|
+
{
|
|
19346
|
+
selectElement: editMapInfo.selectElement,
|
|
19347
|
+
},
|
|
19348
|
+
],
|
|
19349
|
+
currentHistoryIndex: 0,
|
|
19456
19350
|
});
|
|
19457
|
-
clearHistory();
|
|
19458
19351
|
}
|
|
19459
19352
|
}, [points.length, editMapInfo]);
|
|
19460
19353
|
const reset = useCallback(() => {
|
|
@@ -19704,7 +19597,7 @@ const useCreateVisionOffElement = () => {
|
|
|
19704
19597
|
|
|
19705
19598
|
const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChange }, ref) => {
|
|
19706
19599
|
const pointManagerRef = useRef(null);
|
|
19707
|
-
const { editMapInfo, setEditMapInfo } = useMapEditContext();
|
|
19600
|
+
const { editMapInfo, setEditMapInfo, onSelectElement } = useMapEditContext();
|
|
19708
19601
|
const { getVisionOffPoints, centerPoint } = useCreateVisionOffElement();
|
|
19709
19602
|
const { svgElementDatas } = useSvgEditContext();
|
|
19710
19603
|
const { checkCanNotCreateAtPosition, checkDoodle } = useCheckElement();
|
|
@@ -19722,6 +19615,24 @@ const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChang
|
|
|
19722
19615
|
const isCreating = useMemo(() => {
|
|
19723
19616
|
return editMapInfo.createMode === CreateStatus.CREATING;
|
|
19724
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]);
|
|
19725
19636
|
// 调整SVG大小的函数
|
|
19726
19637
|
const adjustSvgSize = (layoutData) => {
|
|
19727
19638
|
const padding = 20; // 添加一些边距以避免内容贴边
|
|
@@ -19811,23 +19722,73 @@ const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChang
|
|
|
19811
19722
|
const svg = selectedDoodle?.svgStr;
|
|
19812
19723
|
const minLength = selectedDoodle.minLength;
|
|
19813
19724
|
const parseSvg = SvgParserNative.parseSvg(svg);
|
|
19814
|
-
const svgMinLength =
|
|
19725
|
+
const svgMinLength = parseSvg.height / SCALE_FACTOR;
|
|
19815
19726
|
// 使用获取到的 SVG 内容,如果没有获取到则使用 URL
|
|
19816
19727
|
newDoodle.svg = svg;
|
|
19817
19728
|
newDoodle.scale = minLength / svgMinLength;
|
|
19818
19729
|
newDoodle.direction = 0;
|
|
19819
19730
|
newDoodle.center = restorePoint(centerPoint);
|
|
19820
|
-
|
|
19821
|
-
|
|
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
|
+
],
|
|
19822
19785
|
currentHistoryIndex: 0,
|
|
19823
|
-
|
|
19824
|
-
elementType:
|
|
19825
|
-
selectElement:
|
|
19826
|
-
}));
|
|
19827
|
-
addHistory({
|
|
19828
|
-
selectElement: newDoodle,
|
|
19786
|
+
createMode: type === DataType.VISION_OFF ? CreateStatus.COMPLETED : CreateStatus.CREATING,
|
|
19787
|
+
elementType: type,
|
|
19788
|
+
selectElement: newElement,
|
|
19829
19789
|
});
|
|
19830
19790
|
};
|
|
19791
|
+
const saveElement = (type, item) => { };
|
|
19831
19792
|
useEffect(() => {
|
|
19832
19793
|
onEditInfoMapChange?.(editMapInfo);
|
|
19833
19794
|
}, [editMapInfo]);
|
|
@@ -19864,6 +19825,8 @@ const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChang
|
|
|
19864
19825
|
addHistory,
|
|
19865
19826
|
addDoodle,
|
|
19866
19827
|
checkDoodle: () => checkDoodle?.(),
|
|
19828
|
+
addElement,
|
|
19829
|
+
saveElement,
|
|
19867
19830
|
}));
|
|
19868
19831
|
// 初始化多边形绘制 Hook
|
|
19869
19832
|
const { onSvgClick, onSvgMouseMove, onPointClick, points, completed, mousePos, updatePoints } = usePolygonDrawing({ createMode: isCreating });
|
|
@@ -19878,10 +19841,9 @@ const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChang
|
|
|
19878
19841
|
return false;
|
|
19879
19842
|
return checkCanNotCreateAtPosition(mousePos);
|
|
19880
19843
|
}, [mousePos, checkCanNotCreateAtPosition]);
|
|
19881
|
-
|
|
19882
|
-
|
|
19883
|
-
[styles$
|
|
19884
|
-
[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,
|
|
19885
19847
|
}), style: {
|
|
19886
19848
|
display: editMap ? 'block' : 'none',
|
|
19887
19849
|
}, children: jsxs("svg", { style: {
|
|
@@ -19979,1766 +19941,72 @@ const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChang
|
|
|
19979
19941
|
});
|
|
19980
19942
|
SvgEditMap.displayName = 'SvgEditMap';
|
|
19981
19943
|
|
|
19982
|
-
var
|
|
19983
|
-
var
|
|
19984
|
-
|
|
19985
|
-
|
|
19986
|
-
var _rect$2, _path$9, _defs$3;
|
|
19987
|
-
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); }
|
|
19988
|
-
var SvgAddEntry = function SvgAddEntry(props) {
|
|
19989
|
-
return /*#__PURE__*/React.createElement("svg", _extends$d({
|
|
19990
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
19991
|
-
width: 24,
|
|
19992
|
-
height: 24,
|
|
19993
|
-
fill: "none"
|
|
19994
|
-
}, props), _rect$2 || (_rect$2 = /*#__PURE__*/React.createElement("rect", {
|
|
19995
|
-
width: 10.95,
|
|
19996
|
-
height: 10.95,
|
|
19997
|
-
x: 10.613,
|
|
19998
|
-
y: 3.15,
|
|
19999
|
-
fill: "#1F1F1F",
|
|
20000
|
-
stroke: "url(#add-entry_svg__a)",
|
|
20001
|
-
strokeWidth: 0.3,
|
|
20002
|
-
opacity: 0.795,
|
|
20003
|
-
rx: 1.05
|
|
20004
|
-
})), /*#__PURE__*/React.createElement("foreignObject", {
|
|
20005
|
-
width: 23.468,
|
|
20006
|
-
height: 20.501,
|
|
20007
|
-
x: -1.543,
|
|
20008
|
-
y: 3.499
|
|
20009
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
20010
|
-
xmlns: "http://www.w3.org/1999/xhtml",
|
|
20011
|
-
style: {
|
|
20012
|
-
backdropFilter: "blur(1.63px)",
|
|
20013
|
-
clipPath: "url(#add-entry_svg__b)",
|
|
20014
|
-
height: "100%",
|
|
20015
|
-
width: "100%"
|
|
20016
|
-
}
|
|
20017
|
-
})), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
|
|
20018
|
-
fill: "#1F1F1F",
|
|
20019
|
-
stroke: "url(#add-entry_svg__c)",
|
|
20020
|
-
strokeWidth: 0.3,
|
|
20021
|
-
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",
|
|
20022
|
-
"data-figma-bg-blur-radius": 3.262
|
|
20023
|
-
})), _defs$3 || (_defs$3 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
|
20024
|
-
id: "add-entry_svg__a",
|
|
20025
|
-
x1: 16.851,
|
|
20026
|
-
x2: 20.384,
|
|
20027
|
-
y1: 10.392,
|
|
20028
|
-
y2: 4.767,
|
|
20029
|
-
gradientUnits: "userSpaceOnUse"
|
|
20030
|
-
}, /*#__PURE__*/React.createElement("stop", {
|
|
20031
|
-
stopColor: "#fff",
|
|
20032
|
-
stopOpacity: 0.01
|
|
20033
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
20034
|
-
offset: 1,
|
|
20035
|
-
stopColor: "#fff"
|
|
20036
|
-
})), /*#__PURE__*/React.createElement("linearGradient", {
|
|
20037
|
-
id: "add-entry_svg__c",
|
|
20038
|
-
x1: 21.47,
|
|
20039
|
-
x2: 12.314,
|
|
20040
|
-
y1: 15.036,
|
|
20041
|
-
y2: 5.769,
|
|
20042
|
-
gradientUnits: "userSpaceOnUse"
|
|
20043
|
-
}, /*#__PURE__*/React.createElement("stop", {
|
|
20044
|
-
stopColor: "#fff",
|
|
20045
|
-
stopOpacity: 0.01
|
|
20046
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
20047
|
-
offset: 1,
|
|
20048
|
-
stopColor: "#fff"
|
|
20049
|
-
})), /*#__PURE__*/React.createElement("clipPath", {
|
|
20050
|
-
id: "add-entry_svg__b",
|
|
20051
|
-
transform: "translate(1.543 -3.499)"
|
|
20052
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
20053
|
-
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"
|
|
20054
|
-
})))));
|
|
20055
|
-
};
|
|
20056
|
-
|
|
20057
|
-
var _path$8, _path2$3, _path3;
|
|
20058
|
-
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); }
|
|
20059
|
-
var SvgBoundary = function SvgBoundary(props) {
|
|
20060
|
-
return /*#__PURE__*/React.createElement("svg", _extends$c({
|
|
20061
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20062
|
-
width: 16,
|
|
20063
|
-
height: 16,
|
|
20064
|
-
fill: "none"
|
|
20065
|
-
}, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
|
|
20066
|
-
fill: "#1DBEAC",
|
|
20067
|
-
fillRule: "evenodd",
|
|
20068
|
-
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",
|
|
20069
|
-
clipRule: "evenodd",
|
|
20070
|
-
opacity: 0.602
|
|
20071
|
-
})), _path2$3 || (_path2$3 = /*#__PURE__*/React.createElement("path", {
|
|
20072
|
-
fill: "#1DBEAC",
|
|
20073
|
-
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",
|
|
20074
|
-
opacity: 0.152
|
|
20075
|
-
})), _path3 || (_path3 = /*#__PURE__*/React.createElement("path", {
|
|
20076
|
-
fill: "#1DBEAC",
|
|
20077
|
-
fillRule: "evenodd",
|
|
20078
|
-
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",
|
|
20079
|
-
clipRule: "evenodd"
|
|
20080
|
-
})));
|
|
20081
|
-
};
|
|
20082
|
-
|
|
20083
|
-
var _path$7, _path2$2, _rect$1, _rect2$1;
|
|
20084
|
-
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); }
|
|
20085
|
-
var SvgLimitIsland = function SvgLimitIsland(props) {
|
|
20086
|
-
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({
|
|
20087
19948
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20088
|
-
width:
|
|
20089
|
-
height:
|
|
19949
|
+
width: 36,
|
|
19950
|
+
height: 36,
|
|
20090
19951
|
fill: "none"
|
|
20091
|
-
}, props), _path
|
|
20092
|
-
|
|
20093
|
-
|
|
20094
|
-
|
|
20095
|
-
|
|
20096
|
-
d: "
|
|
20097
|
-
})), _rect$1 || (_rect$1 = /*#__PURE__*/React.createElement("rect", {
|
|
20098
|
-
width: 14.237,
|
|
20099
|
-
height: 10.667,
|
|
20100
|
-
x: 0.882,
|
|
20101
|
-
y: 2.667,
|
|
20102
|
-
fill: "#F50",
|
|
20103
|
-
opacity: 0.15,
|
|
20104
|
-
rx: 2
|
|
20105
|
-
})), _rect2$1 || (_rect2$1 = /*#__PURE__*/React.createElement("rect", {
|
|
20106
|
-
width: 14.237,
|
|
20107
|
-
height: 10.667,
|
|
20108
|
-
x: 0.882,
|
|
20109
|
-
y: 2.667,
|
|
20110
|
-
stroke: "#FF5D17",
|
|
20111
|
-
strokeWidth: 0.867,
|
|
20112
|
-
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"
|
|
20113
19958
|
})));
|
|
20114
19959
|
};
|
|
20115
19960
|
|
|
20116
|
-
var
|
|
20117
|
-
|
|
20118
|
-
|
|
20119
|
-
return /*#__PURE__*/React.createElement("svg", _extends$a({
|
|
20120
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20121
|
-
width: 16,
|
|
20122
|
-
height: 16,
|
|
20123
|
-
fill: "none"
|
|
20124
|
-
}, props), _rect || (_rect = /*#__PURE__*/React.createElement("rect", {
|
|
20125
|
-
width: 14.333,
|
|
20126
|
-
height: 10.667,
|
|
20127
|
-
x: 0.833,
|
|
20128
|
-
y: 2.667,
|
|
20129
|
-
fill: "#B1D9FF",
|
|
20130
|
-
rx: 2.667
|
|
20131
|
-
})), _rect2 || (_rect2 = /*#__PURE__*/React.createElement("rect", {
|
|
20132
|
-
width: 13.333,
|
|
20133
|
-
height: 9.667,
|
|
20134
|
-
x: 1.333,
|
|
20135
|
-
y: 3.167,
|
|
20136
|
-
stroke: "#5C9DFF",
|
|
20137
|
-
strokeDasharray: "6.33 6.33",
|
|
20138
|
-
rx: 1.333
|
|
20139
|
-
})), _rect3 || (_rect3 = /*#__PURE__*/React.createElement("rect", {
|
|
20140
|
-
width: 6,
|
|
20141
|
-
height: 6,
|
|
20142
|
-
x: 5,
|
|
20143
|
-
y: 4.833,
|
|
20144
|
-
fill: "#B1D9FF",
|
|
20145
|
-
rx: 3
|
|
20146
|
-
})), /*#__PURE__*/React.createElement("mask", {
|
|
20147
|
-
id: "visionFence_svg__a",
|
|
20148
|
-
width: 6,
|
|
20149
|
-
height: 6,
|
|
20150
|
-
x: 5,
|
|
20151
|
-
y: 5,
|
|
20152
|
-
maskUnits: "userSpaceOnUse",
|
|
20153
|
-
style: {
|
|
20154
|
-
maskType: "alpha"
|
|
20155
|
-
}
|
|
20156
|
-
}, _rect4 || (_rect4 = /*#__PURE__*/React.createElement("rect", {
|
|
20157
|
-
width: 5.333,
|
|
20158
|
-
height: 5.333,
|
|
20159
|
-
x: 5.333,
|
|
20160
|
-
y: 5.5,
|
|
20161
|
-
fill: "#B1D9FF",
|
|
20162
|
-
rx: 2.667
|
|
20163
|
-
}))), _g$3 || (_g$3 = /*#__PURE__*/React.createElement("g", {
|
|
20164
|
-
fill: "#5C9DFF",
|
|
20165
|
-
mask: "url(#visionFence_svg__a)"
|
|
20166
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
20167
|
-
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"
|
|
20168
|
-
}))));
|
|
20169
|
-
};
|
|
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);
|
|
20170
19964
|
|
|
20171
|
-
|
|
20172
|
-
|
|
20173
|
-
|
|
20174
|
-
|
|
20175
|
-
|
|
20176
|
-
|
|
20177
|
-
|
|
20178
|
-
|
|
20179
|
-
|
|
20180
|
-
|
|
20181
|
-
|
|
20182
|
-
|
|
20183
|
-
|
|
20184
|
-
|
|
20185
|
-
|
|
20186
|
-
|
|
20187
|
-
y: 4.332,
|
|
20188
|
-
fill: "#CBFCF7",
|
|
20189
|
-
stroke: "#9AEEE5",
|
|
20190
|
-
strokeWidth: 0.867,
|
|
20191
|
-
rx: 2
|
|
20192
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20193
|
-
fill: "#F2FFFD",
|
|
20194
|
-
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"
|
|
20195
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20196
|
-
fill: "#50D0C2",
|
|
20197
|
-
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"
|
|
20198
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20199
|
-
fill: "#50D0C2",
|
|
20200
|
-
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"
|
|
20201
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20202
|
-
fill: "#9CE7DE",
|
|
20203
|
-
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"
|
|
20204
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20205
|
-
fill: "#50D0C2",
|
|
20206
|
-
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"
|
|
20207
|
-
})))), _defs$2 || (_defs$2 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
20208
|
-
id: "doodle_svg__a"
|
|
20209
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
20210
|
-
fill: "#fff",
|
|
20211
|
-
d: "M0 0h16v16H0z"
|
|
20212
|
-
})), /*#__PURE__*/React.createElement("clipPath", {
|
|
20213
|
-
id: "doodle_svg__b"
|
|
20214
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
20215
|
-
fill: "#fff",
|
|
20216
|
-
d: "M0 0h16v16H0z"
|
|
20217
|
-
})))));
|
|
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;
|
|
20218
19981
|
};
|
|
20219
19982
|
|
|
20220
|
-
|
|
20221
|
-
|
|
20222
|
-
|
|
20223
|
-
|
|
20224
|
-
|
|
20225
|
-
|
|
20226
|
-
|
|
20227
|
-
|
|
20228
|
-
|
|
20229
|
-
|
|
20230
|
-
|
|
20231
|
-
|
|
20232
|
-
type: DataType.OBSTACLE,
|
|
20233
|
-
paramType: RecordTypeEnum.OBSTACLE,
|
|
20234
|
-
label: 'Off-limit island',
|
|
20235
|
-
icon: jsx(SvgLimitIsland, {}),
|
|
20236
|
-
},
|
|
20237
|
-
// { type: DataType.CHANNEL, label: 'Channel', icon: <ChannelIcon /> },
|
|
20238
|
-
{
|
|
20239
|
-
type: DataType.VISION_OFF,
|
|
20240
|
-
paramType: RecordTypeEnum.VISI_OFF,
|
|
20241
|
-
label: 'VisionFence-off zone',
|
|
20242
|
-
icon: jsx(SvgVisionFence, {}),
|
|
20243
|
-
},
|
|
20244
|
-
{
|
|
20245
|
-
type: DataType.DOODLE,
|
|
20246
|
-
paramType: RecordTypeEnum.DOODLE,
|
|
20247
|
-
label: 'Doodle',
|
|
20248
|
-
icon: jsx(SvgDoodle, {}),
|
|
20249
|
-
},
|
|
20250
|
-
];
|
|
20251
|
-
({
|
|
20252
|
-
[DataType.BOUNDARY]: {
|
|
20253
|
-
},
|
|
20254
|
-
[DataType.OBSTACLE]: {
|
|
20255
|
-
},
|
|
20256
|
-
[DataType.CHANNEL]: {
|
|
20257
|
-
},
|
|
20258
|
-
[DataType.VISION_OFF]: {
|
|
20259
|
-
},
|
|
20260
|
-
[DataType.DOODLE]: {
|
|
20261
|
-
},
|
|
20262
|
-
[DataType.PATH]: undefined,
|
|
20263
|
-
[DataType.ANTENNA]: undefined,
|
|
20264
|
-
[DataType.CHARGING_PILE]: undefined,
|
|
20265
|
-
});
|
|
20266
|
-
|
|
20267
|
-
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}";
|
|
20268
|
-
var styles$b = {"modal":"index-module_modal__fkxhn","center":"index-module_center__d461v"};
|
|
20269
|
-
styleInject(css_248z$b);
|
|
20270
|
-
|
|
20271
|
-
const CustomModal = ({ children, titleCenter, hasMinHeight, height, ...props }) => {
|
|
20272
|
-
return (jsx(Modal, { centered: true, styles: {
|
|
20273
|
-
body: {
|
|
20274
|
-
maxHeight: height ? `${height}px` : 'calc(100vh - 200px)',
|
|
20275
|
-
minHeight: hasMinHeight ? '520px' : undefined,
|
|
20276
|
-
overflow: 'auto',
|
|
20277
|
-
},
|
|
20278
|
-
}, wrapClassName: classNames(styles$b.modal, {
|
|
20279
|
-
[styles$b.center]: titleCenter,
|
|
20280
|
-
}), 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
|
+
);
|
|
20281
19995
|
};
|
|
20282
|
-
|
|
20283
|
-
|
|
20284
|
-
|
|
20285
|
-
|
|
20286
|
-
|
|
20287
|
-
const
|
|
20288
|
-
const
|
|
20289
|
-
|
|
20290
|
-
const
|
|
20291
|
-
|
|
20292
|
-
|
|
20293
|
-
|
|
20294
|
-
|
|
20295
|
-
|
|
20296
|
-
}, []);
|
|
20297
|
-
// 确认选择
|
|
20298
|
-
const handleConfirm = useCallback(() => {
|
|
20299
|
-
if (selectedDoodle) {
|
|
20300
|
-
const newDoodle = initDoodle();
|
|
20301
|
-
const svg = selectedDoodle?.svgStr;
|
|
20302
|
-
const minLength = selectedDoodle.minLength;
|
|
20303
|
-
const parseSvg = SvgParserNative.parseSvg(svg);
|
|
20304
|
-
const svgMinLength = parseSvg.height / SCALE_FACTOR;
|
|
20305
|
-
// 使用获取到的 SVG 内容,如果没有获取到则使用 URL
|
|
20306
|
-
newDoodle.svg = svg;
|
|
20307
|
-
newDoodle.scale = minLength / svgMinLength;
|
|
20308
|
-
newDoodle.direction = 0;
|
|
20309
|
-
newDoodle.center = restorePoint(centerPoint);
|
|
20310
|
-
onHandleEnterRecord?.({
|
|
20311
|
-
type: 1,
|
|
20312
|
-
function: 0,
|
|
20313
|
-
})?.then(() => {
|
|
20314
|
-
setEditMapInfo({
|
|
20315
|
-
...editMapInfo,
|
|
20316
|
-
historyList: [
|
|
20317
|
-
{
|
|
20318
|
-
selectElement: newDoodle,
|
|
20319
|
-
},
|
|
20320
|
-
],
|
|
20321
|
-
currentHistoryIndex: 0,
|
|
20322
|
-
createMode: CreateStatus.COMPLETED,
|
|
20323
|
-
elementType: DataType.DOODLE,
|
|
20324
|
-
selectElement: newDoodle,
|
|
20325
|
-
isShowDrag: true,
|
|
20326
|
-
});
|
|
20327
|
-
setOpen(false);
|
|
20328
|
-
onSelect?.(svg);
|
|
20329
|
-
}, (error) => {
|
|
20330
|
-
message.error('Save failed, please try again');
|
|
20331
|
-
});
|
|
20332
|
-
}
|
|
20333
|
-
}, [selectedDoodle, setEditMapInfo, editMapInfo, setOpen, onSelect, centerPoint]);
|
|
20334
|
-
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
|
|
20335
|
-
?.filter((item) => !noNeed.includes(item.name))
|
|
20336
|
-
.map((item) => {
|
|
20337
|
-
return (jsx("div", { className: classNames(styles$a.item, {
|
|
20338
|
-
[styles$a.active]: selectedDoodle?.svg === item.svg,
|
|
20339
|
-
}), onClick: () => handleSelectDoodle(item), children: jsx("div", { className: styles$a.svgImage, dangerouslySetInnerHTML: { __html: item?.svgStr } }) }, item.id));
|
|
20340
|
-
}) })] }) }));
|
|
20341
|
-
};
|
|
20342
|
-
|
|
20343
|
-
const AddEntry = ({ doodleList, disabledObstacles, editMap }) => {
|
|
20344
|
-
const { svgRef } = useSvgEditContext();
|
|
20345
|
-
const { editMapInfo, setEditMapInfo, onHandleEnterRecord } = useMapEditContext();
|
|
20346
|
-
const divRef = useRef(null);
|
|
20347
|
-
const [open, setOpen] = useState(false);
|
|
20348
|
-
const [doodleOpen, setDoodleOpen] = useState(false);
|
|
20349
|
-
const centerPoint = useMemo(() => {
|
|
20350
|
-
if (!svgRef)
|
|
20351
|
-
return null;
|
|
20352
|
-
const baseVal = svgRef?.viewBox.baseVal;
|
|
20353
|
-
const center = [
|
|
20354
|
-
baseVal?.x + (baseVal?.width || 0) / 2,
|
|
20355
|
-
baseVal?.y + (baseVal?.height || 0) / 2,
|
|
20356
|
-
];
|
|
20357
|
-
return center;
|
|
20358
|
-
}, [svgRef?.viewBox?.baseVal?.x]);
|
|
20359
|
-
const centerBounds = useMemo(() => {
|
|
20360
|
-
if (!svgRef)
|
|
20361
|
-
return null;
|
|
20362
|
-
const elementWidth = 50 * 10;
|
|
20363
|
-
const [minX, minY, maxX, maxY] = [
|
|
20364
|
-
centerPoint[0] - elementWidth / 2,
|
|
20365
|
-
centerPoint[1] - elementWidth / 2,
|
|
20366
|
-
centerPoint[0] + elementWidth / 2,
|
|
20367
|
-
centerPoint[1] + elementWidth / 2,
|
|
20368
|
-
];
|
|
20369
|
-
const elementPoints = [
|
|
20370
|
-
[minX, minY],
|
|
20371
|
-
[minX, maxY],
|
|
20372
|
-
[maxX, maxY],
|
|
20373
|
-
[maxX, minY],
|
|
20374
|
-
];
|
|
20375
|
-
return elementPoints;
|
|
20376
|
-
}, [centerPoint]);
|
|
20377
|
-
const addNewElement = useCallback((type, item) => {
|
|
20378
|
-
setOpen(false);
|
|
20379
|
-
let newElement = null;
|
|
20380
|
-
if (type === DataType.BOUNDARY) {
|
|
20381
|
-
newElement = initBoundary();
|
|
20382
|
-
}
|
|
20383
|
-
else if (type === DataType.OBSTACLE) {
|
|
20384
|
-
newElement = initObstacle();
|
|
20385
|
-
}
|
|
20386
|
-
else if (type === DataType.CHANNEL) {
|
|
20387
|
-
newElement = initChannel();
|
|
20388
|
-
}
|
|
20389
|
-
else if (type === DataType.VISION_OFF) {
|
|
20390
|
-
newElement = initVisionOff();
|
|
20391
|
-
newElement.points = centerBounds;
|
|
20392
|
-
}
|
|
20393
|
-
else if (type === DataType.DOODLE) {
|
|
20394
|
-
return setDoodleOpen(true);
|
|
20395
|
-
}
|
|
20396
|
-
onHandleEnterRecord?.({
|
|
20397
|
-
type: item?.paramType,
|
|
20398
|
-
function: item?.type === DataType.OBSTACLE ? 0 : undefined,
|
|
20399
|
-
})?.then(() => {
|
|
20400
|
-
setEditMapInfo({
|
|
20401
|
-
...editMapInfo,
|
|
20402
|
-
historyList: [
|
|
20403
|
-
{
|
|
20404
|
-
selectElement: newElement,
|
|
20405
|
-
},
|
|
20406
|
-
],
|
|
20407
|
-
currentHistoryIndex: 0,
|
|
20408
|
-
createMode: type === DataType.VISION_OFF ? CreateStatus.COMPLETED : CreateStatus.CREATING,
|
|
20409
|
-
elementType: type,
|
|
20410
|
-
selectElement: newElement,
|
|
20411
|
-
});
|
|
20412
|
-
}, (errorText) => {
|
|
20413
|
-
message.error('Save failed, please try again');
|
|
20414
|
-
});
|
|
20415
|
-
}, [centerBounds]);
|
|
20416
|
-
const addItems = useMemo(() => {
|
|
20417
|
-
return DATE_TYPE_MAP?.filter((item) => {
|
|
20418
|
-
if (item.type === DataType.OBSTACLE) {
|
|
20419
|
-
return !disabledObstacles;
|
|
20420
|
-
}
|
|
20421
|
-
return item.type !== DataType.BOUNDARY;
|
|
20422
|
-
});
|
|
20423
|
-
}, [disabledObstacles]);
|
|
20424
|
-
// console.log('addEntry->', editMapInfo, editMap);
|
|
20425
|
-
if (editMapInfo.createMode || editMapInfo.editMap || !editMap) {
|
|
20426
|
-
return null;
|
|
20427
|
-
}
|
|
20428
|
-
return (jsxs("div", { ref: divRef, className: styles$c.addEntry, children: [jsx(Popover, { open: open, onOpenChange: setOpen, arrow: false, placement: "leftTop", content: addItems?.map((item) => {
|
|
20429
|
-
return (jsxs("div", { className: styles$c.addItem, onClick: () => {
|
|
20430
|
-
addNewElement(item.type, item);
|
|
20431
|
-
}, children: [jsx("div", { className: styles$c.icon, children: item?.icon }), jsx("div", { className: styles$c.label, children: item?.label })] }, item.label));
|
|
20432
|
-
}), children: jsx("div", { className: styles$c.icon, children: jsx(SvgAddEntry, {}) }) }), jsx(DoodleModal, { centerPoint: centerPoint, doodleList: doodleList, open: doodleOpen, onOk: () => setDoodleOpen(false), setOpen: setDoodleOpen })] }));
|
|
20433
|
-
};
|
|
20434
|
-
|
|
20435
|
-
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}";
|
|
20436
|
-
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"};
|
|
20437
|
-
styleInject(css_248z$9);
|
|
20438
|
-
|
|
20439
|
-
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}";
|
|
20440
|
-
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"};
|
|
20441
|
-
styleInject(css_248z$8);
|
|
20442
|
-
|
|
20443
|
-
var _path$6;
|
|
20444
|
-
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); }
|
|
20445
|
-
var SvgFocus = function SvgFocus(props) {
|
|
20446
|
-
return /*#__PURE__*/React.createElement("svg", _extends$8({
|
|
20447
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20448
|
-
width: 16,
|
|
20449
|
-
height: 16,
|
|
20450
|
-
fill: "none"
|
|
20451
|
-
}, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
|
|
20452
|
-
fill: "#FF5A00",
|
|
20453
|
-
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"
|
|
20454
|
-
})));
|
|
20455
|
-
};
|
|
20456
|
-
|
|
20457
|
-
var _path$5;
|
|
20458
|
-
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); }
|
|
20459
|
-
var SvgDelete = function SvgDelete(props) {
|
|
20460
|
-
return /*#__PURE__*/React.createElement("svg", _extends$7({
|
|
20461
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20462
|
-
width: 16,
|
|
20463
|
-
height: 16,
|
|
20464
|
-
fill: "none"
|
|
20465
|
-
}, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
|
|
20466
|
-
fill: "#FF5A00",
|
|
20467
|
-
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"
|
|
20468
|
-
})));
|
|
20469
|
-
};
|
|
20470
|
-
|
|
20471
|
-
const Header = ({ handleDelete, handleFocus, showFocus = false, showDelete = true, type, }) => {
|
|
20472
|
-
const currentType = useMemo(() => {
|
|
20473
|
-
return DATE_TYPE_MAP.find((item) => item.type === type);
|
|
20474
|
-
}, [type]);
|
|
20475
|
-
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, {}) }))] })] }));
|
|
20476
|
-
};
|
|
20477
|
-
|
|
20478
|
-
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}";
|
|
20479
|
-
var styles$7 = {"nameEdit":"index-module_nameEdit__O5bL0","content":"index-module_content__Bi2fa","edit":"index-module_edit__3yRM0"};
|
|
20480
|
-
styleInject(css_248z$7);
|
|
20481
|
-
|
|
20482
|
-
var _path$4;
|
|
20483
|
-
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); }
|
|
20484
|
-
var SvgEdit = function SvgEdit(props) {
|
|
20485
|
-
return /*#__PURE__*/React.createElement("svg", _extends$6({
|
|
20486
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20487
|
-
width: 16,
|
|
20488
|
-
height: 16,
|
|
20489
|
-
fill: "none"
|
|
20490
|
-
}, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
|
|
20491
|
-
fill: "#FF5A00",
|
|
20492
|
-
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"
|
|
20493
|
-
})));
|
|
20494
|
-
};
|
|
20495
|
-
|
|
20496
|
-
const NameModal = ({ title, name, open, setOpen, onOk }) => {
|
|
20497
|
-
const [nameValue, setNameValue] = useState('');
|
|
20498
|
-
useEffect(() => {
|
|
20499
|
-
if (open) {
|
|
20500
|
-
setNameValue(name || '');
|
|
20501
|
-
}
|
|
20502
|
-
}, [name, open]);
|
|
20503
|
-
return (jsx(CustomModal, { title: `${title}`, titleCenter: true, open: open, onOk: () => {
|
|
20504
|
-
onOk?.(nameValue);
|
|
20505
|
-
setOpen(false);
|
|
20506
|
-
}, onCancel: () => setOpen(false), okText: "Confirm", afterClose: () => {
|
|
20507
|
-
setNameValue('');
|
|
20508
|
-
}, children: jsx(Input, { maxLength: 12, showCount: true, placeholder: "Please enter boundary name", value: nameValue, onChange: (e) => setNameValue(e.target.value) }) }));
|
|
20509
|
-
};
|
|
20510
|
-
|
|
20511
|
-
const NameEdit = ({ title, name, onChange }) => {
|
|
20512
|
-
const [open, setOpen] = React__default.useState(false);
|
|
20513
|
-
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 })] }));
|
|
20514
|
-
};
|
|
20515
|
-
|
|
20516
|
-
var _path$3;
|
|
20517
|
-
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); }
|
|
20518
|
-
var SvgArrow = function SvgArrow(props) {
|
|
20519
|
-
return /*#__PURE__*/React.createElement("svg", _extends$5({
|
|
20520
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20521
|
-
width: 16,
|
|
20522
|
-
height: 16,
|
|
20523
|
-
fill: "none"
|
|
20524
|
-
}, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
|
|
20525
|
-
fill: "#1F1F1F",
|
|
20526
|
-
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"
|
|
20527
|
-
})));
|
|
20528
|
-
};
|
|
20529
|
-
|
|
20530
|
-
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}";
|
|
20531
|
-
var styles$6 = {"item":"index-module_item__wwHEt"};
|
|
20532
|
-
styleInject(css_248z$6);
|
|
20533
|
-
|
|
20534
|
-
const Item = ({ children }) => {
|
|
20535
|
-
return (jsx("div", { className: styles$6.item, children: children }));
|
|
20536
|
-
};
|
|
20537
|
-
|
|
20538
|
-
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}";
|
|
20539
|
-
var styles$5 = {"edgeMowing":"index-module_edgeMowing__kmHPN","item":"index-module_item__O2omj","content":"index-module_content__ENa5I","tip":"index-module_tip__BoRNQ"};
|
|
20540
|
-
styleInject(css_248z$5);
|
|
20541
|
-
|
|
20542
|
-
const MowingEdgeModal = ({ open, setOpen, onChange, value }) => {
|
|
20543
|
-
const [currentValue, setCurrentValue] = useState({});
|
|
20544
|
-
const handleOk = () => {
|
|
20545
|
-
onChange(currentValue);
|
|
20546
|
-
setOpen(false);
|
|
20547
|
-
};
|
|
20548
|
-
useEffect(() => {
|
|
20549
|
-
if (!open)
|
|
20550
|
-
return;
|
|
20551
|
-
setCurrentValue(value);
|
|
20552
|
-
}, [open]);
|
|
20553
|
-
return (jsx(CustomModal, { title: "Edge Mowing", titleCenter: true, open: open, onCancel: () => setOpen(false), onOk: handleOk, afterClose: () => {
|
|
20554
|
-
setCurrentValue({});
|
|
20555
|
-
}, 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({
|
|
20556
|
-
obstacleMowEdge: currentValue?.obstacleMowEdge,
|
|
20557
|
-
edgeMowing: val,
|
|
20558
|
-
}) }) })] }), 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({
|
|
20559
|
-
obstacleMowEdge: val,
|
|
20560
|
-
edgeMowing: currentValue?.edgeMowing,
|
|
20561
|
-
}) }) })] }), jsx("div", { className: styles$5.tip, children: "When enabled, the mower will mow around the off-limit islands within the selected mowing zone." })] })] }) }));
|
|
20562
|
-
};
|
|
20563
|
-
|
|
20564
|
-
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}";
|
|
20565
|
-
var styles$4 = {"zoneHeightModal":"index-module_zoneHeightModal__ehNMQ","item":"index-module_item__wQUzZ","checked":"index-module_checked__xbxQ4","right":"index-module_right__IuIfk"};
|
|
20566
|
-
styleInject(css_248z$4);
|
|
20567
|
-
|
|
20568
|
-
const CutHeightSlider = ({ units, value, onChange, heightOptions, ...rest }) => {
|
|
20569
|
-
const converteOptions = useCallback((options) => {
|
|
20570
|
-
return options.map((item) => ({
|
|
20571
|
-
label: units === UnitsType.Metric
|
|
20572
|
-
? `${item}`
|
|
20573
|
-
: `${convertCutHeightFormatted(item)}`,
|
|
20574
|
-
value: item,
|
|
20575
|
-
}));
|
|
20576
|
-
}, [units, convertCutHeightFormatted]);
|
|
20577
|
-
const options = useMemo(() => {
|
|
20578
|
-
if (heightOptions && heightOptions?.length > 0) {
|
|
20579
|
-
return converteOptions(heightOptions);
|
|
20580
|
-
}
|
|
20581
|
-
return [];
|
|
20582
|
-
}, [heightOptions, converteOptions]);
|
|
20583
|
-
return (jsx(Slider, { value: value, ...rest, tooltip: {
|
|
20584
|
-
open: false,
|
|
20585
|
-
}, step: null, min: options?.[0]?.value, max: options?.[options?.length - 1]?.value, marks: options?.reduce((acc, item) => {
|
|
20586
|
-
acc[item?.value] = {
|
|
20587
|
-
label: item?.label,
|
|
20588
|
-
style: {
|
|
20589
|
-
color: item?.value === Number(value)
|
|
20590
|
-
? 'rgba(241, 102, 41, 1)'
|
|
20591
|
-
: 'rgba(0, 0, 0, 0.20)',
|
|
20592
|
-
fontWeight: item?.value === Number(value) ? 'bold' : 'normal',
|
|
20593
|
-
},
|
|
20594
|
-
};
|
|
20595
|
-
return acc;
|
|
20596
|
-
}, {}), onChange: onChange }));
|
|
20597
|
-
};
|
|
20598
|
-
|
|
20599
|
-
var ZoneHeightModalTypeEnum;
|
|
20600
|
-
(function (ZoneHeightModalTypeEnum) {
|
|
20601
|
-
ZoneHeightModalTypeEnum[ZoneHeightModalTypeEnum["GLOBAL"] = 1] = "GLOBAL";
|
|
20602
|
-
ZoneHeightModalTypeEnum[ZoneHeightModalTypeEnum["RADIO"] = 0] = "RADIO";
|
|
20603
|
-
})(ZoneHeightModalTypeEnum || (ZoneHeightModalTypeEnum = {}));
|
|
20604
|
-
const HeightModal = ({ zoneName, open, setOpen, onChange, value, heightOptions, globalHeight, }) => {
|
|
20605
|
-
const { unitType } = useCommonContext();
|
|
20606
|
-
const [currentValue, setCurrentValue] = useState(value);
|
|
20607
|
-
const handleOk = useCallback(() => {
|
|
20608
|
-
setOpen(false);
|
|
20609
|
-
onChange?.(currentValue);
|
|
20610
|
-
}, [currentValue, setOpen, onChange]);
|
|
20611
|
-
const onHeightChange = useCallback((value) => {
|
|
20612
|
-
console.log('change->', value);
|
|
20613
|
-
setCurrentValue({
|
|
20614
|
-
cuttingHeight: value,
|
|
20615
|
-
isFlowGlobal: ZoneHeightModalTypeEnum.RADIO,
|
|
20616
|
-
});
|
|
20617
|
-
}, []);
|
|
20618
|
-
console.log('globalHeight', globalHeight, heightOptions);
|
|
20619
|
-
useEffect(() => {
|
|
20620
|
-
if (!open)
|
|
20621
|
-
return;
|
|
20622
|
-
setCurrentValue(value);
|
|
20623
|
-
}, [value, open]);
|
|
20624
|
-
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({
|
|
20625
|
-
isFlowGlobal: e.target.value,
|
|
20626
|
-
cuttingHeight: currentValue?.cuttingHeight,
|
|
20627
|
-
}), children: [jsxs("div", { className: classNames(styles$4.item, {
|
|
20628
|
-
[styles$4.checked]: currentValue?.isFlowGlobal === ZoneHeightModalTypeEnum.GLOBAL,
|
|
20629
|
-
}), 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, {
|
|
20630
|
-
[styles$4.checked]: currentValue?.isFlowGlobal === ZoneHeightModalTypeEnum.RADIO,
|
|
20631
|
-
}), 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 }) })] })] }) }) }));
|
|
20632
|
-
};
|
|
20633
|
-
|
|
20634
|
-
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}";
|
|
20635
|
-
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"};
|
|
20636
|
-
styleInject(css_248z$3);
|
|
20637
|
-
|
|
20638
|
-
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}";
|
|
20639
|
-
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"};
|
|
20640
|
-
styleInject(css_248z$2);
|
|
20641
|
-
|
|
20642
|
-
const DirectionLine = (props) => {
|
|
20643
|
-
const { selected = false, ...svgProps } = props;
|
|
20644
|
-
const colorMap = useMemo(() => {
|
|
20645
|
-
if (selected) {
|
|
20646
|
-
return {
|
|
20647
|
-
circleFill: '#FEE2D5',
|
|
20648
|
-
circleStroke: '#FF7133',
|
|
20649
|
-
line: '#FF7133',
|
|
20650
|
-
};
|
|
20651
|
-
}
|
|
20652
|
-
return {
|
|
20653
|
-
circleFill: '#E0E0E6',
|
|
20654
|
-
circleStroke: '#B3B4C3',
|
|
20655
|
-
line: '#D2D2E0',
|
|
20656
|
-
};
|
|
20657
|
-
}, [selected]);
|
|
20658
|
-
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" })] }));
|
|
20659
|
-
};
|
|
20660
|
-
|
|
20661
|
-
var _g$1, _defs$1;
|
|
20662
|
-
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); }
|
|
20663
|
-
var SvgDirectDialPlate = function SvgDirectDialPlate(props) {
|
|
20664
|
-
return /*#__PURE__*/React.createElement("svg", _extends$4({
|
|
20665
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20666
|
-
width: 293,
|
|
20667
|
-
height: 293,
|
|
20668
|
-
fill: "none"
|
|
20669
|
-
}, props), _g$1 || (_g$1 = /*#__PURE__*/React.createElement("g", {
|
|
20670
|
-
clipPath: "url(#direct-dial-plate_svg__a)"
|
|
20671
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
20672
|
-
opacity: 0.55
|
|
20673
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
20674
|
-
filter: "url(#direct-dial-plate_svg__b)",
|
|
20675
|
-
shapeRendering: "crispEdges"
|
|
20676
|
-
}, /*#__PURE__*/React.createElement("circle", {
|
|
20677
|
-
cx: 146.549,
|
|
20678
|
-
cy: 146.553,
|
|
20679
|
-
r: 133.643,
|
|
20680
|
-
fill: "#fff",
|
|
20681
|
-
fillOpacity: 0.65
|
|
20682
|
-
}), /*#__PURE__*/React.createElement("circle", {
|
|
20683
|
-
cx: 146.549,
|
|
20684
|
-
cy: 146.553,
|
|
20685
|
-
r: 133.643,
|
|
20686
|
-
stroke: "#C1C2D1"
|
|
20687
|
-
})), /*#__PURE__*/React.createElement("g", {
|
|
20688
|
-
filter: "url(#direct-dial-plate_svg__c)",
|
|
20689
|
-
shapeRendering: "crispEdges"
|
|
20690
|
-
}, /*#__PURE__*/React.createElement("circle", {
|
|
20691
|
-
cx: 146.549,
|
|
20692
|
-
cy: 146.553,
|
|
20693
|
-
r: 140,
|
|
20694
|
-
fill: "#fff",
|
|
20695
|
-
fillOpacity: 0.65
|
|
20696
|
-
}), /*#__PURE__*/React.createElement("circle", {
|
|
20697
|
-
cx: 146.549,
|
|
20698
|
-
cy: 146.553,
|
|
20699
|
-
r: 140,
|
|
20700
|
-
stroke: "#fff"
|
|
20701
|
-
})), /*#__PURE__*/React.createElement("circle", {
|
|
20702
|
-
cx: 146.549,
|
|
20703
|
-
cy: 146.553,
|
|
20704
|
-
r: 112,
|
|
20705
|
-
fill: "#fff",
|
|
20706
|
-
transform: "rotate(90 146.549 146.553)"
|
|
20707
|
-
})), /*#__PURE__*/React.createElement("circle", {
|
|
20708
|
-
cx: 146.549,
|
|
20709
|
-
cy: 146.553,
|
|
20710
|
-
r: 115,
|
|
20711
|
-
stroke: "#E0E0E6",
|
|
20712
|
-
strokeWidth: 6
|
|
20713
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20714
|
-
fill: "#E0E0E7",
|
|
20715
|
-
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"
|
|
20716
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20717
|
-
fill: "#B3B4C3",
|
|
20718
|
-
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"
|
|
20719
|
-
}))), _defs$1 || (_defs$1 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("filter", {
|
|
20720
|
-
id: "direct-dial-plate_svg__b",
|
|
20721
|
-
width: 276.285,
|
|
20722
|
-
height: 276.285,
|
|
20723
|
-
x: 8.406,
|
|
20724
|
-
y: 8.41,
|
|
20725
|
-
colorInterpolationFilters: "sRGB",
|
|
20726
|
-
filterUnits: "userSpaceOnUse"
|
|
20727
|
-
}, /*#__PURE__*/React.createElement("feFlood", {
|
|
20728
|
-
floodOpacity: 0,
|
|
20729
|
-
result: "BackgroundImageFix"
|
|
20730
|
-
}), /*#__PURE__*/React.createElement("feColorMatrix", {
|
|
20731
|
-
"in": "SourceAlpha",
|
|
20732
|
-
result: "hardAlpha",
|
|
20733
|
-
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
20734
|
-
}), /*#__PURE__*/React.createElement("feOffset", null), /*#__PURE__*/React.createElement("feGaussianBlur", {
|
|
20735
|
-
stdDeviation: 2
|
|
20736
|
-
}), /*#__PURE__*/React.createElement("feComposite", {
|
|
20737
|
-
in2: "hardAlpha",
|
|
20738
|
-
operator: "out"
|
|
20739
|
-
}), /*#__PURE__*/React.createElement("feColorMatrix", {
|
|
20740
|
-
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"
|
|
20741
|
-
}), /*#__PURE__*/React.createElement("feBlend", {
|
|
20742
|
-
in2: "BackgroundImageFix",
|
|
20743
|
-
result: "effect1_dropShadow_10512_51195"
|
|
20744
|
-
}), /*#__PURE__*/React.createElement("feBlend", {
|
|
20745
|
-
"in": "SourceGraphic",
|
|
20746
|
-
in2: "effect1_dropShadow_10512_51195",
|
|
20747
|
-
result: "shape"
|
|
20748
|
-
})), /*#__PURE__*/React.createElement("filter", {
|
|
20749
|
-
id: "direct-dial-plate_svg__c",
|
|
20750
|
-
width: 291,
|
|
20751
|
-
height: 291,
|
|
20752
|
-
x: 1.049,
|
|
20753
|
-
y: 1.053,
|
|
20754
|
-
colorInterpolationFilters: "sRGB",
|
|
20755
|
-
filterUnits: "userSpaceOnUse"
|
|
20756
|
-
}, /*#__PURE__*/React.createElement("feFlood", {
|
|
20757
|
-
floodOpacity: 0,
|
|
20758
|
-
result: "BackgroundImageFix"
|
|
20759
|
-
}), /*#__PURE__*/React.createElement("feColorMatrix", {
|
|
20760
|
-
"in": "SourceAlpha",
|
|
20761
|
-
result: "hardAlpha",
|
|
20762
|
-
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
20763
|
-
}), /*#__PURE__*/React.createElement("feOffset", null), /*#__PURE__*/React.createElement("feGaussianBlur", {
|
|
20764
|
-
stdDeviation: 2.5
|
|
20765
|
-
}), /*#__PURE__*/React.createElement("feComposite", {
|
|
20766
|
-
in2: "hardAlpha",
|
|
20767
|
-
operator: "out"
|
|
20768
|
-
}), /*#__PURE__*/React.createElement("feColorMatrix", {
|
|
20769
|
-
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"
|
|
20770
|
-
}), /*#__PURE__*/React.createElement("feBlend", {
|
|
20771
|
-
in2: "BackgroundImageFix",
|
|
20772
|
-
result: "effect1_dropShadow_10512_51195"
|
|
20773
|
-
}), /*#__PURE__*/React.createElement("feBlend", {
|
|
20774
|
-
"in": "SourceGraphic",
|
|
20775
|
-
in2: "effect1_dropShadow_10512_51195",
|
|
20776
|
-
result: "shape"
|
|
20777
|
-
})), /*#__PURE__*/React.createElement("clipPath", {
|
|
20778
|
-
id: "direct-dial-plate_svg__a"
|
|
20779
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
20780
|
-
fill: "#fff",
|
|
20781
|
-
d: "M.549 292.553v-292h292v292z"
|
|
20782
|
-
})))));
|
|
20783
|
-
};
|
|
20784
|
-
|
|
20785
|
-
var _g, _defs;
|
|
20786
|
-
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); }
|
|
20787
|
-
var SvgOption = function SvgOption(props) {
|
|
20788
|
-
return /*#__PURE__*/React.createElement("svg", _extends$3({
|
|
20789
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20790
|
-
width: 22,
|
|
20791
|
-
height: 18,
|
|
20792
|
-
fill: "none"
|
|
20793
|
-
}, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
|
|
20794
|
-
filter: "url(#option_svg__a)"
|
|
20795
|
-
}, /*#__PURE__*/React.createElement("mask", {
|
|
20796
|
-
id: "option_svg__b",
|
|
20797
|
-
width: 18,
|
|
20798
|
-
height: 15,
|
|
20799
|
-
x: 2,
|
|
20800
|
-
y: 0.612,
|
|
20801
|
-
fill: "#000",
|
|
20802
|
-
maskUnits: "userSpaceOnUse"
|
|
20803
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
20804
|
-
fill: "#fff",
|
|
20805
|
-
d: "M2 .612h18v15H2z"
|
|
20806
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20807
|
-
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"
|
|
20808
|
-
})), /*#__PURE__*/React.createElement("path", {
|
|
20809
|
-
fill: "currentColor",
|
|
20810
|
-
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"
|
|
20811
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20812
|
-
fill: "#F5F6F8",
|
|
20813
|
-
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",
|
|
20814
|
-
mask: "url(#option_svg__b)"
|
|
20815
|
-
}))), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("filter", {
|
|
20816
|
-
id: "option_svg__a",
|
|
20817
|
-
width: 21.287,
|
|
20818
|
-
height: 17.232,
|
|
20819
|
-
x: 0,
|
|
20820
|
-
y: 0.384,
|
|
20821
|
-
colorInterpolationFilters: "sRGB",
|
|
20822
|
-
filterUnits: "userSpaceOnUse"
|
|
20823
|
-
}, /*#__PURE__*/React.createElement("feFlood", {
|
|
20824
|
-
floodOpacity: 0,
|
|
20825
|
-
result: "BackgroundImageFix"
|
|
20826
|
-
}), /*#__PURE__*/React.createElement("feColorMatrix", {
|
|
20827
|
-
"in": "SourceAlpha",
|
|
20828
|
-
result: "hardAlpha",
|
|
20829
|
-
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
20830
|
-
}), /*#__PURE__*/React.createElement("feOffset", {
|
|
20831
|
-
dy: 1
|
|
20832
|
-
}), /*#__PURE__*/React.createElement("feGaussianBlur", {
|
|
20833
|
-
stdDeviation: 1
|
|
20834
|
-
}), /*#__PURE__*/React.createElement("feComposite", {
|
|
20835
|
-
in2: "hardAlpha",
|
|
20836
|
-
operator: "out"
|
|
20837
|
-
}), /*#__PURE__*/React.createElement("feColorMatrix", {
|
|
20838
|
-
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
|
|
20839
|
-
}), /*#__PURE__*/React.createElement("feBlend", {
|
|
20840
|
-
in2: "BackgroundImageFix",
|
|
20841
|
-
result: "effect1_dropShadow_13071_1578"
|
|
20842
|
-
}), /*#__PURE__*/React.createElement("feBlend", {
|
|
20843
|
-
"in": "SourceGraphic",
|
|
20844
|
-
in2: "effect1_dropShadow_13071_1578",
|
|
20845
|
-
result: "shape"
|
|
20846
|
-
})))));
|
|
20847
|
-
};
|
|
20848
|
-
|
|
20849
|
-
// json中返回的是多选方向的加值,所以需要拆开
|
|
20850
|
-
function convertDirectionToParams(value) {
|
|
20851
|
-
const A = 1 << 0; // bit0 = 1
|
|
20852
|
-
const B = 1 << 1; // bit1 = 2
|
|
20853
|
-
const C = 1 << 2; // bit2 = 4
|
|
20854
|
-
const D = 1 << 3; // bit3 = 8
|
|
20855
|
-
const E = 1 << 4; // bit4 = 16
|
|
20856
|
-
const F = 1 << 5; // bit5 = 32
|
|
20857
|
-
const directions = [];
|
|
20858
|
-
// 检查每个位标志是否被设置
|
|
20859
|
-
if (value & A)
|
|
20860
|
-
directions.push(A);
|
|
20861
|
-
if (value & B)
|
|
20862
|
-
directions.push(B);
|
|
20863
|
-
if (value & C)
|
|
20864
|
-
directions.push(C);
|
|
20865
|
-
if (value & D)
|
|
20866
|
-
directions.push(D);
|
|
20867
|
-
if (value & E)
|
|
20868
|
-
directions.push(E);
|
|
20869
|
-
if (value & F)
|
|
20870
|
-
directions.push(F);
|
|
20871
|
-
return directions;
|
|
20872
|
-
}
|
|
20873
|
-
|
|
20874
|
-
const DEFAULT_LIST = [
|
|
20875
|
-
{
|
|
20876
|
-
value: 1 << 0,
|
|
20877
|
-
text: 'A',
|
|
20878
|
-
selected: false,
|
|
20879
|
-
},
|
|
20880
|
-
{
|
|
20881
|
-
value: 1 << 1,
|
|
20882
|
-
text: 'B',
|
|
20883
|
-
selected: false,
|
|
20884
|
-
},
|
|
20885
|
-
{
|
|
20886
|
-
value: 1 << 2,
|
|
20887
|
-
text: 'C',
|
|
20888
|
-
selected: false,
|
|
20889
|
-
},
|
|
20890
|
-
{
|
|
20891
|
-
value: 1 << 3,
|
|
20892
|
-
text: 'D',
|
|
20893
|
-
selected: false,
|
|
20894
|
-
},
|
|
20895
|
-
{
|
|
20896
|
-
value: 1 << 4,
|
|
20897
|
-
text: 'E',
|
|
20898
|
-
selected: false,
|
|
20899
|
-
},
|
|
20900
|
-
{
|
|
20901
|
-
value: 1 << 5,
|
|
20902
|
-
text: 'F',
|
|
20903
|
-
selected: false,
|
|
20904
|
-
},
|
|
20905
|
-
];
|
|
20906
|
-
const MowDirection_L = (props) => {
|
|
20907
|
-
const { value, angleValue, optionAngle = 45, zIndex = 10000, onChange,
|
|
20908
|
-
// children,
|
|
20909
|
-
} = props;
|
|
20910
|
-
const [angle, setAngle] = useState(0);
|
|
20911
|
-
const lineList = useMemo(() => {
|
|
20912
|
-
return DEFAULT_LIST.map((item) => ({
|
|
20913
|
-
...item,
|
|
20914
|
-
selected: convertDirectionToParams(value).includes(item.value),
|
|
20915
|
-
}));
|
|
20916
|
-
}, [value]);
|
|
20917
|
-
// const [lineList, setLineList] = useState<LineItem[]>([
|
|
20918
|
-
// {
|
|
20919
|
-
// value: 1 << 0,
|
|
20920
|
-
// text: 'A',
|
|
20921
|
-
// selected: false,
|
|
20922
|
-
// },
|
|
20923
|
-
// {
|
|
20924
|
-
// value: 1 << 1,
|
|
20925
|
-
// text: 'B',
|
|
20926
|
-
// selected: false,
|
|
20927
|
-
// },
|
|
20928
|
-
// {
|
|
20929
|
-
// value: 1 << 2,
|
|
20930
|
-
// text: 'C',
|
|
20931
|
-
// selected: false,
|
|
20932
|
-
// },
|
|
20933
|
-
// {
|
|
20934
|
-
// value: 1 << 3,
|
|
20935
|
-
// text: 'D',
|
|
20936
|
-
// selected: false,
|
|
20937
|
-
// },
|
|
20938
|
-
// {
|
|
20939
|
-
// value: 1 << 4,
|
|
20940
|
-
// text: 'E',
|
|
20941
|
-
// selected: false,
|
|
20942
|
-
// },
|
|
20943
|
-
// {
|
|
20944
|
-
// value: 1 << 5,
|
|
20945
|
-
// text: 'F',
|
|
20946
|
-
// selected: false,
|
|
20947
|
-
// },
|
|
20948
|
-
// ]);
|
|
20949
|
-
const hitRectAngle = useMemo(() => {
|
|
20950
|
-
const direction = lineList
|
|
20951
|
-
?.filter((item) => item?.selected)
|
|
20952
|
-
?.reduce((pre, line) => {
|
|
20953
|
-
return pre + line.value;
|
|
20954
|
-
}, 0);
|
|
20955
|
-
const angles = getSelectAngles(direction)?.map((item) => item + angleValue);
|
|
20956
|
-
return angles?.includes(optionAngle);
|
|
20957
|
-
}, [lineList, angleValue, optionAngle]);
|
|
20958
|
-
const allSelect = useMemo(() => {
|
|
20959
|
-
return lineList?.every((item) => item?.selected);
|
|
20960
|
-
}, [lineList]);
|
|
20961
|
-
useEffect(() => {
|
|
20962
|
-
setAngle(angleValue);
|
|
20963
|
-
}, [angleValue]);
|
|
20964
|
-
console.log('hitRectAngle-->', hitRectAngle);
|
|
20965
|
-
const onLineClick = (index) => {
|
|
20966
|
-
const newLine = lineList.map((line, i) => {
|
|
20967
|
-
if (i === index) {
|
|
20968
|
-
return {
|
|
20969
|
-
...line,
|
|
20970
|
-
selected: !line.selected,
|
|
20971
|
-
};
|
|
20972
|
-
}
|
|
20973
|
-
return { ...line };
|
|
20974
|
-
});
|
|
20975
|
-
onChange?.(newLine
|
|
20976
|
-
?.filter((item) => item?.selected)
|
|
20977
|
-
.reduce((pre, line) => {
|
|
20978
|
-
return pre + line.value;
|
|
20979
|
-
}, 0));
|
|
20980
|
-
};
|
|
20981
|
-
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: {
|
|
20982
|
-
transform: `rotate(${angle}deg)`,
|
|
20983
|
-
}, children: lineList.map((line, index) => (jsxs("div", { className: styles$2.directLineContent, style: {
|
|
20984
|
-
transform: `translate(-50%, -50%) rotate(${30 * index}deg)`,
|
|
20985
|
-
}, children: [jsx("div", { className: styles$2.directLineText, style: {
|
|
20986
|
-
color: line.selected ? '#FF996C' : '#B3B4C3',
|
|
20987
|
-
}, children: line.text }), jsx(DirectionLine, { className: styles$2.directLine, selected: line.selected, onClick: () => onLineClick(index) }), jsx("div", { className: styles$2.directLineText, style: {
|
|
20988
|
-
transform: 'rotate(180deg)',
|
|
20989
|
-
color: line.selected ? '#FF996C' : '#B3B4C3',
|
|
20990
|
-
}, children: line.text })] }, line.value))) }), jsx("div", { className: classNames(styles$2.directCenterCircle, {
|
|
20991
|
-
[styles$2.active]: allSelect && hitRectAngle,
|
|
20992
|
-
}) })] }) }), jsxs("div", { className: styles$2.directOption, style: {
|
|
20993
|
-
transform: `rotate(${optionAngle}deg)`,
|
|
20994
|
-
color: hitRectAngle ? '#FF996C' : '#B3B4C3',
|
|
20995
|
-
}, children: [jsx("div", { className: styles$2.leftTop, children: jsx(SvgOption, {}) }), jsx("div", { className: styles$2.rightBottom, children: jsx(SvgOption, {}) })] })] }) }) }));
|
|
20996
|
-
};
|
|
20997
|
-
|
|
20998
|
-
const BoundarySvgRender = React__default.memo(({ mapJson, id, maxWidth = 300 }) => {
|
|
20999
|
-
const svgElementData = useMemo(() => {
|
|
21000
|
-
const data = UnifiedMapDataProcessor.processMapData(mapJson, DEFAULT_STYLES) || {};
|
|
21001
|
-
return data;
|
|
21002
|
-
}, [mapJson, DEFAULT_STYLES]);
|
|
21003
|
-
const boundaryInfo = useMemo(() => {
|
|
21004
|
-
const boundary = svgElementData.boundary.find((item) => item.id === id);
|
|
21005
|
-
return boundary;
|
|
21006
|
-
}, [id, svgElementData]);
|
|
21007
|
-
// 计算当前boundary的viewBox
|
|
21008
|
-
const boundaryViewBox = useMemo(() => {
|
|
21009
|
-
if (!boundaryInfo?.points || boundaryInfo.points.length === 0) {
|
|
21010
|
-
return null;
|
|
21011
|
-
}
|
|
21012
|
-
// 计算边界
|
|
21013
|
-
let minX = Infinity;
|
|
21014
|
-
let minY = Infinity;
|
|
21015
|
-
let maxX = -Infinity;
|
|
21016
|
-
let maxY = -Infinity;
|
|
21017
|
-
boundaryInfo.points.forEach((point) => {
|
|
21018
|
-
minX = Math.min(minX, point[0]);
|
|
21019
|
-
minY = Math.min(minY, point[1]);
|
|
21020
|
-
maxX = Math.max(maxX, point[0]);
|
|
21021
|
-
maxY = Math.max(maxY, point[1]);
|
|
21022
|
-
});
|
|
21023
|
-
// 添加边距
|
|
21024
|
-
const padding = 50;
|
|
21025
|
-
const width = maxX - minX + padding * 2;
|
|
21026
|
-
const height = maxY - minY + padding * 2;
|
|
21027
|
-
return {
|
|
21028
|
-
x: minX - padding,
|
|
21029
|
-
y: minY - padding,
|
|
21030
|
-
width,
|
|
21031
|
-
height,
|
|
21032
|
-
};
|
|
21033
|
-
}, [boundaryInfo]);
|
|
21034
|
-
const style = useMemo(() => {
|
|
21035
|
-
if (boundaryViewBox?.width > boundaryViewBox?.height) {
|
|
21036
|
-
return {
|
|
21037
|
-
width: maxWidth,
|
|
21038
|
-
height: maxWidth * (boundaryViewBox.height / boundaryViewBox.width),
|
|
21039
|
-
};
|
|
21040
|
-
}
|
|
21041
|
-
return {
|
|
21042
|
-
width: maxWidth * (boundaryViewBox.height / boundaryViewBox.width),
|
|
21043
|
-
height: maxWidth,
|
|
21044
|
-
};
|
|
21045
|
-
}, [boundaryViewBox, maxWidth]);
|
|
21046
|
-
return (jsxs("div", { style: {
|
|
21047
|
-
position: 'relative',
|
|
21048
|
-
width: style.width,
|
|
21049
|
-
height: style.height,
|
|
21050
|
-
margin: '0 auto',
|
|
21051
|
-
}, 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) => {
|
|
21052
|
-
return svgElementData[key]?.map((element) => {
|
|
21053
|
-
if (key === DataType.VISION_OFF)
|
|
21054
|
-
return null;
|
|
21055
|
-
return (jsx(GElement, { type: key, data: svgElementData[key], children: jsx(SvgElement, { type: key, data: element, onSelect: () => { }, onCancel: () => { } }, element.id) }, key));
|
|
21056
|
-
});
|
|
21057
|
-
}) }), jsx(CharginPile, { mapData: mapJson, mapConfig: DEFAULT_STYLES, viewBox: boundaryViewBox || null, rotation: 0 })] }));
|
|
21058
|
-
});
|
|
21059
|
-
|
|
21060
|
-
const DirectionModal = ({ directionInfo, open, setOpen, zoneName, optionAngle, onChange, }) => {
|
|
21061
|
-
const { mapJson, mapConfig } = useCommonContext();
|
|
21062
|
-
const { editMapInfo } = useMapEditContext();
|
|
21063
|
-
const [directions, setDirections] = useState(ALL_DIRECTION_SELECTED);
|
|
21064
|
-
const [angle, setAngle] = useState(MIN_DIRECTION_ANGLE);
|
|
21065
|
-
const canSetDefault = useMemo(() => {
|
|
21066
|
-
const angles = getSelectAngles(directions)?.map((item) => item + angle);
|
|
21067
|
-
const hitRectAngle = angles?.includes(optionAngle);
|
|
21068
|
-
return directions !== ALL_DIRECTION_SELECTED || !hitRectAngle;
|
|
21069
|
-
}, [directions, angle]);
|
|
21070
|
-
const canSave = useMemo(() => {
|
|
21071
|
-
return directions !== directionInfo?.direction || angle !== directionInfo?.angle;
|
|
21072
|
-
}, [directions, angle, directionInfo]);
|
|
21073
|
-
useEffect(() => {
|
|
21074
|
-
if (!open)
|
|
21075
|
-
return;
|
|
21076
|
-
setDirections(directionInfo.direction);
|
|
21077
|
-
setAngle(directionInfo.angle);
|
|
21078
|
-
}, [directionInfo, open]);
|
|
21079
|
-
const resetDirection = () => {
|
|
21080
|
-
setDirections(ALL_DIRECTION_SELECTED);
|
|
21081
|
-
const defaultAngle = getDefaultAngle(optionAngle);
|
|
21082
|
-
console.log('defaultAngle=>', defaultAngle, optionAngle);
|
|
21083
|
-
if (defaultAngle) {
|
|
21084
|
-
setAngle(defaultAngle);
|
|
21085
|
-
}
|
|
21086
|
-
};
|
|
21087
|
-
const handleCancel = useCallback(() => {
|
|
21088
|
-
if (!canSave) {
|
|
21089
|
-
setOpen(false);
|
|
21090
|
-
return;
|
|
21091
|
-
}
|
|
21092
|
-
Modal.confirm({
|
|
21093
|
-
icon: null,
|
|
21094
|
-
centered: true,
|
|
21095
|
-
title: 'Exit editing',
|
|
21096
|
-
content: 'Changes you made will not be saved. Are you sure you want to exit editing the mowing direction?',
|
|
21097
|
-
onOk: () => {
|
|
21098
|
-
setOpen(false);
|
|
21099
|
-
},
|
|
21100
|
-
okText: 'Exit',
|
|
21101
|
-
cancelText: 'Continue editing',
|
|
21102
|
-
});
|
|
21103
|
-
}, [canSave, setOpen]);
|
|
21104
|
-
console.log('directionInfo=>', directionInfo, mapJson);
|
|
21105
|
-
return (jsx(CustomModal, { maskClosable: false, titleCenter: true, title: `${zoneName} mowing direction`, open: open, width: 600, onCancel: handleCancel, onOk: () => {
|
|
21106
|
-
onChange?.(directions, angle);
|
|
21107
|
-
setOpen(false);
|
|
21108
|
-
}, okText: "Confirm", cancelText: "Cancel", okButtonProps: { disabled: !canSave }, afterClose: () => {
|
|
21109
|
-
setDirections(ALL_DIRECTION_SELECTED);
|
|
21110
|
-
setAngle(MIN_DIRECTION_ANGLE);
|
|
21111
|
-
}, 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) => {
|
|
21112
|
-
console.log('valie=>', value);
|
|
21113
|
-
if (!value)
|
|
21114
|
-
return message.warning('Choose at least one mowing direction');
|
|
21115
|
-
setDirections(value);
|
|
21116
|
-
} }) })] }), 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: {
|
|
21117
|
-
formatter: (value) => `${value}°`,
|
|
21118
|
-
}, min: MIN_DIRECTION_ANGLE, max: MAX_DIRECTION_ANGLE, value: angle, onChange: (value) => setAngle(value) }) })] }) }));
|
|
21119
|
-
};
|
|
21120
|
-
|
|
21121
|
-
const BoundaryInfo = ({ onHandleDelete }) => {
|
|
21122
|
-
const { unitType, heightOptions, globalHeight } = useCommonContext();
|
|
21123
|
-
const { editMapInfo, setEditMapInfo } = useMapEditContext();
|
|
21124
|
-
const nameValue = editMapInfo.selectElement?.name;
|
|
21125
|
-
const onHandleFocus = () => { };
|
|
21126
|
-
const [open, setOpen] = useState(false);
|
|
21127
|
-
const [heightOpen, setHeightOpen] = useState(false);
|
|
21128
|
-
const [directionOpen, setDirectionOpen] = useState(false);
|
|
21129
|
-
const sizeValue = useMemo(() => {
|
|
21130
|
-
const points = editMapInfo.selectElement?.points?.map((item) => [
|
|
21131
|
-
item[0] / SCALE_FACTOR,
|
|
21132
|
-
item[1] / SCALE_FACTOR,
|
|
21133
|
-
]);
|
|
21134
|
-
const { area: areaValue, perimeter: perimeterValue } = calculatePolygonAreaAndPerimeter(points) || {};
|
|
21135
|
-
const formatArea = convertAreaByUnits(areaValue);
|
|
21136
|
-
const formatPerimeter = convertDistanceByUnits(perimeterValue);
|
|
21137
|
-
return {
|
|
21138
|
-
area: formatArea.value,
|
|
21139
|
-
perimeter: formatPerimeter.value,
|
|
21140
|
-
};
|
|
21141
|
-
}, [editMapInfo.selectElement]);
|
|
21142
|
-
const edgeMowingValue = useMemo(() => {
|
|
21143
|
-
return {
|
|
21144
|
-
edgeMowing: editMapInfo?.selectElement?.edgeMowing,
|
|
21145
|
-
obstacleMowEdge: editMapInfo?.selectElement?.obstacleMowEdge,
|
|
21146
|
-
};
|
|
21147
|
-
}, [editMapInfo.selectElement]);
|
|
21148
|
-
const heightValue = useMemo(() => {
|
|
21149
|
-
return {
|
|
21150
|
-
isFlowGlobal: editMapInfo?.selectElement?.isFlowGlobal,
|
|
21151
|
-
cuttingHeight: editMapInfo?.selectElement?.cuttingHeight,
|
|
21152
|
-
};
|
|
21153
|
-
}, [editMapInfo.selectElement]);
|
|
21154
|
-
const directionInfo = useMemo(() => {
|
|
21155
|
-
return {
|
|
21156
|
-
direction: editMapInfo?.selectElement?.direction,
|
|
21157
|
-
angle: editMapInfo?.selectElement?.angle,
|
|
21158
|
-
};
|
|
21159
|
-
}, [editMapInfo.selectElement?.direction, editMapInfo.selectElement?.angle]);
|
|
21160
|
-
const optionAngle = useMemo(() => {
|
|
21161
|
-
return editMapInfo?.selectElement?.recBaseAngle;
|
|
21162
|
-
}, [editMapInfo.selectElement?.recBaseAngle]);
|
|
21163
|
-
console.log('height---->', editMapInfo?.selectElement, heightValue, edgeMowingValue);
|
|
21164
|
-
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) => {
|
|
21165
|
-
setEditMapInfo({
|
|
21166
|
-
...editMapInfo,
|
|
21167
|
-
isShowDrag: false,
|
|
21168
|
-
selectElement: {
|
|
21169
|
-
...editMapInfo.selectElement,
|
|
21170
|
-
name: name,
|
|
21171
|
-
},
|
|
21172
|
-
});
|
|
21173
|
-
} }) }), 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: () => {
|
|
21174
|
-
setHeightOpen(true);
|
|
21175
|
-
}, 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: () => {
|
|
21176
|
-
setDirectionOpen(true);
|
|
21177
|
-
}, 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: () => {
|
|
21178
|
-
setOpen(true);
|
|
21179
|
-
}, 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) => {
|
|
21180
|
-
setEditMapInfo({
|
|
21181
|
-
...editMapInfo,
|
|
21182
|
-
selectElement: {
|
|
21183
|
-
...editMapInfo.selectElement,
|
|
21184
|
-
edgeMowing: value.edgeMowing ? 1 : 0,
|
|
21185
|
-
obstacleMowEdge: value.obstacleMowEdge ? 1 : 0,
|
|
21186
|
-
},
|
|
21187
|
-
});
|
|
21188
|
-
}, open: open, setOpen: setOpen }), jsx(HeightModal, { zoneName: editMapInfo.selectElement?.name, heightOptions: heightOptions, globalHeight: globalHeight, open: heightOpen, setOpen: setHeightOpen, value: heightValue, onChange: (value) => {
|
|
21189
|
-
setEditMapInfo({
|
|
21190
|
-
...editMapInfo,
|
|
21191
|
-
selectElement: {
|
|
21192
|
-
...editMapInfo.selectElement,
|
|
21193
|
-
cuttingHeight: value.cuttingHeight,
|
|
21194
|
-
isFlowGlobal: value.isFlowGlobal,
|
|
21195
|
-
},
|
|
21196
|
-
});
|
|
21197
|
-
} }), jsx(DirectionModal, { directionInfo: directionInfo, optionAngle: optionAngle, open: directionOpen, setOpen: setDirectionOpen, zoneName: editMapInfo.selectElement?.name, onChange: (direction, angle) => {
|
|
21198
|
-
setEditMapInfo({
|
|
21199
|
-
...editMapInfo,
|
|
21200
|
-
selectElement: {
|
|
21201
|
-
...editMapInfo.selectElement,
|
|
21202
|
-
direction,
|
|
21203
|
-
angle,
|
|
21204
|
-
},
|
|
21205
|
-
});
|
|
21206
|
-
} })] }));
|
|
21207
|
-
};
|
|
21208
|
-
|
|
21209
|
-
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}";
|
|
21210
|
-
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"};
|
|
21211
|
-
styleInject(css_248z$1);
|
|
21212
|
-
|
|
21213
|
-
var RadioValue;
|
|
21214
|
-
(function (RadioValue) {
|
|
21215
|
-
RadioValue[RadioValue["LONG_TIME"] = 0] = "LONG_TIME";
|
|
21216
|
-
RadioValue[RadioValue["SHORT_TIME"] = 1] = "SHORT_TIME";
|
|
21217
|
-
})(RadioValue || (RadioValue = {}));
|
|
21218
|
-
const TimePeriod = ({ value, onChange }) => {
|
|
21219
|
-
// eslint-disable-next-line no-undef
|
|
21220
|
-
const [date, setDate] = useState();
|
|
21221
|
-
const [open, setOpen] = useState(false);
|
|
21222
|
-
const [radioValue, setRadioValue] = useState(RadioValue.LONG_TIME);
|
|
21223
|
-
console.log('time period->', date, radioValue);
|
|
21224
|
-
useEffect(() => {
|
|
21225
|
-
if (!open && date?.length !== 2) {
|
|
21226
|
-
setRadioValue(RadioValue.LONG_TIME);
|
|
21227
|
-
}
|
|
21228
|
-
}, [open]);
|
|
21229
|
-
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) => {
|
|
21230
|
-
onChange({
|
|
21231
|
-
...value,
|
|
21232
|
-
status: checked ? 1 : 0,
|
|
21233
|
-
start_timestamp: checked ? value.start_timestamp : 0,
|
|
21234
|
-
end_timestamp: checked ? value.end_timestamp : 0,
|
|
21235
|
-
});
|
|
21236
|
-
} }) })] }), jsx("div", { className: styles$1.timePeriodContent, children: jsxs(Radio.Group, { value: radioValue, onChange: (e) => {
|
|
21237
|
-
setRadioValue(e.target.value);
|
|
21238
|
-
if (e.target.value === RadioValue.LONG_TIME) {
|
|
21239
|
-
setDate(null);
|
|
21240
|
-
onChange({
|
|
21241
|
-
...value,
|
|
21242
|
-
start_timestamp: 0,
|
|
21243
|
-
end_timestamp: 0,
|
|
21244
|
-
});
|
|
21245
|
-
}
|
|
21246
|
-
else if (e.target.value === RadioValue.SHORT_TIME) {
|
|
21247
|
-
setOpen(true);
|
|
21248
|
-
// onChange({
|
|
21249
|
-
// ...value,
|
|
21250
|
-
// startTimestamp: dayjs().add(30, 'minute').unix(),
|
|
21251
|
-
// endTimestamp: dayjs().add(1, 'hour').unix(),
|
|
21252
|
-
// });
|
|
21253
|
-
}
|
|
21254
|
-
}, 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) => {
|
|
21255
|
-
setOpen(open);
|
|
21256
|
-
}, onChange: (dateValue, dateString) => {
|
|
21257
|
-
setDate(dateValue);
|
|
21258
|
-
if (dateValue?.length === 2) {
|
|
21259
|
-
onChange({
|
|
21260
|
-
status: RadioValue.SHORT_TIME,
|
|
21261
|
-
start_timestamp: dateValue[0].unix(),
|
|
21262
|
-
end_timestamp: dateValue[1].unix(),
|
|
21263
|
-
});
|
|
21264
|
-
}
|
|
21265
|
-
} }) }) })] }) })] }));
|
|
21266
|
-
};
|
|
21267
|
-
|
|
21268
|
-
const ObstacleInfo = ({ onHandleDelete }) => {
|
|
21269
|
-
const { editMapInfo, setEditMapInfo } = useMapEditContext();
|
|
21270
|
-
const nameValue = editMapInfo.selectElement?.name;
|
|
21271
|
-
console.log('obstacle->', editMapInfo.selectElement);
|
|
21272
|
-
const timePeriodValue = useMemo(() => {
|
|
21273
|
-
if (!editMapInfo.selectElement)
|
|
21274
|
-
return null;
|
|
21275
|
-
const status = editMapInfo.selectElement?.status;
|
|
21276
|
-
const start_timestamp = editMapInfo.selectElement?.start_timestamp;
|
|
21277
|
-
const end_timestamp = editMapInfo.selectElement?.end_timestamp;
|
|
21278
|
-
return {
|
|
21279
|
-
status,
|
|
21280
|
-
start_timestamp,
|
|
21281
|
-
end_timestamp,
|
|
21282
|
-
};
|
|
21283
|
-
}, [editMapInfo.selectElement]);
|
|
21284
|
-
const sizeValue = useMemo(() => {
|
|
21285
|
-
const points = editMapInfo.selectElement?.points?.map((item) => [
|
|
21286
|
-
item[0] / SCALE_FACTOR,
|
|
21287
|
-
item[1] / SCALE_FACTOR,
|
|
21288
|
-
]);
|
|
21289
|
-
const { area: areaValue, perimeter: perimeterValue } = calculatePolygonAreaAndPerimeter(points) || {};
|
|
21290
|
-
const formatArea = convertAreaByUnits(areaValue);
|
|
21291
|
-
const formatPerimeter = convertDistanceByUnits(perimeterValue);
|
|
21292
|
-
return {
|
|
21293
|
-
area: formatArea.value,
|
|
21294
|
-
perimeter: formatPerimeter.value,
|
|
21295
|
-
};
|
|
21296
|
-
}, [editMapInfo.selectElement]);
|
|
21297
|
-
return (jsxs("div", { className: styles$9.obstacleInfo, children: [jsx(Header, { handleDelete: () => {
|
|
21298
|
-
onHandleDelete();
|
|
21299
|
-
}, handleFocus: () => { }, type: editMapInfo.elementType }), jsx("div", { className: styles$9.nameEdit, children: jsx(NameEdit, { title: "Obstacle name", name: nameValue, onChange: (name) => {
|
|
21300
|
-
setEditMapInfo({
|
|
21301
|
-
...editMapInfo,
|
|
21302
|
-
isShowDrag: false,
|
|
21303
|
-
selectElement: {
|
|
21304
|
-
...editMapInfo.selectElement,
|
|
21305
|
-
name: name,
|
|
21306
|
-
},
|
|
21307
|
-
});
|
|
21308
|
-
} }) }), jsx("div", { className: styles$9.border }), jsx("div", { className: styles$9.timePeriod, children: jsx(TimePeriod, { value: timePeriodValue, onChange: (value) => {
|
|
21309
|
-
setEditMapInfo({
|
|
21310
|
-
...editMapInfo,
|
|
21311
|
-
isShowDrag: editMapInfo?.isShowDrag || false,
|
|
21312
|
-
selectElement: {
|
|
21313
|
-
...editMapInfo.selectElement,
|
|
21314
|
-
status: value.status,
|
|
21315
|
-
start_timestamp: value.start_timestamp,
|
|
21316
|
-
end_timestamp: value.end_timestamp,
|
|
21317
|
-
},
|
|
21318
|
-
});
|
|
21319
|
-
} }) }), 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 })] })] })] }));
|
|
21320
|
-
};
|
|
21321
|
-
|
|
21322
|
-
const DoodleInfo = ({ onHandleDelete }) => {
|
|
21323
|
-
const { editMapInfo, setEditMapInfo } = useMapEditContext();
|
|
21324
|
-
const options = useMemo(() => {
|
|
21325
|
-
return new Array(30).fill(0).map((_, index) => {
|
|
21326
|
-
return {
|
|
21327
|
-
label: `${index + 1}day`,
|
|
21328
|
-
value: index + 1,
|
|
21329
|
-
};
|
|
21330
|
-
});
|
|
21331
|
-
}, []);
|
|
21332
|
-
const isCreate = useMemo(() => {
|
|
21333
|
-
return editMapInfo?.createMode;
|
|
21334
|
-
}, [editMapInfo?.createMode]);
|
|
21335
|
-
const doodleInfo = useMemo(() => {
|
|
21336
|
-
if (!editMapInfo.selectElement)
|
|
21337
|
-
return null;
|
|
21338
|
-
const create_ts = editMapInfo?.selectElement?.create_ts;
|
|
21339
|
-
const expiration_ts = editMapInfo.selectElement.expiration_ts;
|
|
21340
|
-
const diff = expiration_ts - create_ts;
|
|
21341
|
-
const day = Math.floor(diff / (60 * 60 * 24));
|
|
21342
|
-
return {
|
|
21343
|
-
day: day,
|
|
21344
|
-
};
|
|
21345
|
-
}, [editMapInfo?.selectElement]);
|
|
21346
|
-
const remainDay = useMemo(() => {
|
|
21347
|
-
if (!editMapInfo.selectElement)
|
|
21348
|
-
return null;
|
|
21349
|
-
const expiration_ts = editMapInfo.selectElement.expiration_ts;
|
|
21350
|
-
const diff = expiration_ts - Date.now() / 1000;
|
|
21351
|
-
return Math.floor(diff / (60 * 60 * 24));
|
|
21352
|
-
}, [editMapInfo?.selectElement]);
|
|
21353
|
-
const sizeValue = useMemo(() => {
|
|
21354
|
-
if (!editMapInfo.selectElement || !editMapInfo.selectElement.svg)
|
|
21355
|
-
return '';
|
|
21356
|
-
const svg = editMapInfo.selectElement?.svg;
|
|
21357
|
-
const scale = editMapInfo.selectElement.scale;
|
|
21358
|
-
const parseSvg = SvgParserNative.parseSvg(svg);
|
|
21359
|
-
const width = (parseSvg.width * scale) / SCALE_FACTOR;
|
|
21360
|
-
const height = (parseSvg.height * scale) / SCALE_FACTOR;
|
|
21361
|
-
console.log('parseSvg->', editMapInfo, parseSvg);
|
|
21362
|
-
return `${width.toFixed(1)} m x ${height.toFixed(1)} m`;
|
|
21363
|
-
}, [editMapInfo.selectElement]);
|
|
21364
|
-
const handleChange = useCallback((day) => {
|
|
21365
|
-
setEditMapInfo((pre) => {
|
|
21366
|
-
return {
|
|
21367
|
-
...pre,
|
|
21368
|
-
selectElement: {
|
|
21369
|
-
...pre.selectElement,
|
|
21370
|
-
create_ts: Date.now() / 1000,
|
|
21371
|
-
expiration_ts: Date.now() / 1000 + day * 24 * 60 * 60,
|
|
21372
|
-
},
|
|
21373
|
-
};
|
|
21374
|
-
});
|
|
21375
|
-
}, [editMapInfo.selectElement]);
|
|
21376
|
-
console.log('doodleInfo->', doodleInfo);
|
|
21377
|
-
return (jsxs("div", { className: styles$9.doodleInfo, children: [jsx(Header, { handleDelete: () => {
|
|
21378
|
-
onHandleDelete();
|
|
21379
|
-
}, 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 })] })] }))] }));
|
|
21380
|
-
};
|
|
21381
|
-
|
|
21382
|
-
const VisionOffInfo = ({ onHandleDelete }) => {
|
|
21383
|
-
const { editMapInfo, setEditMapInfo } = useMapEditContext();
|
|
21384
|
-
const sizeValue = useMemo(() => {
|
|
21385
|
-
if (!editMapInfo.selectElement)
|
|
21386
|
-
return '';
|
|
21387
|
-
const points = editMapInfo.selectElement?.points;
|
|
21388
|
-
const [width, height] = calculateRectangleDimensions(points);
|
|
21389
|
-
const formatWidth = convertDistanceByUnits(width / SCALE_FACTOR);
|
|
21390
|
-
const formatHeight = convertDistanceByUnits(height / SCALE_FACTOR);
|
|
21391
|
-
return `${formatWidth.value} x ${formatHeight.value}`;
|
|
21392
|
-
}, [editMapInfo.selectElement]);
|
|
21393
|
-
return (jsxs("div", { className: "visionOffInfo", children: [jsx(Header, { handleDelete: () => {
|
|
21394
|
-
onHandleDelete?.();
|
|
21395
|
-
}, 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 })] }) })] }));
|
|
21396
|
-
};
|
|
21397
|
-
|
|
21398
|
-
var _path$2, _path2$1;
|
|
21399
|
-
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); }
|
|
21400
|
-
var SvgUndo = function SvgUndo(props) {
|
|
21401
|
-
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
21402
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
21403
|
-
width: 24,
|
|
21404
|
-
height: 24,
|
|
21405
|
-
fill: "none"
|
|
21406
|
-
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
21407
|
-
stroke: "currentColor",
|
|
21408
|
-
strokeLinecap: "round",
|
|
21409
|
-
strokeLinejoin: "round",
|
|
21410
|
-
strokeWidth: 2,
|
|
21411
|
-
d: "M4.329 7.821h10.506a5.581 5.581 0 0 1 0 11.163h-5.27"
|
|
21412
|
-
})), _path2$1 || (_path2$1 = /*#__PURE__*/React.createElement("path", {
|
|
21413
|
-
stroke: "currentColor",
|
|
21414
|
-
strokeLinecap: "round",
|
|
21415
|
-
strokeLinejoin: "round",
|
|
21416
|
-
strokeWidth: 2,
|
|
21417
|
-
d: "m7.293 3.607-4.39 4.215 4.39 4.316"
|
|
21418
|
-
})));
|
|
21419
|
-
};
|
|
21420
|
-
|
|
21421
|
-
var _path$1, _path2;
|
|
21422
|
-
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); }
|
|
21423
|
-
var SvgRedo = function SvgRedo(props) {
|
|
21424
|
-
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
21425
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
21426
|
-
width: 24,
|
|
21427
|
-
height: 24,
|
|
21428
|
-
fill: "none"
|
|
21429
|
-
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
21430
|
-
stroke: "currentColor",
|
|
21431
|
-
strokeLinecap: "round",
|
|
21432
|
-
strokeLinejoin: "round",
|
|
21433
|
-
strokeWidth: 2,
|
|
21434
|
-
d: "M19.672 7.821H9.165a5.581 5.581 0 1 0 0 11.163h5.27"
|
|
21435
|
-
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
21436
|
-
stroke: "currentColor",
|
|
21437
|
-
strokeLinecap: "round",
|
|
21438
|
-
strokeLinejoin: "round",
|
|
21439
|
-
strokeWidth: 2,
|
|
21440
|
-
d: "m16.708 3.607 4.389 4.215-4.39 4.315"
|
|
21441
|
-
})));
|
|
21442
|
-
};
|
|
21443
|
-
|
|
21444
|
-
const HandleElementInfo = () => {
|
|
21445
|
-
const { svgElementDatas } = useSvgEditContext();
|
|
21446
|
-
const { checkDoodle } = useCheckElement();
|
|
21447
|
-
const { undo, redo } = useHistoryHandle();
|
|
21448
|
-
const { editMapInfo, setEditMapInfo, onHandleStopRecord, onHandleCompleteRecord, onHandleDeleteElement, onUpdateBoundary, } = useMapEditContext();
|
|
21449
|
-
const currentType = useMemo(() => {
|
|
21450
|
-
return DATE_TYPE_MAP.find((item) => item.type === editMapInfo.elementType);
|
|
21451
|
-
}, [editMapInfo.elementType]);
|
|
21452
|
-
const isUndoDisabled = useMemo(() => {
|
|
21453
|
-
if (editMapInfo?.elementType === DataType.OBSTACLE &&
|
|
21454
|
-
editMapInfo?.createMode === CreateStatus.CREATING) {
|
|
21455
|
-
return !(editMapInfo?.currentHistoryIndex > 0 && editMapInfo?.historyList?.length);
|
|
21456
|
-
}
|
|
21457
|
-
else {
|
|
21458
|
-
return !(editMapInfo?.currentHistoryIndex > 0 && editMapInfo?.historyList?.length);
|
|
21459
|
-
}
|
|
21460
|
-
}, [
|
|
21461
|
-
editMapInfo?.currentHistoryIndex,
|
|
21462
|
-
editMapInfo?.historyList,
|
|
21463
|
-
editMapInfo?.createMode,
|
|
21464
|
-
editMapInfo?.elementType,
|
|
21465
|
-
]);
|
|
21466
|
-
const idRedoDisabled = useMemo(() => {
|
|
21467
|
-
return !(editMapInfo?.currentHistoryIndex < editMapInfo?.historyList?.length - 1 &&
|
|
21468
|
-
editMapInfo?.historyList?.length);
|
|
21469
|
-
}, [editMapInfo?.currentHistoryIndex, editMapInfo?.historyList]);
|
|
21470
|
-
const handleUndo = useCallback((e) => {
|
|
21471
|
-
e.stopPropagation();
|
|
21472
|
-
e.preventDefault();
|
|
21473
|
-
if (isUndoDisabled)
|
|
21474
|
-
return;
|
|
21475
|
-
undo();
|
|
21476
|
-
}, [undo, isUndoDisabled]);
|
|
21477
|
-
const handleRedo = useCallback((e) => {
|
|
21478
|
-
e.stopPropagation();
|
|
21479
|
-
e.preventDefault();
|
|
21480
|
-
if (idRedoDisabled)
|
|
21481
|
-
return;
|
|
21482
|
-
redo();
|
|
21483
|
-
}, [redo, idRedoDisabled]);
|
|
21484
|
-
const renderElementData = useCallback((element) => {
|
|
21485
|
-
if (!editMapInfo.selectElement)
|
|
21486
|
-
return null;
|
|
21487
|
-
const data = {
|
|
21488
|
-
doodle: undefined,
|
|
21489
|
-
visionOffAreas: undefined,
|
|
21490
|
-
obstacle: undefined,
|
|
21491
|
-
boundary: undefined,
|
|
21492
|
-
};
|
|
21493
|
-
if (element?.type === DataType.DOODLE) {
|
|
21494
|
-
const doodleData = {
|
|
21495
|
-
center: element.center,
|
|
21496
|
-
direction: element.direction,
|
|
21497
|
-
scale: element.scale,
|
|
21498
|
-
svg: element.svg,
|
|
21499
|
-
expiration_ts: element.expiration_ts,
|
|
21500
|
-
create_ts: element.create_ts,
|
|
21501
|
-
};
|
|
21502
|
-
if (element?.id) {
|
|
21503
|
-
doodleData.id = element?.id;
|
|
21504
|
-
}
|
|
21505
|
-
data.doodle = JSON.stringify([doodleData]);
|
|
21506
|
-
}
|
|
21507
|
-
if (element?.type === DataType.VISION_OFF) {
|
|
21508
|
-
const visionOffArea = svgElementDatas?.[DataType.VISION_OFF]
|
|
21509
|
-
?.filter((item) => item.id !== element.id)
|
|
21510
|
-
?.map((item) => ({
|
|
21511
|
-
id: item.id,
|
|
21512
|
-
points: restorePointsFormat(item.points),
|
|
21513
|
-
})) || [];
|
|
21514
|
-
const visionOffAreaData = [
|
|
21515
|
-
...visionOffArea,
|
|
21516
|
-
{
|
|
21517
|
-
id: element?.id,
|
|
21518
|
-
points: restorePointsFormat(element.points),
|
|
21519
|
-
},
|
|
21520
|
-
]?.map((item) => {
|
|
21521
|
-
if (item?.id) {
|
|
21522
|
-
return {
|
|
21523
|
-
id: item.id,
|
|
21524
|
-
points: item.points,
|
|
21525
|
-
};
|
|
21526
|
-
}
|
|
21527
|
-
return {
|
|
21528
|
-
points: item.points,
|
|
21529
|
-
};
|
|
21530
|
-
}) || [];
|
|
21531
|
-
data.visionOffAreas = JSON.stringify(visionOffAreaData);
|
|
21532
|
-
}
|
|
21533
|
-
if (element?.type === DataType.OBSTACLE) {
|
|
21534
|
-
data.obstacle = {
|
|
21535
|
-
name: element?.name,
|
|
21536
|
-
status: element?.status ?? 1,
|
|
21537
|
-
end_timestamp: element?.end_timestamp,
|
|
21538
|
-
start_timestamp: element?.start_timestamp,
|
|
21539
|
-
points: restorePointsFormat(element.points),
|
|
21540
|
-
};
|
|
21541
|
-
if (element?.id) {
|
|
21542
|
-
data.obstacle.id = element?.id;
|
|
21543
|
-
}
|
|
21544
|
-
}
|
|
21545
|
-
if (element?.type === DataType.BOUNDARY) {
|
|
21546
|
-
data.boundary = {
|
|
21547
|
-
cuttingHeight: element?.cuttingHeight,
|
|
21548
|
-
isFlowGlobal: element?.isFlowGlobal,
|
|
21549
|
-
angle: element?.angle,
|
|
21550
|
-
direction: element?.direction,
|
|
21551
|
-
name: element?.name,
|
|
21552
|
-
edgeMowing: element?.edgeMowing,
|
|
21553
|
-
edgeVision: element?.edgeVision,
|
|
21554
|
-
obstacleMowEdge: element?.obstacleMowEdge,
|
|
21555
|
-
};
|
|
21556
|
-
if (element?.id) {
|
|
21557
|
-
data.boundary.id = element?.id;
|
|
21558
|
-
}
|
|
21559
|
-
}
|
|
21560
|
-
return data;
|
|
21561
|
-
}, [editMapInfo.selectElement]);
|
|
21562
|
-
const handleSave = useCallback(() => {
|
|
21563
|
-
const params = renderElementData(editMapInfo?.selectElement);
|
|
21564
|
-
const isObstacle = editMapInfo?.selectElement?.type === DataType.OBSTACLE;
|
|
21565
|
-
const hasNotEnoughPoints = params?.obstacle?.points?.length < 3;
|
|
21566
|
-
const isDoodle = editMapInfo?.selectElement?.type === DataType.DOODLE;
|
|
21567
|
-
const doodleResult = checkDoodle();
|
|
21568
|
-
if (isDoodle && !doodleResult?.isValid) {
|
|
21569
|
-
message.error('Keep more distance from boundaries, off-limit island and other doodles');
|
|
21570
|
-
return;
|
|
21571
|
-
}
|
|
21572
|
-
if (isObstacle && hasNotEnoughPoints) {
|
|
21573
|
-
message.error('Save failed, please draw a closed shape');
|
|
21574
|
-
return;
|
|
21575
|
-
}
|
|
21576
|
-
console.log('save->', editMapInfo, params);
|
|
21577
|
-
if (editMapInfo?.selectElement?.type === DataType.BOUNDARY) {
|
|
21578
|
-
onUpdateBoundary?.(params)?.then(() => {
|
|
21579
|
-
setEditMapInfo({
|
|
21580
|
-
...editMapInfo,
|
|
21581
|
-
createMode: null,
|
|
21582
|
-
elementType: null,
|
|
21583
|
-
selectElement: null,
|
|
21584
|
-
isShowDrag: false,
|
|
21585
|
-
});
|
|
21586
|
-
}, (errorText) => {
|
|
21587
|
-
message.error('Save failed, please try again');
|
|
21588
|
-
});
|
|
21589
|
-
}
|
|
21590
|
-
else {
|
|
21591
|
-
onHandleCompleteRecord?.(params)?.then(() => {
|
|
21592
|
-
setEditMapInfo({
|
|
21593
|
-
...editMapInfo,
|
|
21594
|
-
createMode: null,
|
|
21595
|
-
elementType: null,
|
|
21596
|
-
selectElement: null,
|
|
21597
|
-
isShowDrag: false,
|
|
21598
|
-
});
|
|
21599
|
-
}, (errorText) => {
|
|
21600
|
-
message.error('Save failed, please try again');
|
|
21601
|
-
});
|
|
21602
|
-
}
|
|
21603
|
-
}, [editMapInfo.selectElement, onUpdateBoundary, onHandleCompleteRecord]);
|
|
21604
|
-
const handleCancel = useCallback(() => {
|
|
21605
|
-
const name = DATE_TYPE_MAP.find((item) => item.type === editMapInfo.elementType)?.label;
|
|
21606
|
-
Modal.confirm({
|
|
21607
|
-
icon: null,
|
|
21608
|
-
centered: true,
|
|
21609
|
-
title: 'Quit editing',
|
|
21610
|
-
content: `Changes you made will not be saved. Are you sure you want to quit editing the ${name}?`,
|
|
21611
|
-
okText: 'Quit',
|
|
21612
|
-
cancelText: 'Keep editing',
|
|
21613
|
-
onOk: () => {
|
|
21614
|
-
onHandleStopRecord?.()?.then(() => {
|
|
21615
|
-
setEditMapInfo({
|
|
21616
|
-
...editMapInfo,
|
|
21617
|
-
createMode: null,
|
|
21618
|
-
elementType: null,
|
|
21619
|
-
selectElement: null,
|
|
21620
|
-
isShowDrag: false,
|
|
21621
|
-
});
|
|
21622
|
-
});
|
|
21623
|
-
},
|
|
21624
|
-
});
|
|
21625
|
-
}, [editMapInfo]);
|
|
21626
|
-
const handleDelete = useCallback(() => {
|
|
21627
|
-
console.log('handleDelete 1->', editMapInfo);
|
|
21628
|
-
Modal.confirm({
|
|
21629
|
-
icon: null,
|
|
21630
|
-
title: 'Delete',
|
|
21631
|
-
content: 'Are you sure you want to delete this element?',
|
|
21632
|
-
okText: 'Delete',
|
|
21633
|
-
cancelText: 'Cancel',
|
|
21634
|
-
onOk: () => {
|
|
21635
|
-
onHandleStopRecord?.()?.then(() => {
|
|
21636
|
-
console.log('handleDelete 2->', editMapInfo, onHandleDeleteElement);
|
|
21637
|
-
if (editMapInfo?.selectElement?.id) {
|
|
21638
|
-
onHandleDeleteElement?.({
|
|
21639
|
-
id: editMapInfo.selectElement?.id,
|
|
21640
|
-
type: editMapInfo.elementType,
|
|
21641
|
-
})?.then(() => {
|
|
21642
|
-
setEditMapInfo({
|
|
21643
|
-
...editMapInfo,
|
|
21644
|
-
createMode: null,
|
|
21645
|
-
elementType: null,
|
|
21646
|
-
selectElement: null,
|
|
21647
|
-
isShowDrag: false,
|
|
21648
|
-
});
|
|
21649
|
-
}, (errorText) => {
|
|
21650
|
-
message.error('Save failed, please try again');
|
|
21651
|
-
});
|
|
21652
|
-
}
|
|
21653
|
-
else {
|
|
21654
|
-
setEditMapInfo({
|
|
21655
|
-
...editMapInfo,
|
|
21656
|
-
createMode: null,
|
|
21657
|
-
elementType: null,
|
|
21658
|
-
selectElement: null,
|
|
21659
|
-
isShowDrag: false,
|
|
21660
|
-
});
|
|
21661
|
-
}
|
|
21662
|
-
}, (errorText) => {
|
|
21663
|
-
message.error('Save failed, please try again');
|
|
21664
|
-
});
|
|
21665
|
-
},
|
|
21666
|
-
});
|
|
21667
|
-
}, [editMapInfo?.selectElement, onHandleDeleteElement, onHandleStopRecord]);
|
|
21668
|
-
if (!editMapInfo.selectElement)
|
|
21669
|
-
return null;
|
|
21670
|
-
console.log('handleElementInfo->', editMapInfo, currentType);
|
|
21671
|
-
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: () => {
|
|
21672
|
-
handleCancel();
|
|
21673
|
-
}, children: "Cancel" }), jsx(Button, { variant: "solid", color: "primary", onClick: handleSave, children: "Save" })] }) })] }));
|
|
21674
|
-
};
|
|
21675
|
-
|
|
21676
|
-
var _path;
|
|
21677
|
-
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); }
|
|
21678
|
-
var SvgMobileAddPoint = function SvgMobileAddPoint(props) {
|
|
21679
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
21680
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
21681
|
-
width: 36,
|
|
21682
|
-
height: 36,
|
|
21683
|
-
fill: "none"
|
|
21684
|
-
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
21685
|
-
stroke: "#fff",
|
|
21686
|
-
strokeLinecap: "round",
|
|
21687
|
-
strokeLinejoin: "round",
|
|
21688
|
-
strokeWidth: 3,
|
|
21689
|
-
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"
|
|
21690
|
-
})));
|
|
21691
|
-
};
|
|
21692
|
-
|
|
21693
|
-
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}";
|
|
21694
|
-
var styles = {"crosshair":"index-module_crosshair__etey6"};
|
|
21695
|
-
styleInject(css_248z);
|
|
21696
|
-
|
|
21697
|
-
/**
|
|
21698
|
-
* 十字准心组件
|
|
21699
|
-
* 相对于父容器居中显示
|
|
21700
|
-
*/
|
|
21701
|
-
const Crosshair = () => {
|
|
21702
|
-
const { platform } = useCommonContext();
|
|
21703
|
-
const { editMapInfo } = useMapEditContext();
|
|
21704
|
-
const isVisible = useMemo(() => {
|
|
21705
|
-
if (platform === PlatformType.H5 &&
|
|
21706
|
-
editMapInfo?.mobileMode === MobileEditMode.CREATE &&
|
|
21707
|
-
editMapInfo?.elementType === DataType.OBSTACLE) {
|
|
21708
|
-
return true;
|
|
21709
|
-
}
|
|
21710
|
-
return false;
|
|
21711
|
-
}, [platform, editMapInfo]);
|
|
21712
|
-
return isVisible ? (jsx("div", { className: styles.crosshair, children: jsx(SvgMobileAddPoint, {}) })) : null;
|
|
21713
|
-
};
|
|
21714
|
-
|
|
21715
|
-
// 验证GPS坐标是否有效
|
|
21716
|
-
const isValidGpsCoordinate = (coordinate) => {
|
|
21717
|
-
if (!coordinate || coordinate.length < 2)
|
|
21718
|
-
return false;
|
|
21719
|
-
const [lng, lat] = coordinate;
|
|
21720
|
-
// 检查是否为有效的GPS坐标范围,且不是原点(0,0)
|
|
21721
|
-
return (lng >= -180 &&
|
|
21722
|
-
lng <= 180 &&
|
|
21723
|
-
lat >= -90 &&
|
|
21724
|
-
lat <= 90 &&
|
|
21725
|
-
!(Math.abs(lng) < 0.001 && Math.abs(lat) < 0.001) // 排除接近(0,0)的坐标
|
|
21726
|
-
);
|
|
21727
|
-
};
|
|
21728
|
-
// 旋转坐标点
|
|
21729
|
-
const rotateCoordinate = (point, center, angleRadians) => {
|
|
21730
|
-
const [x, y] = point;
|
|
21731
|
-
const [cx, cy] = center;
|
|
21732
|
-
// 将点移动到原点
|
|
21733
|
-
const dx = x - cx;
|
|
21734
|
-
const dy = y - cy;
|
|
21735
|
-
// 应用旋转矩阵
|
|
21736
|
-
const cos = Math.cos(angleRadians);
|
|
21737
|
-
const sin = Math.sin(angleRadians);
|
|
21738
|
-
const rotatedX = dx * cos - dy * sin;
|
|
21739
|
-
const rotatedY = dx * sin + dy * cos;
|
|
21740
|
-
// 移回原位置
|
|
21741
|
-
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];
|
|
21742
20010
|
};
|
|
21743
20011
|
// 获取有效的GPS边界
|
|
21744
20012
|
const getValidGpsBounds = (mapData, rotation = 0) => {
|
|
@@ -21796,7 +20064,7 @@ const defaultMapConfig = DEFAULT_STYLES;
|
|
|
21796
20064
|
// 地图渲染器组件
|
|
21797
20065
|
const MowerMapRenderer = forwardRef(({ sn, platform = PlatformType.WEB, edger = false, unitType = UnitsType.Imperial, language = 'en', onlyRead = false, mapConfig,
|
|
21798
20066
|
// pathConfig,
|
|
21799
|
-
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) => {
|
|
21800
20068
|
const [currentError, setCurrentError] = useState(null);
|
|
21801
20069
|
const overlayRef = useRef(null);
|
|
21802
20070
|
// const mapRef = useMap();
|
|
@@ -21844,7 +20112,10 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
21844
20112
|
return {
|
|
21845
20113
|
minDistance,
|
|
21846
20114
|
editMapInfo,
|
|
21847
|
-
setEditMapInfo
|
|
20115
|
+
setEditMapInfo: (editMapInfo) => {
|
|
20116
|
+
setEditMapInfo(editMapInfo);
|
|
20117
|
+
onEditInfoMapChange?.(editMapInfo);
|
|
20118
|
+
},
|
|
21848
20119
|
onHandleEnterRecord,
|
|
21849
20120
|
onHandleCompleteRecord,
|
|
21850
20121
|
onHandleStopRecord,
|
|
@@ -21853,6 +20124,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
21853
20124
|
onHandleDeleteElement,
|
|
21854
20125
|
onUpdateBoundary,
|
|
21855
20126
|
onHandleEvent,
|
|
20127
|
+
onSelectElement,
|
|
21856
20128
|
};
|
|
21857
20129
|
}, [
|
|
21858
20130
|
minDistance,
|
|
@@ -21865,6 +20137,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
21865
20137
|
onSaveMap,
|
|
21866
20138
|
onUpdateBoundary,
|
|
21867
20139
|
onHandleEvent,
|
|
20140
|
+
onSelectElement,
|
|
21868
20141
|
]);
|
|
21869
20142
|
// 合并配置
|
|
21870
20143
|
const mergedMapConfig = useMemo(() => {
|
|
@@ -22258,6 +20531,10 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
22258
20531
|
addDoodle: (doodle) => svgEditMapRef.current?.addDoodle(doodle),
|
|
22259
20532
|
// 检查doodle
|
|
22260
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),
|
|
22261
20538
|
}));
|
|
22262
20539
|
/**
|
|
22263
20540
|
* 根据割草机的位置更新路径
|
|
@@ -22272,7 +20549,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
22272
20549
|
}
|
|
22273
20550
|
// console.log('mowerrender------->', svgViewBox);
|
|
22274
20551
|
// 使用goole maps自定义叠加层,返回debug信息(如果启用)
|
|
22275
|
-
return (jsx(CommonContextProvider, { value: commonValue, children: jsx(SvgEditContextProvider, { value: svgEditValue, children: jsxs(MapEditContextProvider, { value: mapEditValue, children: [platform !== PlatformType.H5 && (
|
|
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) => {
|
|
22276
20553
|
setOverlay(lay);
|
|
22277
20554
|
}, onDraw: (style) => {
|
|
22278
20555
|
const layout = Object.keys(style).reduce((pre, cur) => {
|
|
@@ -22290,4 +20567,66 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
22290
20567
|
});
|
|
22291
20568
|
MowerMapRenderer.displayName = 'MowerMapRenderer';
|
|
22292
20569
|
|
|
22293
|
-
|
|
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 };
|