120 lines
2.4 KiB
Dart
120 lines
2.4 KiB
Dart
/// 告警中心全局常量
|
|
/// 包含颜色、尺寸、枚举等全局配置
|
|
library;
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
/// 颜色常量
|
|
class AlarmColors {
|
|
/// 主色调
|
|
static const Color primary = Color(0xFF165DFF);
|
|
|
|
/// 高危色 - 红色告警
|
|
static const Color danger = Color(0xFFF53F3F);
|
|
|
|
/// 中危色 - 橙色告警
|
|
static const Color warning = Color(0xFFFF7D00);
|
|
|
|
/// 低危色 - 绿色告警
|
|
static const Color success = Color(0xFF00B42A);
|
|
|
|
/// 提示色 - 蓝色提示
|
|
static const Color info = Color(0xFF69b1ff);
|
|
|
|
/// 背景色
|
|
static const Color background = Color(0xFFFFFFFF);
|
|
|
|
/// 主要文字色
|
|
static const Color textPrimary = Color(0xFF1D2129);
|
|
|
|
/// 次要文字色
|
|
static const Color textSecondary = Color(0xFF4E5969);
|
|
|
|
/// 辅助文字色
|
|
static const Color textTertiary = Color(0xFF86909C);
|
|
|
|
/// 未处理背景色
|
|
static const Color unprocessedBg = Color(0xFFFFF0F0);
|
|
|
|
/// AI诊断卡片背景色
|
|
static const Color aiCardBg = Color(0xFFF0F7FF);
|
|
}
|
|
|
|
/// 尺寸常量
|
|
class AlarmDimensions {
|
|
/// 通用圆角
|
|
static const double borderRadius = 16.0;
|
|
|
|
/// 水平边距
|
|
static const double horizontalPadding = 16.0;
|
|
|
|
/// 模块间距
|
|
static const double moduleSpacing = 20.0;
|
|
|
|
/// 导航栏高度
|
|
static const double appBarHeight = 44.0;
|
|
|
|
/// 卡片阴影
|
|
static BoxShadow cardShadow = const BoxShadow(
|
|
color: Color(0x0D000000),
|
|
blurRadius: 4,
|
|
offset: Offset(0, 2),
|
|
);
|
|
}
|
|
|
|
/// 告警等级枚举
|
|
enum AlarmLevel {
|
|
/// 高危
|
|
danger('高危', AlarmColors.danger, Icons.warning_rounded),
|
|
|
|
/// 中危
|
|
warning('中危', AlarmColors.warning, Icons.warning_amber_rounded),
|
|
|
|
/// 低危
|
|
low('低危', AlarmColors.success, Icons.info_rounded),
|
|
|
|
/// 提示
|
|
info('提示', AlarmColors.info, Icons.info_outline_rounded);
|
|
|
|
const AlarmLevel(this.label, this.color, this.icon);
|
|
|
|
/// 显示文本
|
|
final String label;
|
|
|
|
/// 颜色
|
|
final Color color;
|
|
|
|
/// 图标
|
|
final IconData icon;
|
|
}
|
|
|
|
/// 告警状态枚举
|
|
enum AlarmStatus {
|
|
/// 未确认
|
|
unconfirmed('未确认'),
|
|
|
|
/// 已确认
|
|
confirmed('已确认'),
|
|
|
|
/// 已恢复
|
|
recovered('已恢复');
|
|
|
|
const AlarmStatus(this.label);
|
|
|
|
/// 显示文本
|
|
final String label;
|
|
}
|
|
|
|
/// 筛选标签枚举
|
|
enum AlarmFilterTab {
|
|
all('全部'),
|
|
unprocessed('未处理'),
|
|
confirmed('已确认'),
|
|
recovered('已恢复');
|
|
|
|
const AlarmFilterTab(this.label);
|
|
|
|
/// 显示文本
|
|
final String label;
|
|
}
|