一次大的提交

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

@@ -7,6 +7,7 @@ import 'package:maibu_satabot_v2/features/v2/home/presentation/bloc/home_v2_bloc
import 'package:maibu_satabot_v2/features/v2/home/presentation/bloc/home_v2_event.dart';
import 'package:maibu_satabot_v2/features/v2/home/presentation/bloc/home_v2_state.dart';
import 'package:maibu_satabot_v2/features/v2/site/presentation/cubit/site_cubit.dart';
import 'package:maibu_satabot_v2/features/v2/site/presentation/widgets/site_selector_widget.dart';
import 'package:maibu_satabot_v2/features/v2/home/presentation/widgets/power_card.dart';
import 'package:maibu_satabot_v2/features/v2/home/presentation/widgets/stats_grid.dart';
import 'package:maibu_satabot_v2/features/v2/home/presentation/widgets/work_order_card.dart';
@@ -60,9 +61,16 @@ class _HomeV2PageState extends State<HomeV2Page> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(Icons.error_outline, size: 48, color: Colors.orange),
const Icon(
Icons.error_outline,
size: 48,
color: Colors.orange,
),
const SizedBox(height: 12),
Text(state.message, style: const TextStyle(fontSize: 14, color: Colors.grey)),
Text(
state.message,
style: const TextStyle(fontSize: 14, color: Colors.grey),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () => _bloc.add(const HomeV2LoadData()),
@@ -91,47 +99,8 @@ class _HomeV2PageState extends State<HomeV2Page> {
color: Colors.white,
child: Row(
children: [
Expanded(
child: InkWell(
onTap: _showPlantSelector,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Flexible(
child: StreamBuilder<SiteState>(
stream: sl<SiteCubit>().stream,
builder: (context, snapshot) {
final siteState =
snapshot.data ??
sl<SiteCubit>().state;
return Text(
siteState.selectedSite?.siteName ??
AppLocalizations.of(
context,
).translate(
'home_v2.select_site',
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Color(0xFF1D2129),
),
);
},
),
),
const SizedBox(width: 4),
const Icon(
Icons.arrow_drop_down,
size: 20,
color: Color(0xFF1D2129),
),
],
),
),
),
Expanded(child: SiteSelectorWidget()),
const SizedBox(width: 12),
TcpStatusIndicator(
onTap: () => _showDeviceStatusModal(context),
),
@@ -252,7 +221,9 @@ class _HomeV2PageState extends State<HomeV2Page> {
}
// 🔥 Initial/Loading 状态显示加载指示器
return const Center(child: CircularProgressIndicator(color: Color(0xFF165DFF)));
return const Center(
child: CircularProgressIndicator(color: Color(0xFF165DFF)),
);
},
),
);