1.优化补足了首页下拉刷新中对获取场站接口的加入,确保能够实时获取数据并渲染。
2.优化修改了tcp重连机制,具体操作:断开重连时候不再建立新链接 而是将旧链接重置,并重新发送数据。 3.大面积的给项目中的各个页面 手动接入了多语言的支持。同时也调整了相应带来的问题英文长度较大影响原有的样式的问题,已解决了对应的样式不和谐问题。保证了外观的统一性。 4.给项目中的主要操作加了几个核心的操作比如远程遥控和路径规划添加了双层的保护,设置里安全模式,即在此期间对服务器推送的重复登录操作后的自动退出登录做一个拦截 保证操作的安全性。
This commit is contained in:
@@ -9,18 +9,18 @@ class ReportCubit extends Cubit<ReportState> {
|
||||
final SubmitReportUseCase submitReportUseCase;
|
||||
|
||||
ReportCubit({required this.submitReportUseCase})
|
||||
: super(ReportFormState(report: ReportEntity()));
|
||||
: super(ReportFormState(report: ReportEntity()));
|
||||
|
||||
/// 选择上报类型
|
||||
void selectReportType(ReportType type) {
|
||||
if (state is ReportFormState) {
|
||||
final currentState = state as ReportFormState;
|
||||
emit(currentState.copyWith(
|
||||
selectedReportType: type,
|
||||
report: currentState.report.copyWith(
|
||||
reportType: type.label,
|
||||
emit(
|
||||
currentState.copyWith(
|
||||
selectedReportType: type,
|
||||
report: currentState.report.copyWith(reportType: type.labelKey),
|
||||
),
|
||||
));
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,10 +28,12 @@ class ReportCubit extends Cubit<ReportState> {
|
||||
void selectDevice(String device) {
|
||||
if (state is ReportFormState) {
|
||||
final currentState = state as ReportFormState;
|
||||
emit(currentState.copyWith(
|
||||
selectedDevice: device,
|
||||
report: currentState.report.copyWith(deviceId: device),
|
||||
));
|
||||
emit(
|
||||
currentState.copyWith(
|
||||
selectedDevice: device,
|
||||
report: currentState.report.copyWith(deviceId: device),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,10 +41,12 @@ class ReportCubit extends Cubit<ReportState> {
|
||||
void updateLocation(String location) {
|
||||
if (state is ReportFormState) {
|
||||
final currentState = state as ReportFormState;
|
||||
emit(currentState.copyWith(
|
||||
location: location,
|
||||
report: currentState.report.copyWith(location: location),
|
||||
));
|
||||
emit(
|
||||
currentState.copyWith(
|
||||
location: location,
|
||||
report: currentState.report.copyWith(location: location),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,9 +54,11 @@ class ReportCubit extends Cubit<ReportState> {
|
||||
void updateDescription(String description) {
|
||||
if (state is ReportFormState) {
|
||||
final currentState = state as ReportFormState;
|
||||
emit(currentState.copyWith(
|
||||
report: currentState.report.copyWith(description: description),
|
||||
));
|
||||
emit(
|
||||
currentState.copyWith(
|
||||
report: currentState.report.copyWith(description: description),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,12 +66,12 @@ class ReportCubit extends Cubit<ReportState> {
|
||||
void selectProblemLevel(ProblemLevel level) {
|
||||
if (state is ReportFormState) {
|
||||
final currentState = state as ReportFormState;
|
||||
emit(currentState.copyWith(
|
||||
selectedProblemLevel: level,
|
||||
report: currentState.report.copyWith(
|
||||
problemLevel: level.label,
|
||||
emit(
|
||||
currentState.copyWith(
|
||||
selectedProblemLevel: level,
|
||||
report: currentState.report.copyWith(problemLevel: level.labelKey),
|
||||
),
|
||||
));
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,10 +81,12 @@ class ReportCubit extends Cubit<ReportState> {
|
||||
final currentState = state as ReportFormState;
|
||||
final updatedFiles = List<String>.from(currentState.mediaFiles)
|
||||
..add(filePath);
|
||||
emit(currentState.copyWith(
|
||||
mediaFiles: updatedFiles,
|
||||
report: currentState.report.copyWith(mediaUrls: updatedFiles),
|
||||
));
|
||||
emit(
|
||||
currentState.copyWith(
|
||||
mediaFiles: updatedFiles,
|
||||
report: currentState.report.copyWith(mediaUrls: updatedFiles),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,10 +96,12 @@ class ReportCubit extends Cubit<ReportState> {
|
||||
final currentState = state as ReportFormState;
|
||||
final updatedFiles = List<String>.from(currentState.mediaFiles)
|
||||
..removeAt(index);
|
||||
emit(currentState.copyWith(
|
||||
mediaFiles: updatedFiles,
|
||||
report: currentState.report.copyWith(mediaUrls: updatedFiles),
|
||||
));
|
||||
emit(
|
||||
currentState.copyWith(
|
||||
mediaFiles: updatedFiles,
|
||||
report: currentState.report.copyWith(mediaUrls: updatedFiles),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user