集成接口 开始执行任务的领域层和数据层和UI层的开发啊(待测试)
集成功能 暂停 取消功能 恢复功能的接口的领域层和数据层的开发 下一步待集成到页面上 优化功能,优化了接口异常和未知异常对页面渲染的影响对用户的体验的不好情况。具体通过弹窗友好提示! 优化更新了tcp指示灯点击出现机器状态中添加选中设备的编号 方便用户使用的明白明了!。 优化更新关闭了tcp重连操作内链条中的获取用户设备和切换设备操作项。 调整了获取无人机状态信息的更新频率 为14秒一次
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import '../../domain/entities/device_task_entity.dart';
|
||||
|
||||
enum DeviceTaskOperationType {
|
||||
none,
|
||||
cancel,
|
||||
pause,
|
||||
recovery,
|
||||
}
|
||||
|
||||
class DeviceTaskState extends Equatable {
|
||||
final List<DeviceTaskEntity> taskPool;
|
||||
final DeviceTaskEntity? currentTask;
|
||||
final int? currentTaskId;
|
||||
final bool isLoading;
|
||||
final String? errorMessage;
|
||||
final DeviceTaskOperationType operationType;
|
||||
final bool shouldShowError; // 🔥 标记是否需要显示错误弹窗
|
||||
|
||||
const DeviceTaskState({
|
||||
this.taskPool = const [],
|
||||
this.currentTask,
|
||||
this.currentTaskId,
|
||||
this.isLoading = false,
|
||||
this.errorMessage,
|
||||
this.operationType = DeviceTaskOperationType.none,
|
||||
this.shouldShowError = false,
|
||||
});
|
||||
|
||||
DeviceTaskState copyWith({
|
||||
List<DeviceTaskEntity>? taskPool,
|
||||
DeviceTaskEntity? currentTask,
|
||||
int? currentTaskId,
|
||||
bool? isLoading,
|
||||
String? errorMessage,
|
||||
DeviceTaskOperationType? operationType,
|
||||
bool? shouldShowError,
|
||||
}) {
|
||||
return DeviceTaskState(
|
||||
taskPool: taskPool ?? this.taskPool,
|
||||
currentTask: currentTask ?? this.currentTask,
|
||||
currentTaskId: currentTaskId ?? this.currentTaskId,
|
||||
isLoading: isLoading ?? this.isLoading,
|
||||
errorMessage: errorMessage,
|
||||
operationType: operationType ?? this.operationType,
|
||||
shouldShowError: shouldShowError ?? false, // 🔥 默认重置为 false
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
taskPool,
|
||||
currentTask,
|
||||
currentTaskId,
|
||||
isLoading,
|
||||
errorMessage,
|
||||
operationType,
|
||||
shouldShowError,
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user