-
- {/* 左侧栏:城市体征 */}
-
-
- 城市运行体征
-
- }
- className="panel-card glass-panel panel-card--left-tabs"
- size="small"
- >
-
- 覆盖、发现、处置、复核一体化评分
-
-
-
-
- ),
- },
- {
- key: 'env',
- label: '环境感知',
- children: (
-
-
空地协同采集 · 24 小时滚动
-
-
-
-
- ),
- },
- {
- key: 'traffic',
- label: '交通热力',
- children: (
-
- ),
- },
- ]}
- />
-
-
-
- 城市事件流
-
- }
- className="panel-card glass-panel panel-card--events"
- size="small"
- extra={实时}
- >
-
-
}}
- renderItem={(item) => (
-
-
-
-
-
- {item.title}
- {item.timeText}
-
-
- {item.location}
-
- {item.status}
-
-
- {item.source}
-
-
-
{item.desc}
-
-
-
- )}
- />
-
-
+
+
+
+ {/* 左侧栏 - CSS Grid 强制 1:1 分配 */}
+
+
+
-
- {/* 中间栏:核心监控 */}
-
- {/* 顶部KPI */}
-
- {smartModels.kpis.map((kpi) => (
-
-
- {kpi.label}
-
-
-
- {kpi.value}
- {kpi.unit ? {kpi.unit} : null}
-
- {kpi.sub ?
{kpi.sub}
: null}
-
- ))}
-
-
- {/* 地图/3D入口 */}
-
-
-
-
-
- {compactLevel === 2 ? (
-
- 事件点位
- AI识别
-
- ) : (
- <>
-
- 事件点位
- 航线叠加
- 电子围栏
- AI识别
-
-
-
- 安全态势
-
-
- 空域管理
-
-
- 数字孪生
-
-
- >
- )}
-
-
-
-
全域数字孪生中枢
-
空地协同巡检 · 城市事件识别 · 应急快速响应
-
-
-
-
-
- 在线无人机
- {smartModels.fleet.droneOnline}
-
-
- 在飞架次
- {smartModels.fleet.droneInFlight}
-
- {compactLevel === 2 ? null : (
- <>
-
- 可用机库
- {smartModels.fleet.dockOnline}
-
-
- 合规指数
-
- {smartModels.airspace.complianceIndex}
-
-
- >
- )}
-
-
-
-
-
- 无人机态势与AI洞察
-
- }
- className="panel-card glass-panel fill-bottom panel-card--snap"
- size="small"
- >
-
-
- {new Array(Math.max(1, Math.ceil(smartModels.aiSnapshots.length / snapshotsPerPage)))
- .fill(0)
- .map((_, pageIdx) => {
- const start = pageIdx * snapshotsPerPage;
- const page = smartModels.aiSnapshots.slice(start, start + snapshotsPerPage);
- return (
-
-
- {page.map((s) => (
-
-
- {s.tag}
- {s.timeText}
-
-
{s.title}
-
- {s.location}
- 置信度 {s.confidence}%
-
-
- ))}
-
-
- );
- })}
-
-
- ),
- },
- {
- key: 'fleet',
- label: '机队态势',
- children: (
-
-
-
-
平均电量
-
{smartModels.fleet.avgBattery}%
-
低电 {smartModels.fleet.lowBatteryAlerts} 起
-
-
-
飞行时长
-
{smartModels.fleet.flightHoursToday}h
-
今日累计
-
-
-
飞行里程
-
{smartModels.fleet.flightMileageToday}km
-
含航线复飞
-
-
-
可用机库
-
- {smartModels.fleet.dockOnline}/{smartModels.fleet.dockTotal}
-
-
在线/总量
-
-
-
-
-
-
机队状态占比
-
- {Object.keys(droneStatusPieConfig).length ? (
-
- ) : (
-
- )}
-
-
-
-
重点区域覆盖
-
- {visibleRegionCoverage.map((r) => (
-
-
- {r.name}
-
-
- {r.risk === 'critical' ? '高风险' : r.risk === 'warning' ? '关注' : '正常'}
-
- {r.updatedAt}
-
-
-
-
-
{r.coverage}%
-
待处置 {r.pending}
-
-
- ))}
-
-
-
-
- ),
- },
- {
- key: 'airspace',
- label: '空域合规',
- children: (
-
-
-
-
-
-
合规指数
-
围栏/禁飞/审批综合
-
城市安全指数 {smartModels.airspace.safetyIndex}
-
-
-
-
-
-
{smartModels.airspace.geofenceTriggers}
-
围栏触发
-
-
-
{smartModels.airspace.noFlyWarnings}
-
禁飞预警
-
-
-
{smartModels.airspace.approvalsToday}
-
今日审批
-
-
-
{smartModels.airspace.approvalsPassRate}%
-
通过率
-
-
-
-
-
-
-
- 重点区域启用“低空走廊”,优先保障应急任务快速通行。
-
- {compactLevel === 2 ? null : (
- <>
-
-
- 围栏触发或禁飞预警上升时,建议自动降级为“复核模式”。
-
-
-
- 审批通过率稳定后,可扩大夜航与多机协同策略的投放比例。
-
- >
- )}
-
-
- ),
- },
- ]}
- />
-
+
+
+
- {/* 右侧栏:任务与运维 */}
-
-
- {taskPeriodText}运行调度
-
- }
- className="panel-card glass-panel panel-card--dispatch"
- size="small"
- extra={
-
- setTaskStatType(v as any)}
- />
- v && setTaskStatDate(v)}
- picker={taskStatType === 'day' ? 'date' : taskStatType}
- allowClear={false}
- format={datePickerFormat}
- disabledDate={(d) => !!d && d.isAfter(dayjs(), 'day')}
- />
-
- }
- >
-
-
-
{taskStats?.pending || 0}
-
待执行
-
-
-
{taskStats?.running || 0}
-
执行中
-
-
-
{taskStats?.completed || 0}
-
已完成
-
-
-
{taskStats?.failed || 0}
-
异常
-
-
-
{taskStats?.successRate || 0}%
-
成功率
-
-
-
-
-
-
- 事件处置与洞察
-
- }
- className="panel-card glass-panel flex-grow panel-card--right-tabs"
- size="small"
- >
-
-
-
-
-
- ),
- },
- {
- key: 'types',
- label: '类型分布',
- children: (
-
- ),
- },
- {
- key: 'asset',
- label: '资产构成',
- children: smartModels.terminalPieData?.length ? (
-
- ) : (
-
- ),
- },
- {
- key: 'capacity',
- label: '作业结构',
- children: taskTypeData?.length ? (
-
- ) : (
-
- ),
- },
- {
- key: 'risk',
- label: '风险画像',
- children: failureAnalysisData?.length ? (
-
- ) : (
-
- ),
- },
- {
- key: 'year',
- label: '年度趋势',
- children: annualData?.length ? (
-
- ) : (
-
- ),
- },
- ]}
- />
-
+ {/* 中间栏 - KPI固定70px + 剩余空间1:1分配 */}
+
+ {/* 右侧栏 - CSS Grid 各50% */}
+
diff --git a/zlt-web/yingyan/src/pages/dashboard/smartCity.ts b/zlt-web/yingyan/src/pages/dashboard/smartCity.ts
new file mode 100644
index 00000000..e6bf1dcd
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/dashboard/smartCity.ts
@@ -0,0 +1,401 @@
+import dayjs from 'dayjs';
+import type { AlertItem, DeviceStats, TaskStats, TrendItem } from '@/services/dashboard';
+
+type Severity = 'normal' | 'warning' | 'critical';
+
+export interface SmartCityKpiItem {
+ key: string;
+ label: string;
+ value: number | string;
+ unit?: string;
+ accent?: 'blue' | 'green' | 'yellow' | 'red' | 'purple';
+ sub?: string;
+}
+
+export interface SmartCityEventItem {
+ id: string;
+ title: string;
+ location: string;
+ source: '无人机' | '摄像头' | '机库' | '多源融合';
+ severity: Severity;
+ status: '待确认' | '已派单' | '处理中' | '已闭环';
+ timeText: string;
+ desc: string;
+}
+
+export interface SmartCityModels {
+ kpis: SmartCityKpiItem[];
+ fleet: {
+ droneTotal: number;
+ droneOnline: number;
+ droneInFlight: number;
+ droneStandby: number;
+ droneMaintenance: number;
+ dockTotal: number;
+ dockOnline: number;
+ cameraTotal: number;
+ cameraOnline: number;
+ lowBatteryAlerts: number;
+ avgBattery: number;
+ flightHoursToday: number;
+ flightMileageToday: number;
+ };
+ airspace: {
+ safetyIndex: number;
+ complianceIndex: number;
+ geofenceTriggers: number;
+ noFlyWarnings: number;
+ approvalsToday: number;
+ approvalsPassRate: number;
+ };
+ regionCoverage: Array<{
+ id: string;
+ name: string;
+ coverage: number;
+ pending: number;
+ risk: Severity;
+ updatedAt: string;
+ }>;
+ terminalPieData: { name: string; count: number }[];
+ onlineRate: number;
+ liquidRate: number;
+ gridRadarData: { item: string; score: number; type: '当前' }[];
+ envTrendData: { time: string; type: string; value: number }[];
+ trafficHeatmapData: { x: string; y: string; value: number }[];
+ eventTypeData: { type: string; value: number }[];
+ eventFunnelData: { stage: string; value: number }[];
+ eventList: SmartCityEventItem[];
+ aiSnapshots: Array<{
+ id: string;
+ title: string;
+ location: string;
+ tag: string;
+ confidence: number;
+ timeText: string;
+ severity: Severity;
+ }>;
+}
+
+function hashStringToSeed(text: string): number {
+ let hash = 2166136261;
+ for (let i = 0; i < text.length; i++) {
+ hash ^= text.charCodeAt(i);
+ hash = Math.imul(hash, 16777619);
+ }
+ return hash >>> 0;
+}
+
+function createRng(seedText: string) {
+ let seed = hashStringToSeed(seedText) || 1;
+ return () => {
+ seed = (Math.imul(seed, 1664525) + 1013904223) >>> 0;
+ return seed / 4294967296;
+ };
+}
+
+function clampNumber(value: number, min: number, max: number) {
+ return Math.max(min, Math.min(max, value));
+}
+
+function pickOne
(rng: () => number, items: T[]): T {
+ return items[Math.floor(rng() * items.length)];
+}
+
+function mapAlertToEvent(alert: AlertItem): Omit & {
+ severity: Severity;
+ title: string;
+} {
+ const severity: Severity =
+ alert.level === 'critical' ? 'critical' : alert.level === 'error' ? 'warning' : 'normal';
+
+ if (alert.type === 'device_offline') {
+ return {
+ id: alert.id,
+ title: '关键点位离线预警',
+ severity,
+ timeText: dayjs(alert.timestamp).format('HH:mm'),
+ desc: alert.message,
+ };
+ }
+ if (alert.type === 'low_battery') {
+ return {
+ id: alert.id,
+ title: '保障能力风险提示',
+ severity: severity === 'normal' ? 'warning' : severity,
+ timeText: dayjs(alert.timestamp).format('HH:mm'),
+ desc: alert.message,
+ };
+ }
+ if (alert.type === 'task_failed') {
+ return {
+ id: alert.id,
+ title: '巡检任务异常',
+ severity,
+ timeText: dayjs(alert.timestamp).format('HH:mm'),
+ desc: alert.message,
+ };
+ }
+ return {
+ id: alert.id,
+ title: '终端运行异常',
+ severity: severity === 'normal' ? 'warning' : severity,
+ timeText: dayjs(alert.timestamp).format('HH:mm'),
+ desc: alert.message,
+ };
+}
+
+function calcSafetyIndex(params: {
+ deviceStats?: DeviceStats | null;
+ taskStats?: TaskStats | null;
+ alerts?: AlertItem[];
+ baseSeed: string;
+}) {
+ const rng = createRng(`${params.baseSeed}:safety`);
+ const onlineRate = params.deviceStats?.onlineRate ?? 0;
+ const successRate = params.taskStats?.successRate ?? 0;
+ const alerts = params.alerts || [];
+
+ const critical = alerts.filter((a) => a.level === 'critical').length;
+ const error = alerts.filter((a) => a.level === 'error').length;
+ const warning = alerts.filter((a) => a.level === 'warning').length;
+
+ const baseline = 90 + Math.round(rng() * 4);
+ const penalty = critical * 6 + error * 4 + warning * 2 + Math.round((100 - onlineRate) * 0.18);
+ const bonus = Math.round((successRate - 80) * 0.15);
+
+ return clampNumber(baseline - penalty + bonus, 60, 99);
+}
+
+export function buildSmartCityModels(params: {
+ tenantId?: string;
+ deviceStats?: DeviceStats | null;
+ taskStats?: TaskStats | null;
+ taskTrend?: TrendItem[];
+ alerts?: AlertItem[];
+}): SmartCityModels {
+ const todayKey = dayjs().format('YYYY-MM-DD');
+ const baseSeed = `${params.tenantId || 'default'}:${todayKey}`;
+ const rng = createRng(baseSeed);
+
+ const deviceStats = params.deviceStats;
+ const taskStats = params.taskStats;
+ const taskTrend = params.taskTrend || [];
+ const alerts = params.alerts || [];
+
+ const onlineRate = deviceStats?.onlineRate ?? 0;
+ const safetyIndex = calcSafetyIndex({ deviceStats, taskStats, alerts, baseSeed });
+
+ const eventCount = alerts.length + 6 + Math.floor(rng() * 6);
+ const avgResponse = clampNumber(8 + Math.round((1 - (taskStats?.successRate ?? 0) / 100) * 12) + Math.round(rng() * 4), 6, 28);
+ const closedLoopRate = clampNumber(
+ taskStats?.total ? Math.round(((taskStats.completed || 0) / taskStats.total) * 100) : 70 + Math.round(rng() * 18),
+ 40,
+ 99,
+ );
+
+ const byType = deviceStats?.byType || [];
+ const droneTotal = byType.find((d) => d.type === 'drone')?.count || 0;
+ const dockTotal = byType.find((d) => d.type === 'dock')?.count || 0;
+ const cameraTotal = byType.find((d) => d.type === 'camera')?.count || 0;
+
+ const ratio = clampNumber((onlineRate || 0) / 100, 0, 1);
+ const droneOnline = clampNumber(Math.round(droneTotal * ratio * (0.94 + rng() * 0.12)), 0, droneTotal);
+ const dockOnline = clampNumber(Math.round(dockTotal * ratio * (0.92 + rng() * 0.14)), 0, dockTotal);
+ const cameraOnline = clampNumber(Math.round(cameraTotal * ratio * (0.90 + rng() * 0.16)), 0, cameraTotal);
+
+ const runningTasks = taskStats?.running || 0;
+ const droneInFlight = clampNumber(Math.min(droneOnline, Math.max(0, runningTasks) + Math.round(rng() * 2)), 0, droneOnline);
+ const droneMaintenance = clampNumber(Math.round(droneTotal * (0.06 + rng() * 0.09)), 0, droneTotal);
+ const droneStandby = clampNumber(droneOnline - droneInFlight - Math.min(droneMaintenance, droneOnline), 0, droneOnline);
+
+ const lowBatteryAlerts = alerts.filter((a) => a.type === 'low_battery').length;
+ const avgBattery = clampNumber(62 + Math.round(rng() * 28) - lowBatteryAlerts * 3, 18, 98);
+ const flightHoursToday = clampNumber(6 + Math.round((taskStats?.total || 0) * 0.55) + Math.round(rng() * 4), 0, 78);
+ const flightMileageToday = clampNumber(28 + Math.round((taskStats?.total || 0) * 2.2) + Math.round(rng() * 12), 0, 420);
+
+ const critical = alerts.filter((a) => a.level === 'critical').length;
+ const error = alerts.filter((a) => a.level === 'error').length;
+ const warning = alerts.filter((a) => a.level === 'warning').length;
+
+ const complianceIndex = clampNumber(95 - critical * 6 - error * 3 - warning * 1 - Math.round((100 - onlineRate) * 0.12) + Math.round(rng() * 2), 60, 99);
+ const geofenceTriggers = clampNumber(Math.round(rng() * 5) + critical + Math.floor(error / 2), 0, 12);
+ const noFlyWarnings = clampNumber(Math.round(rng() * 3) + Math.floor(warning / 2), 0, 10);
+ const approvalsToday = clampNumber(18 + Math.round(rng() * 28), 0, 120);
+ const approvalsPassRate = clampNumber(92 - critical * 2 - error + Math.round(rng() * 4), 70, 99);
+
+ const fleet = {
+ droneTotal,
+ droneOnline,
+ droneInFlight,
+ droneStandby,
+ droneMaintenance,
+ dockTotal,
+ dockOnline,
+ cameraTotal,
+ cameraOnline,
+ lowBatteryAlerts,
+ avgBattery,
+ flightHoursToday,
+ flightMileageToday,
+ };
+
+ const airspace = {
+ safetyIndex,
+ complianceIndex,
+ geofenceTriggers,
+ noFlyWarnings,
+ approvalsToday,
+ approvalsPassRate,
+ };
+
+ const kpis: SmartCityKpiItem[] = [
+ { key: 'air', label: '空域合规指数', value: complianceIndex, unit: '', accent: complianceIndex >= 92 ? 'green' : complianceIndex >= 82 ? 'yellow' : 'red', sub: '围栏/禁飞/链路综合' },
+ { key: 'flight', label: '在飞无人机', value: droneInFlight, unit: '架', accent: 'purple', sub: `在线 ${droneOnline}/${droneTotal}` },
+ { key: 'sortie', label: '今日出动任务', value: taskStats?.todayNew ?? 0, unit: '次', accent: 'blue', sub: '巡检/应急/处置' },
+ { key: 'closed', label: '问题闭环率', value: closedLoopRate, unit: '%', accent: closedLoopRate >= 85 ? 'green' : 'yellow', sub: '发现→处置→复核' },
+ { key: 'online', label: '终端在线率', value: onlineRate, unit: '%', accent: onlineRate >= 90 ? 'green' : onlineRate >= 75 ? 'yellow' : 'red', sub: `低电 ${lowBatteryAlerts} 起` },
+ ];
+
+ const terminalPieData = (deviceStats?.byType || []).map((d) => ({ name: d.name, count: d.count }));
+
+ const regionCoverage = (() => {
+ const regions = ['政务中心片区', '滨河公园带', '高新大道走廊', '老城商圈', '西站枢纽', '南湖片区', '工业园北区', '东门立交'];
+ const picked = regions.slice(0, 6);
+ return picked.map((name, idx) => {
+ const coverage = clampNumber(72 + Math.round(rng() * 26) - idx * 2, 45, 99);
+ const pending = clampNumber(Math.round(rng() * 8) + (idx % 2 === 0 ? 1 : 0), 0, 18);
+ const risk: Severity = coverage >= 88 ? 'normal' : coverage >= 76 ? 'warning' : 'critical';
+ const updatedAt = dayjs().subtract(5 + Math.round(rng() * 55), 'minute').format('HH:mm');
+ return { id: `region-${idx}`, name, coverage, pending, risk, updatedAt };
+ });
+ })();
+
+ const gridRadarData = [
+ { item: '巡检覆盖', score: clampNumber(70 + Math.round(rng() * 24), 55, 98), type: '当前' as const },
+ { item: '问题发现', score: clampNumber(62 + Math.round(rng() * 30), 50, 98), type: '当前' as const },
+ { item: '处置效率', score: clampNumber(68 + Math.round(rng() * 22), 50, 98), type: '当前' as const },
+ { item: '复核通过', score: clampNumber(72 + Math.round(rng() * 18), 55, 99), type: '当前' as const },
+ { item: '重点关注', score: clampNumber(58 + Math.round(rng() * 34), 45, 98), type: '当前' as const },
+ ];
+
+ const envTrendData: { time: string; type: string; value: number }[] = [];
+ const startHour = dayjs().startOf('day');
+ const pmBase = clampNumber(22 + Math.round(rng() * 26), 15, 60);
+ const noiseBase = clampNumber(52 + Math.round(rng() * 10), 45, 70);
+ for (let i = 0; i < 24; i++) {
+ const time = startHour.add(i, 'hour').format('HH:00');
+ const wave = Math.sin((i / 24) * Math.PI * 2);
+ const pm = clampNumber(pmBase + wave * 10 + (rng() - 0.5) * 6, 8, 85);
+ const noise = clampNumber(noiseBase + Math.abs(wave) * 9 + (rng() - 0.5) * 4, 35, 85);
+ envTrendData.push({ time, type: 'PM2.5', value: Number(pm.toFixed(1)) });
+ envTrendData.push({ time, type: '噪声(dB)', value: Number(noise.toFixed(1)) });
+ }
+
+ const trafficHeatmapData: { x: string; y: string; value: number }[] = [];
+ const cols = 10;
+ const rows = 6;
+ for (let y = 0; y < rows; y++) {
+ for (let x = 0; x < cols; x++) {
+ const centerBias = 1 - Math.abs(x - (cols - 1) / 2) / cols;
+ const value = clampNumber(12 + centerBias * 36 + rng() * 18 + (y % 2 === 0 ? 2 : -2), 0, 100);
+ trafficHeatmapData.push({ x: `${x + 1}`, y: `${rows - y}`, value: Math.round(value) });
+ }
+ }
+
+ const locations = ['政务中心', '滨河公园', '高新大道', '老城商圈', '西站枢纽', '南湖片区', '工业园北区', '东门立交'];
+ const sources: SmartCityEventItem['source'][] = ['无人机', '摄像头', '机库', '多源融合'];
+ const statuses: SmartCityEventItem['status'][] = ['待确认', '已派单', '处理中', '已闭环'];
+
+ const eventListFromAlerts: SmartCityEventItem[] = alerts.slice(0, 8).map((a, idx) => {
+ const base = mapAlertToEvent(a);
+ const status = idx === 0 ? '处理中' : idx === 1 ? '待确认' : pickOne(rng, statuses);
+ const source = idx % 2 === 0 ? '无人机' : '机库';
+ return {
+ ...base,
+ location: pickOne(rng, locations),
+ source,
+ status,
+ };
+ });
+
+ const aiEventTypes = ['违停抓拍', '烟火识别', '占道经营', '河道漂浮物', '工地未戴帽', '夜间聚集'];
+ const aiSnapshots = new Array(10).fill(0).map((_, i) => {
+ const type = aiEventTypes[i % aiEventTypes.length];
+ const confidence = clampNumber(78 + Math.round(rng() * 20), 60, 99);
+ const severity: Severity = confidence >= 92 ? 'critical' : confidence >= 84 ? 'warning' : 'normal';
+ const timeText = dayjs().subtract(Math.round(rng() * 65), 'minute').format('HH:mm');
+ return {
+ id: `snap-${todayKey}-${i}`,
+ title: type,
+ location: pickOne(rng, locations),
+ tag: pickOne(rng, ['AI识别', '多源融合', '重点区域', '高频点位']),
+ confidence,
+ timeText,
+ severity,
+ };
+ });
+
+ const eventListGenerated: SmartCityEventItem[] = aiSnapshots.slice(0, 6).map((s, idx) => {
+ const severity: Severity = s.severity;
+ const status = idx < 2 ? '待确认' : idx < 4 ? '已派单' : pickOne(rng, statuses);
+ const source = idx % 3 === 0 ? '无人机' : idx % 3 === 1 ? '摄像头' : '多源融合';
+ return {
+ id: `evt-${s.id}`,
+ title: s.title,
+ location: s.location,
+ source,
+ severity,
+ status,
+ timeText: s.timeText,
+ desc: `疑似${s.title}(置信度 ${s.confidence}%)`,
+ };
+ });
+
+ const eventList = [...eventListGenerated, ...eventListFromAlerts].slice(0, 12);
+
+ const eventTypeCounts: Record = {};
+ eventList.forEach((e) => {
+ const key = e.title;
+ eventTypeCounts[key] = (eventTypeCounts[key] || 0) + 1;
+ });
+ const eventTypeData = Object.entries(eventTypeCounts)
+ .map(([type, value]) => ({ type, value }))
+ .sort((a, b) => b.value - a.value)
+ .slice(0, 6);
+
+ const eventFunnelData = (() => {
+ const total = eventCount;
+ const confirmed = clampNumber(Math.round(total * (0.78 + rng() * 0.08)), 0, total);
+ const assigned = clampNumber(Math.round(confirmed * (0.75 + rng() * 0.1)), 0, confirmed);
+ const processing = clampNumber(Math.round(assigned * (0.72 + rng() * 0.12)), 0, assigned);
+ const closed = clampNumber(Math.round(processing * (0.78 + rng() * 0.12)), 0, processing);
+ return [
+ { stage: '识别', value: total },
+ { stage: '确认', value: confirmed },
+ { stage: '派单', value: assigned },
+ { stage: '处置', value: processing },
+ { stage: '闭环', value: closed },
+ ];
+ })();
+
+ const liquidRate = clampNumber((onlineRate || 0) / 100, 0, 1);
+
+ void taskTrend;
+
+ return {
+ kpis,
+ fleet,
+ airspace,
+ regionCoverage,
+ terminalPieData,
+ onlineRate,
+ liquidRate,
+ gridRadarData,
+ envTrendData,
+ trafficHeatmapData,
+ eventTypeData,
+ eventFunnelData,
+ eventList,
+ aiSnapshots,
+ };
+}
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/components/AnnualTrendCard.tsx b/zlt-web/yingyan/src/pages/maritime/dashboard/components/AnnualTrendCard.tsx
new file mode 100644
index 00000000..2e7192d2
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/components/AnnualTrendCard.tsx
@@ -0,0 +1,186 @@
+import React from 'react';
+import { Card } from 'antd';
+import { BarChartOutlined } from '@ant-design/icons';
+import { Area, Column } from '@ant-design/plots';
+
+interface AnnualTrendCardProps {
+ annualData: any[];
+ taskTypeData: any[];
+}
+
+const AnnualTrendCard: React.FC = ({ annualData, taskTypeData }) => {
+ const areaConfig: any = {
+ data: annualData,
+ xField: 'month',
+ yField: 'value',
+ seriesField: 'type',
+ color: ['#00b4d8', '#00e5a0'],
+ areaStyle: { fillOpacity: 0.3 },
+ line: {
+ style: { lineWidth: 2 },
+ },
+ point: {
+ size: 3,
+ shape: 'circle',
+ style: {
+ fill: '#fff',
+ stroke: '#00b4d8',
+ lineWidth: 2,
+ },
+ },
+ xAxis: {
+ label: {
+ style: { fill: 'rgba(200,230,255,0.75)', fontSize: 11 },
+ },
+ line: {
+ style: { stroke: 'rgba(0,180,216,0.2)' },
+ },
+ tickLine: null,
+ },
+ yAxis: {
+ label: {
+ style: { fill: 'rgba(200,230,255,0.75)', fontSize: 11 },
+ },
+ grid: {
+ line: { style: { stroke: 'rgba(0,150,200,0.15)', lineDash: [4, 4] } },
+ },
+ line: null,
+ tickLine: null,
+ },
+ legend: {
+ position: 'top',
+ itemName: {
+ style: { fill: 'rgba(200,230,255,0.85)', fontSize: 12, fontWeight: 600 },
+ },
+ marker: {
+ symbol: 'circle',
+ style: { r: 4 },
+ },
+ itemSpacing: 16,
+ },
+ smooth: true,
+ animation: {
+ appear: {
+ animation: 'wave-in',
+ duration: 1000,
+ },
+ },
+ tooltip: {
+ showMarkers: true,
+ marker: {
+ fill: '#00b4d8',
+ },
+ domStyles: {
+ 'g2-tooltip': {
+ background: 'rgba(10, 30, 50, 0.95)',
+ boxShadow: '0 4px 12px rgba(0,0,0,0.3)',
+ border: '1px solid rgba(0,180,216,0.3)',
+ },
+ 'g2-tooltip-title': {
+ color: 'rgba(200,230,255,0.95)',
+ },
+ 'g2-tooltip-list-item': {
+ color: 'rgba(200,230,255,0.85)',
+ },
+ },
+ },
+ autoFit: true,
+ };
+
+ const columnConfig: any = {
+ data: taskTypeData,
+ xField: 'type',
+ yField: 'value',
+ seriesField: 'type',
+ color: ({ type }: any) => {
+ if (type === '航线巡检') return '#00b4d8';
+ if (type === '定点监测') return '#00e5a0';
+ return '#ff9f43';
+ },
+ columnStyle: {
+ radius: [6, 6, 0, 0],
+ },
+ label: {
+ text: (datum: any) => datum?.value?.toString() || '0',
+ style: {
+ fill: '#fff',
+ fontSize: 12,
+ fontWeight: 600,
+ textAlign: 'center',
+ },
+ position: 'top',
+ offset: 8,
+ },
+ xAxis: {
+ label: {
+ style: { fill: 'rgba(200,230,255,0.75)', fontSize: 11 },
+ },
+ line: {
+ style: { stroke: 'rgba(0,180,216,0.2)' },
+ },
+ tickLine: null,
+ },
+ yAxis: {
+ label: {
+ style: { fill: 'rgba(200,230,255,0.75)', fontSize: 11 },
+ },
+ grid: {
+ line: { style: { stroke: 'rgba(0,150,200,0.15)', lineDash: [4, 4] } },
+ },
+ line: null,
+ tickLine: null,
+ },
+ legend: false,
+ animation: {
+ appear: {
+ animation: 'scale-in-y',
+ duration: 800,
+ },
+ },
+ tooltip: {
+ domStyles: {
+ 'g2-tooltip': {
+ background: 'rgba(10, 30, 50, 0.95)',
+ boxShadow: '0 4px 12px rgba(0,0,0,0.3)',
+ border: '1px solid rgba(0,180,216,0.3)',
+ },
+ 'g2-tooltip-title': {
+ color: 'rgba(200,230,255,0.95)',
+ },
+ 'g2-tooltip-list-item': {
+ color: 'rgba(200,230,255,0.85)',
+ },
+ },
+ },
+ autoFit: true,
+ };
+
+ return (
+
+ 年度巡检任务趋势与任务类型
+
+ }
+ className="maritime-card"
+ size="small"
+ >
+
+
+ );
+};
+
+export default AnnualTrendCard;
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/components/AnnualTrendChart.tsx b/zlt-web/yingyan/src/pages/maritime/dashboard/components/AnnualTrendChart.tsx
new file mode 100644
index 00000000..eecc1743
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/components/AnnualTrendChart.tsx
@@ -0,0 +1,116 @@
+import React from 'react';
+import { Card } from 'antd';
+import { LineChartOutlined } from '@ant-design/icons';
+import { Area } from '@ant-design/plots';
+
+interface AnnualTrendChartProps {
+ annualData: any[];
+}
+
+const AnnualTrendChart: React.FC = ({ annualData }) => {
+ const areaConfig: any = {
+ data: annualData,
+ xField: 'month',
+ yField: 'value',
+ seriesField: 'type',
+ color: ['#00b4d8', '#00e5a0'],
+ appendPadding: [20, 10, 10, 10],
+ areaStyle: { fillOpacity: 0.25 },
+ line: {
+ style: { lineWidth: 2 },
+ },
+ point: {
+ size: 2,
+ shape: 'circle',
+ style: {
+ fill: '#fff',
+ stroke: '#00b4d8',
+ lineWidth: 1.5,
+ },
+ },
+ xAxis: {
+ label: {
+ style: { fill: 'rgba(200,230,255,0.75)', fontSize: 10 },
+ autoRotate: false,
+ autoHide: true,
+ },
+ line: {
+ style: { stroke: 'rgba(0,180,216,0.2)' },
+ },
+ tickLine: null,
+ },
+ yAxis: {
+ label: {
+ style: { fill: 'rgba(200,230,255,0.75)', fontSize: 10 },
+ },
+ grid: {
+ line: { style: { stroke: 'rgba(0,150,200,0.15)', lineDash: [4, 4] } },
+ },
+ line: null,
+ tickLine: null,
+ },
+ legend: {
+ position: 'top-left',
+ offsetY: -5,
+ itemName: {
+ style: { fill: 'rgba(200,230,255,0.85)', fontSize: 11, fontWeight: 600 },
+ },
+ marker: {
+ symbol: 'circle',
+ style: { r: 3 },
+ },
+ itemSpacing: 12,
+ },
+ smooth: true,
+ animation: {
+ appear: {
+ animation: 'wave-in',
+ duration: 1000,
+ },
+ },
+ tooltip: {
+ showMarkers: true,
+ marker: {
+ fill: '#00b4d8',
+ },
+ domStyles: {
+ 'g2-tooltip': {
+ background: 'rgba(10, 30, 50, 0.95)',
+ boxShadow: '0 4px 12px rgba(0,0,0,0.3)',
+ border: '1px solid rgba(0,180,216,0.3)',
+ },
+ 'g2-tooltip-title': {
+ color: 'rgba(200,230,255,0.95)',
+ },
+ 'g2-tooltip-list-item': {
+ color: 'rgba(200,230,255,0.85)',
+ },
+ },
+ },
+ autoFit: true,
+ };
+
+ return (
+
+ 年度巡检任务趋势
+
+ }
+ className="maritime-card"
+ size="small"
+ styles={{
+ body: {
+ padding: '8px 8px 4px 8px',
+ overflow: 'visible',
+ },
+ }}
+ >
+
+
+ );
+};
+
+export default AnnualTrendChart;
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/components/DeviceTypeCard.tsx b/zlt-web/yingyan/src/pages/maritime/dashboard/components/DeviceTypeCard.tsx
new file mode 100644
index 00000000..94678a14
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/components/DeviceTypeCard.tsx
@@ -0,0 +1,106 @@
+import React from 'react';
+import { Card } from 'antd';
+import { AppstoreOutlined } from '@ant-design/icons';
+import { Pie } from '@ant-design/plots';
+import type { DeviceStats } from '@/services/dashboard';
+
+interface DeviceTypeCardProps {
+ deviceStats: DeviceStats | null;
+}
+
+const DeviceTypeCard: React.FC = ({ deviceStats }) => {
+ const usvTypeData = (deviceStats?.byType || [
+ { name: '巡检型', count: 12 },
+ { name: '监测型', count: 8 },
+ { name: '救援型', count: 5 },
+ { name: '测量型', count: 3 },
+ ]).map(item => ({ name: item.name, count: item.count }));
+
+ const pieConfig: any = {
+ data: usvTypeData,
+ angleField: 'count',
+ colorField: 'name',
+ radius: 0.7,
+ innerRadius: 0.5,
+ color: ['#00b4d8', '#0096c7', '#00e5a0', '#48cae4'],
+ appendPadding: [20, 10, 5, 10],
+ label: {
+ text: (datum: any) => {
+ const name = datum?.name || '';
+ const count = datum?.count ?? 0;
+ const total = usvTypeData.reduce((sum, d) => sum + (d.count || 0), 0);
+ const percent = total > 0 ? ((count / total) * 100).toFixed(1) : 0;
+ return `${name}\n${percent}%`;
+ },
+ style: {
+ fill: 'rgba(200,230,255,0.95)',
+ fontSize: 10,
+ fontWeight: 600,
+ textAlign: 'center',
+ },
+ offset: 20,
+ },
+ legend: {
+ position: 'bottom',
+ offsetY: -10,
+ itemValue: {
+ style: { fill: 'rgba(200,230,255,0.75)', fontSize: 10 }
+ },
+ itemName: {
+ style: { fill: 'rgba(200,230,255,0.75)', fontSize: 10 }
+ },
+ itemSpacing: 6,
+ layout: 'horizontal',
+ },
+ statistic: {
+ title: {
+ style: { fontSize: 11, fill: 'rgba(200,230,255,0.65)' },
+ content: '设备总数',
+ },
+ content: {
+ style: { fontSize: 16, fontWeight: 'bold', fill: '#00e5a0' },
+ formatter: () => {
+ const total = usvTypeData.reduce((sum, d) => sum + (d.count || 0), 0);
+ return `${total}`;
+ },
+ },
+ },
+ autoFit: true,
+ };
+
+ return (
+
+ 设备类型分布
+
+ }
+ className="maritime-card"
+ size="small"
+ styles={{
+ body: {
+ padding: 0,
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'center',
+ justifyContent: 'flex-start',
+ overflow: 'visible',
+ height: '100%',
+ },
+ }}
+ >
+
+
+ );
+};
+
+export default DeviceTypeCard;
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/components/MaritimeAlertCard.tsx b/zlt-web/yingyan/src/pages/maritime/dashboard/components/MaritimeAlertCard.tsx
new file mode 100644
index 00000000..08f205e8
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/components/MaritimeAlertCard.tsx
@@ -0,0 +1,58 @@
+import React from 'react';
+import { Card, List, Tag } from 'antd';
+import { WarningOutlined } from '@ant-design/icons';
+import dayjs from 'dayjs';
+import type { AlertItem } from '@/services/dashboard';
+
+interface MaritimeAlertCardProps {
+ alerts: AlertItem[];
+}
+
+const getAlertColor = (level: string) => {
+ switch (level) {
+ case 'critical': return '#ff4757';
+ case 'error': return '#ff9f43';
+ case 'warning': return '#feca57';
+ default: return '#54a0ff';
+ }
+};
+
+const MaritimeAlertCard: React.FC = ({ alerts }) => {
+ return (
+
+ 实时告警
+
+ }
+ extra={LIVE}
+ className="maritime-card"
+ size="small"
+ >
+
+
(
+
+
+
+ {item.level.toUpperCase().slice(0, 1)}
+
+
+
+ {item.deviceName || item.taskName}
+ {dayjs(item.timestamp).format('HH:mm')}
+
+
{item.message}
+
+
+
+ )}
+ />
+
+
+ );
+};
+
+export default MaritimeAlertCard;
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/components/MaritimeInsightCard.tsx b/zlt-web/yingyan/src/pages/maritime/dashboard/components/MaritimeInsightCard.tsx
new file mode 100644
index 00000000..e79dd668
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/components/MaritimeInsightCard.tsx
@@ -0,0 +1,146 @@
+import React from 'react';
+import { Card, Tabs } from 'antd';
+import { FundOutlined } from '@ant-design/icons';
+import { Line, Pie, Rose } from '@ant-design/plots';
+import type { TaskStats, TrendItem } from '@/services/dashboard';
+
+interface MaritimeInsightCardProps {
+ taskStats: TaskStats | null;
+ taskTrend: TrendItem[];
+ violationAnalysisData: any[];
+}
+
+const MaritimeInsightCard: React.FC = ({
+ taskStats,
+ taskTrend,
+ violationAnalysisData,
+}) => {
+ // 任务趋势配置
+ const taskTrendSeriesData = taskTrend.flatMap((t) => [
+ { date: t.date, type: '下发', value: t.created || 0 },
+ { date: t.date, type: '完成', value: t.completed || 0 },
+ { date: t.date, type: '失败', value: t.failed || 0 },
+ ]);
+
+ const taskTrendConfig: any = {
+ data: taskTrendSeriesData,
+ xField: 'date',
+ yField: 'value',
+ seriesField: 'type',
+ smooth: true,
+ color: ['#00b4d8', '#00e5a0', '#ff9f43'],
+ areaStyle: {
+ fill: 'l(270) 0:#ffffff 0.5:#7ec2f3 1:#0077b6',
+ fillOpacity: 0.1,
+ },
+ xAxis: { label: { style: { fill: 'rgba(200,230,255,0.65)' } }, grid: null },
+ yAxis: {
+ label: { style: { fill: 'rgba(200,230,255,0.65)' } },
+ grid: { line: { style: { stroke: 'rgba(0,150,200,0.1)' } } },
+ },
+ tooltip: { showMarkers: true },
+ autoFit: true,
+ };
+
+ // 任务状态饼图配置
+ const taskStatusPieConfig: any = {
+ data: [
+ { name: '待执行', value: taskStats?.pending || 0 },
+ { name: '执行中', value: taskStats?.running || 0 },
+ { name: '已完成', value: taskStats?.completed || 0 },
+ { name: '已失败', value: taskStats?.failed || 0 },
+ ],
+ angleField: 'value',
+ colorField: 'name',
+ radius: 0.85,
+ innerRadius: 0.55,
+ color: ['#ffa502', '#00b4d8', '#00e5a0', '#ff6b6b'],
+ label: {
+ text: (datum: any) => {
+ const name = datum?.name || '';
+ const value = datum?.value ?? 0;
+ const total =
+ (taskStats?.pending || 0) +
+ (taskStats?.running || 0) +
+ (taskStats?.completed || 0) +
+ (taskStats?.failed || 0);
+ const percent = total > 0 ? ((value / total) * 100).toFixed(1) : 0;
+ return `${name} ${percent}%`;
+ },
+ style: { fill: 'rgba(200,230,255,0.85)', fontSize: 12, fontWeight: 600 },
+ },
+ legend: {
+ position: 'bottom',
+ itemValue: { style: { fill: 'rgba(200,230,255,0.75)' } },
+ itemName: { style: { fill: 'rgba(200,230,255,0.75)' } },
+ },
+ autoFit: true,
+ };
+
+ // 违规分析玫瑰图配置
+ const roseConfig: any = {
+ data: violationAnalysisData,
+ xField: 'type',
+ yField: 'value',
+ seriesField: 'type',
+ radius: 0.9,
+ color: ['#ff6b6b', '#ffa502', '#ff9f43', '#00b4d8', '#48cae4', '#90e0ef'],
+ label: {
+ text: (datum: any) => datum?.type || '',
+ style: { fill: '#fff', fontSize: 10 },
+ },
+ legend: {
+ position: 'bottom',
+ itemName: { style: { fill: 'rgba(200,230,255,0.75)' } },
+ },
+ autoFit: true,
+ };
+
+ return (
+
+ 综合分析洞察
+
+ }
+ className="maritime-card maritime-insight-card"
+ size="small"
+ >
+
+
+
+ ),
+ },
+ {
+ key: 'status',
+ label: '任务状态占比',
+ children: (
+
+ ),
+ },
+ {
+ key: 'violation',
+ label: '违规类型分析',
+ children: (
+
+
+
+ ),
+ },
+ ]}
+ />
+
+ );
+};
+
+export default MaritimeInsightCard;
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/components/MaritimeKpiStrip.tsx b/zlt-web/yingyan/src/pages/maritime/dashboard/components/MaritimeKpiStrip.tsx
new file mode 100644
index 00000000..9639e339
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/components/MaritimeKpiStrip.tsx
@@ -0,0 +1,77 @@
+import React from 'react';
+import { EnvironmentOutlined, RocketOutlined, PieChartOutlined } from '@ant-design/icons';
+import './maritime-card.less';
+
+// 无人船图标组件
+const USVIcon = () => (
+
+);
+
+interface MaritimeKpiStripProps {
+ deviceTotal: number;
+ seaAreaCount: number;
+ todayNew: number;
+ successRate: number;
+ taskNewLabel?: string;
+}
+
+const MaritimeKpiStrip: React.FC
= ({
+ deviceTotal,
+ seaAreaCount,
+ todayNew,
+ successRate,
+ taskNewLabel = '当日任务',
+}) => {
+ const kpis = [
+ {
+ key: 'ship',
+ label: '设备总数',
+ value: deviceTotal,
+ icon: ,
+ accent: 'ship',
+ },
+ {
+ key: 'area',
+ label: '海域总数',
+ value: seaAreaCount,
+ icon: ,
+ accent: 'anchor',
+ },
+ {
+ key: 'task',
+ label: taskNewLabel,
+ value: todayNew,
+ icon: ,
+ accent: 'alert',
+ },
+ {
+ key: 'rate',
+ label: '执行成功率',
+ value: successRate,
+ unit: '%',
+ icon: ,
+ accent: 'route',
+ },
+ ];
+
+ return (
+
+ {kpis.map((kpi) => (
+
+
{kpi.icon}
+
+
{kpi.label}
+
+ {kpi.value}
+ {kpi.unit && {kpi.unit}}
+
+
+
+ ))}
+
+ );
+};
+
+export default MaritimeKpiStrip;
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/components/PortStatusCard.tsx b/zlt-web/yingyan/src/pages/maritime/dashboard/components/PortStatusCard.tsx
new file mode 100644
index 00000000..e18227a8
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/components/PortStatusCard.tsx
@@ -0,0 +1,81 @@
+import React, { useMemo } from 'react';
+import { Card } from 'antd';
+import { AimOutlined } from '@ant-design/icons';
+import type { DeviceStats, TaskStats, AlertItem } from '@/services/dashboard';
+
+interface PortStatusCardProps {
+ deviceStats: DeviceStats | null;
+ taskStats: TaskStats | null;
+ alerts: AlertItem[];
+}
+
+const PortStatusCard: React.FC = ({
+ deviceStats,
+ taskStats,
+ alerts,
+}) => {
+ const portStatusData = useMemo(() => {
+ const totalShips = deviceStats?.total || 24;
+ const pendingTasks = taskStats?.pending || 6;
+ const runningTasks = taskStats?.running || 3;
+ const alertBase = alerts.length || 4;
+ const baseShips = Math.max(6, Math.round(totalShips / 3));
+
+ return [
+ {
+ name: '东港枢纽',
+ ships: baseShips + 3,
+ tasks: pendingTasks + 2,
+ alerts: Math.max(1, Math.round(alertBase * 0.4)),
+ },
+ {
+ name: '西湾港区',
+ ships: baseShips + 1,
+ tasks: Math.max(1, pendingTasks + 1),
+ alerts: Math.max(1, Math.round(alertBase * 0.3)),
+ },
+ {
+ name: '南航道',
+ ships: Math.max(4, baseShips - 1),
+ tasks: Math.max(1, runningTasks + 1),
+ alerts: Math.max(0, Math.round(alertBase * 0.2)),
+ },
+ ];
+ }, [alerts.length, deviceStats, taskStats]);
+
+ return (
+
+ 重点港口状态
+
+ }
+ className="maritime-card"
+ size="small"
+ >
+
+ {portStatusData.map((item) => (
+
+ ))}
+
+
+ );
+};
+
+export default PortStatusCard;
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/components/SeaAreaPortal.tsx b/zlt-web/yingyan/src/pages/maritime/dashboard/components/SeaAreaPortal.tsx
new file mode 100644
index 00000000..3471c781
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/components/SeaAreaPortal.tsx
@@ -0,0 +1,28 @@
+import React from 'react';
+import { Button } from 'antd';
+import { CompassOutlined } from '@ant-design/icons';
+import { history } from 'umi';
+
+const SeaAreaPortal: React.FC = () => {
+ const goTo3D = () => {
+ history.push('/map3d?from=maritime');
+ };
+
+ return (
+
+
+
+
+
+
+
海域智慧巡检监控中心
+
+
+
+
+ );
+};
+
+export default SeaAreaPortal;
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/components/TaskOverviewCard.tsx b/zlt-web/yingyan/src/pages/maritime/dashboard/components/TaskOverviewCard.tsx
new file mode 100644
index 00000000..0da4c723
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/components/TaskOverviewCard.tsx
@@ -0,0 +1,185 @@
+import React, { useMemo } from 'react';
+import { Card, DatePicker, Segmented, Space, Progress } from 'antd';
+import { LineChartOutlined, RiseOutlined, FallOutlined } from '@ant-design/icons';
+import type { Dayjs } from 'dayjs';
+import type { TaskStats } from '@/services/dashboard';
+
+interface TaskOverviewCardProps {
+ taskStats: TaskStats | null;
+ taskStatType: 'day' | 'month' | 'year';
+ taskStatDate: Dayjs;
+ onStatTypeChange: (type: 'day' | 'month' | 'year') => void;
+ onDateChange: (date: Dayjs) => void;
+}
+
+const TaskOverviewCard: React.FC = ({
+ taskStats,
+ taskStatType,
+ taskStatDate,
+ onStatTypeChange,
+ onDateChange,
+}) => {
+ const taskPeriodText = useMemo(() => {
+ if (taskStatType === 'day') return '当日';
+ if (taskStatType === 'month') return '当月';
+ return '当年';
+ }, [taskStatType]);
+
+ const datePickerFormat = useMemo(() => {
+ if (taskStatType === 'day') return 'YYYY-MM-DD';
+ if (taskStatType === 'month') return 'YYYY-MM';
+ return 'YYYY';
+ }, [taskStatType]);
+
+ // 计算额外统计数据
+ const extraStats = useMemo(() => {
+ const total = (taskStats?.pending || 0) + (taskStats?.running || 0) +
+ (taskStats?.completed || 0) + (taskStats?.failed || 0);
+ const completed = taskStats?.completed || 0;
+ const failed = taskStats?.failed || 0;
+ const running = taskStats?.running || 0;
+
+ // 模拟同比增长率
+ const growthRate = Math.floor(Math.random() * 30) - 10; // -10% ~ +20%
+
+ // 计算完成率
+ const completionRate = total > 0 ? Math.round((completed / total) * 100) : 0;
+
+ // 计算失败率
+ const failureRate = total > 0 ? Math.round((failed / total) * 100) : 0;
+
+ // 计算平均响应时间(分钟)
+ const avgResponseTime = Math.floor(Math.random() * 20) + 10; // 10-30分钟
+
+ return {
+ total,
+ growthRate,
+ completionRate,
+ failureRate,
+ avgResponseTime,
+ };
+ }, [taskStats]);
+
+ return (
+
+ {taskPeriodText}巡检任务概览
+
+ }
+ extra={
+
+ onStatTypeChange(v as any)}
+ />
+ v && onDateChange(v)}
+ picker={taskStatType === 'day' ? 'date' : taskStatType}
+ allowClear={false}
+ format={datePickerFormat}
+ />
+
+ }
+ className="maritime-card"
+ size="small"
+ >
+ {/* 主要状态网格 */}
+
+
+
{taskStats?.pending || 0}
+
待执行
+
+
+
{taskStats?.running || 0}
+
执行中
+
+
+
{taskStats?.completed || 0}
+
已完成
+
+
+
{taskStats?.failed || 0}
+
已失败
+
+
+
+ {/* 成功率展示 */}
+
+
{taskStats?.successRate || 0}%
+
{taskPeriodText}成功率
+
+
+ {/* 新增:详细统计信息 */}
+
+
+
+
+ 任务总量
+ {extraStats.growthRate >= 0 ? (
+
+ ) : (
+
+ )}
+
+
{extraStats.total}
+
= 0 ? '#00e5a0' : '#ff6b6b' }}>
+ 同比 {extraStats.growthRate >= 0 ? '+' : ''}{extraStats.growthRate}%
+
+
+
+
平均响应
+
{extraStats.avgResponseTime}分
+
任务平均响应时间
+
+
+
+ {/* 完成率和失败率进度条 */}
+
+
+
+ 完成率
+ {extraStats.completionRate}%
+
+
+
+
+
+ 失败率
+ {extraStats.failureRate}%
+
+
+
+
+
+
+ );
+};
+
+export default TaskOverviewCard;
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/components/TaskTypeChart.tsx b/zlt-web/yingyan/src/pages/maritime/dashboard/components/TaskTypeChart.tsx
new file mode 100644
index 00000000..c92c9a68
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/components/TaskTypeChart.tsx
@@ -0,0 +1,105 @@
+import React from 'react';
+import { Card } from 'antd';
+import { BarChartOutlined } from '@ant-design/icons';
+import { Column } from '@ant-design/plots';
+
+interface TaskTypeChartProps {
+ taskTypeData: any[];
+}
+
+const TaskTypeChart: React.FC = ({ taskTypeData }) => {
+ const columnConfig: any = {
+ data: taskTypeData,
+ xField: 'type',
+ yField: 'value',
+ seriesField: 'type',
+ appendPadding: [20, 10, 10, 10],
+ color: ({ type }: any) => {
+ if (type === '航线巡检') return '#00b4d8';
+ if (type === '定点监测') return '#00e5a0';
+ return '#ff9f43';
+ },
+ columnStyle: {
+ radius: [6, 6, 0, 0],
+ },
+ label: {
+ text: (datum: any) => datum?.value?.toString() || '0',
+ style: {
+ fill: '#fff',
+ fontSize: 11,
+ fontWeight: 600,
+ textAlign: 'center',
+ },
+ position: 'top',
+ offset: 6,
+ },
+ xAxis: {
+ label: {
+ style: { fill: 'rgba(200,230,255,0.75)', fontSize: 10 },
+ autoRotate: false,
+ autoHide: false,
+ },
+ line: {
+ style: { stroke: 'rgba(0,180,216,0.2)' },
+ },
+ tickLine: null,
+ },
+ yAxis: {
+ label: {
+ style: { fill: 'rgba(200,230,255,0.75)', fontSize: 10 },
+ },
+ grid: {
+ line: { style: { stroke: 'rgba(0,150,200,0.15)', lineDash: [4, 4] } },
+ },
+ line: null,
+ tickLine: null,
+ },
+ legend: false,
+ animation: {
+ appear: {
+ animation: 'scale-in-y',
+ duration: 800,
+ },
+ },
+ tooltip: {
+ domStyles: {
+ 'g2-tooltip': {
+ background: 'rgba(10, 30, 50, 0.95)',
+ boxShadow: '0 4px 12px rgba(0,0,0,0.3)',
+ border: '1px solid rgba(0,180,216,0.3)',
+ },
+ 'g2-tooltip-title': {
+ color: 'rgba(200,230,255,0.95)',
+ },
+ 'g2-tooltip-list-item': {
+ color: 'rgba(200,230,255,0.85)',
+ },
+ },
+ },
+ autoFit: true,
+ };
+
+ return (
+
+ 任务类型统计
+
+ }
+ className="maritime-card"
+ size="small"
+ styles={{
+ body: {
+ padding: '8px 8px 4px 8px',
+ overflow: 'visible',
+ },
+ }}
+ >
+
+
+
+
+ );
+};
+
+export default TaskTypeChart;
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/components/WeatherCard.tsx b/zlt-web/yingyan/src/pages/maritime/dashboard/components/WeatherCard.tsx
new file mode 100644
index 00000000..b0b65d28
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/components/WeatherCard.tsx
@@ -0,0 +1,41 @@
+import React, { useMemo } from 'react';
+import { Card } from 'antd';
+import {
+ CloudOutlined,
+ CompassOutlined,
+ DashboardOutlined,
+ RiseOutlined,
+} from '@ant-design/icons';
+
+const WeatherCard: React.FC = () => {
+ const weatherMetrics = useMemo(() => ([
+ { label: '风速', value: '4.6 m/s', icon: },
+ { label: '浪高', value: '1.2 m', icon: },
+ { label: '能见度', value: '7.8 km', icon: },
+ { label: '潮位', value: '2.4 m', icon: },
+ ]), []);
+
+ return (
+
+ 海况与气象
+
+ }
+ className="maritime-card"
+ size="small"
+ >
+
+ {weatherMetrics.map((item) => (
+
+
{item.icon}
+
{item.value}
+
{item.label}
+
+ ))}
+
+
+ );
+};
+
+export default WeatherCard;
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/components/index.tsx b/zlt-web/yingyan/src/pages/maritime/dashboard/components/index.tsx
new file mode 100644
index 00000000..a0e6e179
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/components/index.tsx
@@ -0,0 +1,10 @@
+export { default as MaritimeKpiStrip } from './MaritimeKpiStrip';
+export { default as DeviceTypeCard } from './DeviceTypeCard';
+export { default as PortStatusCard } from './PortStatusCard';
+export { default as MaritimeAlertCard } from './MaritimeAlertCard';
+export { default as WeatherCard } from './WeatherCard';
+export { default as SeaAreaPortal } from './SeaAreaPortal';
+export { default as AnnualTrendChart } from './AnnualTrendChart';
+export { default as TaskTypeChart } from './TaskTypeChart';
+export { default as TaskOverviewCard } from './TaskOverviewCard';
+export { default as MaritimeInsightCard } from './MaritimeInsightCard';
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/components/maritime-card.less b/zlt-web/yingyan/src/pages/maritime/dashboard/components/maritime-card.less
new file mode 100644
index 00000000..63baa6a7
--- /dev/null
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/components/maritime-card.less
@@ -0,0 +1,623 @@
+/* 海事大屏组件样式 */
+
+.maritime-card {
+ height: 100%;
+ min-height: 0;
+ max-height: 100%;
+ display: flex;
+ flex-direction: column;
+ background: rgba(14, 34, 64, 0.75) !important;
+ border: 1px solid rgba(0, 180, 216, 0.2) !important;
+ border-radius: 8px;
+ overflow: hidden;
+ backdrop-filter: blur(8px);
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
+
+ &::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ pointer-events: none;
+ background:
+ linear-gradient(90deg, rgba(0, 180, 216, 0.5), transparent 50px) top left / 50px 2px no-repeat,
+ linear-gradient(180deg, rgba(0, 180, 216, 0.5), transparent 50px) top left / 2px 50px no-repeat,
+ linear-gradient(270deg, rgba(0, 180, 216, 0.5), transparent 50px) top right / 50px 2px no-repeat,
+ linear-gradient(180deg, rgba(0, 180, 216, 0.5), transparent 50px) top right / 2px 50px no-repeat,
+ linear-gradient(90deg, rgba(0, 180, 216, 0.5), transparent 50px) bottom left / 50px 2px no-repeat,
+ linear-gradient(0deg, rgba(0, 180, 216, 0.5), transparent 50px) bottom left / 2px 50px no-repeat,
+ linear-gradient(270deg, rgba(0, 180, 216, 0.5), transparent 50px) bottom right / 50px 2px no-repeat,
+ linear-gradient(0deg, rgba(0, 180, 216, 0.5), transparent 50px) bottom right / 2px 50px no-repeat;
+ opacity: 0.4;
+ }
+
+ :global(.ant-card-head) {
+ min-height: 40px;
+ padding: 0 12px;
+ border-bottom: 1px solid rgba(0, 180, 216, 0.15);
+ flex: 0 0 auto;
+ }
+
+ :global(.ant-card-body) {
+ flex: 1;
+ padding: 12px;
+ overflow: hidden;
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ }
+}
+
+/* KPI 指标条样式 */
+.maritime-kpi-strip {
+ display: grid;
+ grid-template-columns: repeat(4, 1fr);
+ gap: 12px;
+ width: 100%;
+ padding: 0;
+}
+
+.maritime-kpi-tile {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 12px 16px;
+ border-radius: 8px;
+ background: rgba(14, 34, 64, 0.7);
+ border: 1px solid rgba(0, 180, 216, 0.18);
+ transition: all 0.3s ease;
+
+ &:hover {
+ transform: translateY(-2px);
+ border-color: rgba(0, 180, 216, 0.35);
+ box-shadow: 0 6px 16px rgba(0, 180, 216, 0.15);
+ }
+
+ &--ship .maritime-kpi-tile__icon {
+ color: #00b4d8;
+ background: rgba(0, 180, 216, 0.15);
+ }
+
+ &--anchor .maritime-kpi-tile__icon {
+ color: #00e5a0;
+ background: rgba(0, 229, 160, 0.15);
+ }
+
+ &--alert .maritime-kpi-tile__icon {
+ color: #ff9f43;
+ background: rgba(255, 159, 67, 0.15);
+ }
+
+ &--route .maritime-kpi-tile__icon {
+ color: #48cae4;
+ background: rgba(72, 202, 228, 0.15);
+ }
+}
+
+.maritime-kpi-tile__icon {
+ flex: 0 0 auto;
+ width: 40px;
+ height: 40px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 20px;
+ border-radius: 8px;
+}
+
+.maritime-kpi-tile__info {
+ flex: 1;
+ min-width: 0;
+}
+
+.maritime-kpi-tile__label {
+ font-size: 13px;
+ color: rgba(200, 230, 255, 0.75);
+ line-height: 1.3;
+}
+
+.maritime-kpi-tile__value {
+ font-size: 24px;
+ font-weight: 800;
+ color: rgba(255, 255, 255, 0.95);
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
+ margin-top: 2px;
+
+ small {
+ font-size: 16px;
+ font-weight: 700;
+ margin-left: 2px;
+ }
+}
+
+/* 图表容器样式 */
+.maritime-chart-wrapper {
+ flex: 1;
+ width: 100%;
+ min-height: 0;
+ overflow: hidden;
+
+ > div {
+ width: 100%;
+ height: 100%;
+ }
+
+ :global(canvas) {
+ max-width: 100%;
+ max-height: 100%;
+ }
+}
+
+/* 港口状态列表样式 */
+.port-status-list {
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+}
+
+.port-item {
+ padding: 12px;
+ border-radius: 8px;
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid rgba(0, 180, 216, 0.12);
+}
+
+.port-name {
+ font-size: 14px;
+ font-weight: 600;
+ color: rgba(200, 230, 255, 0.92);
+ margin-bottom: 10px;
+}
+
+.port-stats {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 8px;
+
+ .stat {
+ text-align: center;
+
+ .num {
+ font-size: 20px;
+ font-weight: 800;
+ color: #00b4d8;
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
+ }
+
+ .txt {
+ font-size: 11px;
+ color: rgba(200, 230, 255, 0.65);
+ margin-top: 4px;
+ }
+ }
+}
+
+/* 告警列表样式 */
+.alert-list-container {
+ flex: 1;
+ min-height: 0;
+ overflow-y: auto;
+ overflow-x: hidden;
+ padding-right: 4px;
+
+ &::-webkit-scrollbar {
+ width: 4px;
+ }
+
+ &::-webkit-scrollbar-thumb {
+ background: rgba(0, 180, 216, 0.3);
+ border-radius: 2px;
+ }
+}
+
+.maritime-alert-item {
+ padding: 10px 0 !important;
+ border-bottom: 1px solid rgba(0, 180, 216, 0.08) !important;
+
+ .alert-row {
+ display: flex;
+ gap: 10px;
+ align-items: flex-start;
+ width: 100%;
+ }
+
+ .alert-badge {
+ flex: 0 0 auto;
+ }
+
+ .alert-content {
+ flex: 1;
+ min-width: 0;
+ }
+
+ .alert-head {
+ display: flex;
+ justify-content: space-between;
+ gap: 10px;
+ margin-bottom: 4px;
+ }
+
+ .alert-name {
+ font-size: 13px;
+ font-weight: 600;
+ color: rgba(200, 230, 255, 0.92);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ .alert-time {
+ font-size: 12px;
+ color: rgba(200, 230, 255, 0.55);
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
+ }
+
+ .alert-msg {
+ font-size: 12px;
+ color: rgba(200, 230, 255, 0.65);
+ line-height: 1.4;
+ }
+}
+
+/* 天气面板样式 */
+.weather-panel {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 12px;
+}
+
+.weather-item {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ padding: 16px 12px;
+ border-radius: 8px;
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid rgba(0, 180, 216, 0.12);
+ transition: all 0.3s ease;
+
+ &:hover {
+ background: rgba(255, 255, 255, 0.05);
+ border-color: rgba(0, 180, 216, 0.25);
+ }
+
+ .weather-icon {
+ font-size: 28px;
+ color: #00b4d8;
+ margin-bottom: 8px;
+ }
+
+ .weather-value {
+ font-size: 18px;
+ font-weight: 800;
+ color: rgba(255, 255, 255, 0.95);
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
+ margin-bottom: 4px;
+ }
+
+ .weather-label {
+ font-size: 12px;
+ color: rgba(200, 230, 255, 0.65);
+ }
+}
+
+/* 海域门户样式 */
+.sea-area-portal {
+ position: relative;
+ height: 100%;
+ min-height: 0;
+ background: rgba(14, 34, 64, 0.75);
+ border: 1px solid rgba(0, 180, 216, 0.2);
+ border-radius: 8px;
+ overflow: hidden;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ .nautical-grid {
+ position: absolute;
+ inset: 0;
+ background-image:
+ linear-gradient(rgba(0, 180, 216, 0.12) 1px, transparent 1px),
+ linear-gradient(90deg, rgba(0, 180, 216, 0.12) 1px, transparent 1px);
+ background-size: 40px 40px;
+ opacity: 0.4;
+ }
+
+ .compass-sweep {
+ position: absolute;
+ inset: 0;
+ background: radial-gradient(circle at center, rgba(0, 180, 216, 0.18), transparent 60%);
+ animation: pulse 3s ease-in-out infinite;
+ }
+
+ .portal-content {
+ position: relative;
+ z-index: 2;
+ text-align: center;
+ }
+
+ .portal-center {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ }
+
+ .portal-title {
+ font-size: 22px;
+ font-weight: 700;
+ color: rgba(255, 255, 255, 0.92);
+ margin-bottom: 20px;
+ text-shadow: 0 2px 8px rgba(0, 180, 216, 0.3);
+ }
+
+ .portal-btn {
+ background: linear-gradient(135deg, #00b4d8, #0096c7);
+ border: none;
+ box-shadow: 0 4px 16px rgba(0, 180, 216, 0.3);
+ transition: all 0.3s ease;
+
+ &:hover {
+ transform: translateY(-2px);
+ box-shadow: 0 6px 20px rgba(0, 180, 216, 0.4);
+ }
+ }
+}
+
+@keyframes pulse {
+ 0%, 100% { opacity: 0.3; }
+ 50% { opacity: 0.5; }
+}
+
+/* 面板分割样式 */
+.panel-split {
+ flex: 1;
+ min-height: 0;
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 12px;
+ overflow: hidden;
+}
+
+.panel-section {
+ min-height: 0;
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+}
+
+.panel-subtitle {
+ margin: 0 0 8px;
+ font-size: 12px;
+ color: rgba(200, 230, 255, 0.65);
+ letter-spacing: 0.2px;
+ flex: 0 0 auto;
+}
+
+/* 任务筛选器样式 */
+.task-filter {
+ :global(.ant-segmented) {
+ background: rgba(0, 180, 216, 0.08);
+ border: 1px solid rgba(0, 180, 216, 0.2);
+ }
+
+ :global(.ant-segmented-item-label) {
+ color: rgba(200, 230, 255, 0.85);
+ font-size: 12px;
+ }
+
+ :global(.ant-segmented-item-selected) {
+ background: rgba(0, 180, 216, 0.25) !important;
+ }
+
+ :global(.ant-picker) {
+ background: rgba(0, 180, 216, 0.08);
+ border: 1px solid rgba(0, 180, 216, 0.2);
+ color: rgba(200, 230, 255, 0.85);
+ }
+
+ :global(.ant-picker-input > input) {
+ color: rgba(200, 230, 255, 0.85);
+ font-size: 12px;
+ }
+
+ :global(.ant-picker-suffix) {
+ color: rgba(200, 230, 255, 0.65);
+ }
+}
+
+/* 船只状态网格 */
+.ship-status-grid {
+ display: grid;
+ grid-template-columns: repeat(4, 1fr);
+ gap: 12px;
+ margin-bottom: 16px;
+}
+
+.ship-stat-box {
+ padding: 12px;
+ border-radius: 8px;
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid rgba(0, 180, 216, 0.12);
+ text-align: center;
+
+ .val {
+ font-size: 24px;
+ font-weight: 800;
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
+ margin-bottom: 4px;
+
+ &.sailing { color: #ffa502; }
+ &.anchored { color: #00b4d8; }
+ &.docked { color: #00e5a0; }
+ &.warning { color: #ff6b6b; }
+ }
+
+ .lbl {
+ font-size: 12px;
+ color: rgba(200, 230, 255, 0.65);
+ }
+}
+
+/* 任务成功率 */
+.task-success {
+ padding: 16px;
+ border-radius: 8px;
+ background: linear-gradient(135deg, rgba(0, 229, 160, 0.12), rgba(0, 180, 216, 0.08));
+ border: 1px solid rgba(0, 229, 160, 0.2);
+ text-align: center;
+ margin-bottom: 16px;
+
+ .rate {
+ font-size: 32px;
+ font-weight: 900;
+ color: #00e5a0;
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
+ text-shadow: 0 2px 8px rgba(0, 229, 160, 0.3);
+ }
+
+ .label {
+ font-size: 13px;
+ color: rgba(200, 230, 255, 0.75);
+ margin-top: 4px;
+ }
+}
+
+/* 任务详细统计 */
+.task-detail-stats {
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+
+ .stat-row {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 12px;
+ }
+
+ .stat-item {
+ padding: 12px;
+ border-radius: 8px;
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid rgba(0, 180, 216, 0.12);
+ text-align: center;
+
+ .stat-label {
+ font-size: 12px;
+ color: rgba(200, 230, 255, 0.65);
+ margin-bottom: 6px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .stat-value {
+ font-size: 22px;
+ font-weight: 800;
+ color: #00b4d8;
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
+ margin-bottom: 4px;
+
+ .stat-unit {
+ font-size: 12px;
+ margin-left: 2px;
+ color: rgba(200, 230, 255, 0.75);
+ }
+ }
+
+ .stat-sub {
+ font-size: 11px;
+ color: rgba(200, 230, 255, 0.55);
+ }
+ }
+
+ .progress-row {
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+ }
+
+ .progress-item {
+ padding: 12px;
+ border-radius: 8px;
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid rgba(0, 180, 216, 0.12);
+
+ .progress-label {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 8px;
+ font-size: 12px;
+ color: rgba(200, 230, 255, 0.75);
+
+ .progress-percent {
+ font-size: 13px;
+ font-weight: 700;
+ color: rgba(255, 255, 255, 0.85);
+ }
+ }
+
+ :global(.ant-progress-bg) {
+ border-radius: 4px;
+ }
+ }
+}
+
+/* Tabs 样式 */
+.maritime-tabs {
+ height: 100%;
+ min-height: 0;
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+
+ :global(.ant-tabs-nav) {
+ margin: 0 0 8px;
+ flex: 0 0 auto;
+ }
+
+ :global(.ant-tabs-nav::before) {
+ border-bottom-color: rgba(0, 180, 216, 0.15);
+ }
+
+ :global(.ant-tabs-tab) {
+ color: rgba(200, 230, 255, 0.65);
+ }
+
+ :global(.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn) {
+ color: rgba(200, 230, 255, 0.95);
+ }
+
+ :global(.ant-tabs-ink-bar) {
+ background: #00b4d8;
+ }
+
+ :global(.ant-tabs-content-holder) {
+ flex: 1;
+ min-height: 0;
+ overflow: hidden;
+ }
+
+ :global(.ant-tabs-content) {
+ height: 100%;
+ min-height: 0;
+ }
+
+ :global(.ant-tabs-tabpane) {
+ height: 100%;
+ min-height: 0;
+ padding: 0;
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+ }
+}
+
+.maritime-insight-card {
+ :global(.ant-card-body) {
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ }
+}
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/index.less b/zlt-web/yingyan/src/pages/maritime/dashboard/index.less
index 26076528..de622f9d 100644
--- a/zlt-web/yingyan/src/pages/maritime/dashboard/index.less
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/index.less
@@ -1,10 +1,27 @@
/* 海事智慧监控服务平台 - 主题样式 */
/* 采用深海蓝色调 + 波浪动效 + 海事元素 - 区别于通用大屏 */
+/* 导入组件样式 */
+@import './components/maritime-card.less';
+
.maritime-dashboard {
position: relative;
width: 100%;
height: 100%;
+ min-height: 0;
+ min-width: 0;
+ flex: 1;
+ font-size: clamp(11px, 1.0vh, 13px);
+ --mar-pad-x: clamp(10px, 1.1vw, 14px);
+ --mar-pad-y: clamp(8px, 0.9vh, 12px);
+ --mar-gap: clamp(8px, 0.9vh, 12px);
+ --mar-kpi-h: clamp(62px, 7.2vh, 78px);
+ --mar-card-head-h: clamp(32px, 3.6vh, 38px);
+ --mar-card-body-pad: clamp(6px, 0.9vh, 10px);
+ --mar-frame-h: clamp(14px, 2.0vh, 20px);
+ --mar-frame-gap: clamp(4px, 0.6vh, 8px);
+ /* 重要:避免中心入口的 min-height 撑破网格,导致底部卡片被挤出屏幕 */
+ --mar-map-min: 0px;
background: linear-gradient(180deg,
#020c1b 0%,
#051525 25%,
@@ -107,42 +124,146 @@
}
}
+.maritime-dashboard--compact-1 {
+ --mar-pad-x: clamp(8px, 0.95vw, 12px);
+ --mar-pad-y: clamp(6px, 0.75vh, 10px);
+ --mar-gap: clamp(6px, 0.75vh, 10px);
+ --mar-kpi-h: clamp(56px, 6.4vh, 70px);
+ --mar-card-head-h: clamp(30px, 3.2vh, 36px);
+ --mar-card-body-pad: clamp(6px, 0.75vh, 9px);
+ --mar-frame-h: clamp(12px, 1.8vh, 18px);
+ --mar-frame-gap: clamp(3px, 0.5vh, 7px);
+ --mar-map-min: 0px;
+}
+
+.maritime-dashboard--compact-2 {
+ --mar-pad-x: clamp(6px, 0.85vw, 10px);
+ --mar-pad-y: clamp(4px, 0.65vh, 8px);
+ --mar-gap: clamp(5px, 0.65vh, 8px);
+ --mar-kpi-h: clamp(52px, 6vh, 64px);
+ --mar-card-head-h: clamp(28px, 3.0vh, 34px);
+ --mar-card-body-pad: clamp(5px, 0.65vh, 8px);
+ --mar-frame-h: clamp(10px, 1.6vh, 16px);
+ --mar-frame-gap: clamp(3px, 0.45vh, 6px);
+ --mar-map-min: 0px;
+}
+
/* 主内容区域 */
.maritime-spin {
height: 100%;
+ min-height: 0;
+ display: block;
+ flex: 1;
+ width: 100%;
:global(.ant-spin-container) {
height: 100%;
display: flex;
flex-direction: column;
+ min-height: 0;
+ width: 100%;
}
}
.maritime-content {
flex: 1;
- padding: 16px 18px;
+ padding: var(--mar-pad-y) var(--mar-pad-x);
+ /* 参考智慧城市:底部装饰条保留但尽量少占内容区高度 */
+ padding-bottom: calc(var(--mar-pad-y) + var(--mar-frame-h));
overflow: hidden;
position: relative;
z-index: 1;
height: 100%;
+ min-height: 0;
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+.maritime-bottom-frame {
+ position: absolute;
+ left: clamp(12px, 1.6vw, 26px);
+ right: clamp(12px, 1.6vw, 26px);
+ bottom: clamp(6px, 0.8vh, 12px);
+ height: var(--mar-frame-h);
+ border-radius: 12px;
+ z-index: 2;
+ pointer-events: none;
+ background:
+ linear-gradient(
+ 90deg,
+ rgba(0, 120, 180, 0.08),
+ rgba(0, 180, 230, 0.7) 34%,
+ rgba(0, 229, 160, 0.45) 50%,
+ rgba(0, 180, 230, 0.7) 66%,
+ rgba(0, 120, 180, 0.08)
+ ) bottom/100% 2px no-repeat,
+ linear-gradient(90deg, rgba(0, 220, 255, 0.85), transparent 90px) bottom left/90px 2px no-repeat,
+ linear-gradient(270deg, rgba(0, 220, 255, 0.85), transparent 90px) bottom right/90px 2px no-repeat,
+ linear-gradient(180deg, rgba(0, 180, 230, 0.6), transparent 80%) bottom left/2px 100% no-repeat,
+ linear-gradient(180deg, rgba(0, 180, 230, 0.6), transparent 80%) bottom right/2px 100% no-repeat;
+ box-shadow: 0 -6px 18px rgba(0, 120, 180, 0.3);
+
+ &::before {
+ content: '';
+ position: absolute;
+ left: 50%;
+ bottom: 6px;
+ width: clamp(120px, 18vw, 220px);
+ height: 6px;
+ transform: translateX(-50%);
+ border-radius: 999px;
+ background: linear-gradient(90deg, transparent, rgba(0, 220, 255, 0.85), transparent);
+ box-shadow: 0 0 12px rgba(0, 180, 230, 0.4);
+ opacity: 0.85;
+ }
}
.maritime-grid {
display: grid;
- grid-template-columns: 25% 50% 25%;
- grid-template-rows: 100%;
- gap: 14px;
+ grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
+ grid-template-rows: minmax(0, 1fr);
+ gap: var(--mar-gap);
+ /* 只用 flex 约束高度,避免百分比高度在某些容器链路下变成不确定值 */
+ flex: 1;
+ width: 100%;
+ min-height: 0;
+ min-width: 0;
+ justify-items: stretch;
+ align-items: stretch;
+}
+
+.maritime-dashboard .grid-col {
+ display: grid;
+ gap: var(--mar-gap);
height: 100%;
+ overflow: hidden;
+ min-height: 0;
+ min-width: 0;
width: 100%;
}
-.grid-col {
- display: flex;
- flex-direction: column;
- gap: 14px;
- height: 100%;
+.maritime-dashboard .grid-col > * {
+ min-height: 0;
+ max-height: 100%;
overflow: hidden;
}
+.maritime-dashboard .grid-col.left-col {
+ /* 4张卡片:上两张偏“静态概览”稍矮,告警为主要信息流更高,海况为补充更矮 */
+ grid-template-rows: minmax(0, 0.9fr) minmax(0, 0.85fr) minmax(0, 1.35fr) minmax(0, 0.55fr);
+}
+
+.maritime-dashboard .grid-col.right-col {
+ /* 4张卡片:概览较高,其余三张均衡 */
+ grid-template-rows: minmax(0, 1.15fr) minmax(0, 0.95fr) minmax(0, 1fr) minmax(0, 0.9fr);
+}
+
+.maritime-dashboard .grid-col.center-col {
+ /* 参考智慧城市:固定 KPI + 其余区域按比例分配,避免底部卡片被挤出屏幕 */
+ grid-template-rows: var(--mar-kpi-h) minmax(0, 1.35fr) minmax(0, 0.85fr);
+}
+
/* 海事风格玻璃面板 */
.panel-card {
background: transparent !important;
@@ -180,22 +301,22 @@
}
:global(.ant-card-head) {
- min-height: 42px;
- padding: 0 14px;
+ min-height: var(--mar-card-head-h);
+ padding: 0 12px;
border-bottom: 1px solid rgba(0, 180, 230, 0.15);
background: linear-gradient(90deg, rgba(0, 100, 150, 0.2), transparent);
.ant-card-head-title {
- font-size: 15px;
+ font-size: 13px;
color: #e0f7ff;
- padding: 10px 0;
+ padding: 8px 0;
letter-spacing: 1px;
}
}
:global(.ant-card-body) {
flex: 1;
- padding: 12px;
+ padding: var(--mar-card-body-pad);
overflow: hidden;
position: relative;
display: flex;
@@ -203,6 +324,49 @@
}
}
+.panel-block {
+ height: 100%;
+ min-height: 0;
+}
+
+.panel-split {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: var(--mar-gap);
+ height: 100%;
+ min-height: 0;
+}
+
+.panel-split--ratio {
+ grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
+}
+
+.panel-stack {
+ display: grid;
+ grid-template-rows: repeat(2, minmax(0, 1fr));
+ gap: var(--mar-gap);
+ height: 100%;
+ min-height: 0;
+}
+
+.panel-stack--alert {
+ grid-template-rows: minmax(0, 1.3fr) minmax(0, 0.7fr);
+}
+
+.panel-section {
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ overflow: hidden;
+}
+
+.panel-subtitle {
+ font-size: 12px;
+ color: rgba(200, 230, 255, 0.7);
+ letter-spacing: 1px;
+ margin-bottom: 6px;
+}
+
.chart-wrapper {
flex: 1;
width: 100%;
@@ -222,8 +386,8 @@
.kpi-row {
display: grid;
grid-template-columns: repeat(4, 1fr);
- gap: 12px;
- height: 85px;
+ gap: var(--mar-gap);
+ height: var(--mar-kpi-h);
}
.kpi-card {
@@ -232,7 +396,7 @@
border-radius: 8px;
display: flex;
align-items: center;
- padding: 0 16px;
+ padding: 0 12px;
position: relative;
overflow: hidden;
@@ -248,10 +412,10 @@
}
.kpi-icon {
- font-size: 26px;
- margin-right: 14px;
- width: 46px;
- height: 46px;
+ font-size: 22px;
+ margin-right: 10px;
+ width: 40px;
+ height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
@@ -267,7 +431,7 @@
.kpi-info {
.label { font-size: 12px; color: rgba(200, 230, 255, 0.7); }
.value {
- font-size: 26px;
+ font-size: 22px;
font-weight: bold;
color: #fff;
font-family: 'Segoe UI', sans-serif;
@@ -281,6 +445,8 @@
/* 中央海图监控区域 */
.map-portal-wrapper {
flex: 2;
+ min-height: var(--mar-map-min);
+ height: 100%;
position: relative;
background: linear-gradient(180deg, rgba(0, 40, 80, 0.5) 0%, rgba(0, 60, 100, 0.3) 100%);
border: 1px solid rgba(0, 180, 230, 0.35);
@@ -353,8 +519,8 @@
.portal-center {
text-align: center;
- width: 320px;
- height: 320px;
+ width: clamp(240px, 16vw, 300px);
+ height: clamp(240px, 16vw, 300px);
display: flex;
flex-direction: column;
align-items: center;
@@ -385,16 +551,16 @@
.portal-title {
color: #e0f7ff;
- margin-bottom: 20px;
- font-size: 20px;
+ margin-bottom: 14px;
+ font-size: 18px;
letter-spacing: 3px;
text-shadow: 0 0 15px rgba(0, 200, 255, 0.5);
}
.portal-btn {
- height: 46px;
- padding: 0 36px;
- font-size: 15px;
+ height: 42px;
+ padding: 0 30px;
+ font-size: 14px;
background: linear-gradient(135deg, #0096c7 0%, #0077b6 100%);
border: none;
box-shadow: 0 4px 20px rgba(0, 150, 200, 0.4);
@@ -412,6 +578,8 @@
/* 告警列表 - 海事风格 */
.alert-list-container {
+ flex: 1;
+ min-height: 0;
height: 100%;
overflow-y: auto;
@@ -487,11 +655,31 @@
}
}
+.task-success {
+ margin-top: 16px;
+ text-align: center;
+
+ .rate {
+ font-size: 32px;
+ font-weight: bold;
+ color: #00e5a0;
+ }
+
+ .label {
+ font-size: 14px;
+ color: #e0f7ff;
+ margin-top: 4px;
+ }
+}
+
/* 气象信息面板 */
.weather-panel {
display: flex;
flex-wrap: wrap;
gap: 12px;
+ flex: 1;
+ min-height: 0;
+ align-content: flex-start;
.weather-item {
flex: 1;
@@ -524,6 +712,13 @@
/* 港口状态 */
.port-status-list {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ flex: 1;
+ min-height: 0;
+ overflow-y: auto;
+
.port-item {
display: flex;
align-items: center;
@@ -531,7 +726,7 @@
padding: 10px 12px;
background: rgba(0, 80, 120, 0.25);
border-radius: 6px;
- margin-bottom: 8px;
+ margin-bottom: 0;
border-left: 3px solid #00b4d8;
.port-name {
@@ -635,9 +830,19 @@
}
/* 响应式布局 */
-@media (max-width: 1400px) {
+@media (max-width: 1680px) {
.maritime-grid {
- grid-template-columns: 28% 44% 28%;
+ grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.8fr) minmax(0, 1.1fr);
+ }
+}
+
+
+
+
+
+@media (max-width: 1440px) {
+ .maritime-grid {
+ grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) minmax(0, 1.2fr);
}
}
@@ -657,7 +862,10 @@
grid-template-rows: auto;
}
- .grid-col {
+ .maritime-dashboard .grid-col {
+ display: flex;
+ flex-direction: column;
+ gap: var(--mar-gap);
height: auto;
min-height: 400px;
}
diff --git a/zlt-web/yingyan/src/pages/maritime/dashboard/index.tsx b/zlt-web/yingyan/src/pages/maritime/dashboard/index.tsx
index 45472e12..a90113f8 100644
--- a/zlt-web/yingyan/src/pages/maritime/dashboard/index.tsx
+++ b/zlt-web/yingyan/src/pages/maritime/dashboard/index.tsx
@@ -1,34 +1,22 @@
import React, { useState, useEffect, useCallback, useMemo } from 'react';
-import { Card, Button, List, Tag, Spin, message, DatePicker, Segmented, Space } from 'antd';
-import {
- WarningOutlined,
- RocketOutlined,
- CompassOutlined,
- PieChartOutlined,
- EnvironmentOutlined,
-} from '@ant-design/icons';
-import { Line, Pie, Column, Area, Rose } from '@ant-design/plots';
-import { history } from 'umi';
+import { Spin, message } from 'antd';
import dayjs from 'dayjs';
+import type { AlertItem, DeviceStats, TaskStats, TrendItem } from '@/services/dashboard';
+import { getDeviceStats, getTaskStats, getTrendData } from '@/services/dashboard';
import {
- getDeviceStats,
- getTaskStats,
- getTrendData,
- getMockAlerts,
- DeviceStats,
- TaskStats,
- TrendItem,
- AlertItem,
-} from '@/services/dashboard';
+ MaritimeKpiStrip,
+ DeviceTypeCard,
+ PortStatusCard,
+ MaritimeAlertCard,
+ WeatherCard,
+ SeaAreaPortal,
+ AnnualTrendChart,
+ TaskTypeChart,
+ TaskOverviewCard,
+ MaritimeInsightCard,
+} from './components';
import './index.less';
-// 无人船图标组件
-const USVIcon = () => (
-
-);
-
const MaritimeDashboard: React.FC = () => {
const [loading, setLoading] = useState(true);
const [deviceStats, setDeviceStats] = useState(null);
@@ -43,6 +31,18 @@ const MaritimeDashboard: React.FC = () => {
const [tenantId, setTenantId] = useState();
const [includeChildren, setIncludeChildren] = useState(true);
+ // 海事专用告警数据
+ const getMaritimeAlerts = useCallback((): AlertItem[] => {
+ return [
+ { id: '1', type: 'device_fault', level: 'critical', deviceName: '巡检船-01', message: '检测到船只超速航行,航速28节', timestamp: new Date(Date.now() - 120000).toISOString() },
+ { id: '2', type: 'device_offline', level: 'error', deviceName: '巡检船-03', message: '设备信号丢失超过10分钟', timestamp: new Date(Date.now() - 300000).toISOString() },
+ { id: '3', type: 'task_failed', level: 'warning', taskName: '巡检任务#1024', message: '发现违规锚泊船只1艘', timestamp: new Date(Date.now() - 600000).toISOString() },
+ { id: '4', type: 'low_battery', level: 'warning', deviceName: '巡检船-02', message: '电池电量低于20%', timestamp: new Date(Date.now() - 900000).toISOString() },
+ { id: '5', type: 'task_failed', level: 'warning', taskName: '巡检任务#1023', message: '巡检完成,未发现违规', timestamp: new Date(Date.now() - 1200000).toISOString() },
+ ];
+ }, []);
+
+ // 初始化模拟数据
useEffect(() => {
// 模拟年度数据
const mockAnnual: any[] = [];
@@ -78,6 +78,7 @@ const MaritimeDashboard: React.FC = () => {
]);
}, []);
+ // 监听租户变化
useEffect(() => {
const handler = (e: any) => {
const nextTenantId = e?.detail?.tenantId as string | undefined;
@@ -89,6 +90,7 @@ const MaritimeDashboard: React.FC = () => {
return () => window.removeEventListener('tenant-change', handler as any);
}, []);
+ // 获取数据
const fetchData = useCallback(async () => {
setLoading(true);
try {
@@ -110,7 +112,6 @@ const MaritimeDashboard: React.FC = () => {
setDeviceStats(deviceRes);
setTaskStats(taskRes);
setTaskTrend(trendRes.taskTrend);
- // 模拟海事告警数据
setAlerts(getMaritimeAlerts());
} catch (error) {
console.error('获取数据失败:', error);
@@ -118,418 +119,141 @@ const MaritimeDashboard: React.FC = () => {
} finally {
setLoading(false);
}
- }, [includeChildren, taskStatDate, taskStatType, tenantId]);
-
- // 海事专用告警数据
- const getMaritimeAlerts = (): AlertItem[] => {
- return [
- { id: '1', type: 'device_fault', level: 'critical', deviceName: '巡检船-01', message: '检测到船只超速航行,航速28节', timestamp: new Date(Date.now() - 120000).toISOString() },
- { id: '2', type: 'device_offline', level: 'error', deviceName: '巡检船-03', message: '设备信号丢失超过10分钟', timestamp: new Date(Date.now() - 300000).toISOString() },
- { id: '3', type: 'task_failed', level: 'warning', taskName: '巡检任务#1024', message: '发现违规锚泊船只1艘', timestamp: new Date(Date.now() - 600000).toISOString() },
- { id: '4', type: 'low_battery', level: 'warning', deviceName: '巡检船-02', message: '电池电量低于20%', timestamp: new Date(Date.now() - 900000).toISOString() },
- { id: '5', type: 'task_failed', level: 'warning', taskName: '巡检任务#1023', message: '巡检完成,未发现违规', timestamp: new Date(Date.now() - 1200000).toISOString() },
- ];
- };
+ }, [getMaritimeAlerts, includeChildren, taskStatDate, taskStatType, tenantId]);
+ // 初始化和定时刷新数据
useEffect(() => {
- if (!tenantId) return;
fetchData();
- }, [fetchData]);
-
- // 定时刷新
- useEffect(() => {
const dataTimer = setInterval(fetchData, 30000);
return () => {
clearInterval(dataTimer);
};
}, [fetchData]);
- const goTo3D = () => {
- // 传递来源页面,以便从map3d返回时能回到正确的大屏
- history.push('/map3d?from=maritime');
- };
-
- // --- 图表配置 ---
-
- const taskTrendSeriesData = useMemo(() => {
- return taskTrend.flatMap((t) => [
- { date: t.date, type: '下发', value: t.created || 0 },
- { date: t.date, type: '完成', value: t.completed || 0 },
- { date: t.date, type: '失败', value: t.failed || 0 },
- ]);
- }, [taskTrend]);
-
- // 近7日任务完成数趋势数据
- const taskCompleteTrendData = useMemo(() => {
- return taskTrend.map((t) => ({
- date: t.date,
- value: t.completed || 0,
- }));
- }, [taskTrend]);
-
- const taskTrendConfig: any = {
- data: taskTrendSeriesData,
- xField: 'date',
- yField: 'value',
- seriesField: 'type',
- smooth: true,
- color: ['#00b4d8', '#00e5a0', '#ff9f43'],
- areaStyle: {
- fill: 'l(270) 0:#ffffff 0.5:#7ec2f3 1:#0077b6',
- fillOpacity: 0.1,
- },
- xAxis: { label: { style: { fill: 'rgba(200,230,255,0.65)' } }, grid: null },
- yAxis: { label: { style: { fill: 'rgba(200,230,255,0.65)' } }, grid: { line: { style: { stroke: 'rgba(0,150,200,0.1)' } } } },
- tooltip: { showMarkers: true },
- height: 180,
- };
-
- // 设备类型分布 - 模拟数据
- const usvTypeData: { name: string; count: number }[] = useMemo(() => {
- return (deviceStats?.byType || [
- { name: '巡检型', count: 12 },
- { name: '监测型', count: 8 },
- { name: '救援型', count: 5 },
- { name: '测量型', count: 3 },
- ]).map(item => ({ name: item.name, count: item.count }));
- }, [deviceStats]);
-
- const pieConfig: any = {
- data: usvTypeData,
- angleField: 'count',
- colorField: 'name',
- radius: 0.7,
- innerRadius: 0.5,
- color: ['#00b4d8', '#0096c7', '#00e5a0', '#48cae4'],
- label: {
- text: (datum: any) => {
- const name = datum?.name || '';
- const count = datum?.count ?? 0;
- const data = usvTypeData as { name: string; count: number }[];
- const total = data.reduce((sum, d) => sum + (d.count || 0), 0);
- const percent = total > 0 ? ((count / total) * 100).toFixed(1) : 0;
- return `${name} ${percent}%`;
- },
- style: { fill: 'rgba(200,230,255,0.65)' },
- },
- legend: { position: 'bottom', itemValue: { style: { fill: 'rgba(200,230,255,0.65)' } }, itemName: { style: { fill: 'rgba(200,230,255,0.65)' } } },
- height: 200,
- };
-
- const columnConfig: any = {
- data: taskTypeData,
- xField: 'type',
- yField: 'value',
- seriesField: 'type',
- color: ({ type }: any) => {
- if (type === '航线巡检') return '#00b4d8';
- if (type === '定点监测') return '#00e5a0';
- return '#ff9f43';
- },
- label: {
- text: (datum: any) => datum?.value?.toString() || '0',
- style: { fill: '#fff' },
- },
- xAxis: { label: { style: { fill: 'rgba(200,230,255,0.65)' } } },
- yAxis: { label: { style: { fill: 'rgba(200,230,255,0.65)' } }, grid: { line: { style: { stroke: 'rgba(0,150,200,0.1)' } } } },
- legend: false,
- height: 180,
- };
-
- const taskCompleteTrendConfig: any = {
- data: taskCompleteTrendData,
- xField: 'date',
- yField: 'value',
- smooth: true,
- color: '#00e5a0',
- areaStyle: { fillOpacity: 0.2 },
- xAxis: { label: { style: { fill: 'rgba(200,230,255,0.65)' } }, grid: null },
- yAxis: {
- label: { style: { fill: 'rgba(200,230,255,0.65)' } },
- grid: { line: { style: { stroke: 'rgba(0,150,200,0.08)' } } },
- },
- tooltip: { showMarkers: true },
- height: 160,
- };
-
- const areaConfig: any = {
- data: annualData,
- xField: 'month',
- yField: 'value',
- seriesField: 'type',
- color: ['#00b4d8', '#00e5a0'],
- areaStyle: { fillOpacity: 0.25 },
- xAxis: { label: { style: { fill: 'rgba(200,230,255,0.65)' } } },
- yAxis: { label: { style: { fill: 'rgba(200,230,255,0.65)' } }, grid: { line: { style: { stroke: 'rgba(0,150,200,0.1)' } } } },
- legend: { position: 'top-right', itemName: { style: { fill: 'rgba(200,230,255,0.8)' } } },
- smooth: true,
- height: 220,
- };
-
- const roseConfig: any = {
- data: violationAnalysisData,
- xField: 'type',
- yField: 'value',
- seriesField: 'type',
- radius: 0.9,
- color: ['#ff6b6b', '#ffa502', '#ff9f43', '#00b4d8', '#48cae4', '#90e0ef'],
- label: {
- text: (datum: any) => datum?.type || '',
- style: { fill: '#fff', fontSize: 10 },
- },
- legend: { position: 'bottom', itemName: { style: { fill: 'rgba(200,230,255,0.65)' } } },
- height: 200,
- };
-
- const taskStatusPieConfig: any = {
- data: [
- { name: '待执行', value: taskStats?.pending || 0 },
- { name: '执行中', value: taskStats?.running || 0 },
- { name: '已完成', value: taskStats?.completed || 0 },
- { name: '已失败', value: taskStats?.failed || 0 },
- ],
- angleField: 'value',
- colorField: 'name',
- radius: 0.85,
- innerRadius: 0.55,
- color: ['#ffa502', '#00b4d8', '#00e5a0', '#ff6b6b'],
- label: {
- text: (datum: any) => {
- const name = datum?.name || '';
- const value = datum?.value ?? 0;
- const total = (taskStats?.pending || 0) + (taskStats?.running || 0) + (taskStats?.completed || 0) + (taskStats?.failed || 0);
- const percent = total > 0 ? ((value / total) * 100).toFixed(1) : 0;
- return `${name} ${percent}%`;
- },
- style: { fill: 'rgba(200,230,255,0.65)' },
- },
- legend: { position: 'bottom', itemValue: { style: { fill: 'rgba(200,230,255,0.65)' } }, itemName: { style: { fill: 'rgba(200,230,255,0.65)' } } },
- height: 190,
- };
-
- const getAlertColor = (level: string) => {
- switch (level) {
- case 'critical': return '#ff4757';
- case 'error': return '#ff9f43';
- case 'warning': return '#feca57';
- default: return '#54a0ff';
- }
- };
-
- const taskPeriodText = useMemo(() => {
- if (taskStatType === 'day') return '当日';
- if (taskStatType === 'month') return '当月';
- return '当年';
- }, [taskStatType]);
-
const taskNewLabel = useMemo(() => {
if (taskStatType === 'day') return '当日任务';
if (taskStatType === 'month') return '当月任务';
return '当年任务';
}, [taskStatType]);
- const datePickerFormat = useMemo(() => {
- if (taskStatType === 'day') return 'YYYY-MM-DD';
- if (taskStatType === 'month') return 'YYYY-MM';
- return 'YYYY';
- }, [taskStatType]);
+ // 使用 CSS Grid 强制分配高度(类似智慧城市首页)
+ const gap = 12;
return (
-
+
+ {/* 保留海事背景装饰 */}
+
-
-
-
- {/* 左侧栏:设备态势 */}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
实时告警}
- className="panel-card ocean-glass flex-grow"
- size="small"
- extra={LIVE}
- >
-
-
(
-
-
-
- {item.level.toUpperCase().slice(0, 1)}
-
-
-
- {item.deviceName || item.taskName}
- {dayjs(item.timestamp).format('HH:mm')}
-
-
{item.message}
-
-
-
- )}
- />
-
-
+
+ {/* 左侧栏 - CSS Grid 四个卡片分配,设备类型分布给更多空间 */}
+
- {/* 中间栏:核心监控 */}
-
- {/* 顶部KPI */}
-
-
-
-
-
设备总数
-
{deviceStats?.total || 0}
-
-
-
-
-
-
海域总数
-
{deviceStats?.tourismCount || 0}
-
-
-
-
-
-
{taskNewLabel}
-
{taskStats?.todayNew || 0}
-
-
-
-
-
-
执行成功率
-
{taskStats?.successRate || 0}%
-
-
+ {/* 中间栏 - KPI固定70px + 海域门户 + 年度趋势和任务类型左右并排 */}
+
+
+
+
+
+
+
+ {/* 年度趋势和任务类型左右并排 */}
+
+
-
- {/* 海域监控入口 */}
-
-
-
-
-
-
-
海域智慧巡检监控中心
-
-
-
+
+
-
- {/* 年度巡检任务趋势 */}
-
-
-
+
- {/* 右侧栏:任务与运维 */}
-
-
- setTaskStatType(v as any)}
- />
- v && setTaskStatDate(v)}
- picker={taskStatType === 'day' ? 'date' : taskStatType}
- allowClear={false}
- format={datePickerFormat}
- disabledDate={(d) => !!d && d.isAfter(dayjs(), 'day')}
- />
-
- }
- >
-
-
-
{taskStats?.pending || 0}
-
待执行
-
-
-
{taskStats?.running || 0}
-
执行中
-
-
-
{taskStats?.completed || 0}
-
已完成
-
-
-
{taskStats?.failed || 0}
-
已失败
-
-
-
-
- {taskStats?.successRate || 0}%
-
-
- {taskPeriodText}成功率
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ {/* 右侧栏 - CSS Grid 各50% */}
+
diff --git a/zlt-web/yingyan/tmp_delete_test.txt b/zlt-web/yingyan/tmp_delete_test.txt
deleted file mode 100644
index 9daeafb9..00000000
--- a/zlt-web/yingyan/tmp_delete_test.txt
+++ /dev/null
@@ -1 +0,0 @@
-test