接入设备故障告警和场站实时任务进度
This commit is contained in:
@@ -11,8 +11,9 @@ import 'package:maibu_satabot_v2/features/v2/waring_center/presentation/widgets/
|
||||
/// 告警详情页面
|
||||
class AlarmDetailPage extends StatefulWidget {
|
||||
final String alarmId;
|
||||
final Widget Function(BuildContext, AlarmDetailEntity)? actionBuilder;
|
||||
|
||||
const AlarmDetailPage({super.key, required this.alarmId});
|
||||
const AlarmDetailPage({super.key, required this.alarmId, this.actionBuilder});
|
||||
|
||||
@override
|
||||
State<AlarmDetailPage> createState() => _AlarmDetailPageState();
|
||||
@@ -33,9 +34,7 @@ class _AlarmDetailPageState extends State<AlarmDetailPage> {
|
||||
Widget build(BuildContext context) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
value: isDark
|
||||
? SystemUiOverlayStyle.light
|
||||
: SystemUiOverlayStyle.dark,
|
||||
value: isDark ? SystemUiOverlayStyle.light : SystemUiOverlayStyle.dark,
|
||||
child: Scaffold(
|
||||
backgroundColor: context.appColors.pageBackground,
|
||||
appBar: _buildAppBar(),
|
||||
@@ -95,7 +94,7 @@ class _AlarmDetailPageState extends State<AlarmDetailPage> {
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.arrow_back, color: context.appColors.textPrimary),
|
||||
onPressed: () => context.pop(),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
title: Text(
|
||||
'告警详情',
|
||||
@@ -251,7 +250,9 @@ class _AlarmDetailPageState extends State<AlarmDetailPage> {
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: _buildBottomButtons(state),
|
||||
child:
|
||||
widget.actionBuilder?.call(context, alarm) ??
|
||||
_buildBottomButtons(state),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -265,7 +266,11 @@ class _AlarmDetailPageState extends State<AlarmDetailPage> {
|
||||
color: context.appColors.cardBackground,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(color: context.appColors.cardShadow, blurRadius: 4, offset: const Offset(0, 2)),
|
||||
BoxShadow(
|
||||
color: context.appColors.cardShadow,
|
||||
blurRadius: 4,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
@@ -390,7 +395,11 @@ class _AlarmDetailPageState extends State<AlarmDetailPage> {
|
||||
color: context.appColors.cardBackground,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(color: context.appColors.cardShadow, blurRadius: 4, offset: const Offset(0, 2)),
|
||||
BoxShadow(
|
||||
color: context.appColors.cardShadow,
|
||||
blurRadius: 4,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
@@ -474,7 +483,11 @@ class _AlarmDetailPageState extends State<AlarmDetailPage> {
|
||||
}
|
||||
|
||||
Widget _buildDivider() {
|
||||
return Divider(height: 24, thickness: 0.5, color: context.appColors.divider);
|
||||
return Divider(
|
||||
height: 24,
|
||||
thickness: 0.5,
|
||||
color: context.appColors.divider,
|
||||
);
|
||||
}
|
||||
|
||||
bool _hasHistoryData(HistoryMetrics historyData) {
|
||||
@@ -491,7 +504,11 @@ class _AlarmDetailPageState extends State<AlarmDetailPage> {
|
||||
color: context.appColors.cardBackground,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(color: context.appColors.cardShadow, blurRadius: 4, offset: const Offset(0, 2)),
|
||||
BoxShadow(
|
||||
color: context.appColors.cardShadow,
|
||||
blurRadius: 4,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
@@ -646,7 +663,9 @@ class _AlarmDetailPageState extends State<AlarmDetailPage> {
|
||||
child: ElevatedButton(
|
||||
onPressed: isLoading || isDisabled ? null : onPressed,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: isPrimary ? context.appColors.primary : context.appColors.cardBackground,
|
||||
backgroundColor: isPrimary
|
||||
? context.appColors.primary
|
||||
: context.appColors.cardBackground,
|
||||
foregroundColor: isPrimary ? Colors.white : context.appColors.primary,
|
||||
elevation: 0,
|
||||
side: isPrimary ? null : BorderSide(color: context.appColors.primary),
|
||||
@@ -681,18 +700,29 @@ class _AlarmDetailPageState extends State<AlarmDetailPage> {
|
||||
backgroundColor: context.appColors.cardBackground,
|
||||
title: Text(
|
||||
'AI诊断结果',
|
||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: context.appColors.textPrimary),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: context.appColors.textPrimary,
|
||||
),
|
||||
),
|
||||
content: SingleChildScrollView(
|
||||
child: Text(
|
||||
result,
|
||||
style: TextStyle(fontSize: 14, height: 1.6, color: context.appColors.textSecondary),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
height: 1.6,
|
||||
color: context.appColors.textSecondary,
|
||||
),
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => context.pop(),
|
||||
child: Text('关闭', style: TextStyle(color: context.appColors.primary)),
|
||||
child: Text(
|
||||
'关闭',
|
||||
style: TextStyle(color: context.appColors.primary),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user