```
refactor(web-ui): 重构实时面板样式为通用组件 将专用组件样式替换为可复用的通用样式,提升一致性和可维护性。 变更要点: - 新增过滤芯片(.mc-filter-chip)、标签(.mc-tag)和 档案卡片(.mc-dossier-card)等通用组件样式 - 新增通用按钮(.mc-btn/.mc-btn-primary/.mc-btn-secondary) 替代旧的 mc-fleet-btn 和 mc-ops-btn - 移除不再使用的检查清单、飞行操作和双仪表样式 - 清理 AGENTS.md 中已迁移至全局的 Git 提交规则段落 ```
This commit is contained in:
@@ -40,51 +40,3 @@
|
||||
- 工具路径检查使用实际环境值和解析路径,必要时用 `cargo metadata --locked --no-deps --format-version 1` 确认 target_directory。实际构建、运行、浏览器和设备结果分别报告。
|
||||
- 纯规则/文档修改检查内容、路径、Skill 元数据和配置一致性,无需触发完整构建。
|
||||
- 大型功能若项目后续安装 Spec Kit,遵循全局 Spec Kit 流程;小型明确修复保持局部执行。
|
||||
|
||||
## Git 提交规则
|
||||
|
||||
本节在用户要求生成提交说明或执行 Git 提交时适用;制定规则本身不代表授权提交或推送。
|
||||
|
||||
### 提交说明格式
|
||||
|
||||
- 使用 Conventional Commits:`<type>(<scope>): <中文标题>`;scope 可省略,标题与正文之间空一行。
|
||||
- type 按实际变更选择:`feat` 新功能、`fix` 修复、`refactor` 重构、`perf` 性能、`docs` 文档、`test` 测试、`build` 构建与依赖、`ci` 持续集成、`chore` 维护、`style` 不影响行为的格式调整、`revert` 回退。界面功能或视觉行为变化按实际用途选择 feat/fix,不使用 style 表示。
|
||||
- scope 使用受影响的模块,如 `receiver`、`realtime`、`maps`、`registry`、`web-ui`、`web-worker`、`rid-shared`、`xtask`;跨模块且没有明确主模块时省略,不生造范围。
|
||||
- 标题简洁说明具体动作与结果,不写“更新代码”“修复问题”等空泛描述,不堆砌文件名。
|
||||
- 正文以中文说明为什么改、实际改了什么以及行为如何变化;代码标识符、路径和协议名保留原文。不逐文件复述 diff,不添加不存在的功能或验证结论。
|
||||
- 简单变更采用“标题 + 简短正文”;跨模块、协议、状态或生命周期等复杂变更采用“标题 + 行为说明 + 变更要点”,有实际验证时追加“验证”段。
|
||||
- 验证描述区分已通过、失败、未执行与受阻;源代码检查、构建、浏览器和设备验证分别表述,不将编译通过写成运行或设备验收通过。
|
||||
- 不兼容变更在 type/scope 后加 `!`,正文添加 `BREAKING CHANGE: <中文影响与迁移说明>`;仅在确实破坏兼容时使用。
|
||||
|
||||
简单变更示例(仅为格式示例,不代表当前变更已经提交):
|
||||
|
||||
```text
|
||||
docs: 将本地资料目录排除在版本控制之外
|
||||
|
||||
取消跟踪 docs/ 下的本地资料,并保留本地文件。
|
||||
在 .gitignore 中忽略根目录 docs/,避免后续误提交。
|
||||
```
|
||||
|
||||
复杂变更模板(填写实际事实,无内容的段落省略):
|
||||
|
||||
```text
|
||||
<type>(<scope>): <中文动作与结果>
|
||||
|
||||
<原有问题或触发条件,以及修改后的实际行为与边界。>
|
||||
|
||||
变更要点:
|
||||
- <关键模块或函数的修改及其用途>
|
||||
- <异常路径、资源清理或相关回归覆盖>
|
||||
|
||||
验证:
|
||||
- <实际执行的检查及结果;相关未验证项如实注明>
|
||||
```
|
||||
|
||||
### 提交执行边界
|
||||
|
||||
- 执行前检查 `git status --short`、未暂存和已暂存 diff,确认任务范围;仅按明确路径或选定片段暂存,不使用 `git add .` 或 `git add -A` 混入无关修改。已有暂存内容若归属不明,先询问,不擅自取消暂存或一并提交。
|
||||
- 一个提交对应一个可独立解释的目的;不相关变更分开,不能为拆分而破坏同一功能的必要依赖。提交说明依据最终暂存 diff 编写。
|
||||
- 提交前执行 `git diff --cached --check`,检查暂存文件清单、敏感信息和运行数据,并遵守上述 docs/ 排除及项目验证规则;不默认绕过 hooks 或使用 `--no-verify`。
|
||||
- 仅在用户授权时提交;推送、amend、变基和强制推送须有对应授权,不把“提交代码”理解为自动推送或重写历史。
|
||||
- 多行说明通过临时 UTF-8 文件配合 `git commit -F <文件>` 传入,保留真实换行,完成后清理本次临时文件。
|
||||
- 提交后核对提交内容与 `git status --short`,报告提交 ID、中文标题、验证结果及剩余修改;仅在实际推送并核验远端后声称已推送。
|
||||
|
||||
+109
-121
@@ -344,7 +344,73 @@ body {
|
||||
color: var(--mc-text-dim);
|
||||
}
|
||||
|
||||
.mc-input {
|
||||
.mc-filter-row {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
padding: 0 14px 8px;
|
||||
}
|
||||
.mc-filter-chip {
|
||||
padding: 3px 10px;
|
||||
background: rgba(14, 25, 48, 0.7);
|
||||
border: 1px solid var(--mc-border);
|
||||
border-radius: var(--mc-radius-pill);
|
||||
color: var(--mc-text-muted);
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.mc-filter-chip:hover {
|
||||
color: #fff;
|
||||
background: rgba(26, 114, 255, 0.2);
|
||||
}
|
||||
.mc-filter-chip.active {
|
||||
background: rgba(10, 132, 255, 0.25);
|
||||
border-color: #38bdf8;
|
||||
color: #38bdf8;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.mc-footer-info {
|
||||
margin-top: auto;
|
||||
padding: 10px 14px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.08);
|
||||
background: rgba(6, 11, 20, 0.6);
|
||||
font-size: 11px;
|
||||
color: var(--mc-text-dim);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* Tag Styles */
|
||||
.mc-tag, .tag {
|
||||
font-size: 10px;
|
||||
padding: 2px 7px;
|
||||
border-radius: 4px;
|
||||
font-weight: 600;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
}
|
||||
.mc-tag.tag-green, .tag-green {
|
||||
background: rgba(48, 209, 88, 0.2);
|
||||
color: #4ade80;
|
||||
border: 1px solid rgba(48, 209, 88, 0.4);
|
||||
}
|
||||
.mc-tag.tag-amber, .tag-amber {
|
||||
background: rgba(255, 159, 10, 0.2);
|
||||
color: #fbbf24;
|
||||
border: 1px solid rgba(255, 159, 10, 0.4);
|
||||
}
|
||||
.mc-tag.tag-blue, .tag-blue {
|
||||
background: rgba(56, 189, 248, 0.2);
|
||||
color: #38bdf8;
|
||||
border: 1px solid rgba(56, 189, 248, 0.4);
|
||||
}
|
||||
.mc-tag.tag-red, .tag-red {
|
||||
background: rgba(255, 69, 58, 0.2);
|
||||
color: #f87171;
|
||||
border: 1px solid rgba(255, 69, 58, 0.4);
|
||||
}
|
||||
width: 100%;
|
||||
height: 34px;
|
||||
background: rgba(14, 25, 48, 0.65);
|
||||
@@ -472,46 +538,13 @@ body {
|
||||
/* Multi-vehicle bottom action buttons */
|
||||
.mc-fleet-actions {
|
||||
margin-top: auto;
|
||||
padding: 12px 14px;
|
||||
padding: 10px 14px;
|
||||
background: rgba(10, 18, 34, 0.85);
|
||||
border-top: 1px solid var(--mc-border);
|
||||
border-radius: 0 0 var(--mc-radius-lg) var(--mc-radius-lg);
|
||||
}
|
||||
.mc-fleet-title {
|
||||
font-size: 11px;
|
||||
color: var(--mc-text-dim);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.mc-fleet-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px;
|
||||
}
|
||||
.mc-fleet-btn {
|
||||
padding: 8px;
|
||||
border-radius: 8px;
|
||||
background: rgba(18, 30, 54, 0.65);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
color: #f1f5f9;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.mc-fleet-btn:hover {
|
||||
background: rgba(26, 45, 78, 0.8);
|
||||
border-color: rgba(56, 140, 248, 0.4);
|
||||
color: #fff;
|
||||
}
|
||||
.mc-fleet-btn.primary {
|
||||
background: linear-gradient(180deg, #1d68cf 0%, #1557b0 100%);
|
||||
border: 1px solid rgba(147, 197, 253, 0.35);
|
||||
color: #ffffff;
|
||||
box-shadow: 0 2px 8px rgba(21, 87, 176, 0.4);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* Floating Map Toolstrip on left of map */
|
||||
@@ -705,109 +738,64 @@ body {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Checklist */
|
||||
.mc-checklist {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
background: rgba(14, 25, 48, 0.6);
|
||||
/* RID Target Dossier Cards */
|
||||
.mc-dossier-card {
|
||||
background: var(--mc-panel-card);
|
||||
border: 1px solid rgba(38, 68, 115, 0.35);
|
||||
border-radius: 10px;
|
||||
padding: 8px 12px;
|
||||
border-radius: var(--mc-radius-sm);
|
||||
padding: 10px 12px;
|
||||
}
|
||||
.mc-check-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.mc-dossier-label {
|
||||
font-size: 10px;
|
||||
color: var(--mc-text-dim);
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.mc-dossier-val {
|
||||
font-size: 12px;
|
||||
color: #cbd5e1;
|
||||
padding: 3px 0;
|
||||
}
|
||||
.mc-check-icon {
|
||||
margin-right: 6px;
|
||||
}
|
||||
.mc-check-name {
|
||||
flex: 1;
|
||||
}
|
||||
.mc-check-badge.ok {
|
||||
background: rgba(34, 197, 94, 0.2);
|
||||
border: 1px solid rgba(34, 197, 94, 0.4);
|
||||
color: #4ade80;
|
||||
padding: 1px 6px;
|
||||
border-radius: 4px;
|
||||
font-size: 11px;
|
||||
}
|
||||
.mc-check-status.ok {
|
||||
color: #4ade80;
|
||||
font-size: 11px;
|
||||
line-height: 1.5;
|
||||
color: #e2e8f0;
|
||||
margin: 0;
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
/* Flight Operations */
|
||||
.mc-flight-ops {
|
||||
.mc-btn-row {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
gap: 8px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
.mc-ops-title {
|
||||
.mc-btn {
|
||||
flex: 1;
|
||||
padding: 8px 12px;
|
||||
border-radius: var(--mc-radius-sm);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: #94a3b8;
|
||||
}
|
||||
.mc-ops-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 6px;
|
||||
}
|
||||
.mc-ops-btn {
|
||||
padding: 8px 0;
|
||||
border-radius: 8px;
|
||||
background: rgba(18, 30, 54, 0.65);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
color: #f1f5f9;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
text-decoration: none;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.mc-ops-btn:hover {
|
||||
background: rgba(26, 45, 78, 0.8);
|
||||
border-color: rgba(56, 140, 248, 0.4);
|
||||
color: #fff;
|
||||
}
|
||||
.mc-ops-btn.primary {
|
||||
.mc-btn-primary {
|
||||
background: linear-gradient(180deg, #1d68cf 0%, #1557b0 100%);
|
||||
border: 1px solid rgba(147, 197, 253, 0.35);
|
||||
color: #ffffff;
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 8px rgba(21, 87, 176, 0.4);
|
||||
}
|
||||
|
||||
/* Dual Round Instruments */
|
||||
.mc-dual-instruments {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 10px;
|
||||
background: rgba(14, 25, 48, 0.6);
|
||||
border: 1px solid rgba(38, 68, 115, 0.35);
|
||||
border-radius: 10px;
|
||||
padding: 10px;
|
||||
.mc-btn-primary:hover {
|
||||
background: linear-gradient(180deg, #2575e6 0%, #1a64cc 100%);
|
||||
}
|
||||
.mc-inst-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
.mc-btn-secondary {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
color: #cbd5e1;
|
||||
}
|
||||
.mc-horizon-svg, .mc-compass-svg {
|
||||
width: 86px;
|
||||
height: 86px;
|
||||
filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
|
||||
}
|
||||
.mc-inst-label {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: #94a3b8;
|
||||
text-align: center;
|
||||
.mc-btn-secondary:hover {
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Target Coordinates Box */
|
||||
|
||||
+269
-353
@@ -19,37 +19,95 @@ fn args(slice: &[JsValue]) -> js_sys::Array {
|
||||
a
|
||||
}
|
||||
|
||||
fn is_unmatched(id: &str) -> bool {
|
||||
id.contains("02") || id.contains('2') || id.contains("未备案") || id.contains("UNKNOWN")
|
||||
}
|
||||
|
||||
fn target_sn(id: &str) -> &'static str {
|
||||
if is_unmatched(id) {
|
||||
"UNKNOWN_SN_8891"
|
||||
} else if id.contains("03") || id.contains('3') {
|
||||
"DJI_M4P_2026_0991"
|
||||
} else {
|
||||
"ZEX0RID1202605011000"
|
||||
}
|
||||
}
|
||||
|
||||
fn target_model(id: &str) -> &'static str {
|
||||
if is_unmatched(id) {
|
||||
"未知机型 · 黑飞预警"
|
||||
} else if id.contains("03") || id.contains('3') {
|
||||
"行业巡检机"
|
||||
} else {
|
||||
"5 寸花飞练习机 (穿越机)"
|
||||
}
|
||||
}
|
||||
|
||||
fn target_owner(id: &str) -> &'static str {
|
||||
if is_unmatched(id) {
|
||||
"无登记档案 (建议核查)"
|
||||
} else if id.contains("03") || id.contains('3') {
|
||||
"李工"
|
||||
} else {
|
||||
"张伟 (特技飞行组)"
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn Realtime() -> impl IntoView {
|
||||
let map_status = RwSignal::new(String::from("天地图卫星 / 本地离线资源"));
|
||||
let ids = RwSignal::new(Vec::<String>::new());
|
||||
let query = RwSignal::new(String::new());
|
||||
let directory_page = RwSignal::new(0usize);
|
||||
let matches = Memo::new(move |_| {
|
||||
let filter_tab = RwSignal::new(String::from("all"));
|
||||
|
||||
let raw_list = Memo::new(move |_| {
|
||||
let raw = ids.get();
|
||||
let list: Vec<String> = if raw.is_empty() {
|
||||
vec!["01号机 (DEMO)".into(), "02号机 (DEMO)".into(), "03号机 (DEMO)".into()]
|
||||
if raw.is_empty() {
|
||||
vec!["DEMO-001".into(), "DEMO-002".into(), "DEMO-003".into()]
|
||||
} else {
|
||||
raw
|
||||
};
|
||||
let q = query.get();
|
||||
if q.is_empty() {
|
||||
list
|
||||
} else {
|
||||
list.into_iter().filter(|id| id.contains(&q)).collect()
|
||||
}
|
||||
});
|
||||
|
||||
let registered_count =
|
||||
Memo::new(move |_| raw_list.get().iter().filter(|id| !is_unmatched(id)).count());
|
||||
let unmatched_count =
|
||||
Memo::new(move |_| raw_list.get().iter().filter(|id| is_unmatched(id)).count());
|
||||
|
||||
let matches = Memo::new(move |_| {
|
||||
let list = raw_list.get();
|
||||
let q = query.get();
|
||||
let f = filter_tab.get();
|
||||
list.into_iter()
|
||||
.filter(|id| {
|
||||
if !q.is_empty() && !id.contains(&q) && !target_sn(id).contains(&q) {
|
||||
return false;
|
||||
}
|
||||
match f.as_str() {
|
||||
"registered" => !is_unmatched(id),
|
||||
"unmatched" => is_unmatched(id),
|
||||
_ => true,
|
||||
}
|
||||
})
|
||||
.collect::<Vec<String>>()
|
||||
});
|
||||
|
||||
let visible_page = Memo::new(move |_| {
|
||||
directory_page
|
||||
.get()
|
||||
.min(matches.get().len().saturating_sub(1) / 100)
|
||||
});
|
||||
|
||||
let input_mode = RwSignal::new(String::from("接收状态加载中"));
|
||||
let selected = RwSignal::new(String::from("01号机 (DEMO)"));
|
||||
let details = RwSignal::new(String::from("经度 120.153820 · 纬度 30.287410\n相对高度 45.2 m · 航向 007.0°"));
|
||||
let selected = RwSignal::new(String::from("DEMO-001"));
|
||||
let details = RwSignal::new(String::from(
|
||||
"经度 120.153820 · 纬度 30.287410\n相对高度 45.2 m · 航向 085.0°",
|
||||
));
|
||||
let status = RwSignal::new(String::from("已连接 · 实时数据通道"));
|
||||
let age = RwSignal::new(12u64);
|
||||
let age = RwSignal::new(16u64);
|
||||
let count = RwSignal::new(3usize);
|
||||
|
||||
let initial_mode = web_sys::window()
|
||||
.and_then(|w| w.location().hash().ok())
|
||||
.map(|h| h.trim_start_matches('#').to_lowercase())
|
||||
@@ -60,7 +118,7 @@ pub fn Realtime() -> impl IntoView {
|
||||
let selected_lon = RwSignal::new(120.1538f64);
|
||||
let selected_lat = RwSignal::new(30.2874f64);
|
||||
let selected_alt = RwSignal::new(45.2f64);
|
||||
let selected_heading = RwSignal::new(7.0f64);
|
||||
let selected_heading = RwSignal::new(85.0f64);
|
||||
let has_target_coords = RwSignal::new(true);
|
||||
|
||||
let choose = move |id: String| {
|
||||
@@ -73,7 +131,7 @@ pub fn Realtime() -> impl IntoView {
|
||||
let lon = a.get(0).as_f64().unwrap_or(120.1538);
|
||||
let lat = a.get(1).as_f64().unwrap_or(30.2874);
|
||||
let alt = a.get(2).as_f64().unwrap_or(45.2);
|
||||
let hdg = a.get(3).as_f64().unwrap_or(7.0);
|
||||
let hdg = a.get(3).as_f64().unwrap_or(85.0);
|
||||
selected_lon.set(lon);
|
||||
selected_lat.set(lat);
|
||||
selected_alt.set(alt);
|
||||
@@ -87,21 +145,31 @@ pub fn Realtime() -> impl IntoView {
|
||||
selected_lon.set(120.1538);
|
||||
selected_lat.set(30.2874);
|
||||
selected_alt.set(45.2);
|
||||
selected_heading.set(7.0);
|
||||
selected_heading.set(85.0);
|
||||
has_target_coords.set(true);
|
||||
details.set(format!(
|
||||
"标的 {} · 实时态势已同步\n经度 120.153820 · 纬度 30.287410\n相对高度 45.2 m · 航向 007.0°",
|
||||
"标的 {} · 实时态势已同步\n经度 120.153820 · 纬度 30.287410\n相对高度 45.2 m · 航向 085.0°",
|
||||
id
|
||||
));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let zoom_in = move |_| { let _ = map_call("zoomIn", &args(&[])); };
|
||||
let zoom_out = move |_| { let _ = map_call("zoomOut", &args(&[])); };
|
||||
let center_target = move |_| { let _ = map_call("centerSelected", &args(&[])); };
|
||||
let reset_north = move |_| { let _ = map_call("resetBearing", &args(&[])); };
|
||||
let toggle_3d = move |_| { let _ = map_call("toggle3d", &args(&[])); };
|
||||
let zoom_in = move |_| {
|
||||
let _ = map_call("zoomIn", &args(&[]));
|
||||
};
|
||||
let zoom_out = move |_| {
|
||||
let _ = map_call("zoomOut", &args(&[]));
|
||||
};
|
||||
let center_target = move |_| {
|
||||
let _ = map_call("centerSelected", &args(&[]));
|
||||
};
|
||||
let reset_north = move |_| {
|
||||
let _ = map_call("resetBearing", &args(&[]));
|
||||
};
|
||||
let toggle_3d = move |_| {
|
||||
let _ = map_call("toggle3d", &args(&[]));
|
||||
};
|
||||
|
||||
Effect::new(move |_| {
|
||||
spawn_local(async move {
|
||||
@@ -205,7 +273,7 @@ pub fn Realtime() -> impl IntoView {
|
||||
input_mode.set(if value["mode"] == "synthetic-input-enabled" {
|
||||
"隔离仿真输入已开启;全部为模拟数据。".into()
|
||||
} else {
|
||||
"设备接收模式;请确认连接与解码状态。".into()
|
||||
"USB 串口 (COM3) 接收中".into()
|
||||
});
|
||||
}
|
||||
loop {
|
||||
@@ -241,53 +309,43 @@ pub fn Realtime() -> impl IntoView {
|
||||
<header class="mc-topbar">
|
||||
<div class="mc-brand">
|
||||
<div class="mc-brand-icon">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"/>
|
||||
<circle cx="12" cy="12" r="3"/>
|
||||
</svg>
|
||||
"📡"
|
||||
</div>
|
||||
<div class="mc-brand-text">
|
||||
<strong class="mc-brand-title">"任务指挥"</strong>
|
||||
<span class="mc-brand-sub">"MISSION CONTROL"</span>
|
||||
<strong class="mc-brand-title">"RID / 实时目标工作台"</strong>
|
||||
<span class="mc-brand-sub">"REMOTE ID SURVEILLANCE & REGULATORY FORENSICS"</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav class="mc-nav-tabs" aria-label="工作台模式">
|
||||
<button class=move||if layout_mode.get()=="a"{"mc-nav-tab active"}else{"mc-nav-tab"} on:click=move |_|layout_mode.set("a".into())>
|
||||
"飞行监控"
|
||||
"🛰️ 地图监控"
|
||||
</button>
|
||||
<button class=move||if layout_mode.get()=="b"{"mc-nav-tab active"}else{"mc-nav-tab"} on:click=move |_|layout_mode.set("b".into())>
|
||||
"调度指挥"
|
||||
"📋 调度指挥"
|
||||
</button>
|
||||
<button class=move||if layout_mode.get()=="c"{"mc-nav-tab active"}else{"mc-nav-tab"} on:click=move |_|layout_mode.set("c".into())>
|
||||
"目标研判"
|
||||
"🔍 目标研判"
|
||||
</button>
|
||||
<a class="mc-nav-tab mc-nav-link" href="/">
|
||||
"设备登记"
|
||||
"📋 设备登记"
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
<div class="mc-top-status-capsule">
|
||||
<div class="mc-capsule-item">
|
||||
<span class="mc-capsule-icon">"🛸"</span>
|
||||
<span>{move||format!("当前控制: {}", if selected.get().is_empty(){"01号机".into()}else{selected.get()})}</span>
|
||||
</div>
|
||||
<div class="mc-capsule-divider"></div>
|
||||
<div class="mc-capsule-item">
|
||||
<span class="mc-pulse-dot green"></span>
|
||||
<span>"已连接"</span>
|
||||
<span>{move||format!("接收机: {}", input_mode.get())}</span>
|
||||
</div>
|
||||
<div class="mc-capsule-divider"></div>
|
||||
<div class="mc-capsule-item">
|
||||
<span>"🎮 手动模式"</span>
|
||||
<span>"空域侦测: "</span>
|
||||
<strong style="color:#38bdf8;">{move||format!("{} 架", count.get())}</strong>
|
||||
</div>
|
||||
<div class="mc-capsule-divider"></div>
|
||||
<div class="mc-capsule-item">
|
||||
<span>"📶 GNSS 18"</span>
|
||||
</div>
|
||||
<div class="mc-capsule-divider"></div>
|
||||
<div class="mc-capsule-item">
|
||||
<span class="mc-battery-tag">"🔋 电量 86%"</span>
|
||||
<span>"待核验/未备案: "</span>
|
||||
<strong style="color:#ff9f0a;">{move||unmatched_count.get()}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
@@ -296,17 +354,26 @@ pub fn Realtime() -> impl IntoView {
|
||||
{move||match layout_mode.get().as_str() {
|
||||
"a" => view! {
|
||||
<div class="mc-layout-a">
|
||||
<!-- Left Floating Drawer: 机队概览 -->
|
||||
<aside class="mc-floating-panel mc-drawer-left">
|
||||
<div class="mc-panel-header">
|
||||
<h3>{move||format!("机队概览 · {}架在线", matches.get().len())}</h3>
|
||||
<span class="mc-panel-header-icon">"⌃"</span>
|
||||
<h3>{move||format!("监控范围 · 目标列表 ({} 在线)", raw_list.get().len())}</h3>
|
||||
<span class="mc-tag tag-blue">{move||format!("{} 目标", raw_list.get().len())}</span>
|
||||
</div>
|
||||
|
||||
<crate::receiver_ui::ReceiverControls/>
|
||||
<div class="mc-filter-row">
|
||||
<button class=move||if filter_tab.get()=="all"{"mc-filter-chip active"}else{"mc-filter-chip"} on:click=move|_|filter_tab.set("all".into())>
|
||||
{move||format!("全部 ({})", raw_list.get().len())}
|
||||
</button>
|
||||
<button class=move||if filter_tab.get()=="registered"{"mc-filter-chip active"}else{"mc-filter-chip"} on:click=move|_|filter_tab.set("registered".into())>
|
||||
{move||format!("已备案 ({})", registered_count.get())}
|
||||
</button>
|
||||
<button class=move||if filter_tab.get()=="unmatched"{"mc-filter-chip active"}else{"mc-filter-chip"} on:click=move|_|filter_tab.set("unmatched".into())>
|
||||
{move||format!("未匹配 ({})", unmatched_count.get())}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="mc-search-box">
|
||||
<input class="mc-input" aria-label="搜索实时目标" placeholder="🔍 按目标编号筛选…" on:input=move|e|{directory_page.set(0);query.set(event_target_value(&e));}/>
|
||||
<input class="mc-input" aria-label="搜索实时目标" placeholder="🔍 按 RID / SN 筛选…" on:input=move|e|{directory_page.set(0);query.set(event_target_value(&e));}/>
|
||||
</div>
|
||||
|
||||
<nav class="mc-pagination" aria-label="目标目录分页">
|
||||
@@ -317,23 +384,31 @@ pub fn Realtime() -> impl IntoView {
|
||||
|
||||
<div class="mc-target-list">
|
||||
{move||matches.get().into_iter().skip(visible_page.get()*100).take(100).map(|id|{
|
||||
let label = id.clone();
|
||||
let is_unm = is_unmatched(&id);
|
||||
let sn = target_sn(&id);
|
||||
let owner = target_owner(&id);
|
||||
let picked1 = id.clone();
|
||||
let picked2 = id.clone();
|
||||
let picked3 = id.clone();
|
||||
let target_id2 = id.clone();
|
||||
let label = id.clone();
|
||||
view!{
|
||||
<div class=move||if selected.get() == picked1 {"mc-vehicle-card active"}else{"mc-vehicle-card"} on:click=move |_|choose(id.clone())>
|
||||
<div class=move||if selected.get() == picked1 {"mc-vehicle-card active"}else{"mc-vehicle-card"} on:click=move |_|choose(picked2.clone())>
|
||||
<div class="mc-vc-row1">
|
||||
<span class="mc-vc-icon">"🛸"</span>
|
||||
<span class="mc-vc-icon">"📡"</span>
|
||||
<strong class="mc-vc-name">{label}</strong>
|
||||
<span class=move||if selected.get() == picked2 {"mc-vc-badge active"}else{"mc-vc-badge"}>
|
||||
{move||if selected.get() == picked3 {"当前控制"}else{"就绪"}}
|
||||
</span>
|
||||
{if is_unm {
|
||||
view! { <span class="mc-tag tag-amber">"待核对 (未备案)"</span> }.into_any()
|
||||
} else {
|
||||
view! { <span class="mc-tag tag-green">"已匹配 (已备案)"</span> }.into_any()
|
||||
}}
|
||||
</div>
|
||||
<div class="mc-vc-row2">
|
||||
<span class="mc-vc-bat">"🔋 86%"</span>
|
||||
<span class="mc-vc-status">"● 就绪"</span>
|
||||
<span style="color:#94a3b8;font-size:11px;">{format!("SN: {} · {}", sn, owner)}</span>
|
||||
</div>
|
||||
<div class="mc-vc-row2" style="margin-top:2px;">
|
||||
<span style=if is_unm{"color:#fbbf24;font-size:11px;"}else{"color:#4ade80;font-size:11px;"}>
|
||||
{if is_unm {"⚠️ 需核验档案"} else {"● 正常跟踪"}}
|
||||
</span>
|
||||
<button class="mc-vc-btn-locate" title="在地图上居中" on:click=move|e|{
|
||||
e.stop_propagation();
|
||||
choose(target_id2.clone());
|
||||
@@ -345,41 +420,36 @@ pub fn Realtime() -> impl IntoView {
|
||||
}).collect_view()}
|
||||
</div>
|
||||
|
||||
<!-- Bottom Multi-vehicle operations -->
|
||||
<div class="mc-fleet-actions">
|
||||
<div class="mc-fleet-title">"多机协同 · 快速操作"</div>
|
||||
<div class="mc-fleet-grid">
|
||||
<button class="mc-fleet-btn">"🔒 解锁"</button>
|
||||
<button class="mc-fleet-btn">"🔓 上锁"</button>
|
||||
<button class="mc-fleet-btn primary">"▶ 开始任务"</button>
|
||||
<button class="mc-fleet-btn">"⏸ 暂停"</button>
|
||||
</div>
|
||||
<crate::receiver_ui::ReceiverControls/>
|
||||
|
||||
<div class="mc-footer-info">
|
||||
<div>"接收机协议: USB 串口 (RAW / JSON / Postcard)"</div>
|
||||
<div>"空域更新频率: 20ms / 广播帧"</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- Center Map Area -->
|
||||
<section class="mc-map-area">
|
||||
<div id="rt-map" class="rt-map-canvas"></div>
|
||||
|
||||
<!-- Floating Top Warning Banner -->
|
||||
<div class="mc-map-alert-banner">
|
||||
<span class="mc-alert-icon">"⚠️"</span>
|
||||
<span class="mc-alert-msg">{move||format!("{}: 目标信号正常保持中 · 遥控器在线", if selected.get().is_empty(){"01号机".into()}else{selected.get()})}</span>
|
||||
<a class="mc-alert-action" href="#c">"查看详情 ›"</a>
|
||||
</div>
|
||||
{move||if unmatched_count.get() > 0 {
|
||||
view! {
|
||||
<div class="mc-map-alert-banner">
|
||||
<span class="mc-alert-icon">"⚠️"</span>
|
||||
<span class="mc-alert-msg">"DEMO-002: 捕获到未登记 RID 广播信号 · 建议核查本地备案库"</span>
|
||||
<a class="mc-alert-action" href="#c" on:click=move|_|layout_mode.set("c".into())>"调取档案研判 ›"</a>
|
||||
</div>
|
||||
}.into_any()
|
||||
} else {
|
||||
().into_any()
|
||||
}}
|
||||
|
||||
<!-- Floating Map Toolstrip on left of map -->
|
||||
<div class="mc-map-toolstrip">
|
||||
<button class="mc-toolstrip-btn active" title="底图切换" on:click=move|_|{let _=map_call("refresh", &args(&[]));}>
|
||||
<span class="mc-ts-icon">"🗺️"</span>
|
||||
<span class="mc-ts-label">"地图"</span>
|
||||
</button>
|
||||
<button class="mc-toolstrip-btn" title="态势图层">
|
||||
<span class="mc-ts-icon">"📑"</span>
|
||||
<span class="mc-ts-label">"图层"</span>
|
||||
</button>
|
||||
<button class="mc-toolstrip-btn" title="视口居中选中目标" on:click=center_target>
|
||||
<span class="mc-ts-icon">"📍"</span>
|
||||
<span class="mc-ts-icon">"🎯"</span>
|
||||
<span class="mc-ts-label">"定位"</span>
|
||||
</button>
|
||||
<button class="mc-toolstrip-btn" title="2D/3D 俯仰视角切换" on:click=toggle_3d>
|
||||
@@ -388,187 +458,75 @@ pub fn Realtime() -> impl IntoView {
|
||||
</button>
|
||||
<button class="mc-toolstrip-btn" title="复位正北" on:click=reset_north>
|
||||
<span class="mc-ts-icon">"🧭"</span>
|
||||
<span class="mc-ts-label">"测量"</span>
|
||||
<span class="mc-ts-label">"正北"</span>
|
||||
</button>
|
||||
<div class="mc-toolstrip-divider"></div>
|
||||
<button class="mc-toolstrip-btn zoom" title="放大" on:click=zoom_in>"+"</button>
|
||||
<button class="mc-toolstrip-btn zoom" title="缩小" on:click=zoom_out>"-"</button>
|
||||
</div>
|
||||
|
||||
<!-- Floating Bottom Telemetry Ribbon -->
|
||||
<div class="mc-telemetry-ribbon">
|
||||
<div class="mc-ribbon-item brand">
|
||||
<span class="mc-ribbon-drone">"🛸"</span>
|
||||
<strong>{move||if selected.get().is_empty(){"01号机".into()}else{selected.get()}}</strong>
|
||||
</div>
|
||||
<div class="mc-ribbon-divider"></div>
|
||||
<div class="mc-ribbon-item">
|
||||
<span class="mc-ribbon-label">"相对高度"</span>
|
||||
<strong class="mc-ribbon-val">{move||format!("{:.1} m", selected_alt.get())}</strong>
|
||||
</div>
|
||||
<div class="mc-ribbon-divider"></div>
|
||||
<div class="mc-ribbon-item">
|
||||
<span class="mc-ribbon-label">"地速"</span>
|
||||
<strong class="mc-ribbon-val">"12.4 m/s"</strong>
|
||||
</div>
|
||||
<div class="mc-ribbon-divider"></div>
|
||||
<div class="mc-ribbon-item">
|
||||
<span class="mc-ribbon-label">"空速"</span>
|
||||
<strong class="mc-ribbon-val">"12.0 m/s"</strong>
|
||||
</div>
|
||||
<div class="mc-ribbon-divider"></div>
|
||||
<div class="mc-ribbon-item">
|
||||
<span class="mc-ribbon-label">"航向"</span>
|
||||
<strong class="mc-ribbon-val">{move||format!("{:03.0}°", selected_heading.get())}</strong>
|
||||
</div>
|
||||
<div class="mc-ribbon-divider"></div>
|
||||
<div class="mc-ribbon-item">
|
||||
<span class="mc-ribbon-label">"飞行时间"</span>
|
||||
<strong class="mc-ribbon-val">"00:14:32"</strong>
|
||||
</div>
|
||||
<div class="mc-ribbon-divider"></div>
|
||||
<button class="mc-ribbon-btn" on:click=reset_north>"⚙️ 仪表设置"</button>
|
||||
</div>
|
||||
|
||||
<div class="mc-map-infobar">{move || map_status.get()}</div>
|
||||
</section>
|
||||
|
||||
<!-- Right Floating Panel: 单机工作台 -->
|
||||
<aside class="mc-floating-panel mc-hud-right">
|
||||
<div class="mc-panel-header">
|
||||
<h3>{move||format!("单机工作台 · {}", if selected.get().is_empty(){"01号机".into()}else{selected.get()})}</h3>
|
||||
<span class="mc-panel-header-icon">"⌃"</span>
|
||||
<h3>{move||format!("选中目标 / {}", if selected.get().is_empty(){"DEMO-001".into()}else{selected.get()})}</h3>
|
||||
{move||{
|
||||
let sel = selected.get();
|
||||
if is_unmatched(&sel) {
|
||||
view! { <span class="mc-tag tag-amber">"黑飞未备案"</span> }.into_any()
|
||||
} else {
|
||||
view! { <span class="mc-tag tag-green">"已备案登记"</span> }.into_any()
|
||||
}
|
||||
}}
|
||||
</div>
|
||||
|
||||
<!-- Checklist items -->
|
||||
<div class="mc-checklist">
|
||||
<div class="mc-check-row">
|
||||
<span class="mc-check-icon">"📋"</span>
|
||||
<span class="mc-check-name">"飞前检查"</span>
|
||||
<span class="mc-check-badge ok">"已通过 ›"</span>
|
||||
</div>
|
||||
<div class="mc-check-row">
|
||||
<span class="mc-check-icon">"🎮"</span>
|
||||
<span class="mc-check-name">"遥控器"</span>
|
||||
<span class="mc-check-status ok">"● 等待连接 ›"</span>
|
||||
</div>
|
||||
<div class="mc-check-row">
|
||||
<span class="mc-check-icon">"🛰️"</span>
|
||||
<span class="mc-check-name">"GNSS"</span>
|
||||
<span class="mc-check-status ok">"● 正常 (18) ›"</span>
|
||||
</div>
|
||||
<div class="mc-check-row">
|
||||
<span class="mc-check-icon">"🔋"</span>
|
||||
<span class="mc-check-name">"电池电量"</span>
|
||||
<span class="mc-check-status ok">"● 86% ›"</span>
|
||||
</div>
|
||||
<div class="mc-check-row">
|
||||
<span class="mc-check-icon">"🛡️"</span>
|
||||
<span class="mc-check-name">"机身状态"</span>
|
||||
<span class="mc-check-status ok">"● 正常 ›"</span>
|
||||
<div class="mc-dossier-card">
|
||||
<div class="mc-dossier-label">"身份与备案"</div>
|
||||
<div class="mc-dossier-val">
|
||||
{move||{
|
||||
let sel = selected.get();
|
||||
let is_unm = is_unmatched(&sel);
|
||||
let sn = target_sn(&sel);
|
||||
let model = target_model(&sel);
|
||||
let owner = target_owner(&sel);
|
||||
if is_unm {
|
||||
format!("匹配状态: 未匹配 (黑飞预警)\n登记 SN: {}\n登记机型: {}\n登记所有人: {}", sn, model, owner)
|
||||
} else {
|
||||
format!("匹配状态: 已匹配 (本地备案库)\n登记 SN: {}\n登记机型: {}\n登记所有人: {}", sn, model, owner)
|
||||
}
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flight operations buttons -->
|
||||
<div class="mc-flight-ops">
|
||||
<div class="mc-ops-title">"飞行操作"</div>
|
||||
<div class="mc-ops-grid">
|
||||
<button class="mc-ops-btn primary">"起飞"</button>
|
||||
<button class="mc-ops-btn">"暂停"</button>
|
||||
<button class="mc-ops-btn">"返航"</button>
|
||||
<button class="mc-ops-btn">"降落"</button>
|
||||
<div class="mc-dossier-card">
|
||||
<div class="mc-dossier-label">"最新空间遥测 (WGS84 椭球高)"</div>
|
||||
<div class="mc-dossier-val">
|
||||
{move||format!(
|
||||
"经度: {:.6} · 纬度: {:.6}\n相对高度: {:.1} m (椭球高 {:.1} m)\n地速: 14.2 m/s · 航向角: {:03.0}°",
|
||||
selected_lon.get(),
|
||||
selected_lat.get(),
|
||||
selected_alt.get(),
|
||||
selected_alt.get() + 13.4,
|
||||
selected_heading.get()
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Dual Instruments: Attitude Indicator & Heading Compass -->
|
||||
<div class="mc-dual-instruments">
|
||||
<!-- Instrument 1: Artificial Horizon -->
|
||||
<div class="mc-inst-box">
|
||||
<svg class="mc-horizon-svg" viewBox="0 0 100 100">
|
||||
<defs>
|
||||
<clipPath id="horizon-clip">
|
||||
<circle cx="50" cy="50" r="44"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g clip-path="url(#horizon-clip)">
|
||||
<!-- Sky -->
|
||||
<rect x="0" y="0" width="100" height="50" fill="#0284c7"/>
|
||||
<!-- Earth -->
|
||||
<rect x="0" y="50" width="100" height="50" fill="#854d0e"/>
|
||||
<!-- Horizon Line -->
|
||||
<line x1="0" y1="50" x2="100" y2="50" stroke="#ffffff" stroke-width="1.5"/>
|
||||
<!-- Pitch Ladder -->
|
||||
<line x1="38" y1="36" x2="62" y2="36" stroke="#ffffff" stroke-width="1"/>
|
||||
<text x="32" y="38" fill="#ffffff" font-size="6">"10"</text>
|
||||
<text x="64" y="38" fill="#ffffff" font-size="6">"10"</text>
|
||||
<line x1="38" y1="64" x2="62" y2="64" stroke="#ffffff" stroke-width="1"/>
|
||||
<text x="30" y="66" fill="#ffffff" font-size="6">"-10"</text>
|
||||
<text x="64" y="66" fill="#ffffff" font-size="6">"-10"</text>
|
||||
</g>
|
||||
<!-- Aircraft Reticle Wings -->
|
||||
<line x1="26" y1="50" x2="42" y2="50" stroke="#facc15" stroke-width="2.5"/>
|
||||
<circle cx="50" cy="50" r="2.5" fill="#facc15"/>
|
||||
<line x1="58" y1="50" x2="74" y2="50" stroke="#facc15" stroke-width="2.5"/>
|
||||
<!-- Instrument Bezel Ring -->
|
||||
<circle cx="50" cy="50" r="46" stroke="rgba(255,255,255,0.2)" stroke-width="2" fill="none"/>
|
||||
</svg>
|
||||
<div class="mc-inst-label">"俯仰 0.0° · 横滚 0.0°"</div>
|
||||
</div>
|
||||
|
||||
<!-- Instrument 2: Heading Compass Dial -->
|
||||
<div class="mc-inst-box">
|
||||
<svg class="mc-compass-svg" viewBox="0 0 100 100">
|
||||
<circle cx="50" cy="50" r="46" stroke="rgba(48,100,180,0.4)" stroke-width="2" fill="rgba(6,12,24,0.85)"/>
|
||||
<circle cx="50" cy="50" r="38" stroke="rgba(255,255,255,0.1)" stroke-width="1" fill="none"/>
|
||||
<line x1="50" y1="8" x2="50" y2="15" stroke="#38bdf8" stroke-width="2"/>
|
||||
<line x1="50" y1="92" x2="50" y2="85" stroke="rgba(255,255,255,0.3)" stroke-width="1"/>
|
||||
<line x1="8" y1="50" x2="15" y2="50" stroke="rgba(255,255,255,0.3)" stroke-width="1"/>
|
||||
<line x1="92" y1="50" x2="85" y2="50" stroke="rgba(255,255,255,0.3)" stroke-width="1"/>
|
||||
<text x="50" y="24" fill="#38bdf8" font-size="8" font-weight="bold" text-anchor="middle">"N"</text>
|
||||
<text x="82" y="53" fill="rgba(255,255,255,0.6)" font-size="7" text-anchor="middle">"E"</text>
|
||||
<text x="50" y="80" fill="rgba(255,255,255,0.6)" font-size="7" text-anchor="middle">"S"</text>
|
||||
<text x="18" y="53" fill="rgba(255,255,255,0.6)" font-size="7" text-anchor="middle">"W"</text>
|
||||
<g transform=move||format!("rotate({}, 50, 50)", selected_heading.get())>
|
||||
<polygon points="50,16 46,50 54,50" fill="#ef4444"/>
|
||||
<polygon points="50,84 46,50 54,50" fill="rgba(255,255,255,0.25)"/>
|
||||
<circle cx="50" cy="50" r="4" fill="#0b172a" stroke="#38bdf8" stroke-width="1.5"/>
|
||||
</g>
|
||||
</svg>
|
||||
<div class="mc-inst-label">{move||format!("航向 {:03.0}°", selected_heading.get())}</div>
|
||||
<div class="mc-dossier-card">
|
||||
<div class="mc-dossier-label">"质量与事件"</div>
|
||||
<div class="mc-dossier-val">
|
||||
{move||format!(
|
||||
"报文采样延迟: {} ms\n接收物理通道: USB 串口 (COM3)\n空域防区告警: {}",
|
||||
age.get(),
|
||||
if is_unmatched(&selected.get()) { "⚠️ 发现未备案目标侵入" } else { "无违规侵入 (绿码正常)" }
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Target Coordinates Box -->
|
||||
<div class="mc-hud-grid">
|
||||
<div class="mc-metric-box">
|
||||
<span class="mc-metric-label">"相对高度"</span>
|
||||
<strong class="mc-metric-val">{move||format!("{:.1}m", selected_alt.get())}</strong>
|
||||
</div>
|
||||
<div class="mc-metric-box">
|
||||
<span class="mc-metric-label">"航向角"</span>
|
||||
<strong class="mc-metric-val">{move||format!("{:.1}°", selected_heading.get())}</strong>
|
||||
</div>
|
||||
<div class="mc-metric-box">
|
||||
<span class="mc-metric-label">"经度"</span>
|
||||
<strong class="mc-metric-val sm">{move||format!("{:.5}", selected_lon.get())}</strong>
|
||||
</div>
|
||||
<div class="mc-metric-box">
|
||||
<span class="mc-metric-label">"纬度"</span>
|
||||
<strong class="mc-metric-val sm">{move||format!("{:.5}", selected_lat.get())}</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mc-details-card">
|
||||
<p class="mc-details-text">{move||details.get()}</p>
|
||||
<div class="mc-age-tag">
|
||||
<span>"数据年龄:"</span>
|
||||
<strong>{move||format!("{} ms", age.get())}</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mc-quick-actions">
|
||||
<button class="mc-btn mc-btn-primary" on:click=center_target>"🎯 视口居中"</button>
|
||||
<a class="mc-btn mc-btn-secondary" href=move||format!("/?q={}", selected.get())>"📋 备案查询"</a>
|
||||
<div class="mc-btn-row" style="margin-top:auto;">
|
||||
<button class="mc-btn mc-btn-primary" on:click=center_target>"🎯 视口居中追踪"</button>
|
||||
<a class="mc-btn mc-btn-secondary" href=move||format!("/?q={}", selected.get())>"📋 本地登记核验"</a>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
@@ -587,20 +545,36 @@ pub fn Realtime() -> impl IntoView {
|
||||
<button class="mc-toolstrip-btn zoom" title="缩小" on:click=zoom_out>"-"</button>
|
||||
</div>
|
||||
<div class="mc-map-infobar">{move || map_status.get()}</div>
|
||||
|
||||
<aside class="mc-floating-panel" style="right:16px; top:16px; bottom:16px; width:340px; padding:16px; gap:10px;">
|
||||
<div class="mc-panel-header">
|
||||
<h3>{move||format!("调度标的 / {}", if selected.get().is_empty(){"DEMO-001".into()}else{selected.get()})}</h3>
|
||||
<span class="mc-tag tag-blue">"实时追踪"</span>
|
||||
</div>
|
||||
<div class="mc-dossier-card">
|
||||
<div class="mc-dossier-label">"备案比对"</div>
|
||||
<div class="mc-dossier-val">{move||format!("已匹配本地登记档案 ({})", target_owner(&selected.get()))}</div>
|
||||
</div>
|
||||
<div class="mc-dossier-card">
|
||||
<div class="mc-dossier-label">"实时航姿"</div>
|
||||
<div class="mc-dossier-val">{move||format!("高度 {:.1}m · 航向 {:03.0}° · 地速 14.2m/s", selected_alt.get(), selected_heading.get())}</div>
|
||||
</div>
|
||||
<div class="mc-btn-row" style="margin-top:auto;">
|
||||
<button class="mc-btn mc-btn-primary" on:click=center_target>"🎯 锁定追踪"</button>
|
||||
<a class="mc-btn mc-btn-secondary" href=move||format!("/?q={}", selected.get())>"⚠️ 发起协查"</a>
|
||||
</div>
|
||||
</aside>
|
||||
</section>
|
||||
|
||||
<section class="mc-hud-dock">
|
||||
<div class="mc-dock-header">
|
||||
<div class="mc-dock-tabs">
|
||||
<button class=move||if hud_tab.get()=="targets"{"mc-dock-tab active"}else{"mc-dock-tab"} on:click=move|_|hud_tab.set("targets".into())>
|
||||
{move||format!("无人机态势列表 ({})", matches.get().len())}
|
||||
{move||format!("事件时间轴 · 实时调度响应 ({})", matches.get().len())}
|
||||
</button>
|
||||
<button class=move||if hud_tab.get()=="receiver"{"mc-dock-tab active"}else{"mc-dock-tab"} on:click=move|_|hud_tab.set("receiver".into())>
|
||||
"接收机与解码"
|
||||
</button>
|
||||
<button class=move||if hud_tab.get()=="events"{"mc-dock-tab active"}else{"mc-dock-tab"} on:click=move|_|hud_tab.set("events".into())>
|
||||
"事件与日志"
|
||||
</button>
|
||||
</div>
|
||||
<div class="mc-dock-substatus">
|
||||
<span>{move||input_mode.get()}</span>
|
||||
@@ -615,109 +589,22 @@ pub fn Realtime() -> impl IntoView {
|
||||
</div>
|
||||
}.into_any(),
|
||||
|
||||
"events" => view! {
|
||||
_ => view! {
|
||||
<div class="mc-events-stream">
|
||||
<div class="mc-event-item">
|
||||
<span class="mc-event-time">"实时通道"</span>
|
||||
<span class="mc-event-badge ok">"CONNECTED"</span>
|
||||
<span class="mc-event-desc">{move||status.get()}</span>
|
||||
<span class="mc-event-time">"15:42:01"</span>
|
||||
<span class="mc-event-badge info">"捕获帧"</span>
|
||||
<span class="mc-event-desc">"串口捕获新 RID 广播帧:标的 <strong>DEMO-001</strong> (SN: ZEX0RID1202605011000)"</span>
|
||||
</div>
|
||||
<div class="mc-event-item">
|
||||
<span class="mc-event-time">"底图引擎"</span>
|
||||
<span class="mc-event-badge info">"SATELLITE"</span>
|
||||
<span class="mc-event-desc">{move||map_status.get()}</span>
|
||||
<span class="mc-event-time">"15:42:02"</span>
|
||||
<span class="mc-event-badge ok">"匹配成功"</span>
|
||||
<span class="mc-event-desc">"本地数据库自动匹配成功:机型 5寸穿越机,登记所有人:张伟"</span>
|
||||
</div>
|
||||
<div class="mc-event-item">
|
||||
<span class="mc-event-time">"遥测刷新"</span>
|
||||
<span class="mc-event-badge info">"TELEMETRY"</span>
|
||||
<span class="mc-event-desc">{move||format!("当前在线目标 {} 架,数据延迟 {} ms", matches.get().len(), age.get())}</span>
|
||||
</div>
|
||||
</div>
|
||||
}.into_any(),
|
||||
|
||||
_ => view! {
|
||||
<div class="mc-dock-split">
|
||||
<div class="mc-dock-table-wrap">
|
||||
<div class="mc-table-controls">
|
||||
<input class="mc-input mc-table-search" placeholder="🔍 快速查找目标 SN / 编号…" on:input=move|e|{directory_page.set(0);query.set(event_target_value(&e));}/>
|
||||
<div class="mc-table-pages">
|
||||
<button class="mc-btn-sm" disabled=move||visible_page.get()==0 on:click=move |_|directory_page.set(visible_page.get().saturating_sub(1))>"◀"</button>
|
||||
<span>{move||format!("{} / {}", visible_page.get()+1, matches.get().len().div_ceil(20).max(1))}</span>
|
||||
<button class="mc-btn-sm" disabled=move||{ (visible_page.get()+1)*20 >= matches.get().len() } on:click=move |_|directory_page.set(visible_page.get()+1)>"▶"</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="mc-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>"#"</th>
|
||||
<th>"目标编号 (RID)"</th>
|
||||
<th>"状态"</th>
|
||||
<th>"遥测数据"</th>
|
||||
<th>"操作"</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{move||matches.get().into_iter().skip(visible_page.get()*20).take(20).enumerate().map(|(idx, id)|{
|
||||
let label = id.clone();
|
||||
let is_active = selected.get() == id;
|
||||
let tid = id.clone();
|
||||
view!{
|
||||
<tr class=if is_active{"mc-tr active"}else{"mc-tr"} on:click=move|_|choose(tid.clone())>
|
||||
<td>{visible_page.get()*20 + idx + 1}</td>
|
||||
<td><strong class="mc-id-code">{label}</strong></td>
|
||||
<td><span class="mc-pill-ok">"● 在线"</span></td>
|
||||
<td>
|
||||
{if is_active && has_target_coords.get(){
|
||||
format!("{:.1}m · {:.1}°", selected_alt.get(), selected_heading.get())
|
||||
} else {
|
||||
"实时解码".to_string()
|
||||
}}
|
||||
</td>
|
||||
<td>
|
||||
<button class="mc-action-btn" on:click=move|e|{
|
||||
e.stop_propagation();
|
||||
choose(id.clone());
|
||||
let _ = map_call("centerSelected", &args(&[]));
|
||||
}>"聚焦"</button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}).collect_view()}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mc-dock-instrument-pane">
|
||||
<div class="mc-quad-header">
|
||||
<span class="mc-quad-name">{move||if selected.get().is_empty(){"01号机 (DEMO)".to_owned()}else{selected.get()}}</span>
|
||||
<span class="mc-quad-state">"● 实时报文"</span>
|
||||
</div>
|
||||
|
||||
<div class="mc-quad-layout">
|
||||
<div class="mc-quad-schematic">
|
||||
<svg viewBox="0 0 80 80" class="mc-quad-svg">
|
||||
<line x1="22" y1="22" x2="58" y2="58" stroke="#38bdf8" stroke-width="3"/>
|
||||
<line x1="22" y1="58" x2="58" y2="22" stroke="#38bdf8" stroke-width="3"/>
|
||||
<circle cx="40" cy="40" r="12" fill="#0b172a" stroke="#38bdf8" stroke-width="2"/>
|
||||
<circle cx="22" cy="22" r="9" fill="none" stroke="rgba(56,189,248,0.7)" stroke-width="2"/>
|
||||
<circle cx="58" cy="22" r="9" fill="none" stroke="rgba(56,189,248,0.7)" stroke-width="2"/>
|
||||
<circle cx="22" cy="58" r="9" fill="none" stroke="rgba(56,189,248,0.7)" stroke-width="2"/>
|
||||
<circle cx="58" cy="58" r="9" fill="none" stroke="rgba(56,189,248,0.7)" stroke-width="2"/>
|
||||
<polygon points="40,32 36,44 44,44" fill="#38bdf8" transform=move||format!("rotate({}, 40, 40)", selected_heading.get())/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="mc-quad-metrics">
|
||||
<div class="mc-quad-metric-row"><span>"椭球高"</span><strong>{move||if has_target_coords.get(){format!("{:.1} m", selected_alt.get())}else{"--".into()}}</strong></div>
|
||||
<div class="mc-quad-metric-row"><span>"航向"</span><strong>{move||if has_target_coords.get(){format!("{:.1}°", selected_heading.get())}else{"--".into()}}</strong></div>
|
||||
<div class="mc-quad-metric-row"><span>"采样年龄"</span><strong>{move||format!("{} ms", age.get())}</strong></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mc-quad-actions">
|
||||
<button class="mc-btn mc-btn-primary mc-btn-sm" on:click=center_target>"🎯 居中"</button>
|
||||
<a class="mc-btn mc-btn-secondary mc-btn-sm" href=move||format!("/?q={}", selected.get())>"📋 档案"</a>
|
||||
</div>
|
||||
<span class="mc-event-time">"15:42:15"</span>
|
||||
<span class="mc-event-badge tag-amber">"异常预警"</span>
|
||||
<span class="mc-event-desc">"捕获未备案目标 <strong>DEMO-002</strong>,未在本地档案中找到匹配记录"</span>
|
||||
</div>
|
||||
</div>
|
||||
}.into_any()
|
||||
@@ -732,9 +619,8 @@ pub fn Realtime() -> impl IntoView {
|
||||
<aside class="mc-column-left">
|
||||
<div class="mc-panel-header">
|
||||
<h3>"目标目录与研判"</h3>
|
||||
<span class="mc-tag">{move||format!("{} 目标", matches.get().len())}</span>
|
||||
<span class="mc-tag tag-blue">{move||format!("{} 目标", matches.get().len())}</span>
|
||||
</div>
|
||||
<crate::receiver_ui::ReceiverControls/>
|
||||
<div class="mc-search-box">
|
||||
<input class="mc-input" aria-label="搜索实时目标" placeholder="🔍 检索 RID / SN…" on:input=move|e|{directory_page.set(0);query.set(event_target_value(&e));}/>
|
||||
</div>
|
||||
@@ -747,14 +633,21 @@ pub fn Realtime() -> impl IntoView {
|
||||
{move||matches.get().into_iter().skip(visible_page.get()*100).take(100).map(|id|{
|
||||
let label = id.clone();
|
||||
let picked = id.clone();
|
||||
let is_unm = is_unmatched(&id);
|
||||
view!{
|
||||
<button class="mc-target-item" aria-pressed=move||(selected.get()==picked).to_string() on:click=move |_|choose(id.clone())>
|
||||
<span class="mc-target-dot"></span>
|
||||
<span class=if is_unm{"mc-target-dot amber"}else{"mc-target-dot"}></span>
|
||||
<span class="mc-target-name">{label}</span>
|
||||
{if is_unm {
|
||||
view!{ <span class="mc-tag tag-amber" style="margin-left:auto;">"未备案"</span> }.into_any()
|
||||
} else {
|
||||
view!{ <span class="mc-tag tag-green" style="margin-left:auto;">"已匹配"</span> }.into_any()
|
||||
}}
|
||||
</button>
|
||||
}
|
||||
}).collect_view()}
|
||||
</div>
|
||||
<crate::receiver_ui::ReceiverControls/>
|
||||
</aside>
|
||||
|
||||
<section class="mc-map-area-c">
|
||||
@@ -764,6 +657,7 @@ pub fn Realtime() -> impl IntoView {
|
||||
<button class="mc-toolstrip-btn" title="聚焦选定目标" on:click=center_target><span class="mc-ts-icon">"🎯"</span></button>
|
||||
<button class="mc-toolstrip-btn" title="2D/3D" on:click=toggle_3d><span class="mc-ts-icon">"🌐"</span></button>
|
||||
<button class="mc-toolstrip-btn" title="复位正北" on:click=reset_north><span class="mc-ts-icon">"🧭"</span></button>
|
||||
<div class="mc-toolstrip-divider"></div>
|
||||
<button class="mc-toolstrip-btn zoom" title="放大" on:click=zoom_in>"+"</button>
|
||||
<button class="mc-toolstrip-btn zoom" title="缩小" on:click=zoom_out>"-"</button>
|
||||
</div>
|
||||
@@ -772,26 +666,48 @@ pub fn Realtime() -> impl IntoView {
|
||||
|
||||
<section class="mc-dossier-panel">
|
||||
<div class="mc-panel-header">
|
||||
<h3>{move||if selected.get().is_empty(){"目标研判档案卡".to_owned()}else{format!("研判标的:{}", selected.get())}}</h3>
|
||||
<div class="mc-header-actions">
|
||||
<button class="mc-btn mc-btn-primary mc-btn-sm" on:click=center_target>"🎯 视口居中"</button>
|
||||
<a class="mc-btn mc-btn-secondary mc-btn-sm" href=move||format!("/?q={}", selected.get())>"📋 核对登记"</a>
|
||||
</div>
|
||||
<h3>{move||if selected.get().is_empty(){"研判档案卡 · DEMO-001".to_owned()}else{format!("研判档案卡 · {}", selected.get())}}</h3>
|
||||
{move||if is_unmatched(&selected.get()){
|
||||
view!{ <span class="mc-tag tag-amber">"黑飞待核"</span> }.into_any()
|
||||
} else {
|
||||
view!{ <span class="mc-tag tag-green">"合规标的"</span> }.into_any()
|
||||
}}
|
||||
</div>
|
||||
<div class="mc-dossier-grid">
|
||||
<div class="mc-dossier-card">
|
||||
<span class="mc-dossier-label">"空间几何坐标"</span>
|
||||
<p class="mc-dossier-val">{move||details.get()}</p>
|
||||
<span class="mc-dossier-label">"空间几何坐标 (WGS84)"</span>
|
||||
<p class="mc-dossier-val">
|
||||
{move||format!(
|
||||
"经纬度:{:.6} · {:.6}\n相对高度:{:.1} m (离地估算)\n椭球高:{:.1} m · 航向:{:03.0}°",
|
||||
selected_lon.get(),
|
||||
selected_lat.get(),
|
||||
selected_alt.get(),
|
||||
selected_alt.get() + 13.4,
|
||||
selected_heading.get()
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<div class="mc-dossier-card">
|
||||
<span class="mc-dossier-label">"报文时效与链路"</span>
|
||||
<p class="mc-dossier-val">{move||format!("数据延迟:{} ms\n输入模式:{}\n服务状态:{}", age.get(), input_mode.get(), status.get())}</p>
|
||||
<span class="mc-dossier-label">"报文时效与物理链路"</span>
|
||||
<p class="mc-dossier-val">
|
||||
{move||format!("数据延迟:{} ms\n输入通道:USB 串口接收解码\n接收信号强度 (RSSI):-68 dBm", age.get())}
|
||||
</p>
|
||||
</div>
|
||||
<div class="mc-dossier-card">
|
||||
<span class="mc-dossier-label">"研判核验结论"</span>
|
||||
<p class="mc-dossier-val">{move||if selected.get().is_empty(){"请从左侧选择目标进行比对".to_owned()}else{"已捕获 RID 广播帧,可一键跳转本地数据库核验 SN 匹配记录。".to_owned()}}</p>
|
||||
<p class="mc-dossier-val" style=move||if is_unmatched(&selected.get()){"color:#fbbf24;"}else{"color:#4ade80;"}>
|
||||
{move||if is_unmatched(&selected.get()) {
|
||||
"⚠️ 捕获到未登记 RID 广播帧\n⚠️ 模块 SN 未在本地数据库找到匹配记录\n⚠️ 建议立即调取取证报告并协查"
|
||||
} else {
|
||||
"✓ 捕获到合规国标 RID 广播数据\n✓ 模块 SN 与本地数据库登记记录完全匹配\n✓ 飞手资质与无人机备案照片齐全"
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mc-btn-row" style="margin-top:auto;">
|
||||
<button class="mc-btn mc-btn-primary" on:click=center_target>"🎯 视口居中"</button>
|
||||
<a class="mc-btn mc-btn-secondary" href=move||format!("/?q={}", selected.get())>"📋 本地核验"</a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
}.into_any()
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<header class="topbar">
|
||||
<img class="brand-mark" src="/fpv-rid-icon.png" alt="FPV-RID 图标">
|
||||
<div class="brand-copy">
|
||||
<strong>任务指挥 MISSION CONTROL</strong>
|
||||
<small>FPV-RID · 本地备案与核验中心</small>
|
||||
<strong>RID / 设备备案登记中心</strong>
|
||||
<small>REMOTE ID REGISTRATION & AUDIT CENTER</small>
|
||||
</div>
|
||||
<nav class="mc-nav-tabs" style="margin-left: 20px;">
|
||||
<span class="mc-nav-pill active"><span class="mc-pill-icon">📋</span> 设备备案登记</span>
|
||||
<a class="mc-nav-pill mc-nav-link" href="/realtime"><span class="mc-pill-icon">🗺️</span> 实时态势工作台</a>
|
||||
<a class="mc-nav-pill mc-nav-link" href="/realtime"><span class="mc-pill-icon">🛰️</span> 实时目标工作台</a>
|
||||
</nav>
|
||||
<div class="top-status"><i></i> 本机沙盒运行</div>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user