一次大的提交

This commit is contained in:
2026-08-07 08:49:29 +08:00
parent bf2fc49c19
commit db70665ced
181 changed files with 23060 additions and 2804 deletions

View File

@@ -1,6 +1,9 @@
import 'package:equatable/equatable.dart';
import '../../domain/entities/report_entity.dart';
import '../constants/report_constants.dart';
import '../../../home/domain/entities/site_entity.dart';
import '../../../device_list/data/models/robot_data_model.dart';
import '../../../device_list/domain/entities/drone_station_entity.dart';
/// 上报页面状态抽象类
abstract class ReportState extends Equatable {
@@ -32,6 +35,11 @@ class ReportFailure extends ReportState {
List<Object?> get props => [message];
}
/// 设备列表加载状态
class ReportDevicesLoading extends ReportState {
const ReportDevicesLoading();
}
/// 表单数据状态
class ReportFormState extends ReportState {
final ReportEntity report;
@@ -39,7 +47,14 @@ class ReportFormState extends ReportState {
final ProblemLevel? selectedProblemLevel;
final String location;
final String? selectedDevice;
final String? selectedDeviceId;
final List<String> mediaFiles;
final List<SiteEntity> sites;
final SiteEntity? selectedSite;
final List<RobotDataModel> robots;
final List<DroneStationEntity> drones;
final String? errorMessage;
final String? successMessage;
const ReportFormState({
required this.report,
@@ -47,7 +62,14 @@ class ReportFormState extends ReportState {
this.selectedProblemLevel,
this.location = '江苏省苏州市吴中区',
this.selectedDevice,
this.selectedDeviceId,
this.mediaFiles = const [],
this.sites = const [],
this.selectedSite,
this.robots = const [],
this.drones = const [],
this.errorMessage,
this.successMessage,
});
ReportFormState copyWith({
@@ -56,7 +78,14 @@ class ReportFormState extends ReportState {
ProblemLevel? selectedProblemLevel,
String? location,
String? selectedDevice,
String? selectedDeviceId,
List<String>? mediaFiles,
List<SiteEntity>? sites,
SiteEntity? selectedSite,
List<RobotDataModel>? robots,
List<DroneStationEntity>? drones,
String? errorMessage,
String? successMessage,
}) {
return ReportFormState(
report: report ?? this.report,
@@ -64,7 +93,14 @@ class ReportFormState extends ReportState {
selectedProblemLevel: selectedProblemLevel ?? this.selectedProblemLevel,
location: location ?? this.location,
selectedDevice: selectedDevice ?? this.selectedDevice,
selectedDeviceId: selectedDeviceId ?? this.selectedDeviceId,
mediaFiles: mediaFiles ?? this.mediaFiles,
sites: sites ?? this.sites,
selectedSite: selectedSite ?? this.selectedSite,
robots: robots ?? this.robots,
drones: drones ?? this.drones,
errorMessage: errorMessage,
successMessage: successMessage,
);
}
@@ -75,6 +111,13 @@ class ReportFormState extends ReportState {
selectedProblemLevel,
location,
selectedDevice,
selectedDeviceId,
mediaFiles,
sites,
selectedSite,
robots,
drones,
errorMessage,
successMessage,
];
}