路径规划点击 某项作业

This commit is contained in:
mmc
2026-02-28 09:55:14 +08:00
parent 4fd5877a3b
commit cf0c18f1ad
5 changed files with 276 additions and 158 deletions

View File

@@ -30,7 +30,7 @@ class DevicesCubit extends Cubit<DevicesState> {
this._deleteWorkRecordUseCase,
this._unbindDeviceUseCase,
this._updateDevicename,
this._selectWorkRecordUseCase
this._selectWorkRecordUseCase,
) : super(const DevicesState());
Future<void> unbindDevice(String deviceId, String deviceName) async {
@@ -86,7 +86,11 @@ class DevicesCubit extends Cubit<DevicesState> {
);
} catch (e) {
emit(
state.copyWith(isLoading: false, errorMessage: '解绑异常:${e.toString()}', operationType: DeviceOperationType.none),
state.copyWith(
isLoading: false,
errorMessage: '解绑异常:${e.toString()}',
operationType: DeviceOperationType.none,
),
);
}
}
@@ -262,18 +266,20 @@ class DevicesCubit extends Cubit<DevicesState> {
),
);
}
/// 加载指定作业名的路径数据
Future<void> loadSelectedPath(String workName) async {
emit(state.copyWith(isLoading: true));
try {
final result = await _selectWorkRecordUseCase.call(workName);
result.fold(
(failure) => emit(state.copyWith(isLoading: false, errorMessage: failure.message)),
(data) => emit(state.copyWith(isLoading: false, pathData: data)),
(failure) => emit(
state.copyWith(isLoading: false, errorMessage: failure.message),
),
(data) => emit(state.copyWith(isLoading: false, pathData: data)),
);
} catch (e) {
emit(state.copyWith(isLoading: false, errorMessage: e.toString()));
}
}
}