feat:平板页面
This commit is contained in:
@@ -1,247 +1,374 @@
|
||||
/* ========== 玻璃拟态变量 ========== */
|
||||
@glass-border: rgba(65, 170, 255, 0.28);
|
||||
@glass-border-light: rgba(92, 211, 255, 0.18);
|
||||
@accent-cyan: #00d4ff;
|
||||
@accent-blue: #0096ff;
|
||||
@text-primary: #eaf6ff;
|
||||
@text-secondary: rgba(255, 255, 255, 0.55);
|
||||
@text-dim: rgba(255, 255, 255, 0.35);
|
||||
@card-bg: linear-gradient(145deg, rgba(10, 24, 48, 0.7), rgba(8, 18, 38, 0.5));
|
||||
@card-bg-active: linear-gradient(145deg, rgba(0, 80, 160, 0.2), rgba(0, 120, 200, 0.1));
|
||||
@card-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
||||
@card-shadow-active: 0 2px 20px rgba(0, 112, 212, 0.2), inset 0 1px 0 rgba(0, 180, 255, 0.12);
|
||||
/* ===== 左侧面板 - 基于 Pixso 设计稿 ===== */
|
||||
|
||||
/* ========== 设计令牌 ========== */
|
||||
@bg-sidebar: #0f172a;
|
||||
@bg-card: #1e293b;
|
||||
@border-color: #1e3a5f;
|
||||
@accent-cyan: #22d3ee;
|
||||
@accent-teal: #0e7490;
|
||||
@color-green: #10b981;
|
||||
@color-amber: #f59e0b;
|
||||
@color-blue: #3b82f6;
|
||||
@text-primary: #ffffff;
|
||||
@text-secondary: #94a3b8;
|
||||
@text-dim: #64748b;
|
||||
@font-mono: 'JetBrains Mono', 'Courier New', monospace;
|
||||
@font-sans: 'Inter', -apple-system, sans-serif;
|
||||
@transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
|
||||
.panel {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* ========== 头部 ========== */
|
||||
.header {
|
||||
padding: 20px 16px 16px;
|
||||
border-bottom: 1px solid @glass-border-light;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16px;
|
||||
gap: 12px;
|
||||
position: relative;
|
||||
|
||||
// 底部渐变高光
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -1px;
|
||||
left: 16px;
|
||||
right: 16px;
|
||||
height: 1px;
|
||||
background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.2), transparent);
|
||||
}
|
||||
}
|
||||
|
||||
.headerIcon {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
/* ========== 信息卡片通用 ========== */
|
||||
.infoCard {
|
||||
padding: 14px;
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(135deg, rgba(0, 100, 200, 0.35), rgba(0, 180, 255, 0.15));
|
||||
backdrop-filter: blur(8px);
|
||||
border: 1px solid rgba(0, 150, 255, 0.25);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.cardHeader {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: @accent-cyan;
|
||||
font-size: 16px;
|
||||
flex-shrink: 0;
|
||||
box-shadow: 0 2px 8px rgba(0, 100, 200, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
||||
justify-content: space-between;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.headerTitle {
|
||||
font-size: 15px;
|
||||
.cardTitle {
|
||||
font-family: @font-mono;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
color: @text-primary;
|
||||
line-height: 1.3;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.headerSub {
|
||||
font-size: 11px;
|
||||
color: @text-dim;
|
||||
letter-spacing: 0.3px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.count {
|
||||
margin-left: auto;
|
||||
background: linear-gradient(135deg, rgba(0, 100, 200, 0.25), rgba(0, 150, 255, 0.15));
|
||||
border: 1px solid rgba(0, 150, 255, 0.2);
|
||||
color: @accent-cyan;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
font-family: 'Rajdhani', 'DIN', monospace;
|
||||
padding: 2px 12px;
|
||||
border-radius: 10px;
|
||||
.badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
font-family: @font-mono;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.badgeGreen {
|
||||
background: rgba(16, 185, 129, 0.12);
|
||||
color: @color-green;
|
||||
}
|
||||
|
||||
.badgeAmber {
|
||||
background: rgba(245, 158, 11, 0.12);
|
||||
color: @color-amber;
|
||||
}
|
||||
|
||||
.badgeBlue {
|
||||
background: rgba(59, 130, 246, 0.12);
|
||||
color: @color-blue;
|
||||
}
|
||||
|
||||
.badgeDot {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
/* ========== 列表 ========== */
|
||||
.list {
|
||||
.cardRow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
.cardLabel {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-family: @font-sans;
|
||||
font-size: 12px;
|
||||
color: @text-secondary;
|
||||
}
|
||||
|
||||
.cardLabelIcon {
|
||||
font-size: 13px;
|
||||
color: @text-dim;
|
||||
}
|
||||
|
||||
.cardValue {
|
||||
font-family: @font-mono;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.cardValueCyan {
|
||||
color: @accent-cyan;
|
||||
}
|
||||
|
||||
.cardValueGreen {
|
||||
color: @color-green;
|
||||
}
|
||||
|
||||
.cardValueAmber {
|
||||
color: @color-amber;
|
||||
}
|
||||
|
||||
.cardValueDim {
|
||||
color: @text-dim;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* ========== 设备状态卡片 ========== */
|
||||
.deviceCard {
|
||||
background: @bg-card;
|
||||
border: 1px solid @border-color;
|
||||
}
|
||||
|
||||
/* ========== 任务信息卡片 ========== */
|
||||
.taskCard {
|
||||
background: rgba(34, 211, 238, 0.05);
|
||||
border: 1px solid rgba(34, 211, 238, 0.25);
|
||||
}
|
||||
|
||||
/* ========== 电池/信号条 ========== */
|
||||
.progressBar {
|
||||
width: 60px;
|
||||
height: 6px;
|
||||
background: @bg-sidebar;
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.progressFill {
|
||||
height: 100%;
|
||||
border-radius: 3px;
|
||||
transition: width 0.3s;
|
||||
}
|
||||
|
||||
.barGroup {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
/* ========== 分隔线 ========== */
|
||||
.divider {
|
||||
height: 1px;
|
||||
background: @border-color;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* ========== 航线区域 ========== */
|
||||
.routeHeader {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.routeHeaderTitle {
|
||||
font-family: @font-mono;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
color: @text-dim;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.routeCountBadge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 4px 10px;
|
||||
background: @bg-card;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: 10px;
|
||||
font-family: @font-mono;
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
color: @text-secondary;
|
||||
}
|
||||
|
||||
.routeScrollArea {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 12px 10px;
|
||||
position: relative;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.routeList {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.scrollHint {
|
||||
text-align: center;
|
||||
font-family: @font-sans;
|
||||
font-size: 10px;
|
||||
color: @text-dim;
|
||||
padding: 8px 0 4px;
|
||||
}
|
||||
|
||||
.center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 200px;
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
/* ========== 线路卡片 ========== */
|
||||
/* ========== 航线卡片 ========== */
|
||||
.routeCard {
|
||||
padding: 14px 16px;
|
||||
margin-bottom: 8px;
|
||||
padding: 12px 14px;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
transition: @transition-fast;
|
||||
border: 1px solid rgba(255, 255, 255, 0.05);
|
||||
background: @card-bg;
|
||||
backdrop-filter: blur(6px);
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
// 左侧指示条
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 20%;
|
||||
bottom: 20%;
|
||||
width: 2px;
|
||||
background: transparent;
|
||||
border-radius: 1px;
|
||||
transition: @transition-fast;
|
||||
}
|
||||
background: @bg-card;
|
||||
border: 1px solid @border-color;
|
||||
|
||||
&:hover {
|
||||
background: linear-gradient(145deg, rgba(0, 80, 160, 0.12), rgba(0, 120, 200, 0.06));
|
||||
border-color: rgba(0, 150, 255, 0.25);
|
||||
box-shadow: @card-shadow;
|
||||
transform: translateX(2px);
|
||||
|
||||
&::before {
|
||||
background: rgba(0, 180, 255, 0.4);
|
||||
}
|
||||
border-color: rgba(34, 211, 238, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
.routeCardActive {
|
||||
background: @card-bg-active;
|
||||
border-color: rgba(0, 150, 255, 0.4);
|
||||
box-shadow: @card-shadow-active;
|
||||
|
||||
&::before {
|
||||
background: linear-gradient(180deg, @accent-cyan, @accent-blue);
|
||||
width: 3px;
|
||||
top: 12%;
|
||||
bottom: 12%;
|
||||
}
|
||||
|
||||
.routeName {
|
||||
color: @accent-cyan;
|
||||
text-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
|
||||
}
|
||||
background: rgba(34, 211, 238, 0.06);
|
||||
border-color: @accent-cyan;
|
||||
}
|
||||
|
||||
.routeName {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: rgba(255, 255, 255, 0.92);
|
||||
margin-bottom: 8px;
|
||||
transition: @transition-fast;
|
||||
letter-spacing: 0.3px;
|
||||
}
|
||||
|
||||
/* ========== 标签行 ========== */
|
||||
.tagRow {
|
||||
.routeCardTop {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.routeNameRow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-bottom: 10px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 11px;
|
||||
color: @text-secondary;
|
||||
background: rgba(0, 100, 180, 0.1);
|
||||
border: 1px solid rgba(0, 150, 255, 0.1);
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
font-family: 'Rajdhani', 'DIN', sans-serif;
|
||||
letter-spacing: 0.3px;
|
||||
}
|
||||
|
||||
.tagIcon {
|
||||
font-size: 10px;
|
||||
color: rgba(0, 180, 255, 0.65);
|
||||
}
|
||||
|
||||
/* ========== 航点路径 ========== */
|
||||
.waypointPath {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
padding: 10px 0 4px;
|
||||
border-top: 1px solid rgba(65, 170, 255, 0.1);
|
||||
}
|
||||
|
||||
.waypointDot {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: @accent-cyan;
|
||||
box-shadow: 0 0 4px rgba(0, 212, 255, 0.4);
|
||||
.routeIcon {
|
||||
font-size: 14px;
|
||||
color: @accent-cyan;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.waypointName {
|
||||
font-size: 12px;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
letter-spacing: 0.2px;
|
||||
.routeName {
|
||||
font-family: @font-sans;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: @text-primary;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.waypointArrow {
|
||||
.routeCardActive .routeName {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.routeMeta {
|
||||
font-family: @font-sans;
|
||||
font-size: 11px;
|
||||
color: rgba(0, 180, 255, 0.45);
|
||||
margin: 0 1px;
|
||||
color: @text-dim;
|
||||
}
|
||||
|
||||
/* ========== 开始航行按钮 ========== */
|
||||
.startBtn {
|
||||
margin-top: 12px;
|
||||
height: 38px;
|
||||
border-radius: 8px;
|
||||
/* ========== 航线操作按钮 ========== */
|
||||
.routeActions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-top: 10px;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.btnPreview {
|
||||
flex: 1;
|
||||
height: 44px;
|
||||
min-height: 44px;
|
||||
border-radius: 7px;
|
||||
background: @bg-card;
|
||||
border: 1px solid @accent-cyan;
|
||||
color: @accent-cyan;
|
||||
font-family: @font-sans;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
letter-spacing: 1.5px;
|
||||
background: linear-gradient(135deg, #0070d4, #0096ff);
|
||||
border: 1px solid rgba(0, 150, 255, 0.3);
|
||||
box-shadow: 0 2px 12px rgba(0, 112, 212, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
||||
cursor: pointer;
|
||||
transition: @transition-fast;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
touch-action: manipulation;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
&:hover {
|
||||
background: linear-gradient(135deg, #0080e8, #00a8ff);
|
||||
box-shadow: 0 4px 20px rgba(0, 112, 212, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
|
||||
transform: translateY(-1px);
|
||||
background: rgba(34, 211, 238, 0.08);
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 1px 6px rgba(0, 112, 212, 0.3);
|
||||
background: rgba(34, 211, 238, 0.15);
|
||||
}
|
||||
}
|
||||
|
||||
.btnExecute {
|
||||
flex: 1;
|
||||
height: 44px;
|
||||
min-height: 44px;
|
||||
border-radius: 7px;
|
||||
background: linear-gradient(90deg, @accent-teal, @accent-cyan);
|
||||
border: none;
|
||||
color: @text-primary;
|
||||
font-family: @font-sans;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: @transition-fast;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
touch-action: manipulation;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 2px 12px rgba(34, 211, 238, 0.3);
|
||||
}
|
||||
|
||||
&:active {
|
||||
box-shadow: 0 2px 16px rgba(34, 211, 238, 0.45);
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
/* ========== 滚动条 ========== */
|
||||
.routeScrollArea::-webkit-scrollbar {
|
||||
width: 3px;
|
||||
}
|
||||
|
||||
.routeScrollArea::-webkit-scrollbar-thumb {
|
||||
background: rgba(34, 211, 238, 0.2);
|
||||
border-radius: 2px;
|
||||
&:hover {
|
||||
background: rgba(34, 211, 238, 0.35);
|
||||
}
|
||||
}
|
||||
|
||||
.routeScrollArea::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import React from 'react';
|
||||
import { Spin, Empty } from 'antd';
|
||||
import {
|
||||
ClockCircleOutlined,
|
||||
EnvironmentOutlined,
|
||||
SendOutlined,
|
||||
NodeIndexOutlined,
|
||||
AimOutlined,
|
||||
ThunderboltOutlined,
|
||||
WifiOutlined,
|
||||
PlayCircleOutlined,
|
||||
EyeOutlined,
|
||||
CompassOutlined,
|
||||
DownOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import type { BoatRouteListVO, BoatWaypointVO } from '@/types/boatRoute';
|
||||
import type { BoatRouteListVO, BoatWaypointVO, BoatTelemetryData } from '@/types/boatRoute';
|
||||
import styles from './index.less';
|
||||
|
||||
interface LeftPanelProps {
|
||||
@@ -15,8 +19,20 @@ interface LeftPanelProps {
|
||||
loading: boolean;
|
||||
selectedRouteId: string | null;
|
||||
onSelectRoute: (routeId: string | null) => void;
|
||||
deviceInfo: any;
|
||||
boatData: BoatTelemetryData | null;
|
||||
sseConnected: boolean;
|
||||
onStartSailing: (routeId: string) => Promise<void>;
|
||||
onPreviewRoute: (routeId: string) => void;
|
||||
sailingLoading: boolean;
|
||||
}
|
||||
|
||||
/** 格式化距离 */
|
||||
const formatDistance = (meters?: number) => {
|
||||
if (!meters || meters <= 0) return null;
|
||||
return meters >= 1000 ? `${(meters / 1000).toFixed(1)}km` : `${Math.round(meters)}m`;
|
||||
};
|
||||
|
||||
/** 格式化时间(秒 → "XX分钟") */
|
||||
const formatDuration = (seconds?: number) => {
|
||||
if (!seconds || seconds <= 0) return null;
|
||||
@@ -24,98 +40,170 @@ const formatDuration = (seconds?: number) => {
|
||||
return min > 0 ? `${min}分钟` : '<1分钟';
|
||||
};
|
||||
|
||||
/** 格式化距离 */
|
||||
const formatDistance = (meters?: number) => {
|
||||
if (!meters || meters <= 0) return null;
|
||||
return meters >= 1000 ? `${(meters / 1000).toFixed(1)}km` : `${Math.round(meters)}m`;
|
||||
};
|
||||
|
||||
const LeftPanel: React.FC<LeftPanelProps> = ({
|
||||
routes,
|
||||
routeWaypointsMap,
|
||||
loading,
|
||||
selectedRouteId,
|
||||
onSelectRoute,
|
||||
deviceInfo,
|
||||
boatData,
|
||||
sseConnected,
|
||||
onStartSailing,
|
||||
onPreviewRoute,
|
||||
sailingLoading,
|
||||
}) => {
|
||||
const battery = boatData?.battery ?? 0;
|
||||
const isOnline = sseConnected;
|
||||
|
||||
return (
|
||||
<div className={styles.panel}>
|
||||
<div className={styles.header}>
|
||||
<div className={styles.headerIcon}>
|
||||
<SendOutlined />
|
||||
{/* ========== 设备状态卡片 ========== */}
|
||||
<div className={`${styles.infoCard} ${styles.deviceCard}`}>
|
||||
<div className={styles.cardHeader}>
|
||||
<span className={styles.cardTitle}>设备状态</span>
|
||||
<span className={`${styles.badge} ${isOnline ? styles.badgeGreen : styles.badgeAmber}`}>
|
||||
<span className={styles.badgeDot} style={{ background: isOnline ? '#10b981' : '#f59e0b' }} />
|
||||
{isOnline ? '在线' : '离线'}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<div className={styles.headerTitle}>游览线路</div>
|
||||
<div className={styles.headerSub}>选择线路开始游览</div>
|
||||
|
||||
<div className={styles.cardRow}>
|
||||
<span className={styles.cardLabel}>
|
||||
<AimOutlined className={styles.cardLabelIcon} />
|
||||
GPS 信号
|
||||
</span>
|
||||
<span className={`${styles.cardValue} ${styles.cardValueGreen}`}>
|
||||
{boatData?.longitude ? '强' : '弱'}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className={styles.cardRow}>
|
||||
<span className={styles.cardLabel}>
|
||||
<CompassOutlined className={styles.cardLabelIcon} />
|
||||
当前位置
|
||||
</span>
|
||||
<span className={`${styles.cardValue} ${styles.cardValueCyan}`}>
|
||||
{boatData?.longitude
|
||||
? `${boatData.longitude.toFixed(2)}°E ${boatData.latitude.toFixed(2)}°N`
|
||||
: '--'}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className={styles.cardRow}>
|
||||
<span className={styles.cardLabel}>
|
||||
<ThunderboltOutlined className={styles.cardLabelIcon} />
|
||||
电池电量
|
||||
</span>
|
||||
<div className={styles.barGroup}>
|
||||
<div className={styles.progressBar}>
|
||||
<div
|
||||
className={styles.progressFill}
|
||||
style={{
|
||||
width: `${battery}%`,
|
||||
background: battery > 20 ? '#10b981' : '#ff4d4f',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<span className={`${styles.cardValue} ${styles.cardValueGreen}`}>{battery}%</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.cardRow}>
|
||||
<span className={styles.cardLabel}>
|
||||
<WifiOutlined className={styles.cardLabelIcon} />
|
||||
通信信号
|
||||
</span>
|
||||
<div className={styles.barGroup}>
|
||||
<div className={styles.progressBar}>
|
||||
<div
|
||||
className={styles.progressFill}
|
||||
style={{
|
||||
width: `${boatData?.signalStrength ?? 0}%`,
|
||||
background: '#10b981',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<span className={`${styles.cardValue} ${styles.cardValueGreen}`}>
|
||||
{isOnline ? '4G LTE' : '无信号'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<span className={styles.count}>{routes.length}</span>
|
||||
</div>
|
||||
|
||||
<div className={styles.list}>
|
||||
{/* ========== 分隔线 ========== */}
|
||||
<div className={styles.divider} />
|
||||
|
||||
{/* ========== 航线区域 ========== */}
|
||||
<div className={styles.routeHeader}>
|
||||
<span className={styles.routeHeaderTitle}>浏览线路</span>
|
||||
<span className={styles.routeCountBadge}>
|
||||
{routes.length} 条航线
|
||||
<DownOutlined style={{ fontSize: 8 }} />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className={styles.routeScrollArea}>
|
||||
{loading ? (
|
||||
<div className={styles.center}><Spin /></div>
|
||||
) : routes.length === 0 ? (
|
||||
<div className={styles.center}>
|
||||
<Empty description="暂无游览线路" image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
||||
<Empty description="暂无航线" image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
||||
</div>
|
||||
) : (
|
||||
routes.map((route) => {
|
||||
const isSelected = selectedRouteId === route.routeId;
|
||||
const waypoints = routeWaypointsMap[route.routeId] || [];
|
||||
const duration = formatDuration(route.totalDuration);
|
||||
const distance = formatDistance(route.totalDistance);
|
||||
<div className={styles.routeList}>
|
||||
{routes.map((route) => {
|
||||
const isSelected = selectedRouteId === route.routeId;
|
||||
const waypoints = routeWaypointsMap[route.routeId] || [];
|
||||
const duration = formatDuration(route.totalDuration);
|
||||
const distance = formatDistance(route.totalDistance);
|
||||
const wpCount = route.waypointCount || waypoints.length;
|
||||
|
||||
// 构建航点路径名称列表
|
||||
const waypointNames = waypoints
|
||||
.filter((wp) => wp.pointName)
|
||||
.map((wp) => wp.pointName);
|
||||
|
||||
return (
|
||||
<div
|
||||
key={route.routeId}
|
||||
className={`${styles.routeCard} ${isSelected ? styles.routeCardActive : ''}`}
|
||||
onClick={() => onSelectRoute(isSelected ? null : route.routeId)}
|
||||
>
|
||||
{/* 线路名称 */}
|
||||
<div className={styles.routeName}>{route.routeName}</div>
|
||||
|
||||
{/* 时长 + 距离 标签 */}
|
||||
<div className={styles.tagRow}>
|
||||
{duration && (
|
||||
<span className={styles.tag}>
|
||||
<ClockCircleOutlined className={styles.tagIcon} />
|
||||
{duration}
|
||||
</span>
|
||||
)}
|
||||
{distance && (
|
||||
<span className={styles.tag}>
|
||||
<EnvironmentOutlined className={styles.tagIcon} />
|
||||
{distance}
|
||||
</span>
|
||||
)}
|
||||
<span className={styles.tag}>
|
||||
<NodeIndexOutlined className={styles.tagIcon} />
|
||||
{route.waypointCount || waypoints.length}个景点
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* 航点路径 */}
|
||||
{waypointNames.length > 0 && (
|
||||
<div className={styles.waypointPath}>
|
||||
{waypointNames.map((name, idx) => (
|
||||
<React.Fragment key={idx}>
|
||||
<span className={styles.waypointDot} />
|
||||
<span className={styles.waypointName}>{name}</span>
|
||||
{idx < waypointNames.length - 1 && (
|
||||
<span className={styles.waypointArrow}>→</span>
|
||||
)}
|
||||
</React.Fragment>
|
||||
))}
|
||||
return (
|
||||
<div
|
||||
key={route.routeId}
|
||||
className={`${styles.routeCard} ${isSelected ? styles.routeCardActive : ''}`}
|
||||
onClick={() => onSelectRoute(isSelected ? null : route.routeId)}
|
||||
>
|
||||
<div className={styles.routeCardTop}>
|
||||
<div className={styles.routeNameRow}>
|
||||
<EnvironmentOutlined className={styles.routeIcon} />
|
||||
<span className={styles.routeName}>{route.routeName}</span>
|
||||
</div>
|
||||
<span className={`${styles.badge} ${styles.badgeGreen}`}>就绪</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})
|
||||
<div className={styles.routeMeta}>
|
||||
{wpCount}个航点{distance ? ` · 约${distance}` : ''}{duration ? ` · 预计${duration}` : ''}
|
||||
</div>
|
||||
|
||||
{/* 选中时显示操作按钮 */}
|
||||
{isSelected && (
|
||||
<div className={styles.routeActions} onClick={(e) => e.stopPropagation()}>
|
||||
<button
|
||||
className={styles.btnPreview}
|
||||
onClick={(e) => { e.stopPropagation(); onPreviewRoute(route.routeId); }}
|
||||
onTouchEnd={(e) => { e.stopPropagation(); e.preventDefault(); onPreviewRoute(route.routeId); }}
|
||||
>
|
||||
<EyeOutlined />
|
||||
预览航线
|
||||
</button>
|
||||
<button
|
||||
className={styles.btnExecute}
|
||||
disabled={sailingLoading}
|
||||
onClick={(e) => { e.stopPropagation(); onStartSailing(route.routeId); }}
|
||||
onTouchEnd={(e) => { if (sailingLoading) return; e.stopPropagation(); e.preventDefault(); onStartSailing(route.routeId); }}
|
||||
>
|
||||
<PlayCircleOutlined />
|
||||
{sailingLoading ? '启动中...' : '执行航线'}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
{routes.length > 2 && <div className={styles.scrollHint}>上下滑动查看更多航线</div>}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user