feat(realtime): 新增 RID 目标与登记档案的人工关联绑定功能

- 新增 target_binding 模块,支持在目标详情面板中搜索、绑定和
  解除 RID 与本地登记档案的人工关联
- 实时目标详情中移除内联档案查询逻辑,改用 TargetBinding 组件
- 档案保存后自动将搜索框设为新记录序列号并跳回首页,避免分页
  遗漏;监听 rid-workspace-view 和 focus 事件以刷新档案列表
- 重构首页卡片预览图为 SVG 方案,增加 caption 说明文字,
  调整白色主题配色以匹配新设计
```
This commit is contained in:
2026-10-24 16:11:58 +08:00
parent 18c5178d8f
commit d4dff5c417
15 changed files with 575 additions and 86 deletions
+31 -1
View File
@@ -526,7 +526,14 @@ async fn save_inner(state: Shared, editing: bool) -> Result<()> {
false,
);
}
let page = state.borrow().page.max(1);
let page = if editing {
state.borrow().page.max(1)
} else {
// The previous archive search/page may exclude the record just saved.
input("history-query").set_value(field(&payload["record"], "serialNo"));
state.borrow_mut().selected.clear();
1
};
if let Err(error) = load(state, page).await {
message(
"history-message",
@@ -644,6 +651,29 @@ pub fn init() {
page: 1,
..State::default()
}));
for event in ["rid-workspace-view", "focus"] {
let state = state.clone();
let refresh = Closure::<dyn FnMut(Event)>::new(move |_| {
if state.borrow().busy
|| document()
.body()
.and_then(|body| body.get_attribute("data-screen"))
.as_deref()
!= Some("archives")
{
return;
}
let state = state.clone();
spawn_local(async move {
let page = state.borrow().page.max(1);
if let Err(error) = load(state, page).await {
message("history-message", &error, true);
}
});
});
let _ = window().add_event_listener_with_callback(event, refresh.as_ref().unchecked_ref());
refresh.forget();
}
{
let state = state.clone();
listen("submit", move |event| {