@fleet-frontend/mower-maps 0.2.0-beta.59 → 0.2.0-beta.60
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 +7 -7
- package/dist/index.js +7 -7
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -28845,7 +28845,7 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
28845
28845
|
const [processStateIsMowing, setProcessStateIsMowing] = useState(false);
|
|
28846
28846
|
const [currentMowingPartitionId, setCurrentMowingPartitionId] = useState('');
|
|
28847
28847
|
const [mowPartitionData, setMowPartitionData] = useState(null);
|
|
28848
|
-
const
|
|
28848
|
+
const isTaskDelayRef = useRef(false);
|
|
28849
28849
|
// drag.x/y 现在存储的是 EPSG:3857 投影坐标的偏移量(米)
|
|
28850
28850
|
const [drag, setDrag] = useState({
|
|
28851
28851
|
x: 0,
|
|
@@ -29151,7 +29151,6 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
29151
29151
|
return;
|
|
29152
29152
|
}
|
|
29153
29153
|
let curMowPartitionData = mowPartitionData;
|
|
29154
|
-
let currentIsTaskDelay = isTaskDelay;
|
|
29155
29154
|
// realtime中包含当前割草任务的数据,根据数据进行path路径和边界的高亮操作,
|
|
29156
29155
|
const mowingPartition = realTimeData.find((item) => item.type === RealTimeDataType.PARTITION);
|
|
29157
29156
|
if (mowingPartition) {
|
|
@@ -29162,18 +29161,19 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
29162
29161
|
const vehicleStatusData = realTimeData?.find((item) => item?.type === RealTimeDataType.STATUS);
|
|
29163
29162
|
if (vehicleStatusData) {
|
|
29164
29163
|
// 如果上一次状态是true,当前变成了false,则认为不需要高亮分区
|
|
29165
|
-
|
|
29164
|
+
// console.error('isTaskDelayRef.current 000---->', isTaskDelayRef.current, vehicleStatusData?.taskDelay);
|
|
29165
|
+
if (isTaskDelayRef.current === true && vehicleStatusData?.taskDelay === false) {
|
|
29166
29166
|
// 兜底收不到割草地块的实时数据,使用状态来兜底
|
|
29167
29167
|
setMowingPartitions(undefined);
|
|
29168
29168
|
setMowPartitionData({});
|
|
29169
29169
|
curMowPartitionData = {};
|
|
29170
29170
|
}
|
|
29171
|
-
|
|
29172
|
-
|
|
29171
|
+
isTaskDelayRef.current = vehicleStatusData?.taskDelay !== undefined ? vehicleStatusData?.taskDelay : isTaskDelayRef.current;
|
|
29172
|
+
// console.error('isTaskDelayRef.current 111---->', isTaskDelayRef.current);
|
|
29173
29173
|
}
|
|
29174
29174
|
const positionData = realTimeData?.find((item) => item?.type === RealTimeDataType.LOCATION);
|
|
29175
29175
|
// 如果当前是taskDelay的状态,或者状态为mowing或者standby,则指定的地块需要高亮,或者全局高亮
|
|
29176
|
-
if ((
|
|
29176
|
+
if ((isTaskDelayRef.current || positionData?.vehicleState === RobotStatus.MOWING || positionData?.vehicleState === RobotStatus.STANDBY) &&
|
|
29177
29177
|
curMowPartitionData &&
|
|
29178
29178
|
!curMowPartitionData?.partitionIds) {
|
|
29179
29179
|
// 设置全局高亮
|
|
@@ -29190,7 +29190,7 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
29190
29190
|
};
|
|
29191
29191
|
}
|
|
29192
29192
|
}
|
|
29193
|
-
else if (!
|
|
29193
|
+
else if (!isTaskDelayRef.current && positionData?.vehicleState === RobotStatus.WORKING) {
|
|
29194
29194
|
// 兜底收不到割草地块的实时数据,使用状态来兜底
|
|
29195
29195
|
setMowingPartitions(undefined);
|
|
29196
29196
|
setMowPartitionData({});
|
package/dist/index.js
CHANGED
|
@@ -28865,7 +28865,7 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
28865
28865
|
const [processStateIsMowing, setProcessStateIsMowing] = React.useState(false);
|
|
28866
28866
|
const [currentMowingPartitionId, setCurrentMowingPartitionId] = React.useState('');
|
|
28867
28867
|
const [mowPartitionData, setMowPartitionData] = React.useState(null);
|
|
28868
|
-
const
|
|
28868
|
+
const isTaskDelayRef = React.useRef(false);
|
|
28869
28869
|
// drag.x/y 现在存储的是 EPSG:3857 投影坐标的偏移量(米)
|
|
28870
28870
|
const [drag, setDrag] = React.useState({
|
|
28871
28871
|
x: 0,
|
|
@@ -29171,7 +29171,6 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
29171
29171
|
return;
|
|
29172
29172
|
}
|
|
29173
29173
|
let curMowPartitionData = mowPartitionData;
|
|
29174
|
-
let currentIsTaskDelay = isTaskDelay;
|
|
29175
29174
|
// realtime中包含当前割草任务的数据,根据数据进行path路径和边界的高亮操作,
|
|
29176
29175
|
const mowingPartition = realTimeData.find((item) => item.type === RealTimeDataType.PARTITION);
|
|
29177
29176
|
if (mowingPartition) {
|
|
@@ -29182,18 +29181,19 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
29182
29181
|
const vehicleStatusData = realTimeData?.find((item) => item?.type === RealTimeDataType.STATUS);
|
|
29183
29182
|
if (vehicleStatusData) {
|
|
29184
29183
|
// 如果上一次状态是true,当前变成了false,则认为不需要高亮分区
|
|
29185
|
-
|
|
29184
|
+
// console.error('isTaskDelayRef.current 000---->', isTaskDelayRef.current, vehicleStatusData?.taskDelay);
|
|
29185
|
+
if (isTaskDelayRef.current === true && vehicleStatusData?.taskDelay === false) {
|
|
29186
29186
|
// 兜底收不到割草地块的实时数据,使用状态来兜底
|
|
29187
29187
|
setMowingPartitions(undefined);
|
|
29188
29188
|
setMowPartitionData({});
|
|
29189
29189
|
curMowPartitionData = {};
|
|
29190
29190
|
}
|
|
29191
|
-
|
|
29192
|
-
|
|
29191
|
+
isTaskDelayRef.current = vehicleStatusData?.taskDelay !== undefined ? vehicleStatusData?.taskDelay : isTaskDelayRef.current;
|
|
29192
|
+
// console.error('isTaskDelayRef.current 111---->', isTaskDelayRef.current);
|
|
29193
29193
|
}
|
|
29194
29194
|
const positionData = realTimeData?.find((item) => item?.type === RealTimeDataType.LOCATION);
|
|
29195
29195
|
// 如果当前是taskDelay的状态,或者状态为mowing或者standby,则指定的地块需要高亮,或者全局高亮
|
|
29196
|
-
if ((
|
|
29196
|
+
if ((isTaskDelayRef.current || positionData?.vehicleState === RobotStatus.MOWING || positionData?.vehicleState === RobotStatus.STANDBY) &&
|
|
29197
29197
|
curMowPartitionData &&
|
|
29198
29198
|
!curMowPartitionData?.partitionIds) {
|
|
29199
29199
|
// 设置全局高亮
|
|
@@ -29210,7 +29210,7 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
29210
29210
|
};
|
|
29211
29211
|
}
|
|
29212
29212
|
}
|
|
29213
|
-
else if (!
|
|
29213
|
+
else if (!isTaskDelayRef.current && positionData?.vehicleState === RobotStatus.WORKING) {
|
|
29214
29214
|
// 兜底收不到割草地块的实时数据,使用状态来兜底
|
|
29215
29215
|
setMowingPartitions(undefined);
|
|
29216
29216
|
setMowPartitionData({});
|