路径规划点击 某项作业
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user