@fleet-frontend/mower-maps 0.2.0-beta.3 → 0.2.0-beta.4
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/index.esm.js +505 -216
- package/dist/index.js +504 -215
- package/dist/src/context/common.d.ts +2 -0
- package/dist/src/context/common.d.ts.map +1 -1
- package/dist/src/context/mapEdit.d.ts +1 -1
- package/dist/src/context/mapEdit.d.ts.map +1 -1
- package/dist/src/processor/unified/BaseData.d.ts +3 -4
- package/dist/src/processor/unified/BaseData.d.ts.map +1 -1
- package/dist/src/processor/unified/UnifiedMapDataProcessor.d.ts.map +1 -1
- package/dist/src/render/MowerMapRenderer.d.ts.map +1 -1
- package/dist/src/render/layers/ObstacleLayer.d.ts +16 -0
- package/dist/src/render/layers/ObstacleLayer.d.ts.map +1 -1
- package/dist/src/render/svgEditMap/components/AddEntry/components/DoodleModal/index.d.ts.map +1 -1
- package/dist/src/render/svgEditMap/components/AddEntry/index.d.ts.map +1 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/boundary.d.ts.map +1 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/index.d.ts.map +1 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/index.d.ts.map +1 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/TimePeriod/index.d.ts +4 -4
- package/dist/src/render/svgEditMap/components/HandleElementInfo/components/TimePeriod/index.d.ts.map +1 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/doodle.d.ts.map +1 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/index.d.ts.map +1 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/obstacle.d.ts.map +1 -1
- package/dist/src/render/svgEditMap/components/HandleElementInfo/visionOff.d.ts.map +1 -1
- package/dist/src/render/svgEditMap/index.d.ts +8 -1
- package/dist/src/render/svgEditMap/index.d.ts.map +1 -1
- package/dist/src/render/svgElement/DoodleElement/index.d.ts.map +1 -1
- package/dist/src/render/svgElement/Mobile/CreateObstacleElement/index.d.ts +4 -1
- package/dist/src/render/svgElement/Mobile/CreateObstacleElement/index.d.ts.map +1 -1
- package/dist/src/render/svgElement/PolygonELement/index.d.ts.map +1 -1
- package/dist/src/render/svgElement/TransformWrapper/DoodleTransformWrapper/DoodleTransformWrapper.d.ts.map +1 -1
- package/dist/src/render/svgElement/TransformWrapper/VisionOffTransformWrapper/VisionOffTransformWrapper.d.ts.map +1 -1
- package/dist/src/types/renderer.d.ts +10 -2
- package/dist/src/types/renderer.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -210,14 +210,13 @@ class ChannelData extends BaseData {
|
|
|
210
210
|
* 障碍物数据类
|
|
211
211
|
*/
|
|
212
212
|
class ObstacleData extends BaseData {
|
|
213
|
-
constructor(originalData, level,
|
|
213
|
+
constructor(originalData, level, style) {
|
|
214
214
|
const convertedPoints = convertPointsFormat(originalData?.points) || [];
|
|
215
215
|
super(originalData?.id, DataType.OBSTACLE, level, RenderType.POLYGON, convertedPoints, originalData);
|
|
216
216
|
this.area = originalData?.area;
|
|
217
217
|
this.status = originalData?.status || 1;
|
|
218
|
-
this.
|
|
219
|
-
this.
|
|
220
|
-
this.isTimeLimit = isTimeLimit;
|
|
218
|
+
this.start_timestamp = originalData?.start_timestamp;
|
|
219
|
+
this.end_timestamp = originalData?.end_timestamp;
|
|
221
220
|
this.name = originalData?.name || 'Obstacle';
|
|
222
221
|
this.style = style;
|
|
223
222
|
}
|
|
@@ -349,8 +348,8 @@ function initDoodle() {
|
|
|
349
348
|
svg: '',
|
|
350
349
|
scale: 1,
|
|
351
350
|
direction: 0,
|
|
352
|
-
create_ts: Date.now(),
|
|
353
|
-
expiration_ts: Date.now() +
|
|
351
|
+
create_ts: Math.floor(Date.now() / 1000),
|
|
352
|
+
expiration_ts: Math.floor(Date.now() / 1000) + 3600 * 24 * 7, // 1小时后过期
|
|
354
353
|
type: 'TIME_LIMIT_OBSTACLE',
|
|
355
354
|
};
|
|
356
355
|
return new DoodleData(doodle, 100);
|
|
@@ -636,7 +635,7 @@ class UnifiedMapDataProcessor {
|
|
|
636
635
|
continue;
|
|
637
636
|
}
|
|
638
637
|
const obstacleData = new ObstacleData(element, 150, // 高层级
|
|
639
|
-
|
|
638
|
+
this.mapConfig.obstacle || {});
|
|
640
639
|
obstacleDataList.push(obstacleData);
|
|
641
640
|
}
|
|
642
641
|
catch (error) {
|
|
@@ -766,7 +765,7 @@ class UnifiedMapDataProcessor {
|
|
|
766
765
|
continue;
|
|
767
766
|
}
|
|
768
767
|
const obstacleData = new ObstacleData(element, 150, // 高层级
|
|
769
|
-
|
|
768
|
+
this.mapConfig.obstacle || {});
|
|
770
769
|
obstacleDataList.push(obstacleData);
|
|
771
770
|
}
|
|
772
771
|
}
|
|
@@ -8713,7 +8712,7 @@ function styleInject(css, ref) {
|
|
|
8713
8712
|
}
|
|
8714
8713
|
}
|
|
8715
8714
|
|
|
8716
|
-
var css_248z$i = ".index-module_edit__-5VvX {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n pointer-events: auto;\n z-index: 1000;\n cursor: move;\n touch-action: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n.index-module_edit__-5VvX .index-module_border__JdNLM {\n position: absolute;\n inset: -10px;\n border: 2px dashed rgb(241, 102, 41);\n border-radius: 2px;\n pointer-events: none;\n}\n.index-module_edit__-5VvX .index-module_drag__uvdPG {\n position: absolute;\n inset: -10px;\n border-radius: 2px;\n}\n.index-module_edit__-5VvX .index-module_rotate__H-KIZ {\n position: absolute;\n top: -20px;\n right: -20px;\n width: 20px;\n height: 20px;\n cursor: grab;\n z-index: 1001;\n pointer-events: auto;\n}\n.index-module_edit__-5VvX .index-module_move__mZF8s {\n position: absolute;\n bottom: -20px;\n left: -20px;\n width: 20px;\n height: 20px;\n cursor: move;\n z-index: 1001;\n pointer-events: auto;\n
|
|
8715
|
+
var css_248z$i = ".index-module_edit__-5VvX {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n pointer-events: auto;\n z-index: 1000;\n cursor: move;\n touch-action: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n.index-module_edit__-5VvX .index-module_border__JdNLM {\n position: absolute;\n inset: -10px;\n border: 2px dashed rgb(241, 102, 41);\n border-radius: 2px;\n pointer-events: none;\n}\n.index-module_edit__-5VvX .index-module_drag__uvdPG {\n position: absolute;\n inset: -10px;\n border-radius: 2px;\n}\n.index-module_edit__-5VvX .index-module_rotate__H-KIZ {\n position: absolute;\n top: -20px;\n right: -20px;\n width: 20px;\n height: 20px;\n cursor: grab;\n z-index: 1001;\n pointer-events: auto;\n}\n.index-module_edit__-5VvX .index-module_move__mZF8s {\n position: absolute;\n bottom: -20px;\n left: -20px;\n width: 20px;\n height: 20px;\n cursor: move;\n z-index: 1001;\n pointer-events: auto;\n}";
|
|
8717
8716
|
var styles$i = {"edit":"index-module_edit__-5VvX","border":"index-module_border__JdNLM","drag":"index-module_drag__uvdPG","rotate":"index-module_rotate__H-KIZ","move":"index-module_move__mZF8s"};
|
|
8718
8717
|
styleInject(css_248z$i);
|
|
8719
8718
|
|
|
@@ -8795,8 +8794,10 @@ const DragHandle = ({ onDragStart, isDragging }) => {
|
|
|
8795
8794
|
onDragStart(e);
|
|
8796
8795
|
}, onTouchStart: (e) => onDragStart(e), onMouseUp: (e) => {
|
|
8797
8796
|
console.log('drag up');
|
|
8798
|
-
onDragEnd(e);
|
|
8799
|
-
},
|
|
8797
|
+
// onDragEnd(e);
|
|
8798
|
+
},
|
|
8799
|
+
// onTouchEnd={(e) => onDragEnd(e)}
|
|
8800
|
+
style: { cursor: isDragging ? 'grabbing' : 'move' }, dangerouslySetInnerHTML: { __html: DEFAULT_DRAG_ICON } }));
|
|
8800
8801
|
};
|
|
8801
8802
|
|
|
8802
8803
|
const MapDrag = ({ map: _map, dragCallbacks, onBoundaryLabelsCollapse, onTransformChange, isDragMap = false, }) => {
|
|
@@ -12533,11 +12534,74 @@ class ObstacleLayer extends BaseLayer {
|
|
|
12533
12534
|
}
|
|
12534
12535
|
}
|
|
12535
12536
|
}
|
|
12537
|
+
/**
|
|
12538
|
+
* 将坐标点按type分组
|
|
12539
|
+
*/
|
|
12540
|
+
groupCoordinatesByType(coordinates) {
|
|
12541
|
+
const segments = [];
|
|
12542
|
+
let currentSegment = null;
|
|
12543
|
+
for (let i = 0; i < coordinates.length; i++) {
|
|
12544
|
+
const coord = coordinates[i];
|
|
12545
|
+
const type = coord[2] || 2; // 默认type为2
|
|
12546
|
+
if (!currentSegment || currentSegment.type !== type) {
|
|
12547
|
+
// 开始新的段
|
|
12548
|
+
if (currentSegment && currentSegment.points.length > 0) {
|
|
12549
|
+
// 为了连接线段,将当前点也加入上一段的结尾
|
|
12550
|
+
currentSegment.points.push(coord);
|
|
12551
|
+
}
|
|
12552
|
+
currentSegment = {
|
|
12553
|
+
type: type,
|
|
12554
|
+
points: [coord],
|
|
12555
|
+
};
|
|
12556
|
+
segments.push(currentSegment);
|
|
12557
|
+
}
|
|
12558
|
+
else {
|
|
12559
|
+
// 继续当前段
|
|
12560
|
+
currentSegment.points.push(coord);
|
|
12561
|
+
}
|
|
12562
|
+
}
|
|
12563
|
+
// 处理封闭边界:如果第一段和最后一段type相同,需要连接起来
|
|
12564
|
+
if (segments.length > 1 && segments[0].type === segments[segments.length - 1].type) {
|
|
12565
|
+
const firstSegment = segments[0];
|
|
12566
|
+
const lastSegment = segments[segments.length - 1];
|
|
12567
|
+
// 将第一个点添加到最后一段,形成封闭
|
|
12568
|
+
lastSegment.points.push(firstSegment.points[0]);
|
|
12569
|
+
}
|
|
12570
|
+
else if (segments.length === 1) {
|
|
12571
|
+
// 只有一段的情况,添加第一个点到末尾形成封闭
|
|
12572
|
+
segments[0].points.push(coordinates[0]);
|
|
12573
|
+
}
|
|
12574
|
+
return segments;
|
|
12575
|
+
}
|
|
12536
12576
|
/**
|
|
12537
12577
|
* 渲染障碍物元素
|
|
12538
12578
|
*/
|
|
12539
12579
|
renderObstacle(svgGroup, element) {
|
|
12540
|
-
const { coordinates, style } = element;
|
|
12580
|
+
const { coordinates, style, originalData } = element;
|
|
12581
|
+
const { status, start_timestamp, end_timestamp } = originalData || {};
|
|
12582
|
+
if (coordinates.length < 2 || status === 0) {
|
|
12583
|
+
return;
|
|
12584
|
+
}
|
|
12585
|
+
if (status === 1 &&
|
|
12586
|
+
(start_timestamp > Date.now() / 1000 || end_timestamp < Date.now() / 1000)) {
|
|
12587
|
+
return;
|
|
12588
|
+
}
|
|
12589
|
+
// 1. 先遍历所有的coordinates,把所有点分为若干段的path
|
|
12590
|
+
const pathSegments = this.groupCoordinatesByType(coordinates);
|
|
12591
|
+
// 2&3. 根据type处理每个path段
|
|
12592
|
+
pathSegments.forEach((segment) => {
|
|
12593
|
+
if (segment.points.length < 2)
|
|
12594
|
+
return;
|
|
12595
|
+
if (segment.type === 2) {
|
|
12596
|
+
// type=2: 直接添加到svgGroup中
|
|
12597
|
+
this.createDirectPath(svgGroup, segment.points, style);
|
|
12598
|
+
}
|
|
12599
|
+
else if (segment.type === 1) {
|
|
12600
|
+
// type=1: 使用PathMeasure逻辑生成平行路径
|
|
12601
|
+
// this.createDirectPath(svgGroup, segment.points, style);
|
|
12602
|
+
this.createParallelPathsWithMeasure(svgGroup, segment.points, style);
|
|
12603
|
+
}
|
|
12604
|
+
});
|
|
12541
12605
|
if (coordinates.length < 3)
|
|
12542
12606
|
return;
|
|
12543
12607
|
const polygon = document.createElementNS('http://www.w3.org/2000/svg', 'polygon');
|
|
@@ -12545,7 +12609,7 @@ class ObstacleLayer extends BaseLayer {
|
|
|
12545
12609
|
const points = coordinates.map((coord) => `${coord[0]},${coord[1]}`).join(' ');
|
|
12546
12610
|
polygon.setAttribute('points', points);
|
|
12547
12611
|
polygon.setAttribute('fill', style.fillColor || 'rgba(220, 53, 69, 0.2)');
|
|
12548
|
-
polygon.setAttribute('stroke',
|
|
12612
|
+
polygon.setAttribute('stroke', 'transparent');
|
|
12549
12613
|
// 确保最小线条宽度
|
|
12550
12614
|
const lineWidth = Math.max(style.lineWidth || 2, 0.5);
|
|
12551
12615
|
polygon.setAttribute('stroke-width', lineWidth.toString());
|
|
@@ -12556,6 +12620,113 @@ class ObstacleLayer extends BaseLayer {
|
|
|
12556
12620
|
polygon.classList.add('vector-obstacle');
|
|
12557
12621
|
svgGroup.appendChild(polygon);
|
|
12558
12622
|
}
|
|
12623
|
+
/**
|
|
12624
|
+
* 创建直接路径(type=2)
|
|
12625
|
+
*/
|
|
12626
|
+
createDirectPath(svgGroup, points, style) {
|
|
12627
|
+
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
12628
|
+
const strokeColor = style.lineColor;
|
|
12629
|
+
// 构建路径数据
|
|
12630
|
+
let pathData = '';
|
|
12631
|
+
for (let i = 0; i < points.length; i++) {
|
|
12632
|
+
const [x, y] = points[i];
|
|
12633
|
+
if (i === 0) {
|
|
12634
|
+
pathData += `M ${x} ${y}`;
|
|
12635
|
+
}
|
|
12636
|
+
else {
|
|
12637
|
+
pathData += ` L ${x} ${y}`;
|
|
12638
|
+
}
|
|
12639
|
+
}
|
|
12640
|
+
path.setAttribute('d', pathData);
|
|
12641
|
+
path.setAttribute('stroke', strokeColor);
|
|
12642
|
+
path.setAttribute('fill', 'none');
|
|
12643
|
+
// 确保最小线条宽度
|
|
12644
|
+
const lineWidth = dp2px(style.lineWidth || 3);
|
|
12645
|
+
path.setAttribute('stroke-width', lineWidth.toString());
|
|
12646
|
+
path.setAttribute('stroke-linecap', 'round');
|
|
12647
|
+
path.setAttribute('stroke-linejoin', 'round');
|
|
12648
|
+
path.setAttribute('opacity', (style.opacity || 1).toString());
|
|
12649
|
+
path.setAttribute('vector-effect', 'non-scaling-stroke');
|
|
12650
|
+
path.classList.add('vector-obstacle');
|
|
12651
|
+
svgGroup.appendChild(path);
|
|
12652
|
+
}
|
|
12653
|
+
/**
|
|
12654
|
+
* 使用PathMeasure逻辑创建平行路径(type=1)
|
|
12655
|
+
*/
|
|
12656
|
+
createParallelPathsWithMeasure(svgGroup, points, style) {
|
|
12657
|
+
const strokeColor = style.lineColor;
|
|
12658
|
+
const lineWidth = dp2px(style.lineWidth || 3);
|
|
12659
|
+
// 获取当前SVG的缩放级别,计算固定屏幕像素间距
|
|
12660
|
+
const fixedScreenDistance = lineWidth; // 固定的屏幕像素距离
|
|
12661
|
+
const offsetDistance = fixedScreenDistance; // 转换为SVG坐标系距离
|
|
12662
|
+
// 直接对每个线段生成平行直线段
|
|
12663
|
+
const parallelPaths = this.generateStraightParallelPaths(points, offsetDistance);
|
|
12664
|
+
// 渲染两条平行虚线
|
|
12665
|
+
parallelPaths.forEach((pathData, index) => {
|
|
12666
|
+
if (!pathData)
|
|
12667
|
+
return;
|
|
12668
|
+
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
12669
|
+
path.setAttribute('d', pathData);
|
|
12670
|
+
path.setAttribute('fill', 'none');
|
|
12671
|
+
path.setAttribute('stroke', strokeColor);
|
|
12672
|
+
path.setAttribute('stroke-width', lineWidth.toString());
|
|
12673
|
+
path.setAttribute('stroke-linecap', 'round');
|
|
12674
|
+
path.setAttribute('stroke-linejoin', 'round');
|
|
12675
|
+
path.setAttribute('opacity', (style.opacity || 1).toString());
|
|
12676
|
+
// 使用CSS样式设置虚线,避免随SVG缩放变化
|
|
12677
|
+
// 或者可以根据当前缩放级别动态计算dash array
|
|
12678
|
+
path.style.strokeDasharray = `${lineWidth}px ${lineWidth * 2}px`;
|
|
12679
|
+
path.classList.add(`vector-boundary-parallel-${index + 1}`);
|
|
12680
|
+
svgGroup.appendChild(path);
|
|
12681
|
+
});
|
|
12682
|
+
}
|
|
12683
|
+
/**
|
|
12684
|
+
* 生成直线平行路径(每个线段分别处理)
|
|
12685
|
+
*/
|
|
12686
|
+
generateStraightParallelPaths(points, offsetDistance) {
|
|
12687
|
+
if (points.length < 2)
|
|
12688
|
+
return ['', ''];
|
|
12689
|
+
let parallelPath1Data = '';
|
|
12690
|
+
let parallelPath2Data = '';
|
|
12691
|
+
// 对每个线段分别计算平行线
|
|
12692
|
+
for (let i = 0; i < points.length - 1; i++) {
|
|
12693
|
+
const startPoint = points[i];
|
|
12694
|
+
const endPoint = points[i + 1];
|
|
12695
|
+
// 计算线段的方向向量
|
|
12696
|
+
const dx = endPoint[0] - startPoint[0];
|
|
12697
|
+
const dy = endPoint[1] - startPoint[1];
|
|
12698
|
+
const length = Math.sqrt(dx * dx + dy * dy);
|
|
12699
|
+
if (length === 0)
|
|
12700
|
+
continue; // 跳过零长度线段
|
|
12701
|
+
// 标准化方向向量
|
|
12702
|
+
const unitX = dx / length;
|
|
12703
|
+
const unitY = dy / length;
|
|
12704
|
+
// 计算垂直向量
|
|
12705
|
+
const perpendicularX = -unitY;
|
|
12706
|
+
const perpendicularY = unitX;
|
|
12707
|
+
// 计算平行线的起点和终点
|
|
12708
|
+
const start1X = startPoint[0] + perpendicularX * offsetDistance;
|
|
12709
|
+
const start1Y = startPoint[1] + perpendicularY * offsetDistance;
|
|
12710
|
+
const end1X = endPoint[0] + perpendicularX * offsetDistance;
|
|
12711
|
+
const end1Y = endPoint[1] + perpendicularY * offsetDistance;
|
|
12712
|
+
const start2X = startPoint[0] - perpendicularX * offsetDistance;
|
|
12713
|
+
const start2Y = startPoint[1] - perpendicularY * offsetDistance;
|
|
12714
|
+
const end2X = endPoint[0] - perpendicularX * offsetDistance;
|
|
12715
|
+
const end2Y = endPoint[1] - perpendicularY * offsetDistance;
|
|
12716
|
+
// 构建路径数据
|
|
12717
|
+
if (i === 0) {
|
|
12718
|
+
parallelPath1Data = `M ${start1X} ${start1Y}`;
|
|
12719
|
+
parallelPath2Data = `M ${start2X} ${start2Y}`;
|
|
12720
|
+
}
|
|
12721
|
+
else {
|
|
12722
|
+
parallelPath1Data += ` M ${start1X} ${start1Y}`;
|
|
12723
|
+
parallelPath2Data += ` M ${start2X} ${start2Y}`;
|
|
12724
|
+
}
|
|
12725
|
+
parallelPath1Data += ` L ${end1X} ${end1Y}`;
|
|
12726
|
+
parallelPath2Data += ` L ${end2X} ${end2Y}`;
|
|
12727
|
+
}
|
|
12728
|
+
return [parallelPath2Data, parallelPath1Data];
|
|
12729
|
+
}
|
|
12559
12730
|
}
|
|
12560
12731
|
|
|
12561
12732
|
var chargingPileImage = "data:image/png;base64,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";
|
|
@@ -15038,15 +15209,15 @@ const VertexElement = React.memo(({ r, stroke, ...props }) => {
|
|
|
15038
15209
|
return (jsxRuntime.jsx("circle", { r: radius * overlayScale, stroke: stroke || '#fff', fill: '#fff', strokeWidth: 2 * overlayScale, ...props }));
|
|
15039
15210
|
});
|
|
15040
15211
|
|
|
15041
|
-
var _path$
|
|
15042
|
-
function _extends$
|
|
15212
|
+
var _path$b;
|
|
15213
|
+
function _extends$j() { return _extends$j = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$j.apply(null, arguments); }
|
|
15043
15214
|
var SvgDelete$1 = function SvgDelete(props) {
|
|
15044
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
15215
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
|
|
15045
15216
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15046
15217
|
width: 16,
|
|
15047
15218
|
height: 16,
|
|
15048
15219
|
fill: "none"
|
|
15049
|
-
}, props), _path$
|
|
15220
|
+
}, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
|
|
15050
15221
|
fill: "#FD494D",
|
|
15051
15222
|
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"
|
|
15052
15223
|
})));
|
|
@@ -15219,6 +15390,7 @@ var MobileEditMode;
|
|
|
15219
15390
|
})(MobileEditMode || (MobileEditMode = {}));
|
|
15220
15391
|
var ClickEventType;
|
|
15221
15392
|
(function (ClickEventType) {
|
|
15393
|
+
// 点击doodle的active time的时候触发
|
|
15222
15394
|
ClickEventType["DOODLE_ACTIVE_TIME"] = "doodleActiveTime";
|
|
15223
15395
|
})(ClickEventType || (ClickEventType = {}));
|
|
15224
15396
|
const INIT_EDIT_MAP_INFO = {
|
|
@@ -15581,7 +15753,7 @@ const useCheckElement = () => {
|
|
|
15581
15753
|
return { isValid: true };
|
|
15582
15754
|
}, [editMapInfo, svgElementDatas, minDistance]);
|
|
15583
15755
|
const checkCanNotCreateAtPosition = React.useCallback((checkPoint) => {
|
|
15584
|
-
|
|
15756
|
+
console.log('editMapInfo.elementType--->', editMapInfo.elementType);
|
|
15585
15757
|
if (!editMapInfo.elementType)
|
|
15586
15758
|
return false;
|
|
15587
15759
|
const points = editMapInfo?.selectElement?.points || [];
|
|
@@ -15971,17 +16143,13 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
|
|
|
15971
16143
|
console.log('handleMouseUp', JSON.stringify(dragState));
|
|
15972
16144
|
if (dragState.isDragging && dragState.currentPosition) {
|
|
15973
16145
|
// 构建新的坐标数组
|
|
15974
|
-
const newCoordinates =
|
|
15975
|
-
? [...coordinates]
|
|
15976
|
-
: [...coordinates].reverse();
|
|
16146
|
+
const newCoordinates = [...coordinates];
|
|
15977
16147
|
// 如果是新创建的顶点,需要确保它已经被插入
|
|
15978
16148
|
if (dragState.dragType === 'new' && dragState.newVertexIndex !== -1) {
|
|
15979
16149
|
if (showNotCreateCursor) ;
|
|
15980
16150
|
else {
|
|
15981
16151
|
// mouseUp 时才真正插入新顶点
|
|
15982
16152
|
newCoordinates.splice(dragState.newVertexIndex, 0, dragState.currentPosition);
|
|
15983
|
-
// 通知外部坐标变化
|
|
15984
|
-
onCoordinatesChange?.(newCoordinates);
|
|
15985
16153
|
}
|
|
15986
16154
|
}
|
|
15987
16155
|
else {
|
|
@@ -15992,9 +16160,11 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
|
|
|
15992
16160
|
else {
|
|
15993
16161
|
newCoordinates[dragState.dragIndex] = dragState.currentPosition;
|
|
15994
16162
|
}
|
|
15995
|
-
// 通知外部坐标变化
|
|
15996
|
-
onCoordinatesChange?.(newCoordinates);
|
|
15997
16163
|
}
|
|
16164
|
+
const result = editMapInfo?.createMode === CreateStatus.CREATING
|
|
16165
|
+
? newCoordinates
|
|
16166
|
+
: newCoordinates.reverse();
|
|
16167
|
+
onCoordinatesChange?.(result);
|
|
15998
16168
|
}
|
|
15999
16169
|
setDragState({
|
|
16000
16170
|
isDragging: false,
|
|
@@ -16087,7 +16257,6 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
|
|
|
16087
16257
|
const ghostFirstMidpoint = createMode && mousePos && !completed && renderCoordinates.length >= 1
|
|
16088
16258
|
? calculateMidpoint(renderCoordinates[0], [mousePos.x, mousePos.y])
|
|
16089
16259
|
: null;
|
|
16090
|
-
console.log('ghostFirstMidpoint', ghostFirstMidpoint, ghostFirstDistance);
|
|
16091
16260
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(editMode || (createMode && completed)) &&
|
|
16092
16261
|
dragState.isDragging &&
|
|
16093
16262
|
dragState.dragType !== 'new' &&
|
|
@@ -16211,7 +16380,8 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
|
|
|
16211
16380
|
if (onVertexDelete &&
|
|
16212
16381
|
(editMode || (createMode && completed)) &&
|
|
16213
16382
|
coordinates.length > 3) {
|
|
16214
|
-
|
|
16383
|
+
// 当前是逆时针展示的,但是外部数据是顺时针的,所以idx需要转换一下
|
|
16384
|
+
onVertexDelete(renderCoordinates?.length - 1 - idx);
|
|
16215
16385
|
}
|
|
16216
16386
|
setTooltipIndex(null);
|
|
16217
16387
|
}, style: { cursor: 'pointer' }, children: [jsxRuntime.jsx("rect", { x: 0, y: -24, width: 20, height: 20, rx: 2, ry: 2, fill: "#fff", strokeWidth: 1, filter: "url(#vertex-tooltip-shadow)" }), jsxRuntime.jsx("g", { transform: `translate(2, -22)`, children: jsxRuntime.jsx(SvgDelete$1, {}) })] })), canComplete && (jsxRuntime.jsx("g", { style: { pointerEvents: 'none' }, transform: `translate(${coord[0] - 5 * overlayScale * 3}, ${coord[1] - 2.5 * overlayScale * 3}) scale(${overlayScale * 3})`, children: jsxRuntime.jsx("svg", { width: "10", height: "5", viewBox: "0 0 6 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.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" }) }) })
|
|
@@ -16903,9 +17073,9 @@ const useVisionOffTransform = (data, scaleConstraints
|
|
|
16903
17073
|
};
|
|
16904
17074
|
|
|
16905
17075
|
var _g$7, _defs$7;
|
|
16906
|
-
function _extends$
|
|
17076
|
+
function _extends$i() { return _extends$i = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$i.apply(null, arguments); }
|
|
16907
17077
|
var SvgTransformDelete = function SvgTransformDelete(props) {
|
|
16908
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
17078
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
|
|
16909
17079
|
xmlns: "http://www.w3.org/2000/svg",
|
|
16910
17080
|
width: 20,
|
|
16911
17081
|
height: 20,
|
|
@@ -16954,9 +17124,9 @@ var SvgTransformDelete = function SvgTransformDelete(props) {
|
|
|
16954
17124
|
};
|
|
16955
17125
|
|
|
16956
17126
|
var _g$6, _defs$6;
|
|
16957
|
-
function _extends$
|
|
17127
|
+
function _extends$h() { return _extends$h = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$h.apply(null, arguments); }
|
|
16958
17128
|
var SvgTransformRotate = function SvgTransformRotate(props) {
|
|
16959
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
17129
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
|
|
16960
17130
|
xmlns: "http://www.w3.org/2000/svg",
|
|
16961
17131
|
width: 21,
|
|
16962
17132
|
height: 20,
|
|
@@ -16990,9 +17160,9 @@ var SvgTransformRotate = function SvgTransformRotate(props) {
|
|
|
16990
17160
|
};
|
|
16991
17161
|
|
|
16992
17162
|
var _g$5, _defs$5;
|
|
16993
|
-
function _extends$
|
|
17163
|
+
function _extends$g() { return _extends$g = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$g.apply(null, arguments); }
|
|
16994
17164
|
var SvgTransformScale = function SvgTransformScale(props) {
|
|
16995
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
17165
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
|
|
16996
17166
|
xmlns: "http://www.w3.org/2000/svg",
|
|
16997
17167
|
width: 21,
|
|
16998
17168
|
height: 20,
|
|
@@ -17026,9 +17196,9 @@ var SvgTransformScale = function SvgTransformScale(props) {
|
|
|
17026
17196
|
};
|
|
17027
17197
|
|
|
17028
17198
|
var _g$4, _defs$4;
|
|
17029
|
-
function _extends$
|
|
17199
|
+
function _extends$f() { return _extends$f = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$f.apply(null, arguments); }
|
|
17030
17200
|
var SvgTransformTranslate = function SvgTransformTranslate(props) {
|
|
17031
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
17201
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
|
|
17032
17202
|
xmlns: "http://www.w3.org/2000/svg",
|
|
17033
17203
|
width: 20,
|
|
17034
17204
|
height: 20,
|
|
@@ -17206,8 +17376,8 @@ const VisionOffTransformWrapper = ({ data, isSelected = false, onSelect, onCance
|
|
|
17206
17376
|
const centerX = (minX + maxX) / 2;
|
|
17207
17377
|
// 计算尺寸显示框的位置(选择框下方)
|
|
17208
17378
|
const infoBoxY = maxY + 20; // 选择框下方20像素
|
|
17209
|
-
const infoBoxWidth = 140; // 信息框宽度
|
|
17210
|
-
const infoBoxHeight = 30; // 信息框高度
|
|
17379
|
+
const infoBoxWidth = 140 * overlayScale; // 信息框宽度
|
|
17380
|
+
const infoBoxHeight = 30 * overlayScale; // 信息框高度
|
|
17211
17381
|
const infoBoxX = centerX - infoBoxWidth / 2; // 居中对齐
|
|
17212
17382
|
const scale = (isWeb ? 2 : 1) * overlayScale;
|
|
17213
17383
|
const offsetLeft = 10 * scale;
|
|
@@ -17261,6 +17431,7 @@ const VisionOffTransformWrapper = ({ data, isSelected = false, onSelect, onCance
|
|
|
17261
17431
|
fontSize: '12px',
|
|
17262
17432
|
color: 'white',
|
|
17263
17433
|
fontWeight: '400',
|
|
17434
|
+
// transform: `translate(0, ${50 * overlayScale}px) scale(${overlayScale})`,
|
|
17264
17435
|
}, children: [dimensions.height, "m \u00D7 ", dimensions.width, "m"] }) }))] }));
|
|
17265
17436
|
})()] }));
|
|
17266
17437
|
};
|
|
@@ -17684,8 +17855,8 @@ const useDoodleTransform = (data, onTransformChange, options) => {
|
|
|
17684
17855
|
const scaledHeight = height * currentScale;
|
|
17685
17856
|
// 转换为米单位(假设SVG坐标单位是米)
|
|
17686
17857
|
// 这里可以根据实际的地图比例尺进行调整
|
|
17687
|
-
const widthInMeters = scaledWidth;
|
|
17688
|
-
const heightInMeters = scaledHeight;
|
|
17858
|
+
const widthInMeters = scaledWidth / SCALE_FACTOR;
|
|
17859
|
+
const heightInMeters = scaledHeight / SCALE_FACTOR;
|
|
17689
17860
|
return {
|
|
17690
17861
|
width: Math.round(widthInMeters * 100) / 100, // 保留2位小数
|
|
17691
17862
|
height: Math.round(heightInMeters * 100) / 100, // 保留2位小数
|
|
@@ -17717,15 +17888,15 @@ const useDoodleTransform = (data, onTransformChange, options) => {
|
|
|
17717
17888
|
};
|
|
17718
17889
|
};
|
|
17719
17890
|
|
|
17720
|
-
var _path$
|
|
17721
|
-
function _extends$
|
|
17891
|
+
var _path$a;
|
|
17892
|
+
function _extends$e() { return _extends$e = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$e.apply(null, arguments); }
|
|
17722
17893
|
var SvgTransformArrow = function SvgTransformArrow(props) {
|
|
17723
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
17894
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
|
|
17724
17895
|
xmlns: "http://www.w3.org/2000/svg",
|
|
17725
17896
|
width: 7,
|
|
17726
17897
|
height: 11,
|
|
17727
17898
|
fill: "none"
|
|
17728
|
-
}, props), _path$
|
|
17899
|
+
}, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
|
|
17729
17900
|
fill: "#fff",
|
|
17730
17901
|
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",
|
|
17731
17902
|
opacity: 0.5
|
|
@@ -17787,7 +17958,7 @@ const DoodleTransform = ({ data, isSelected: _isSelected, onSelect }) => {
|
|
|
17787
17958
|
};
|
|
17788
17959
|
|
|
17789
17960
|
const DoodleTransformWrapper = ({ data, isSelected = false, isSelectedWithoutOperation = false, onSelect, onCancel, onTransformChange, disabled = false, className = '', minScale, onMinScaleReached, onDragMove, onDragEnd, showInfo = true, onClickInfo, }) => {
|
|
17790
|
-
const { platform } = useCommonContext();
|
|
17961
|
+
const { platform, overlayScale } = useCommonContext();
|
|
17791
17962
|
// 使用自定义hook管理所有变换逻辑
|
|
17792
17963
|
const { currentCenter, currentScale, currentDirection, isDragging, isRotating, isScaling, initializeTransform, calculateSelectionBoxPoints, handleMouseDown, handleRotateStart, handleScaleStart, handleMouseMove, handleMouseUp, containerRef, dimensions, } = useDoodleTransform(data, onTransformChange, {
|
|
17793
17964
|
minScale,
|
|
@@ -17809,16 +17980,20 @@ const DoodleTransformWrapper = ({ data, isSelected = false, isSelectedWithoutOpe
|
|
|
17809
17980
|
}, [data?.svg, currentCenter, currentScale, currentDirection]);
|
|
17810
17981
|
const isWeb = React.useMemo(() => platform === 'web', [platform]);
|
|
17811
17982
|
const activeTime = React.useMemo(() => {
|
|
17812
|
-
|
|
17813
|
-
|
|
17814
|
-
console.log('now------->', now);
|
|
17815
|
-
console.log('data.create_ts------->', data.create_ts);
|
|
17816
|
-
console.log('data.expiration_ts------->', data.expiration_ts);
|
|
17817
|
-
if (data.create_ts <= now && data.expiration_ts >= now) {
|
|
17818
|
-
return Math.floor((data.expiration_ts - now) / (60 * 60 * 24 * 1000));
|
|
17983
|
+
if (data.create_ts && data.expiration_ts) {
|
|
17984
|
+
return Math.floor((data.expiration_ts - data.create_ts) / (60 * 60 * 24));
|
|
17819
17985
|
}
|
|
17820
17986
|
return 0;
|
|
17821
17987
|
}, [data]);
|
|
17988
|
+
const remainingTime = React.useMemo(() => {
|
|
17989
|
+
const currentTime = Math.floor(Date.now() / 1000);
|
|
17990
|
+
console.log('data.expiration_ts--', data.expiration_ts);
|
|
17991
|
+
if (data.expiration_ts <= currentTime) {
|
|
17992
|
+
return 0;
|
|
17993
|
+
}
|
|
17994
|
+
// 保留一位小数
|
|
17995
|
+
return ((currentTime - data.expiration_ts) / (24 * 60 * 60)).toFixed(1);
|
|
17996
|
+
}, [data]);
|
|
17822
17997
|
// 初始化变换状态
|
|
17823
17998
|
React.useEffect(() => {
|
|
17824
17999
|
initializeTransform();
|
|
@@ -17899,7 +18074,18 @@ const DoodleTransformWrapper = ({ data, isSelected = false, isSelectedWithoutOpe
|
|
|
17899
18074
|
};
|
|
17900
18075
|
const selectionBoxWithoutOperation = () => {
|
|
17901
18076
|
const selectionBoxPoints = calculateSelectionBoxPoints();
|
|
17902
|
-
|
|
18077
|
+
// 计算选择框的边界
|
|
18078
|
+
const minX = Math.min(...selectionBoxPoints.map((p) => p.x));
|
|
18079
|
+
const maxX = Math.max(...selectionBoxPoints.map((p) => p.x));
|
|
18080
|
+
const maxY = Math.max(...selectionBoxPoints.map((p) => p.y));
|
|
18081
|
+
// 计算选择框的中心
|
|
18082
|
+
const centerX = (minX + maxX) / 2;
|
|
18083
|
+
// 计算尺寸显示框的位置(选择框下方)
|
|
18084
|
+
const infoBoxY = maxY + 20; // 选择框下方20像素
|
|
18085
|
+
const infoBoxWidth = 140 * overlayScale; // 信息框宽度
|
|
18086
|
+
const infoBoxHeight = 100 * overlayScale; // 信息框高度
|
|
18087
|
+
const infoBoxX = centerX - infoBoxWidth / 2; // 居中对齐
|
|
18088
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("polygon", { points: selectionBoxPoints.map((point) => `${point.x},${point.y}`).join(' '), fill: "none", stroke: "#B2B4B9", strokeWidth: "2", strokeDasharray: "5,5", vectorEffect: "non-scaling-stroke", style: { cursor: 'move' }, ...(platform === PlatformType.H5
|
|
17903
18089
|
? {
|
|
17904
18090
|
onTouchStart: createReactEventHandler((e) => {
|
|
17905
18091
|
handleMouseDownWithDisabled(e);
|
|
@@ -17907,7 +18093,26 @@ const DoodleTransformWrapper = ({ data, isSelected = false, isSelectedWithoutOpe
|
|
|
17907
18093
|
}
|
|
17908
18094
|
: {
|
|
17909
18095
|
onMouseDown: handleMouseDownWithDisabled,
|
|
17910
|
-
}) }), jsxRuntime.jsx("circle", { cx: selectionBoxPoints[0].x, cy: selectionBoxPoints[0].y, r:
|
|
18096
|
+
}) }), jsxRuntime.jsx("circle", { cx: selectionBoxPoints[0].x, cy: selectionBoxPoints[0].y, r: 10 * overlayScale, fill: "#B2B4B9", stroke: "none" }), jsxRuntime.jsx("circle", { cx: selectionBoxPoints[3].x, cy: selectionBoxPoints[3].y, r: 10 * overlayScale, fill: "#B2B4B9", stroke: "none" }), jsxRuntime.jsx("circle", { cx: selectionBoxPoints[1].x, cy: selectionBoxPoints[1].y, r: 10 * overlayScale, fill: "#B2B4B9", stroke: "none" }), jsxRuntime.jsx("circle", { cx: selectionBoxPoints[2].x, cy: selectionBoxPoints[2].y, r: 10 * overlayScale, fill: "#B2B4B9", stroke: "none" }), jsxRuntime.jsx("foreignObject", { x: infoBoxX, y: infoBoxY, width: infoBoxWidth, height: infoBoxHeight, style: { textAlign: 'center' }, onClick: () => {
|
|
18097
|
+
onClickInfo?.();
|
|
18098
|
+
}, children: jsxRuntime.jsx("div", { style: {
|
|
18099
|
+
padding: '5px 6px',
|
|
18100
|
+
background: 'rgba(201, 209, 218, 1)',
|
|
18101
|
+
borderRadius: '10px',
|
|
18102
|
+
display: 'inline-flex',
|
|
18103
|
+
flexDirection: 'column',
|
|
18104
|
+
alignItems: 'flex-start',
|
|
18105
|
+
justifyContent: 'center',
|
|
18106
|
+
fontSize: '12px',
|
|
18107
|
+
color: 'white',
|
|
18108
|
+
fontWeight: '400',
|
|
18109
|
+
// transform: `translate(0, ${50 * overlayScale}px) scale(${overlayScale})`,
|
|
18110
|
+
}, children: jsxRuntime.jsx("div", { style: {
|
|
18111
|
+
display: 'flex',
|
|
18112
|
+
alignItems: 'center',
|
|
18113
|
+
justifyContent: 'center',
|
|
18114
|
+
gap: '10px',
|
|
18115
|
+
}, children: jsxRuntime.jsxs("div", { children: ["Remaining Time: ", remainingTime] }) }) }) })] }));
|
|
17911
18116
|
};
|
|
17912
18117
|
React.useEffect(() => {
|
|
17913
18118
|
const isMove = isDragging || isRotating || isScaling;
|
|
@@ -17955,10 +18160,10 @@ const DoodleTransformWrapper = ({ data, isSelected = false, isSelectedWithoutOpe
|
|
|
17955
18160
|
const centerX = (minX + maxX) / 2;
|
|
17956
18161
|
// 计算尺寸显示框的位置(选择框下方)
|
|
17957
18162
|
const infoBoxY = maxY + 20; // 选择框下方20像素
|
|
17958
|
-
const infoBoxWidth = 140; // 信息框宽度
|
|
17959
|
-
const infoBoxHeight =
|
|
18163
|
+
const infoBoxWidth = 140 * overlayScale; // 信息框宽度
|
|
18164
|
+
const infoBoxHeight = 100 * overlayScale; // 信息框高度
|
|
17960
18165
|
const infoBoxX = centerX - infoBoxWidth / 2; // 居中对齐
|
|
17961
|
-
const scale = isWeb ? 2 : 1;
|
|
18166
|
+
const scale = (isWeb ? 2 : 1) * overlayScale;
|
|
17962
18167
|
const offsetLeft = 10 * scale;
|
|
17963
18168
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("polygon", { points: selectionBoxPoints.map((point) => `${point.x},${point.y}`).join(' '), fill: "none", stroke: "#9EA6BA", strokeWidth: "2", strokeDasharray: "5,5", vectorEffect: "non-scaling-stroke", style: { cursor: 'move' }, ...(platform === PlatformType.H5
|
|
17964
18169
|
? {
|
|
@@ -18013,6 +18218,7 @@ const DoodleTransformWrapper = ({ data, isSelected = false, isSelectedWithoutOpe
|
|
|
18013
18218
|
fontSize: '12px',
|
|
18014
18219
|
color: 'white',
|
|
18015
18220
|
fontWeight: '400',
|
|
18221
|
+
// transform: `translate(0, ${50 * overlayScale}px) scale(${overlayScale})`,
|
|
18016
18222
|
}, children: [jsxRuntime.jsxs("div", { children: [dimensions.height, "m \u00D7 ", dimensions.width, "m"] }), jsxRuntime.jsxs("div", { style: {
|
|
18017
18223
|
display: 'flex',
|
|
18018
18224
|
alignItems: 'center',
|
|
@@ -18023,9 +18229,9 @@ const DoodleTransformWrapper = ({ data, isSelected = false, isSelectedWithoutOpe
|
|
|
18023
18229
|
};
|
|
18024
18230
|
|
|
18025
18231
|
const DoodleElement = ({ data }) => {
|
|
18026
|
-
const { editMapInfo, setEditMapInfo, onHandleEnterRecord,
|
|
18232
|
+
const { editMapInfo, setEditMapInfo, onHandleEnterRecord, onHandleEvent } = useMapEditContext();
|
|
18027
18233
|
const { addHistory } = useHistoryHandle();
|
|
18028
|
-
const { platform } = useCommonContext();
|
|
18234
|
+
const { platform, doodleList } = useCommonContext();
|
|
18029
18235
|
const isSelected = React.useMemo(() => {
|
|
18030
18236
|
if (platform === PlatformType.H5) {
|
|
18031
18237
|
if (editMapInfo.mobileMode !== MobileEditMode.START &&
|
|
@@ -18042,6 +18248,23 @@ const DoodleElement = ({ data }) => {
|
|
|
18042
18248
|
}
|
|
18043
18249
|
return data;
|
|
18044
18250
|
}, [data, editMapInfo?.selectElement]);
|
|
18251
|
+
const minScale = React.useMemo(() => {
|
|
18252
|
+
const doodleInfo = doodleList.find((item) => {
|
|
18253
|
+
// 移除所有空白字符(包括\n、\r、\t等)进行比较
|
|
18254
|
+
const normalizedItemSvg = item.svgStr?.replace(/[\s\n\r\t]+/g, '').replace(/\\n/g, '');
|
|
18255
|
+
const normalizedOriginSvg = originData.svg?.replace(/[\s\n\r\t]+/g, '').replace(/\\n/g, '');
|
|
18256
|
+
// console.log('normalizedItemSvg--->', normalizedItemSvg, normalizedOriginSvg);
|
|
18257
|
+
return normalizedItemSvg === normalizedOriginSvg;
|
|
18258
|
+
});
|
|
18259
|
+
console.log('doodleList--->', doodleList, originData, doodleInfo);
|
|
18260
|
+
if (!doodleInfo) {
|
|
18261
|
+
return 1;
|
|
18262
|
+
}
|
|
18263
|
+
const minLength = doodleInfo?.minLength;
|
|
18264
|
+
const parseSvg = SvgParserNative.parseSvg(originData.svg);
|
|
18265
|
+
const svgMinLength = parseSvg.height / SCALE_FACTOR;
|
|
18266
|
+
return minLength / svgMinLength;
|
|
18267
|
+
}, [doodleList, originData]);
|
|
18045
18268
|
const isSelectedWithoutOperation = React.useMemo(() => {
|
|
18046
18269
|
if (platform === PlatformType.H5) {
|
|
18047
18270
|
if (editMapInfo.mobileMode === MobileEditMode.START &&
|
|
@@ -18120,8 +18343,8 @@ const DoodleElement = ({ data }) => {
|
|
|
18120
18343
|
}));
|
|
18121
18344
|
}, []);
|
|
18122
18345
|
const handleClickInfo = React.useCallback(() => {
|
|
18123
|
-
|
|
18124
|
-
}, [
|
|
18346
|
+
onHandleEvent?.(ClickEventType.DOODLE_ACTIVE_TIME);
|
|
18347
|
+
}, [onHandleEvent]);
|
|
18125
18348
|
// const handleDragMove = useCallback(
|
|
18126
18349
|
// (data: DoodleData) => {
|
|
18127
18350
|
// setEditMapInfo((prev: EditMapInfo) => ({
|
|
@@ -18149,7 +18372,8 @@ const DoodleElement = ({ data }) => {
|
|
|
18149
18372
|
},
|
|
18150
18373
|
});
|
|
18151
18374
|
}, [transformedElements]);
|
|
18152
|
-
|
|
18375
|
+
console.log('originData--->', originData, minScale);
|
|
18376
|
+
return (jsxRuntime.jsx(DoodleTransformWrapper, { data: originData, onTransformChange: handleTransformChange, isSelected: isSelected, isSelectedWithoutOperation: isSelectedWithoutOperation, onSelect: handleSelect, onCancel: handleCancel, onDragEnd: handleDragEnd, showInfo: platform === PlatformType.H5, onClickInfo: handleClickInfo, minScale: minScale }));
|
|
18153
18377
|
};
|
|
18154
18378
|
|
|
18155
18379
|
const SvgElement = React.memo(({ type, data, interactive = false }) => {
|
|
@@ -19383,27 +19607,37 @@ const getScreenCenterSvgPoint = (svgElement, mapInstance) => {
|
|
|
19383
19607
|
*/
|
|
19384
19608
|
const CreateObstacleElement = React.forwardRef(({ enabled = false, svgElement, onPointsChange, styles, points }, ref) => {
|
|
19385
19609
|
const { mapRef } = useCommonContext();
|
|
19610
|
+
const { checkCanNotCreateAtPosition } = useCheckElement();
|
|
19386
19611
|
// 使用固定的样式,确保能正常渲染
|
|
19387
19612
|
// 在十字准心位置添加点
|
|
19388
19613
|
const addPoint = React.useCallback(() => {
|
|
19389
19614
|
if (!enabled || !svgElement) {
|
|
19390
19615
|
console.warn('未启用创建模式或SVG元素不存在');
|
|
19391
|
-
return false;
|
|
19616
|
+
return { isValid: false, reason: '未启用创建模式或SVG元素不存在' };
|
|
19392
19617
|
}
|
|
19393
19618
|
if (!mapRef) {
|
|
19394
19619
|
console.warn('地图实例不存在');
|
|
19395
|
-
return false;
|
|
19620
|
+
return { isValid: false, reason: '地图实例不存在' };
|
|
19396
19621
|
}
|
|
19397
19622
|
const centerPoint = getScreenCenterSvgPoint(svgElement, mapRef);
|
|
19398
19623
|
if (!centerPoint) {
|
|
19399
19624
|
console.warn('无法获取屏幕中心点的SVG坐标或点不在SVG可见区域内');
|
|
19400
|
-
|
|
19401
|
-
|
|
19402
|
-
|
|
19625
|
+
return { isValid: false, reason: '无法获取屏幕中心点的SVG坐标或点不在SVG可见区域内' };
|
|
19626
|
+
}
|
|
19627
|
+
console.error('centerPoint--->', centerPoint);
|
|
19628
|
+
console.error('checkCanNotCreateAtPosition--->', checkCanNotCreateAtPosition(centerPoint));
|
|
19629
|
+
// 校验是否能打点
|
|
19630
|
+
if (checkCanNotCreateAtPosition(centerPoint)) {
|
|
19631
|
+
return {
|
|
19632
|
+
isValid: false,
|
|
19633
|
+
reason: '无法获取屏幕中心点的SVG坐标或点不在SVG可见区域内',
|
|
19634
|
+
};
|
|
19403
19635
|
}
|
|
19404
19636
|
const newPoints = [...points, centerPoint];
|
|
19405
19637
|
onPointsChange?.(newPoints);
|
|
19406
|
-
return
|
|
19638
|
+
return {
|
|
19639
|
+
isValid: true,
|
|
19640
|
+
};
|
|
19407
19641
|
}, [enabled, svgElement, mapRef, points, onPointsChange]);
|
|
19408
19642
|
// 撤销最后一个点
|
|
19409
19643
|
const undoLastPoint = React.useCallback(() => {
|
|
@@ -19493,7 +19727,7 @@ const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMa
|
|
|
19493
19727
|
const { editMapInfo, setEditMapInfo } = useMapEditContext();
|
|
19494
19728
|
const { getVisionOffPoints, centerPoint } = useCreateVisionOffElement();
|
|
19495
19729
|
const { svgElementDatas } = useSvgEditContext();
|
|
19496
|
-
const { checkCanNotCreateAtPosition } = useCheckElement();
|
|
19730
|
+
const { checkCanNotCreateAtPosition, checkDoodle } = useCheckElement();
|
|
19497
19731
|
const svgRef = React.useRef(null);
|
|
19498
19732
|
const containerRef = React.useRef(null);
|
|
19499
19733
|
const { platform } = useCommonContext();
|
|
@@ -19627,7 +19861,7 @@ const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMa
|
|
|
19627
19861
|
getEditMapInfo,
|
|
19628
19862
|
// 十字准心点管理器方法
|
|
19629
19863
|
addCreateObstaclePoint: () => {
|
|
19630
|
-
return pointManagerRef.current?.addPoint();
|
|
19864
|
+
return pointManagerRef.current?.addPoint?.();
|
|
19631
19865
|
},
|
|
19632
19866
|
undoCreateObstaclePoint: () => {
|
|
19633
19867
|
pointManagerRef.current?.undoLastPoint();
|
|
@@ -19649,6 +19883,7 @@ const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMa
|
|
|
19649
19883
|
clearHistory,
|
|
19650
19884
|
addHistory,
|
|
19651
19885
|
addDoodle,
|
|
19886
|
+
checkDoodle: () => checkDoodle?.(),
|
|
19652
19887
|
}));
|
|
19653
19888
|
// 初始化多边形绘制 Hook
|
|
19654
19889
|
const { onSvgClick, onSvgMouseMove, onPointClick, points, completed, mousePos, updatePoints } = usePolygonDrawing({ createMode: isCreating });
|
|
@@ -19768,10 +20003,10 @@ var css_248z$c = ".index-module_addEntry__QsQHD {\n position: absolute;\n righ
|
|
|
19768
20003
|
var styles$c = {"addEntry":"index-module_addEntry__QsQHD","icon":"index-module_icon__qIgA4","addItem":"index-module_addItem__mglwZ","label":"index-module_label__QqZ-9"};
|
|
19769
20004
|
styleInject(css_248z$c);
|
|
19770
20005
|
|
|
19771
|
-
var _rect$2, _path$
|
|
19772
|
-
function _extends$
|
|
20006
|
+
var _rect$2, _path$9, _defs$3;
|
|
20007
|
+
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); }
|
|
19773
20008
|
var SvgAddEntry = function SvgAddEntry(props) {
|
|
19774
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
20009
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
|
|
19775
20010
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19776
20011
|
width: 24,
|
|
19777
20012
|
height: 24,
|
|
@@ -19799,7 +20034,7 @@ var SvgAddEntry = function SvgAddEntry(props) {
|
|
|
19799
20034
|
height: "100%",
|
|
19800
20035
|
width: "100%"
|
|
19801
20036
|
}
|
|
19802
|
-
})), _path$
|
|
20037
|
+
})), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
19803
20038
|
fill: "#1F1F1F",
|
|
19804
20039
|
stroke: "url(#add-entry_svg__c)",
|
|
19805
20040
|
strokeWidth: 0.3,
|
|
@@ -19839,15 +20074,15 @@ var SvgAddEntry = function SvgAddEntry(props) {
|
|
|
19839
20074
|
})))));
|
|
19840
20075
|
};
|
|
19841
20076
|
|
|
19842
|
-
var _path$
|
|
19843
|
-
function _extends$
|
|
20077
|
+
var _path$8, _path2$3, _path3;
|
|
20078
|
+
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); }
|
|
19844
20079
|
var SvgBoundary = function SvgBoundary(props) {
|
|
19845
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
20080
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
|
|
19846
20081
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19847
20082
|
width: 16,
|
|
19848
20083
|
height: 16,
|
|
19849
20084
|
fill: "none"
|
|
19850
|
-
}, props), _path$
|
|
20085
|
+
}, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
19851
20086
|
fill: "#1DBEAC",
|
|
19852
20087
|
fillRule: "evenodd",
|
|
19853
20088
|
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",
|
|
@@ -19865,15 +20100,15 @@ var SvgBoundary = function SvgBoundary(props) {
|
|
|
19865
20100
|
})));
|
|
19866
20101
|
};
|
|
19867
20102
|
|
|
19868
|
-
var _path$
|
|
19869
|
-
function _extends$
|
|
20103
|
+
var _path$7, _path2$2, _rect$1, _rect2$1;
|
|
20104
|
+
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); }
|
|
19870
20105
|
var SvgLimitIsland = function SvgLimitIsland(props) {
|
|
19871
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
20106
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
|
|
19872
20107
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19873
20108
|
width: 16,
|
|
19874
20109
|
height: 16,
|
|
19875
20110
|
fill: "none"
|
|
19876
|
-
}, props), _path$
|
|
20111
|
+
}, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
19877
20112
|
fill: "#FFA077",
|
|
19878
20113
|
d: "M11.725 6.714c-1.019-.137-2.516-1.488-1.9-2.14.588-.621 1.91.344 1.9 2.14"
|
|
19879
20114
|
})), _path2$2 || (_path2$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
@@ -19899,9 +20134,9 @@ var SvgLimitIsland = function SvgLimitIsland(props) {
|
|
|
19899
20134
|
};
|
|
19900
20135
|
|
|
19901
20136
|
var _rect, _rect2, _rect3, _rect4, _g$3;
|
|
19902
|
-
function _extends$
|
|
20137
|
+
function _extends$a() { return _extends$a = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$a.apply(null, arguments); }
|
|
19903
20138
|
var SvgVisionFence = function SvgVisionFence(props) {
|
|
19904
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
20139
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
|
|
19905
20140
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19906
20141
|
width: 16,
|
|
19907
20142
|
height: 16,
|
|
@@ -19954,9 +20189,9 @@ var SvgVisionFence = function SvgVisionFence(props) {
|
|
|
19954
20189
|
};
|
|
19955
20190
|
|
|
19956
20191
|
var _g$2, _defs$2;
|
|
19957
|
-
function _extends$
|
|
20192
|
+
function _extends$9() { return _extends$9 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$9.apply(null, arguments); }
|
|
19958
20193
|
var SvgDoodle = function SvgDoodle(props) {
|
|
19959
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
20194
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
|
|
19960
20195
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19961
20196
|
width: 16,
|
|
19962
20197
|
height: 16,
|
|
@@ -20065,25 +20300,10 @@ const CustomModal = ({ children, titleCenter, hasMinHeight, height, ...props })
|
|
|
20065
20300
|
}), cancelButtonProps: { color: 'primary', variant: 'outlined' }, cancelText: 'Cancel', ...props, children: children }));
|
|
20066
20301
|
};
|
|
20067
20302
|
|
|
20068
|
-
var css_248z$a = ".index-module_doodleModal__EGNPW .index-module_title__ViZuB {\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: rgb(29, 29, 29);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n max-height: 230px;\n overflow-y: auto;\n width: 470px;\n margin: 20px auto 0;\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7 {\n width: 70px;\n height: 70px;\n padding: 10px;\n border-radius: 8px;\n cursor: pointer;\n border: 2px solid transparent;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n position: relative;\n background: rgb(233, 242, 241);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7:hover {\n background-color: rgba(0, 0, 0, 0.05);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7.index-module_active__1OHfd {\n border: 2px solid
|
|
20069
|
-
var styles$a = {"doodleModal":"index-module_doodleModal__EGNPW","title":"index-module_title__ViZuB","content":"index-module_content__h-60T","item":"index-module_item__dvoq7","active":"index-module_active__1OHfd","
|
|
20303
|
+
var css_248z$a = ".index-module_doodleModal__EGNPW .index-module_title__ViZuB {\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: rgb(29, 29, 29);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n max-height: 230px;\n overflow-y: auto;\n width: 470px;\n margin: 20px auto 0;\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7 {\n width: 70px;\n height: 70px;\n padding: 10px;\n border-radius: 8px;\n cursor: pointer;\n border: 2px solid transparent;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n position: relative;\n background: rgb(233, 242, 241);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7:hover {\n background-color: rgba(0, 0, 0, 0.05);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7.index-module_active__1OHfd {\n border: 2px solid #ff5a00;\n background-color: rgba(110, 220, 207, 0.1);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7.index-module_active__1OHfd .index-module_selectIcon__EFQF- {\n display: block;\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7 .index-module_svgImage__2OT8- {\n width: 100%;\n height: 100%;\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7 .index-module_svgImage__2OT8- svg {\n width: 100%;\n height: 100%;\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7 .index-module_selectIcon__EFQF- {\n position: absolute;\n bottom: 4px;\n right: 4px;\n display: none;\n}";
|
|
20304
|
+
var styles$a = {"doodleModal":"index-module_doodleModal__EGNPW","title":"index-module_title__ViZuB","content":"index-module_content__h-60T","item":"index-module_item__dvoq7","active":"index-module_active__1OHfd","svgImage":"index-module_svgImage__2OT8-"};
|
|
20070
20305
|
styleInject(css_248z$a);
|
|
20071
20306
|
|
|
20072
|
-
var _path$7;
|
|
20073
|
-
function _extends$9() { return _extends$9 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$9.apply(null, arguments); }
|
|
20074
|
-
var SvgSelect = function SvgSelect(props) {
|
|
20075
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
|
|
20076
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20077
|
-
width: 14,
|
|
20078
|
-
height: 12,
|
|
20079
|
-
fill: "none"
|
|
20080
|
-
}, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
20081
|
-
stroke: "#6EDCCF",
|
|
20082
|
-
strokeWidth: 2,
|
|
20083
|
-
d: "m1 7.5 4 3L12.5 1"
|
|
20084
|
-
})));
|
|
20085
|
-
};
|
|
20086
|
-
|
|
20087
20307
|
const DoodleModal = ({ open, onSelect, setOpen, doodleList, centerPoint }) => {
|
|
20088
20308
|
const { editMapInfo, setEditMapInfo, onHandleEnterRecord } = useMapEditContext();
|
|
20089
20309
|
const [selectedDoodle, setSelectedDoodle] = React.useState(null);
|
|
@@ -20101,7 +20321,7 @@ const DoodleModal = ({ open, onSelect, setOpen, doodleList, centerPoint }) => {
|
|
|
20101
20321
|
const svg = selectedDoodle?.svgStr;
|
|
20102
20322
|
const minLength = selectedDoodle.minLength;
|
|
20103
20323
|
const parseSvg = SvgParserNative.parseSvg(svg);
|
|
20104
|
-
const svgMinLength =
|
|
20324
|
+
const svgMinLength = parseSvg.height / SCALE_FACTOR;
|
|
20105
20325
|
// 使用获取到的 SVG 内容,如果没有获取到则使用 URL
|
|
20106
20326
|
newDoodle.svg = svg;
|
|
20107
20327
|
newDoodle.scale = minLength / svgMinLength;
|
|
@@ -20131,12 +20351,12 @@ const DoodleModal = ({ open, onSelect, setOpen, doodleList, centerPoint }) => {
|
|
|
20131
20351
|
});
|
|
20132
20352
|
}
|
|
20133
20353
|
}, [selectedDoodle, setEditMapInfo, editMapInfo, setOpen, onSelect, centerPoint]);
|
|
20134
|
-
return (jsxRuntime.jsx(CustomModal, { width: 560, title: "
|
|
20354
|
+
return (jsxRuntime.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: jsxRuntime.jsxs("div", { className: styles$a.doodleModal, children: [jsxRuntime.jsx("div", { className: styles$a.title, children: "Select the doodle that you want to create" }), jsxRuntime.jsx("div", { className: styles$a.content, children: doodleList
|
|
20135
20355
|
?.filter((item) => !noNeed.includes(item.name))
|
|
20136
20356
|
.map((item) => {
|
|
20137
|
-
return (jsxRuntime.
|
|
20357
|
+
return (jsxRuntime.jsx("div", { className: classNames(styles$a.item, {
|
|
20138
20358
|
[styles$a.active]: selectedDoodle?.svg === item.svg,
|
|
20139
|
-
}), onClick: () => handleSelectDoodle(item), children:
|
|
20359
|
+
}), onClick: () => handleSelectDoodle(item), children: jsxRuntime.jsx("div", { className: styles$a.svgImage, dangerouslySetInnerHTML: { __html: item?.svgStr } }) }, item.id));
|
|
20140
20360
|
}) })] }) }));
|
|
20141
20361
|
};
|
|
20142
20362
|
|
|
@@ -20232,11 +20452,11 @@ const AddEntry = ({ doodleList, disabledObstacles, editMap }) => {
|
|
|
20232
20452
|
}), children: jsxRuntime.jsx("div", { className: styles$c.icon, children: jsxRuntime.jsx(SvgAddEntry, {}) }) }), jsxRuntime.jsx(DoodleModal, { centerPoint: centerPoint, doodleList: doodleList, open: doodleOpen, onOk: () => setDoodleOpen(false), setOpen: setDoodleOpen })] }));
|
|
20233
20453
|
};
|
|
20234
20454
|
|
|
20235
|
-
var css_248z$9 = ".index-module_handleElementInfo__vWIaf {\n position: absolute;\n right: 0;\n top: 0;\n border-radius: 8px;\n padding:
|
|
20236
|
-
var styles$9 = {"handleElementInfo":"index-module_handleElementInfo__vWIaf","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","
|
|
20455
|
+
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}";
|
|
20456
|
+
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"};
|
|
20237
20457
|
styleInject(css_248z$9);
|
|
20238
20458
|
|
|
20239
|
-
var css_248z$8 = ".index-module_infoHeader__l9F6q {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding:
|
|
20459
|
+
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}";
|
|
20240
20460
|
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"};
|
|
20241
20461
|
styleInject(css_248z$8);
|
|
20242
20462
|
|
|
@@ -20305,7 +20525,7 @@ const NameModal = ({ title, name, open, setOpen, onOk }) => {
|
|
|
20305
20525
|
setOpen(false);
|
|
20306
20526
|
}, onCancel: () => setOpen(false), okText: "Confirm", afterClose: () => {
|
|
20307
20527
|
setNameValue('');
|
|
20308
|
-
}, children: jsxRuntime.jsx(antd.Input, { maxLength:
|
|
20528
|
+
}, children: jsxRuntime.jsx(antd.Input, { maxLength: 12, showCount: true, placeholder: "Please enter boundary name", value: nameValue, onChange: (e) => setNameValue(e.target.value) }) }));
|
|
20309
20529
|
};
|
|
20310
20530
|
|
|
20311
20531
|
const NameEdit = ({ title, name, onChange }) => {
|
|
@@ -20322,12 +20542,12 @@ var SvgArrow = function SvgArrow(props) {
|
|
|
20322
20542
|
height: 16,
|
|
20323
20543
|
fill: "none"
|
|
20324
20544
|
}, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
20325
|
-
fill: "#
|
|
20545
|
+
fill: "#1F1F1F",
|
|
20326
20546
|
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"
|
|
20327
20547
|
})));
|
|
20328
20548
|
};
|
|
20329
20549
|
|
|
20330
|
-
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:
|
|
20550
|
+
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}";
|
|
20331
20551
|
var styles$6 = {"item":"index-module_item__wwHEt"};
|
|
20332
20552
|
styleInject(css_248z$6);
|
|
20333
20553
|
|
|
@@ -20671,43 +20891,81 @@ function convertDirectionToParams(value) {
|
|
|
20671
20891
|
return directions;
|
|
20672
20892
|
}
|
|
20673
20893
|
|
|
20894
|
+
const DEFAULT_LIST = [
|
|
20895
|
+
{
|
|
20896
|
+
value: 1 << 0,
|
|
20897
|
+
text: 'A',
|
|
20898
|
+
selected: false,
|
|
20899
|
+
},
|
|
20900
|
+
{
|
|
20901
|
+
value: 1 << 1,
|
|
20902
|
+
text: 'B',
|
|
20903
|
+
selected: false,
|
|
20904
|
+
},
|
|
20905
|
+
{
|
|
20906
|
+
value: 1 << 2,
|
|
20907
|
+
text: 'C',
|
|
20908
|
+
selected: false,
|
|
20909
|
+
},
|
|
20910
|
+
{
|
|
20911
|
+
value: 1 << 3,
|
|
20912
|
+
text: 'D',
|
|
20913
|
+
selected: false,
|
|
20914
|
+
},
|
|
20915
|
+
{
|
|
20916
|
+
value: 1 << 4,
|
|
20917
|
+
text: 'E',
|
|
20918
|
+
selected: false,
|
|
20919
|
+
},
|
|
20920
|
+
{
|
|
20921
|
+
value: 1 << 5,
|
|
20922
|
+
text: 'F',
|
|
20923
|
+
selected: false,
|
|
20924
|
+
},
|
|
20925
|
+
];
|
|
20674
20926
|
const MowDirection_L = (props) => {
|
|
20675
20927
|
const { value, angleValue, optionAngle = 45, zIndex = 10000, onChange,
|
|
20676
20928
|
// children,
|
|
20677
20929
|
} = props;
|
|
20678
20930
|
const [angle, setAngle] = React.useState(0);
|
|
20679
|
-
const
|
|
20680
|
-
{
|
|
20681
|
-
|
|
20682
|
-
|
|
20683
|
-
|
|
20684
|
-
|
|
20685
|
-
|
|
20686
|
-
|
|
20687
|
-
|
|
20688
|
-
|
|
20689
|
-
|
|
20690
|
-
|
|
20691
|
-
|
|
20692
|
-
|
|
20693
|
-
|
|
20694
|
-
|
|
20695
|
-
|
|
20696
|
-
|
|
20697
|
-
|
|
20698
|
-
|
|
20699
|
-
|
|
20700
|
-
|
|
20701
|
-
|
|
20702
|
-
|
|
20703
|
-
|
|
20704
|
-
|
|
20705
|
-
|
|
20706
|
-
|
|
20707
|
-
|
|
20708
|
-
|
|
20709
|
-
|
|
20710
|
-
|
|
20931
|
+
const lineList = React.useMemo(() => {
|
|
20932
|
+
return DEFAULT_LIST.map((item) => ({
|
|
20933
|
+
...item,
|
|
20934
|
+
selected: convertDirectionToParams(value).includes(item.value),
|
|
20935
|
+
}));
|
|
20936
|
+
}, [value]);
|
|
20937
|
+
// const [lineList, setLineList] = useState<LineItem[]>([
|
|
20938
|
+
// {
|
|
20939
|
+
// value: 1 << 0,
|
|
20940
|
+
// text: 'A',
|
|
20941
|
+
// selected: false,
|
|
20942
|
+
// },
|
|
20943
|
+
// {
|
|
20944
|
+
// value: 1 << 1,
|
|
20945
|
+
// text: 'B',
|
|
20946
|
+
// selected: false,
|
|
20947
|
+
// },
|
|
20948
|
+
// {
|
|
20949
|
+
// value: 1 << 2,
|
|
20950
|
+
// text: 'C',
|
|
20951
|
+
// selected: false,
|
|
20952
|
+
// },
|
|
20953
|
+
// {
|
|
20954
|
+
// value: 1 << 3,
|
|
20955
|
+
// text: 'D',
|
|
20956
|
+
// selected: false,
|
|
20957
|
+
// },
|
|
20958
|
+
// {
|
|
20959
|
+
// value: 1 << 4,
|
|
20960
|
+
// text: 'E',
|
|
20961
|
+
// selected: false,
|
|
20962
|
+
// },
|
|
20963
|
+
// {
|
|
20964
|
+
// value: 1 << 5,
|
|
20965
|
+
// text: 'F',
|
|
20966
|
+
// selected: false,
|
|
20967
|
+
// },
|
|
20968
|
+
// ]);
|
|
20711
20969
|
const hitRectAngle = React.useMemo(() => {
|
|
20712
20970
|
const direction = lineList
|
|
20713
20971
|
?.filter((item) => item?.selected)
|
|
@@ -20720,12 +20978,6 @@ const MowDirection_L = (props) => {
|
|
|
20720
20978
|
const allSelect = React.useMemo(() => {
|
|
20721
20979
|
return lineList?.every((item) => item?.selected);
|
|
20722
20980
|
}, [lineList]);
|
|
20723
|
-
React.useEffect(() => {
|
|
20724
|
-
setLineList(lineList.map((line) => ({
|
|
20725
|
-
...line,
|
|
20726
|
-
selected: convertDirectionToParams(value).includes(line.value),
|
|
20727
|
-
})));
|
|
20728
|
-
}, [value]);
|
|
20729
20981
|
React.useEffect(() => {
|
|
20730
20982
|
setAngle(angleValue);
|
|
20731
20983
|
}, [angleValue]);
|
|
@@ -20740,7 +20992,6 @@ const MowDirection_L = (props) => {
|
|
|
20740
20992
|
}
|
|
20741
20993
|
return { ...line };
|
|
20742
20994
|
});
|
|
20743
|
-
setLineList(newLine);
|
|
20744
20995
|
onChange?.(newLine
|
|
20745
20996
|
?.filter((item) => item?.selected)
|
|
20746
20997
|
.reduce((pre, line) => {
|
|
@@ -20853,10 +21104,25 @@ const DirectionModal = ({ directionInfo, open, setOpen, zoneName, optionAngle, o
|
|
|
20853
21104
|
setAngle(defaultAngle);
|
|
20854
21105
|
}
|
|
20855
21106
|
};
|
|
20856
|
-
|
|
20857
|
-
|
|
21107
|
+
const handleCancel = React.useCallback(() => {
|
|
21108
|
+
if (!canSave) {
|
|
20858
21109
|
setOpen(false);
|
|
20859
|
-
|
|
21110
|
+
return;
|
|
21111
|
+
}
|
|
21112
|
+
antd.Modal.confirm({
|
|
21113
|
+
icon: null,
|
|
21114
|
+
centered: true,
|
|
21115
|
+
title: 'Exit editing',
|
|
21116
|
+
content: 'Changes you made will not be saved. Are you sure you want to exit editing the mowing direction?',
|
|
21117
|
+
onOk: () => {
|
|
21118
|
+
setOpen(false);
|
|
21119
|
+
},
|
|
21120
|
+
okText: 'Exit',
|
|
21121
|
+
cancelText: 'Continue editing',
|
|
21122
|
+
});
|
|
21123
|
+
}, [canSave, setOpen]);
|
|
21124
|
+
console.log('directionInfo=>', directionInfo, mapJson);
|
|
21125
|
+
return (jsxRuntime.jsx(CustomModal, { maskClosable: false, titleCenter: true, title: `${zoneName} mowing direction`, open: open, width: 600, onCancel: handleCancel, onOk: () => {
|
|
20860
21126
|
onChange?.(directions, angle);
|
|
20861
21127
|
setOpen(false);
|
|
20862
21128
|
}, okText: "Confirm", cancelText: "Cancel", okButtonProps: { disabled: !canSave }, afterClose: () => {
|
|
@@ -20864,6 +21130,8 @@ const DirectionModal = ({ directionInfo, open, setOpen, zoneName, optionAngle, o
|
|
|
20864
21130
|
setAngle(MIN_DIRECTION_ANGLE);
|
|
20865
21131
|
}, children: jsxRuntime.jsxs("div", { className: styles$3.directions, children: [jsxRuntime.jsx("div", { className: styles$3.default, children: jsxRuntime.jsx(antd.Button, { disabled: !canSetDefault, variant: "link", color: "primary", onClick: resetDirection, children: "Default" }) }), jsxRuntime.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" }), jsxRuntime.jsxs("div", { className: styles$3.optimal, children: [jsxRuntime.jsx("div", { children: "*" }), jsxRuntime.jsx(SvgOption, {}), jsxRuntime.jsx("div", { className: styles$3.text, children: "Optimal direction" })] }), jsxRuntime.jsxs("div", { className: styles$3.content, children: [jsxRuntime.jsx("div", { className: styles$3.background, children: jsxRuntime.jsx(BoundarySvgRender, { mapJson: mapJson, id: editMapInfo.selectElement.id }) }), jsxRuntime.jsx("div", { className: styles$3.luppan, children: jsxRuntime.jsx(MowDirection_L, { value: directions, angleValue: angle, optionAngle: optionAngle, onChange: (value) => {
|
|
20866
21132
|
console.log('valie=>', value);
|
|
21133
|
+
if (!value)
|
|
21134
|
+
return antd.message.warning('Choose at least one mowing direction');
|
|
20867
21135
|
setDirections(value);
|
|
20868
21136
|
} }) })] }), jsxRuntime.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" }), jsxRuntime.jsx("div", { className: styles$3.slider, children: jsxRuntime.jsx(antd.Slider, { tooltip: {
|
|
20869
21137
|
formatter: (value) => `${value}°`,
|
|
@@ -20922,13 +21190,13 @@ const BoundaryInfo = ({ onHandleDelete }) => {
|
|
|
20922
21190
|
name: name,
|
|
20923
21191
|
},
|
|
20924
21192
|
});
|
|
20925
|
-
} }) }), jsxRuntime.jsxs("div", { className: styles$9.otherEdit, children: [jsxRuntime.jsx(Item, { children: jsxRuntime.jsxs("div", { className: styles$9.otherItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "
|
|
21193
|
+
} }) }), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsxs("div", { className: styles$9.otherEdit, children: [jsxRuntime.jsx(Item, { children: jsxRuntime.jsxs("div", { className: styles$9.otherItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Cutting height" }), jsxRuntime.jsx("div", { className: styles$9.value, children: generateHeightStr(heightValue?.cuttingHeight, unitType, true) }), jsxRuntime.jsx("div", { className: styles$9.icon, onClick: () => {
|
|
20926
21194
|
setHeightOpen(true);
|
|
20927
|
-
}, children: jsxRuntime.jsx(SvgArrow, {}) })] }) }), jsxRuntime.jsx(Item, { children: jsxRuntime.jsxs("div", { className: styles$9.otherItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "
|
|
21195
|
+
}, children: jsxRuntime.jsx(SvgArrow, {}) })] }) }), jsxRuntime.jsx(Item, { children: jsxRuntime.jsxs("div", { className: styles$9.otherItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Mowing direction" }), jsxRuntime.jsx("div", { className: styles$9.value }), jsxRuntime.jsx("div", { className: styles$9.icon, onClick: () => {
|
|
20928
21196
|
setDirectionOpen(true);
|
|
20929
|
-
}, children: jsxRuntime.jsx(SvgArrow, {}) })] }) }), jsxRuntime.jsx(Item, { children: jsxRuntime.jsxs("div", { className: styles$9.otherItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "
|
|
21197
|
+
}, children: jsxRuntime.jsx(SvgArrow, {}) })] }) }), jsxRuntime.jsx(Item, { children: jsxRuntime.jsxs("div", { className: styles$9.otherItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Edge mowing" }), jsxRuntime.jsx("div", { className: styles$9.value }), jsxRuntime.jsx("div", { className: styles$9.icon, onClick: () => {
|
|
20930
21198
|
setOpen(true);
|
|
20931
|
-
}, children: jsxRuntime.jsx(SvgArrow, {}) })] }) })] }), jsxRuntime.jsxs("div", { className: styles$9.areaInfo, children: [jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Area:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue?.area })] }), jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Perimeter:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue?.perimeter })] })] }), jsxRuntime.jsx(MowingEdgeModal, { value: edgeMowingValue, onChange: (value) => {
|
|
21199
|
+
}, children: jsxRuntime.jsx(SvgArrow, {}) })] }) })] }), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsxs("div", { className: styles$9.areaInfo, children: [jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Area:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue?.area })] }), jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Perimeter:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue?.perimeter })] })] }), jsxRuntime.jsx(MowingEdgeModal, { value: edgeMowingValue, onChange: (value) => {
|
|
20932
21200
|
setEditMapInfo({
|
|
20933
21201
|
...editMapInfo,
|
|
20934
21202
|
selectElement: {
|
|
@@ -20958,7 +21226,7 @@ const BoundaryInfo = ({ onHandleDelete }) => {
|
|
|
20958
21226
|
} })] }));
|
|
20959
21227
|
};
|
|
20960
21228
|
|
|
20961
|
-
var css_248z$1 = ".index-module_timePeriod__EkVZl {\n display: flex;\n flex-direction: column;\n
|
|
21229
|
+
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}";
|
|
20962
21230
|
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"};
|
|
20963
21231
|
styleInject(css_248z$1);
|
|
20964
21232
|
|
|
@@ -20989,8 +21257,8 @@ const TimePeriod = ({ value, onChange }) => {
|
|
|
20989
21257
|
setDate(null);
|
|
20990
21258
|
onChange({
|
|
20991
21259
|
...value,
|
|
20992
|
-
|
|
20993
|
-
|
|
21260
|
+
start_timestamp: 0,
|
|
21261
|
+
end_timestamp: 0,
|
|
20994
21262
|
});
|
|
20995
21263
|
}
|
|
20996
21264
|
else if (e.target.value === RadioValue.SHORT_TIME) {
|
|
@@ -21001,15 +21269,15 @@ const TimePeriod = ({ value, onChange }) => {
|
|
|
21001
21269
|
// endTimestamp: dayjs().add(1, 'hour').unix(),
|
|
21002
21270
|
// });
|
|
21003
21271
|
}
|
|
21004
|
-
}, style: { display: 'flex', flexDirection: 'column', gap: '4px' }, children: [jsxRuntime.jsx(antd.Radio, { value: RadioValue.LONG_TIME, children: jsxRuntime.jsx("div", { className: styles$1.timePeriodRadioItem, children: "
|
|
21272
|
+
}, style: { display: 'flex', flexDirection: 'column', gap: '4px' }, children: [jsxRuntime.jsx(antd.Radio, { value: RadioValue.LONG_TIME, children: jsxRuntime.jsx("div", { className: styles$1.timePeriodRadioItem, children: "Always" }) }), jsxRuntime.jsx(antd.Radio, { value: RadioValue.SHORT_TIME, children: jsxRuntime.jsx("div", { className: styles$1.timePeriodRadioItem, children: jsxRuntime.jsx(antd.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) => {
|
|
21005
21273
|
setOpen(open);
|
|
21006
21274
|
}, onChange: (dateValue, dateString) => {
|
|
21007
21275
|
setDate(dateValue);
|
|
21008
21276
|
if (dateValue?.length === 2) {
|
|
21009
21277
|
onChange({
|
|
21010
21278
|
status: RadioValue.SHORT_TIME,
|
|
21011
|
-
|
|
21012
|
-
|
|
21279
|
+
start_timestamp: dateValue[0].unix(),
|
|
21280
|
+
end_timestamp: dateValue[1].unix(),
|
|
21013
21281
|
});
|
|
21014
21282
|
}
|
|
21015
21283
|
} }) }) })] }) })] }));
|
|
@@ -21023,12 +21291,12 @@ const ObstacleInfo = ({ onHandleDelete }) => {
|
|
|
21023
21291
|
if (!editMapInfo.selectElement)
|
|
21024
21292
|
return null;
|
|
21025
21293
|
const status = editMapInfo.selectElement?.status;
|
|
21026
|
-
const
|
|
21027
|
-
const
|
|
21294
|
+
const start_timestamp = editMapInfo.selectElement?.start_timestamp;
|
|
21295
|
+
const end_timestamp = editMapInfo.selectElement?.end_timestamp;
|
|
21028
21296
|
return {
|
|
21029
21297
|
status,
|
|
21030
|
-
|
|
21031
|
-
|
|
21298
|
+
start_timestamp,
|
|
21299
|
+
end_timestamp,
|
|
21032
21300
|
};
|
|
21033
21301
|
}, [editMapInfo.selectElement]);
|
|
21034
21302
|
const sizeValue = React.useMemo(() => {
|
|
@@ -21055,18 +21323,18 @@ const ObstacleInfo = ({ onHandleDelete }) => {
|
|
|
21055
21323
|
name: name,
|
|
21056
21324
|
},
|
|
21057
21325
|
});
|
|
21058
|
-
} }) }), jsxRuntime.jsx("div", { className: styles$9.timePeriod, children: jsxRuntime.jsx(TimePeriod, { value: timePeriodValue, onChange: (value) => {
|
|
21326
|
+
} }) }), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsx("div", { className: styles$9.timePeriod, children: jsxRuntime.jsx(TimePeriod, { value: timePeriodValue, onChange: (value) => {
|
|
21059
21327
|
setEditMapInfo({
|
|
21060
21328
|
...editMapInfo,
|
|
21061
21329
|
isShowDrag: editMapInfo?.isShowDrag || false,
|
|
21062
21330
|
selectElement: {
|
|
21063
21331
|
...editMapInfo.selectElement,
|
|
21064
21332
|
status: value.status,
|
|
21065
|
-
start_timestamp: value.
|
|
21066
|
-
end_timestamp: value.
|
|
21333
|
+
start_timestamp: value.start_timestamp,
|
|
21334
|
+
end_timestamp: value.end_timestamp,
|
|
21067
21335
|
},
|
|
21068
21336
|
});
|
|
21069
|
-
} }) }), jsxRuntime.jsxs("div", { className: styles$9.areaInfo, children: [jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Area:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue?.area })] }), jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Perimeter:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue?.perimeter })] })] })] }));
|
|
21337
|
+
} }) }), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsxs("div", { className: styles$9.areaInfo, children: [jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Area:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue?.area })] }), jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Perimeter:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue?.perimeter })] })] })] }));
|
|
21070
21338
|
};
|
|
21071
21339
|
|
|
21072
21340
|
const DoodleInfo = ({ onHandleDelete }) => {
|
|
@@ -21088,31 +21356,37 @@ const DoodleInfo = ({ onHandleDelete }) => {
|
|
|
21088
21356
|
const create_ts = editMapInfo?.selectElement?.create_ts;
|
|
21089
21357
|
const expiration_ts = editMapInfo.selectElement.expiration_ts;
|
|
21090
21358
|
const diff = expiration_ts - create_ts;
|
|
21091
|
-
const day = Math.floor(diff / (60 * 60 * 24
|
|
21092
|
-
console.log('create_ts->', create_ts, expiration_ts, day);
|
|
21359
|
+
const day = Math.floor(diff / (60 * 60 * 24));
|
|
21093
21360
|
return {
|
|
21094
21361
|
day: day,
|
|
21095
21362
|
};
|
|
21096
21363
|
}, [editMapInfo?.selectElement]);
|
|
21364
|
+
const remainDay = React.useMemo(() => {
|
|
21365
|
+
if (!editMapInfo.selectElement)
|
|
21366
|
+
return null;
|
|
21367
|
+
const expiration_ts = editMapInfo.selectElement.expiration_ts;
|
|
21368
|
+
const diff = expiration_ts - Date.now() / 1000;
|
|
21369
|
+
return Math.floor(diff / (60 * 60 * 24));
|
|
21370
|
+
}, [editMapInfo?.selectElement]);
|
|
21097
21371
|
const sizeValue = React.useMemo(() => {
|
|
21098
21372
|
if (!editMapInfo.selectElement || !editMapInfo.selectElement.svg)
|
|
21099
21373
|
return '';
|
|
21100
21374
|
const svg = editMapInfo.selectElement?.svg;
|
|
21375
|
+
const scale = editMapInfo.selectElement.scale;
|
|
21101
21376
|
const parseSvg = SvgParserNative.parseSvg(svg);
|
|
21102
|
-
const width = parseSvg.width / SCALE_FACTOR;
|
|
21103
|
-
const height = parseSvg.height / SCALE_FACTOR;
|
|
21104
|
-
console.log('parseSvg->', parseSvg);
|
|
21105
|
-
return `${width} m x ${height} m`;
|
|
21377
|
+
const width = (parseSvg.width * scale) / SCALE_FACTOR;
|
|
21378
|
+
const height = (parseSvg.height * scale) / SCALE_FACTOR;
|
|
21379
|
+
console.log('parseSvg->', editMapInfo, parseSvg);
|
|
21380
|
+
return `${width.toFixed(1)} m x ${height.toFixed(1)} m`;
|
|
21106
21381
|
}, [editMapInfo.selectElement]);
|
|
21107
21382
|
const handleChange = React.useCallback((day) => {
|
|
21108
|
-
const lastTime = Date.now() - editMapInfo.selectElement.create_ts;
|
|
21109
21383
|
setEditMapInfo((pre) => {
|
|
21110
|
-
console.log('expiration_ts->', lastTime, day, lastTime + day * 24 * 60 * 60 * 1000);
|
|
21111
21384
|
return {
|
|
21112
21385
|
...pre,
|
|
21113
21386
|
selectElement: {
|
|
21114
21387
|
...pre.selectElement,
|
|
21115
|
-
|
|
21388
|
+
create_ts: Date.now() / 1000,
|
|
21389
|
+
expiration_ts: Date.now() / 1000 + day * 24 * 60 * 60,
|
|
21116
21390
|
},
|
|
21117
21391
|
};
|
|
21118
21392
|
});
|
|
@@ -21120,7 +21394,7 @@ const DoodleInfo = ({ onHandleDelete }) => {
|
|
|
21120
21394
|
console.log('doodleInfo->', doodleInfo);
|
|
21121
21395
|
return (jsxRuntime.jsxs("div", { className: styles$9.doodleInfo, children: [jsxRuntime.jsx(Header, { handleDelete: () => {
|
|
21122
21396
|
onHandleDelete();
|
|
21123
|
-
}, handleFocus: () => { }, type: editMapInfo.elementType }), isCreate ? (jsxRuntime.jsx(Item, { children: jsxRuntime.jsxs("div", { className: styles$9.time, children: [jsxRuntime.jsxs("div", { className: styles$9.exist, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "
|
|
21397
|
+
}, handleFocus: () => { }, type: editMapInfo.elementType }), jsxRuntime.jsx("div", { className: styles$9.border }), isCreate ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Item, { children: jsxRuntime.jsxs("div", { className: styles$9.time, children: [jsxRuntime.jsxs("div", { className: styles$9.exist, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Preserve doodle for" }), jsxRuntime.jsx("div", { className: styles$9.value, children: jsxRuntime.jsx(antd.Select, { defaultValue: doodleInfo?.day, style: { width: 80 }, onChange: (value) => handleChange(value), options: options }) })] }), doodleInfo?.day >= 14 && (jsxRuntime.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." }))] }) }), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsx("div", { className: styles$9.areaInfo, children: jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Size:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue })] }) })] })) : (jsxRuntime.jsxs("div", { className: styles$9.areaInfo, children: [jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Remaining time:" }), jsxRuntime.jsxs("div", { className: styles$9.value, children: [remainDay, " day"] })] }), jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Size:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue })] })] }))] }));
|
|
21124
21398
|
};
|
|
21125
21399
|
|
|
21126
21400
|
const VisionOffInfo = ({ onHandleDelete }) => {
|
|
@@ -21136,7 +21410,7 @@ const VisionOffInfo = ({ onHandleDelete }) => {
|
|
|
21136
21410
|
}, [editMapInfo.selectElement]);
|
|
21137
21411
|
return (jsxRuntime.jsxs("div", { className: "visionOffInfo", children: [jsxRuntime.jsx(Header, { handleDelete: () => {
|
|
21138
21412
|
onHandleDelete?.();
|
|
21139
|
-
}, handleFocus: () => { }, type: DataType.VISION_OFF }), jsxRuntime.jsx("div", { className: styles$9.areaInfo, children: jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Size:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue })] }) })] }));
|
|
21413
|
+
}, handleFocus: () => { }, type: DataType.VISION_OFF }), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsx("div", { className: styles$9.areaInfo, children: jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Size:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue })] }) })] }));
|
|
21140
21414
|
};
|
|
21141
21415
|
|
|
21142
21416
|
var _path$2, _path2$1;
|
|
@@ -21278,8 +21552,8 @@ const HandleElementInfo = () => {
|
|
|
21278
21552
|
data.obstacle = {
|
|
21279
21553
|
name: element?.name,
|
|
21280
21554
|
status: element?.status || 1,
|
|
21281
|
-
end_timestamp: element?.end_timestamp
|
|
21282
|
-
start_timestamp: element?.start_timestamp
|
|
21555
|
+
end_timestamp: element?.end_timestamp,
|
|
21556
|
+
start_timestamp: element?.start_timestamp,
|
|
21283
21557
|
points: restorePointsFormat(element.points),
|
|
21284
21558
|
};
|
|
21285
21559
|
if (element?.id) {
|
|
@@ -21307,6 +21581,12 @@ const HandleElementInfo = () => {
|
|
|
21307
21581
|
const params = renderElementData(editMapInfo?.selectElement);
|
|
21308
21582
|
const isObstacle = editMapInfo?.selectElement?.type === DataType.OBSTACLE;
|
|
21309
21583
|
const hasNotEnoughPoints = params?.obstacle?.points?.length < 3;
|
|
21584
|
+
const isDoodle = editMapInfo?.selectElement?.type === DataType.DOODLE;
|
|
21585
|
+
const doodleResult = checkDoodle();
|
|
21586
|
+
if (isDoodle && !doodleResult?.isValid) {
|
|
21587
|
+
antd.message.error('Keep more distance from boundaries, off-limit island and other doodles');
|
|
21588
|
+
return;
|
|
21589
|
+
}
|
|
21310
21590
|
if (isObstacle && hasNotEnoughPoints) {
|
|
21311
21591
|
antd.message.error('Save failed, please draw a closed shape');
|
|
21312
21592
|
return;
|
|
@@ -21338,16 +21618,27 @@ const HandleElementInfo = () => {
|
|
|
21338
21618
|
antd.message.error('Save failed, please try again');
|
|
21339
21619
|
});
|
|
21340
21620
|
}
|
|
21341
|
-
}, [editMapInfo.selectElement]);
|
|
21621
|
+
}, [editMapInfo.selectElement, onUpdateBoundary, onHandleCompleteRecord]);
|
|
21342
21622
|
const handleCancel = React.useCallback(() => {
|
|
21343
|
-
|
|
21344
|
-
|
|
21345
|
-
|
|
21346
|
-
|
|
21347
|
-
|
|
21348
|
-
|
|
21349
|
-
|
|
21350
|
-
|
|
21623
|
+
const name = DATE_TYPE_MAP.find((item) => item.type === editMapInfo.elementType)?.label;
|
|
21624
|
+
antd.Modal.confirm({
|
|
21625
|
+
icon: null,
|
|
21626
|
+
centered: true,
|
|
21627
|
+
title: 'Quit editing',
|
|
21628
|
+
content: `Changes you made will not be saved. Are you sure you want to quit editing the ${name}?`,
|
|
21629
|
+
okText: 'Quit',
|
|
21630
|
+
cancelText: 'Keep editing',
|
|
21631
|
+
onOk: () => {
|
|
21632
|
+
onHandleStopRecord?.()?.then(() => {
|
|
21633
|
+
setEditMapInfo({
|
|
21634
|
+
...editMapInfo,
|
|
21635
|
+
createMode: null,
|
|
21636
|
+
elementType: null,
|
|
21637
|
+
selectElement: null,
|
|
21638
|
+
isShowDrag: false,
|
|
21639
|
+
});
|
|
21640
|
+
});
|
|
21641
|
+
},
|
|
21351
21642
|
});
|
|
21352
21643
|
}, [editMapInfo]);
|
|
21353
21644
|
const handleDelete = React.useCallback(() => {
|
|
@@ -21392,26 +21683,12 @@ const HandleElementInfo = () => {
|
|
|
21392
21683
|
},
|
|
21393
21684
|
});
|
|
21394
21685
|
}, [editMapInfo?.selectElement, onHandleDeleteElement, onHandleStopRecord]);
|
|
21395
|
-
const checkDisabled = React.useCallback(() => {
|
|
21396
|
-
if (editMapInfo.elementType === DataType.DOODLE) {
|
|
21397
|
-
const result = checkDoodle();
|
|
21398
|
-
return !result?.isValid;
|
|
21399
|
-
}
|
|
21400
|
-
return false;
|
|
21401
|
-
}, [checkDoodle, editMapInfo]);
|
|
21402
21686
|
if (!editMapInfo.selectElement)
|
|
21403
21687
|
return null;
|
|
21404
21688
|
console.log('handleElementInfo->', editMapInfo, currentType);
|
|
21405
|
-
return (jsxRuntime.jsxs("div", { className: styles$9.handleElementInfo, children: [editMapInfo?.elementType !== DataType.BOUNDARY ? (jsxRuntime.jsxs("div", { className: styles$9.undoAndRedo, children: [jsxRuntime.jsx("div", { className: classNames(styles$9.undo, { [styles$9.disabled]: isUndoDisabled }), onClick: handleUndo, children: jsxRuntime.jsx(SvgUndo, {}) }), jsxRuntime.jsx("div", { className: classNames(styles$9.redo, { [styles$9.disabled]: idRedoDisabled }), onClick: handleRedo, children: jsxRuntime.jsx(SvgRedo, {}) })] })) : null, editMapInfo?.elementType === DataType.BOUNDARY && (jsxRuntime.jsx(BoundaryInfo, { onHandleDelete: handleDelete })), editMapInfo?.elementType === DataType.OBSTACLE && (jsxRuntime.jsx(ObstacleInfo, { onHandleDelete: handleDelete })), editMapInfo?.elementType === DataType.DOODLE && jsxRuntime.jsx(DoodleInfo, { onHandleDelete: handleDelete }), editMapInfo?.elementType === DataType.VISION_OFF && (jsxRuntime.jsx(VisionOffInfo, { onHandleDelete: handleDelete })), jsxRuntime.
|
|
21406
|
-
|
|
21407
|
-
|
|
21408
|
-
createMode: null,
|
|
21409
|
-
editMap: false,
|
|
21410
|
-
elementType: undefined,
|
|
21411
|
-
selectElement: null,
|
|
21412
|
-
isShowDrag: false,
|
|
21413
|
-
});
|
|
21414
|
-
}, children: "Cancel" })] })] }));
|
|
21689
|
+
return (jsxRuntime.jsxs("div", { className: styles$9.handleElementInfo, children: [editMapInfo?.elementType !== DataType.BOUNDARY ? (jsxRuntime.jsxs("div", { className: styles$9.undoAndRedo, children: [jsxRuntime.jsx("div", { className: classNames(styles$9.undo, { [styles$9.disabled]: isUndoDisabled }), onClick: handleUndo, children: jsxRuntime.jsx(SvgUndo, {}) }), jsxRuntime.jsx("div", { className: classNames(styles$9.redo, { [styles$9.disabled]: idRedoDisabled }), onClick: handleRedo, children: jsxRuntime.jsx(SvgRedo, {}) })] })) : null, editMapInfo?.elementType === DataType.BOUNDARY && (jsxRuntime.jsx(BoundaryInfo, { onHandleDelete: handleDelete })), editMapInfo?.elementType === DataType.OBSTACLE && (jsxRuntime.jsx(ObstacleInfo, { onHandleDelete: handleDelete })), editMapInfo?.elementType === DataType.DOODLE && jsxRuntime.jsx(DoodleInfo, { onHandleDelete: handleDelete }), editMapInfo?.elementType === DataType.VISION_OFF && (jsxRuntime.jsx(VisionOffInfo, { onHandleDelete: handleDelete })), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsx("div", { className: styles$9.handle, children: jsxRuntime.jsxs(antd.Space, { size: 12, children: [jsxRuntime.jsx(antd.Button, { variant: "outlined", color: "default", onClick: () => {
|
|
21690
|
+
handleCancel();
|
|
21691
|
+
}, children: "Cancel" }), jsxRuntime.jsx(antd.Button, { variant: "solid", color: "primary", onClick: handleSave, children: "Save" })] }) })] }));
|
|
21415
21692
|
};
|
|
21416
21693
|
|
|
21417
21694
|
var _path;
|
|
@@ -21537,7 +21814,7 @@ const defaultMapConfig = DEFAULT_STYLES;
|
|
|
21537
21814
|
// 地图渲染器组件
|
|
21538
21815
|
const MowerMapRenderer = React.forwardRef(({ sn, platform = PlatformType.WEB, edger = false, unitType = UnitsType.Imperial, language = 'en', onlyRead = false, mapConfig,
|
|
21539
21816
|
// pathConfig,
|
|
21540
|
-
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,
|
|
21817
|
+
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) => {
|
|
21541
21818
|
const [currentError, setCurrentError] = React.useState(null);
|
|
21542
21819
|
const overlayRef = React.useRef(null);
|
|
21543
21820
|
// const mapRef = useMap();
|
|
@@ -21593,7 +21870,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
21593
21870
|
onSaveMap,
|
|
21594
21871
|
onHandleDeleteElement,
|
|
21595
21872
|
onUpdateBoundary,
|
|
21596
|
-
|
|
21873
|
+
onHandleEvent,
|
|
21597
21874
|
};
|
|
21598
21875
|
}, [
|
|
21599
21876
|
minDistance,
|
|
@@ -21605,7 +21882,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
21605
21882
|
onSaveBoundaryData,
|
|
21606
21883
|
onSaveMap,
|
|
21607
21884
|
onUpdateBoundary,
|
|
21608
|
-
|
|
21885
|
+
onHandleEvent,
|
|
21609
21886
|
]);
|
|
21610
21887
|
// 合并配置
|
|
21611
21888
|
const mergedMapConfig = React.useMemo(() => {
|
|
@@ -21639,6 +21916,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
21639
21916
|
drag: defaultTransform,
|
|
21640
21917
|
mapRef,
|
|
21641
21918
|
overlayScale,
|
|
21919
|
+
doodleList,
|
|
21642
21920
|
};
|
|
21643
21921
|
}, [
|
|
21644
21922
|
sn,
|
|
@@ -21653,6 +21931,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
21653
21931
|
defaultTransform,
|
|
21654
21932
|
mapRef,
|
|
21655
21933
|
overlayScale,
|
|
21934
|
+
doodleList,
|
|
21656
21935
|
]);
|
|
21657
21936
|
// console.log('svgElementDatas->', svgElementDatas, unStructMapData, commonValue);
|
|
21658
21937
|
// 处理地图分区边界
|
|
@@ -21894,7 +22173,15 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
21894
22173
|
// 基于固定的参考zoom级别计算overlayScale
|
|
21895
22174
|
const zoomDiff = currentZoom - REFERENCE_ZOOM;
|
|
21896
22175
|
const scale = Math.pow(2, -zoomDiff); // 负数实现反向缩放
|
|
21897
|
-
|
|
22176
|
+
if (scale < 1) {
|
|
22177
|
+
setOverlayScale(1);
|
|
22178
|
+
}
|
|
22179
|
+
else if (scale > 4) {
|
|
22180
|
+
setOverlayScale(4);
|
|
22181
|
+
}
|
|
22182
|
+
else {
|
|
22183
|
+
setOverlayScale(scale);
|
|
22184
|
+
}
|
|
21898
22185
|
};
|
|
21899
22186
|
// 使用lodash throttle进行节流处理: 100ms内只执行一次
|
|
21900
22187
|
const handleZoomChanged = throttle$2(updateScale, 50);
|
|
@@ -21987,6 +22274,8 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
21987
22274
|
addHistory: (history) => svgEditMapRef.current?.addHistory(history),
|
|
21988
22275
|
// 添加doodle
|
|
21989
22276
|
addDoodle: (doodle) => svgEditMapRef.current?.addDoodle(doodle),
|
|
22277
|
+
// 检查doodle
|
|
22278
|
+
checkDoodle: () => svgEditMapRef.current?.checkDoodle?.(),
|
|
21990
22279
|
}));
|
|
21991
22280
|
/**
|
|
21992
22281
|
* 根据割草机的位置更新路径
|