@fleet-frontend/mower-maps 0.2.0-beta.10 → 0.2.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/constants.d.ts +6 -6
- package/dist/config/styles.d.ts +1 -1
- package/dist/index.esm.js +33 -23
- package/dist/index.js +33 -23
- package/dist/render/svgEditMap/hooks/usePolygonDrawing.d.ts.map +1 -1
- package/dist/render/svgElement/ObstacleElement/index.d.ts.map +1 -1
- package/dist/render/svgElement/PolygonELement/dashPath/index.d.ts.map +1 -1
- package/dist/render/svgElement/PolygonELement/index.d.ts.map +1 -1
- package/dist/render/svgElement/TransformWrapper/VisionOffTransformWrapper/VisionOffTransformWrapper.d.ts.map +1 -1
- package/dist/utils/dateTimeUtils.d.ts.map +1 -1
- package/dist/utils/display.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -9,14 +9,14 @@ export declare const SCALE_FACTOR = 50;
|
|
|
9
9
|
* 默认线宽设置
|
|
10
10
|
*/
|
|
11
11
|
export declare const DEFAULT_LINE_WIDTHS: {
|
|
12
|
-
readonly BOUNDARY:
|
|
13
|
-
readonly OBSTACLE:
|
|
14
|
-
readonly CHARGING_PILE:
|
|
15
|
-
readonly CHANNEL:
|
|
12
|
+
readonly BOUNDARY: 3;
|
|
13
|
+
readonly OBSTACLE: 3;
|
|
14
|
+
readonly CHARGING_PILE: 3;
|
|
15
|
+
readonly CHANNEL: 3;
|
|
16
16
|
readonly PATH: 20;
|
|
17
17
|
readonly PATH_TRANS: 6;
|
|
18
|
-
readonly VISION_OFF_AREA:
|
|
19
|
-
readonly TUNNEL:
|
|
18
|
+
readonly VISION_OFF_AREA: 3;
|
|
19
|
+
readonly TUNNEL: 3;
|
|
20
20
|
readonly TIME_LIMIT_OBSTACLE: 1;
|
|
21
21
|
};
|
|
22
22
|
/**
|
package/dist/config/styles.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -2,6 +2,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { memo, useMemo, useEffect, useState, useRef, useCallback, createContext, useContext, forwardRef, useImperativeHandle, useLayoutEffect } from 'react';
|
|
4
4
|
import ReactDOM from 'react-dom';
|
|
5
|
+
import { message } from 'antd';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* 常量和枚举类型定义
|
|
@@ -55,11 +56,12 @@ const SCALE_FACTOR = 50; // 50像素/米
|
|
|
55
56
|
* 默认线宽设置
|
|
56
57
|
*/
|
|
57
58
|
const DEFAULT_LINE_WIDTHS = {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
BOUNDARY: 3,
|
|
60
|
+
OBSTACLE: 3,
|
|
61
|
+
CHARGING_PILE: 3,
|
|
62
|
+
CHANNEL: 3,
|
|
61
63
|
PATH: 20,
|
|
62
|
-
VISION_OFF_AREA:
|
|
64
|
+
VISION_OFF_AREA: 3,
|
|
63
65
|
TIME_LIMIT_OBSTACLE: 1,
|
|
64
66
|
};
|
|
65
67
|
/**
|
|
@@ -1004,7 +1006,7 @@ class UnifiedMapDataProcessor {
|
|
|
1004
1006
|
const BOUNDARY_STYLES = {
|
|
1005
1007
|
lineColor: '#ffffff',
|
|
1006
1008
|
fillColor: 'rgba(239, 255, 237, 0.1)', // 更鲜艳的绿色半透明填充,增强可见性
|
|
1007
|
-
lineWidth:
|
|
1009
|
+
lineWidth: DEFAULT_LINE_WIDTHS.BOUNDARY,
|
|
1008
1010
|
opacity: DEFAULT_OPACITIES.FULL,
|
|
1009
1011
|
mowingLineColor: 'rgba(99, 216, 174, 1)',
|
|
1010
1012
|
};
|
|
@@ -1582,8 +1584,9 @@ function calculateMapGpsCenter(mapData) {
|
|
|
1582
1584
|
|
|
1583
1585
|
function dp2px(dp, customDensity = null) {
|
|
1584
1586
|
// 使用自定义密度或设备像素比
|
|
1585
|
-
const density = customDensity || (typeof window !== 'undefined' ? window.devicePixelRatio : 1);
|
|
1586
|
-
return Math.round(dp * density + 0.5);
|
|
1587
|
+
// const density = customDensity || (typeof window !== 'undefined' ? window.devicePixelRatio : 1);
|
|
1588
|
+
// return Math.round(dp * density + 0.5);
|
|
1589
|
+
return dp;
|
|
1587
1590
|
}
|
|
1588
1591
|
|
|
1589
1592
|
/**
|
|
@@ -4969,7 +4972,7 @@ function convertAreaByUnits(area, type = UnitsType.Metric) {
|
|
|
4969
4972
|
return {
|
|
4970
4973
|
originNum: acres,
|
|
4971
4974
|
numStr: result,
|
|
4972
|
-
value: `${
|
|
4975
|
+
value: `${result} ${UnitsAreaType.ACRE}`,
|
|
4973
4976
|
unit: UnitsAreaType.ACRE,
|
|
4974
4977
|
};
|
|
4975
4978
|
}
|
|
@@ -5011,9 +5014,9 @@ function getWeekEnd(date) {
|
|
|
5011
5014
|
* @returns 是否为同一天
|
|
5012
5015
|
*/
|
|
5013
5016
|
function isSameDay(date1, date2) {
|
|
5014
|
-
return date1.getFullYear() === date2.getFullYear() &&
|
|
5017
|
+
return (date1.getFullYear() === date2.getFullYear() &&
|
|
5015
5018
|
date1.getMonth() === date2.getMonth() &&
|
|
5016
|
-
date1.getDate() === date2.getDate();
|
|
5019
|
+
date1.getDate() === date2.getDate());
|
|
5017
5020
|
}
|
|
5018
5021
|
/**
|
|
5019
5022
|
* 判断是否为今天
|
|
@@ -5077,7 +5080,7 @@ function getWeekdayAbbr(date) {
|
|
|
5077
5080
|
*/
|
|
5078
5081
|
function formatBoundaryDateText(timestamp) {
|
|
5079
5082
|
if (!timestamp || timestamp <= 0) {
|
|
5080
|
-
return '
|
|
5083
|
+
return '-';
|
|
5081
5084
|
}
|
|
5082
5085
|
const date = new Date(timestamp * 1000); // 转换为毫秒
|
|
5083
5086
|
const timeStr = formatTime(date);
|
|
@@ -15066,7 +15069,7 @@ function generateStraightParallelPaths(points, offsetDistance) {
|
|
|
15066
15069
|
}
|
|
15067
15070
|
const DashPath = ({ points, stroke, strokeWidth, strokeOpacity, className, }) => {
|
|
15068
15071
|
const [parallelPath2Data, parallelPath1Data] = generateStraightParallelPaths(points, strokeWidth);
|
|
15069
|
-
return (jsxs(Fragment, { children: [jsx("path", { fill: "none", d: parallelPath2Data, stroke: stroke, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", strokeDasharray: `${strokeWidth}px ${strokeWidth * 2}px`, style: { pointerEvents: 'none' }
|
|
15072
|
+
return (jsxs(Fragment, { children: [jsx("path", { fill: "none", d: parallelPath2Data, stroke: stroke, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", strokeDasharray: `${strokeWidth}px ${strokeWidth * 2}px`, style: { pointerEvents: 'none' } }), jsx("path", { fill: "none", d: parallelPath1Data, stroke: stroke, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", strokeDasharray: `${strokeWidth}px ${strokeWidth * 2}px`, style: { pointerEvents: 'none' } })] }));
|
|
15070
15073
|
};
|
|
15071
15074
|
|
|
15072
15075
|
const VertexElement = React__default.memo(({ r, stroke, ...props }) => {
|
|
@@ -16037,9 +16040,7 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
|
|
|
16037
16040
|
}
|
|
16038
16041
|
else {
|
|
16039
16042
|
// 更新拖拽顶点的位置
|
|
16040
|
-
if (showNotCreateCursor)
|
|
16041
|
-
newCoordinates[dragState.dragIndex] = dragState.originalPosition;
|
|
16042
|
-
}
|
|
16043
|
+
if (showNotCreateCursor) ;
|
|
16043
16044
|
else {
|
|
16044
16045
|
newCoordinates[dragState.dragIndex] = dragState.currentPosition;
|
|
16045
16046
|
}
|
|
@@ -16047,7 +16048,12 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
|
|
|
16047
16048
|
const result = editMapInfo?.createMode === CreateStatus.CREATING
|
|
16048
16049
|
? newCoordinates
|
|
16049
16050
|
: newCoordinates.reverse();
|
|
16050
|
-
|
|
16051
|
+
if (showNotCreateCursor) {
|
|
16052
|
+
message.error('Unable to place here, please select a valid spot');
|
|
16053
|
+
}
|
|
16054
|
+
else {
|
|
16055
|
+
onCoordinatesChange?.(result);
|
|
16056
|
+
}
|
|
16051
16057
|
}
|
|
16052
16058
|
setDragState({
|
|
16053
16059
|
isDragging: false,
|
|
@@ -16487,9 +16493,9 @@ const ObstacleElement = ({ data }) => {
|
|
|
16487
16493
|
if (platform === PlatformType.H5 &&
|
|
16488
16494
|
editMapInfo?.selectElement?.id === data.id &&
|
|
16489
16495
|
editMapInfo.mobileMode === MobileEditMode.START) {
|
|
16490
|
-
return (style.lineWidth ||
|
|
16496
|
+
return dp2px((style.lineWidth || 3) * 3);
|
|
16491
16497
|
}
|
|
16492
|
-
return style.lineWidth ||
|
|
16498
|
+
return dp2px(style.lineWidth || 3);
|
|
16493
16499
|
}, [platform, style, editMapInfo]);
|
|
16494
16500
|
const onPathClick = useCallback(() => {
|
|
16495
16501
|
if (platform === PlatformType.H5) {
|
|
@@ -17148,10 +17154,10 @@ const VisionOffTransformWrapper = ({ data, isSelected = false, onSelect, onCance
|
|
|
17148
17154
|
if (platform === PlatformType.H5) {
|
|
17149
17155
|
if (editMapInfo?.mobileMode === MobileEditMode.START &&
|
|
17150
17156
|
editMapInfo?.selectElement?.id === data.id) {
|
|
17151
|
-
return (style.lineWidth || 2) * 2;
|
|
17157
|
+
return dp2px((style.lineWidth || 2) * 2);
|
|
17152
17158
|
}
|
|
17153
17159
|
}
|
|
17154
|
-
return style.lineWidth || 2;
|
|
17160
|
+
return dp2px(style.lineWidth || 2);
|
|
17155
17161
|
}, [style, platform, editMapInfo, data]);
|
|
17156
17162
|
// 初始化 - 无论是否选中都要初始化点坐标
|
|
17157
17163
|
useEffect(() => {
|
|
@@ -19305,7 +19311,7 @@ function usePolygonDrawing(options = {}) {
|
|
|
19305
19311
|
const [mousePos, setMousePos] = useState(null);
|
|
19306
19312
|
const { editMapInfo, setEditMapInfo } = useMapEditContext();
|
|
19307
19313
|
const { checkCanNotCreateAtPosition } = useCheckElement();
|
|
19308
|
-
const { addHistory} = useHistoryHandle();
|
|
19314
|
+
const { addHistory } = useHistoryHandle();
|
|
19309
19315
|
const points = useMemo(() => {
|
|
19310
19316
|
console.log('points->', editMapInfo?.selectElement?.points);
|
|
19311
19317
|
return editMapInfo?.selectElement?.points?.map((item) => ({ x: item[0], y: item[1] })) || [];
|
|
@@ -19332,8 +19338,12 @@ function usePolygonDrawing(options = {}) {
|
|
|
19332
19338
|
return; // 仅在创建模式下且未完成时添加点
|
|
19333
19339
|
const svgEl = e.currentTarget;
|
|
19334
19340
|
const p = getSvgPoint(svgEl, e.clientX, e.clientY);
|
|
19335
|
-
if (!p
|
|
19341
|
+
if (!p)
|
|
19342
|
+
return;
|
|
19343
|
+
if (checkCanNotCreateAtPosition(p)) {
|
|
19344
|
+
message.error('Unable to place here, please select a valid spot');
|
|
19336
19345
|
return;
|
|
19346
|
+
}
|
|
19337
19347
|
setEditMapInfo((pre) => {
|
|
19338
19348
|
return {
|
|
19339
19349
|
...pre,
|
|
@@ -19615,7 +19625,7 @@ const useCreateVisionOffElement = () => {
|
|
|
19615
19625
|
|
|
19616
19626
|
const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChange }, ref) => {
|
|
19617
19627
|
const pointManagerRef = useRef(null);
|
|
19618
|
-
const { editMapInfo, setEditMapInfo
|
|
19628
|
+
const { editMapInfo, setEditMapInfo } = useMapEditContext();
|
|
19619
19629
|
const { getVisionOffPoints, centerPoint } = useCreateVisionOffElement();
|
|
19620
19630
|
const { svgElementDatas } = useSvgEditContext();
|
|
19621
19631
|
const { checkCanNotCreateAtPosition, checkDoodle } = useCheckElement();
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var ReactDOM = require('react-dom');
|
|
6
|
+
var antd = require('antd');
|
|
6
7
|
|
|
7
8
|
function _interopNamespaceDefault(e) {
|
|
8
9
|
var n = Object.create(null);
|
|
@@ -75,11 +76,12 @@ const SCALE_FACTOR = 50; // 50像素/米
|
|
|
75
76
|
* 默认线宽设置
|
|
76
77
|
*/
|
|
77
78
|
const DEFAULT_LINE_WIDTHS = {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
BOUNDARY: 3,
|
|
80
|
+
OBSTACLE: 3,
|
|
81
|
+
CHARGING_PILE: 3,
|
|
82
|
+
CHANNEL: 3,
|
|
81
83
|
PATH: 20,
|
|
82
|
-
VISION_OFF_AREA:
|
|
84
|
+
VISION_OFF_AREA: 3,
|
|
83
85
|
TIME_LIMIT_OBSTACLE: 1,
|
|
84
86
|
};
|
|
85
87
|
/**
|
|
@@ -1024,7 +1026,7 @@ class UnifiedMapDataProcessor {
|
|
|
1024
1026
|
const BOUNDARY_STYLES = {
|
|
1025
1027
|
lineColor: '#ffffff',
|
|
1026
1028
|
fillColor: 'rgba(239, 255, 237, 0.1)', // 更鲜艳的绿色半透明填充,增强可见性
|
|
1027
|
-
lineWidth:
|
|
1029
|
+
lineWidth: DEFAULT_LINE_WIDTHS.BOUNDARY,
|
|
1028
1030
|
opacity: DEFAULT_OPACITIES.FULL,
|
|
1029
1031
|
mowingLineColor: 'rgba(99, 216, 174, 1)',
|
|
1030
1032
|
};
|
|
@@ -1602,8 +1604,9 @@ function calculateMapGpsCenter(mapData) {
|
|
|
1602
1604
|
|
|
1603
1605
|
function dp2px(dp, customDensity = null) {
|
|
1604
1606
|
// 使用自定义密度或设备像素比
|
|
1605
|
-
const density = customDensity || (typeof window !== 'undefined' ? window.devicePixelRatio : 1);
|
|
1606
|
-
return Math.round(dp * density + 0.5);
|
|
1607
|
+
// const density = customDensity || (typeof window !== 'undefined' ? window.devicePixelRatio : 1);
|
|
1608
|
+
// return Math.round(dp * density + 0.5);
|
|
1609
|
+
return dp;
|
|
1607
1610
|
}
|
|
1608
1611
|
|
|
1609
1612
|
/**
|
|
@@ -4989,7 +4992,7 @@ function convertAreaByUnits(area, type = UnitsType.Metric) {
|
|
|
4989
4992
|
return {
|
|
4990
4993
|
originNum: acres,
|
|
4991
4994
|
numStr: result,
|
|
4992
|
-
value: `${
|
|
4995
|
+
value: `${result} ${UnitsAreaType.ACRE}`,
|
|
4993
4996
|
unit: UnitsAreaType.ACRE,
|
|
4994
4997
|
};
|
|
4995
4998
|
}
|
|
@@ -5031,9 +5034,9 @@ function getWeekEnd(date) {
|
|
|
5031
5034
|
* @returns 是否为同一天
|
|
5032
5035
|
*/
|
|
5033
5036
|
function isSameDay(date1, date2) {
|
|
5034
|
-
return date1.getFullYear() === date2.getFullYear() &&
|
|
5037
|
+
return (date1.getFullYear() === date2.getFullYear() &&
|
|
5035
5038
|
date1.getMonth() === date2.getMonth() &&
|
|
5036
|
-
date1.getDate() === date2.getDate();
|
|
5039
|
+
date1.getDate() === date2.getDate());
|
|
5037
5040
|
}
|
|
5038
5041
|
/**
|
|
5039
5042
|
* 判断是否为今天
|
|
@@ -5097,7 +5100,7 @@ function getWeekdayAbbr(date) {
|
|
|
5097
5100
|
*/
|
|
5098
5101
|
function formatBoundaryDateText(timestamp) {
|
|
5099
5102
|
if (!timestamp || timestamp <= 0) {
|
|
5100
|
-
return '
|
|
5103
|
+
return '-';
|
|
5101
5104
|
}
|
|
5102
5105
|
const date = new Date(timestamp * 1000); // 转换为毫秒
|
|
5103
5106
|
const timeStr = formatTime(date);
|
|
@@ -15086,7 +15089,7 @@ function generateStraightParallelPaths(points, offsetDistance) {
|
|
|
15086
15089
|
}
|
|
15087
15090
|
const DashPath = ({ points, stroke, strokeWidth, strokeOpacity, className, }) => {
|
|
15088
15091
|
const [parallelPath2Data, parallelPath1Data] = generateStraightParallelPaths(points, strokeWidth);
|
|
15089
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("path", { fill: "none", d: parallelPath2Data, stroke: stroke, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", strokeDasharray: `${strokeWidth}px ${strokeWidth * 2}px`, style: { pointerEvents: 'none' }
|
|
15092
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("path", { fill: "none", d: parallelPath2Data, stroke: stroke, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", strokeDasharray: `${strokeWidth}px ${strokeWidth * 2}px`, style: { pointerEvents: 'none' } }), jsxRuntime.jsx("path", { fill: "none", d: parallelPath1Data, stroke: stroke, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", strokeDasharray: `${strokeWidth}px ${strokeWidth * 2}px`, style: { pointerEvents: 'none' } })] }));
|
|
15090
15093
|
};
|
|
15091
15094
|
|
|
15092
15095
|
const VertexElement = React.memo(({ r, stroke, ...props }) => {
|
|
@@ -16057,9 +16060,7 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
|
|
|
16057
16060
|
}
|
|
16058
16061
|
else {
|
|
16059
16062
|
// 更新拖拽顶点的位置
|
|
16060
|
-
if (showNotCreateCursor)
|
|
16061
|
-
newCoordinates[dragState.dragIndex] = dragState.originalPosition;
|
|
16062
|
-
}
|
|
16063
|
+
if (showNotCreateCursor) ;
|
|
16063
16064
|
else {
|
|
16064
16065
|
newCoordinates[dragState.dragIndex] = dragState.currentPosition;
|
|
16065
16066
|
}
|
|
@@ -16067,7 +16068,12 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
|
|
|
16067
16068
|
const result = editMapInfo?.createMode === exports.CreateStatus.CREATING
|
|
16068
16069
|
? newCoordinates
|
|
16069
16070
|
: newCoordinates.reverse();
|
|
16070
|
-
|
|
16071
|
+
if (showNotCreateCursor) {
|
|
16072
|
+
antd.message.error('Unable to place here, please select a valid spot');
|
|
16073
|
+
}
|
|
16074
|
+
else {
|
|
16075
|
+
onCoordinatesChange?.(result);
|
|
16076
|
+
}
|
|
16071
16077
|
}
|
|
16072
16078
|
setDragState({
|
|
16073
16079
|
isDragging: false,
|
|
@@ -16507,9 +16513,9 @@ const ObstacleElement = ({ data }) => {
|
|
|
16507
16513
|
if (platform === exports.PlatformType.H5 &&
|
|
16508
16514
|
editMapInfo?.selectElement?.id === data.id &&
|
|
16509
16515
|
editMapInfo.mobileMode === exports.MobileEditMode.START) {
|
|
16510
|
-
return (style.lineWidth ||
|
|
16516
|
+
return dp2px((style.lineWidth || 3) * 3);
|
|
16511
16517
|
}
|
|
16512
|
-
return style.lineWidth ||
|
|
16518
|
+
return dp2px(style.lineWidth || 3);
|
|
16513
16519
|
}, [platform, style, editMapInfo]);
|
|
16514
16520
|
const onPathClick = React.useCallback(() => {
|
|
16515
16521
|
if (platform === exports.PlatformType.H5) {
|
|
@@ -17168,10 +17174,10 @@ const VisionOffTransformWrapper = ({ data, isSelected = false, onSelect, onCance
|
|
|
17168
17174
|
if (platform === exports.PlatformType.H5) {
|
|
17169
17175
|
if (editMapInfo?.mobileMode === exports.MobileEditMode.START &&
|
|
17170
17176
|
editMapInfo?.selectElement?.id === data.id) {
|
|
17171
|
-
return (style.lineWidth || 2) * 2;
|
|
17177
|
+
return dp2px((style.lineWidth || 2) * 2);
|
|
17172
17178
|
}
|
|
17173
17179
|
}
|
|
17174
|
-
return style.lineWidth || 2;
|
|
17180
|
+
return dp2px(style.lineWidth || 2);
|
|
17175
17181
|
}, [style, platform, editMapInfo, data]);
|
|
17176
17182
|
// 初始化 - 无论是否选中都要初始化点坐标
|
|
17177
17183
|
React.useEffect(() => {
|
|
@@ -19325,7 +19331,7 @@ function usePolygonDrawing(options = {}) {
|
|
|
19325
19331
|
const [mousePos, setMousePos] = React.useState(null);
|
|
19326
19332
|
const { editMapInfo, setEditMapInfo } = useMapEditContext();
|
|
19327
19333
|
const { checkCanNotCreateAtPosition } = useCheckElement();
|
|
19328
|
-
const { addHistory} = useHistoryHandle();
|
|
19334
|
+
const { addHistory } = useHistoryHandle();
|
|
19329
19335
|
const points = React.useMemo(() => {
|
|
19330
19336
|
console.log('points->', editMapInfo?.selectElement?.points);
|
|
19331
19337
|
return editMapInfo?.selectElement?.points?.map((item) => ({ x: item[0], y: item[1] })) || [];
|
|
@@ -19352,8 +19358,12 @@ function usePolygonDrawing(options = {}) {
|
|
|
19352
19358
|
return; // 仅在创建模式下且未完成时添加点
|
|
19353
19359
|
const svgEl = e.currentTarget;
|
|
19354
19360
|
const p = getSvgPoint(svgEl, e.clientX, e.clientY);
|
|
19355
|
-
if (!p
|
|
19361
|
+
if (!p)
|
|
19362
|
+
return;
|
|
19363
|
+
if (checkCanNotCreateAtPosition(p)) {
|
|
19364
|
+
antd.message.error('Unable to place here, please select a valid spot');
|
|
19356
19365
|
return;
|
|
19366
|
+
}
|
|
19357
19367
|
setEditMapInfo((pre) => {
|
|
19358
19368
|
return {
|
|
19359
19369
|
...pre,
|
|
@@ -19635,7 +19645,7 @@ const useCreateVisionOffElement = () => {
|
|
|
19635
19645
|
|
|
19636
19646
|
const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChange }, ref) => {
|
|
19637
19647
|
const pointManagerRef = React.useRef(null);
|
|
19638
|
-
const { editMapInfo, setEditMapInfo
|
|
19648
|
+
const { editMapInfo, setEditMapInfo } = useMapEditContext();
|
|
19639
19649
|
const { getVisionOffPoints, centerPoint } = useCreateVisionOffElement();
|
|
19640
19650
|
const { svgElementDatas } = useSvgEditContext();
|
|
19641
19651
|
const { checkCanNotCreateAtPosition, checkDoodle } = useCheckElement();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePolygonDrawing.d.ts","sourceRoot":"","sources":["../../../../src/render/svgEditMap/hooks/usePolygonDrawing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"usePolygonDrawing.d.ts","sourceRoot":"","sources":["../../../../src/render/svgEditMap/hooks/usePolygonDrawing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAOzE,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5C,MAAM,WAAW,wBAAwB;IAEvC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IAEtC,MAAM,EAAE,IAAI,EAAE,CAAC;IAEf,SAAS,EAAE,OAAO,CAAC;IAEnB,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;IAEtB,UAAU,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACrE,cAAc,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACzE,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAE5D,KAAK,EAAE,MAAM,IAAI,CAAC;IAElB,YAAY,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;CAC3C;AAgBD,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,uBAAuB,CAqIjG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/render/svgElement/ObstacleElement/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/render/svgElement/ObstacleElement/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAO7D,UAAU,oBAAoB;IAC5B,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,QAAA,MAAM,eAAe,GAAI,UAAU,oBAAoB,4CA6ItD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/render/svgElement/PolygonELement/dashPath/index.tsx"],"names":[],"mappings":"AAEA,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA0DD,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/render/svgElement/PolygonELement/dashPath/index.tsx"],"names":[],"mappings":"AAEA,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA0DD,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkCrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/render/svgElement/PolygonELement/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/render/svgElement/PolygonELement/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAmBjF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,aAAa,MAAM,EAAE,EAAE,KAAG,MAE7D,CAAC;AA0BF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAa,MAAM,EAAE,EAAE,EACvB,YAAW,OAAc,KACxB,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,CAyC5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,EAAE,EAAE,KAAG,MAUnD,CAAC;AAgBF,UAAU,mBAAmB;IAC3B,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAE3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,KAAK,IAAI,CAAC;IACxD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAE/C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA20BxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisionOffTransformWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/render/svgElement/TransformWrapper/VisionOffTransformWrapper/VisionOffTransformWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"VisionOffTransformWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/render/svgElement/TransformWrapper/VisionOffTransformWrapper/VisionOffTransformWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAepD,UAAU,8BAA8B;IACtC,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE;QAC9B,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,IAAI,CAAC;IACzC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B,gBAAgB,CAAC,EAAE;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CAoXvE,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateTimeUtils.d.ts","sourceRoot":"","sources":["../../src/utils/dateTimeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAS7C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAS3C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"dateTimeUtils.d.ts","sourceRoot":"","sources":["../../src/utils/dateTimeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAS7C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAS3C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,OAAO,CAM3D;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAG3C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAI/C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAM9C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAI7C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAGjD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CA8BhE;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAC/C,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CACtB,GACL,MAAM,CAwDR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/utils/display.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/utils/display.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,aAAa,GAAE,MAAM,GAAG,IAAW,UAKpE"}
|