2026-09-14 01:07:43 +08:00
<!doctype html>
< html lang = "zh-CN" >
< head >
< meta charset = "UTF-8" >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
< title > NL2SQL · 运营工作台</ title >
< link rel = "stylesheet" href = "/static/portal/common/base.css" >
< link rel = "stylesheet" href = "/static/portal/common/operations.css" >
< link rel = "stylesheet" href = "/static/portal/employee-operations/operator-workspace.css?v=20260913" >
2026-09-14 01:42:21 +08:00
< link rel = "stylesheet" href = "/static/portal/employee-operations/nl2sql/nl2sql.css?v=20260913" >
2026-09-14 01:07:43 +08:00
</ head >
< body >
< main id = "main-content" class = "page-shell operations-shell operator-shell operator-workspace" >
< section class = "operations-hero operator-hero fade-in" >
< div class = "operations-hero__content" >< p class = "operations-kicker" > 数据运营 · 只读查询链路</ p >< h1 class = "operations-hero__title" > NL2SQL</ h1 >< p class = "operations-hero__copy" > 支持场外单据核对和通用金融自然语言查询,查询、权限、审计和最终状态均由后端 Agent 链路决定。</ p >< div class = "operations-hero__signals" >< span > 只读查询</ span >< span > 白名单表</ span >< span > 权限审计</ span ></ div ></ div >
< div class = "operations-hero__meta" >< strong data-operator-name > 运营人员</ strong >< span data-operator-scope > 权限加载中</ span ></ div >
</ section >
< article class = "panel panel--flush" >
< div class = "operator-tabs" role = "tablist" aria-label = "NL2SQL 模式" >< button class = "operator-tab" type = "button" aria-selected = "true" data-tab = "offsite" > 场外单据核对</ button >< button class = "operator-tab" type = "button" aria-selected = "false" data-tab = "general" > 通用自然语言查询</ button ></ div >
< section class = "operator-view" data-view = "offsite" >
< div class = "panel__body operator-columns" >
< section class = "operator-stack" >< div >< h2 class = "panel__title" > 场外单据核对</ h2 >< p class = "operator-inline-note" > 先生成并确认自然语言,再执行只读核对。</ p ></ div >< label class = "form-field" >< span class = "form-field__label" > 单据 task_id</ span >< input class = "form-field__input" data-offsite-task placeholder = "例如 20260910-001-A01" ></ label >< label class = "form-field" >< span class = "form-field__label" > 自然语言:</ span >< textarea class = "form-field__input form-field__input--natural-language" data-offsite-natural-language rows = "8" placeholder = "点击“生成自然语言”后显示,可人工修改" ></ textarea >< span class = "operator-inline-note" > 该内容用于人工查看和调整查询意图。</ span ></ label >< label class = "operator-checkboxes" >< input type = "checkbox" data-manual-confirmed > < span > 我已人工确认原始文件内容</ span ></ label >< div class = "operator-actions" >< button class = "button button--primary" type = "button" data-action = "generate-offsite" > 生成自然语言</ button >< button class = "button" type = "button" data-action = "run-offsite" > 执行只读核对</ button >< a class = "button button--back" data-offsite-back href = "/portal/employee-operations/offsite/" > 返回</ a ></ div ></ section >
< section >< div class = "operator-section-heading" >< div >< h2 class = "panel__title" > 核对结果</ h2 >< p class = "operator-inline-note" > 查询结果写回场外单据链路后,返回规则摘要。</ p ></ div >< span class = "tag" data-offsite-status > 等待执行</ span ></ div >< div data-offsite-result >< div class = "operations-empty" > 输入 task_id 后执行一次只读核对。</ div ></ div ></ section >
</ div >
</ section >
< section class = "operator-view" data-view = "general" hidden >
< div class = "panel__body operator-columns" >
< section class = "operator-stack" >< div >< h2 class = "panel__title" > 通用自然语言查询</ h2 >< p class = "operator-inline-note" > 调用 POST /api/v1/agent-runs 并轮询 GET /api/v1/agent-runs/{run_id},前端不会使用无授权头的原生 EventSource。</ p ></ div >< label class = "form-field" >< span class = "form-field__label" > Agent 类型</ span >< select class = "form-field__input" data-agent-type >< option value = "financial_nl2sql" > 金融 NL2SQL</ option >< option value = "offsite_fund" > 场外基金</ option ></ select ></ label >< label class = "form-field" >< span class = "form-field__label" > 会话编号</ span >< input class = "form-field__input" data-session-id placeholder = "留空自动生成" ></ label >< label class = "form-field" >< span class = "form-field__label" > 业务问题</ span >< textarea class = "form-field__input" data-query-text rows = "5" placeholder = "例如:查询某基金最近一个交易日的净值" ></ textarea ></ label >< button class = "button button--primary" type = "button" data-action = "run-general" > 提交只读查询</ button ></ section >
< section >< div class = "operator-section-heading" >< div >< h2 class = "panel__title" > 运行状态与结果</ h2 >< p class = "operator-inline-note" > 状态完成后展示结果和工具调用摘要。</ p ></ div >< span class = "tag" data-general-status > 等待执行</ span ></ div >< div data-general-result >< div class = "operations-empty" > 提交问题后,前端会自动轮询运行状态。</ div ></ div ></ section >
</ div >
</ section >
</ article >
</ main >
< script type = "module" src = "/static/portal/employee-operations/nl2sql/nl2sql.js" ></ script >
</ body >
</ html >