Files
group_fqcd_jr/app/static/portal/employee-operations/nl2sql/index.html
T
lzf_0626 3cbfe10d62 fix(portal): 补齐运营三个新页面的同名 css 入口,修复合并进来的红灯契约测试
合并组员的运营工作台提交后,`test_every_portal_page_has_local_js_and_css_entry`
红了:门户每个页面都要有与目录同名的 `js`/`css` 入口,而新加的
`nl2sql` / `offsite` / `promotion` 三个页面**只有 js**,样式统一引 `operator-workspace.css`。

## 改动

给三个页面补上同名样式入口,并在各自 `index.html` 里引用(放在共用的
`operator-workspace.css` 之后,便于页面覆盖):

- `employee-operations/nl2sql/nl2sql.css`
- `employee-operations/offsite/offsite.css`
- `employee-operations/promotion/promotion.css`

三个文件当前**没有规则**,只写了用途说明 —— 它们的价值是把"页面专属样式"的位置
**确定下来**:这个约定的意义正在于此,否则将来只会继续往共用文件里堆。

⚠️ 只在每个 `index.html` 的 `<head>` 里**加了一行 link**,未改动组员的其它内容。

验证:`tests/unit/api/test_portal_frontend.py` 37 passed;
unit+contract **1398 passed**;integration **110 passed**;ruff 通过;
mypy 251 文件 0 错;三个页面与三个 css 均 200;e2e 冒烟 **40/40**。
2026-09-14 01:42:21 +08:00

37 lines
5.0 KiB
HTML

<!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">
<link rel="stylesheet" href="/static/portal/employee-operations/nl2sql/nl2sql.css?v=20260913">
</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>