Merge branch 'feature/my' of http://1.95.137.212:57001/APP/FlutterApp into feature/my

This commit is contained in:
mmc
2026-02-27 21:04:41 +08:00
11 changed files with 339 additions and 44 deletions

View File

@@ -16,6 +16,9 @@ class DevicesState extends Equatable {
final double? deviceLongitude; // 新增字段
final List<Map<String, dynamic>>? workRecords;
final DeviceOperationType operationType; // 标记当前操作类型
final List<Map<String, dynamic>>? pathData;
const DevicesState({
this.devices = const [],
this.selectedDevice,
@@ -25,6 +28,7 @@ class DevicesState extends Equatable {
this.deviceLongitude,
this.workRecords,
this.operationType = DeviceOperationType.none, // 默认无操作
this.pathData,
});
// 使用 copyWith 方便局部更新状态
@@ -37,6 +41,7 @@ class DevicesState extends Equatable {
double? deviceLongitude,
List<Map<String, dynamic>>? workRecords,
DeviceOperationType? operationType,
List<Map<String, dynamic>>? pathData,
}) {
return DevicesState(
devices: devices ?? this.devices,
@@ -45,6 +50,7 @@ class DevicesState extends Equatable {
errorMessage: errorMessage, // 错误信息通常每次更新都要重新赋值或清空
deviceLatitude: deviceLatitude ?? this.deviceLatitude,
deviceLongitude: deviceLongitude ?? this.deviceLongitude,
pathData: pathData ?? this.pathData,
workRecords: workRecords ?? this.workRecords,
operationType: operationType ?? this.operationType, // 更新操作类型
);
@@ -56,5 +62,6 @@ class DevicesState extends Equatable {
deviceLatitude,
deviceLongitude,
workRecords,
pathData,
];
}