mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-22 11:12:01 +00:00
对账要人选对照时按逐格比对的结论预选:这一列单独比和口径取数的某一列等价(ledger/match._cells 证明了),口径卡上只读那一格的指标就是它最可能的对照,409 的 options 里给 suggested;对账框照它预选、标「预选」,人可以改。只是「相关」的那一格不预选(比到的是第一个试的列,不是最像的),一个口径列对上几个指标的也不预选
This commit is contained in:
@@ -87,6 +87,9 @@ export const LEDGER_UI = {
|
||||
maskedPlaceholder: '已遮罩,请重新填写',
|
||||
pairs: '选择要对照的指标',
|
||||
pairsHint: '认不出这次的哪一列对应口径的哪个指标,请为要对照的列选一个口径卡上的指标',
|
||||
/** 有预选的:按逐格比对证明了的那几列预选上,人可以改 */
|
||||
pairsSuggested: '已按逐格比对的结论预选了能证明对应的列,请核对,可以改选',
|
||||
pairSuggestedTag: '预选',
|
||||
pairNone: '不对照',
|
||||
pairEmpty: '至少选一组对照',
|
||||
launch: '发起对账',
|
||||
|
||||
@@ -84,7 +84,12 @@ export function ReconcileDialog({ runId, action, related, onClose }: {
|
||||
} catch (e) {
|
||||
if (e instanceof ApiError && e.code === NEEDS_PAIRS) {
|
||||
const raw = (e.body as { options?: LedgerPairOptions } | undefined)?.options
|
||||
if (raw && Array.isArray(raw.columns) && Array.isArray(raw.metrics)) setOptions(raw)
|
||||
if (raw && Array.isArray(raw.columns) && Array.isArray(raw.metrics)) {
|
||||
setOptions(raw)
|
||||
// 逐格证明了的那几列预选上(人可以改);已经选过的不盖掉
|
||||
const picks = (raw.suggested ?? []).filter((s) => raw.columns.includes(s.ours) && raw.metrics.some((m) => m.id === s.metric))
|
||||
if (picks.length) setPairs((p) => ({ ...Object.fromEntries(picks.map((s) => [s.ours, s.metric])), ...p }))
|
||||
}
|
||||
setProblem(e.message)
|
||||
} else if (e instanceof ApiError && e.code === CHECK_INPUTS) {
|
||||
setEditing(true)
|
||||
@@ -152,7 +157,9 @@ export function ReconcileDialog({ runId, action, related, onClose }: {
|
||||
{options && (
|
||||
<section data-ledger-pairs="">
|
||||
<div className="mb-1 text-2xs font-medium text-faint">{LEDGER_UI.reconcile.pairs}</div>
|
||||
<p className="mb-1.5 text-2xs text-dim">{LEDGER_UI.reconcile.pairsHint}</p>
|
||||
<p className="mb-1.5 text-2xs text-dim">
|
||||
{options.suggested?.length ? LEDGER_UI.reconcile.pairsSuggested : LEDGER_UI.reconcile.pairsHint}
|
||||
</p>
|
||||
<div className="space-y-1.5">
|
||||
{options.columns.map((col) => (
|
||||
<label key={col} className="flex items-center gap-2 text-2xs">
|
||||
@@ -165,6 +172,9 @@ export function ReconcileDialog({ runId, action, related, onClose }: {
|
||||
<option key={m.id} value={m.id}>{m.name}{m.unit ? `(${m.unit})` : ''}</option>
|
||||
))}
|
||||
</select>
|
||||
{options.suggested?.some((s) => s.ours === col && s.metric === pairs[col]) && (
|
||||
<span className="chip shrink-0" data-ledger-pair-suggested={col}>{LEDGER_UI.reconcile.pairSuggestedTag}</span>
|
||||
)}
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -305,6 +305,11 @@ export interface LedgerReconcileOut {
|
||||
export interface LedgerPairOptions {
|
||||
columns: string[]
|
||||
metrics: { id: string; name: string; unit?: string }[]
|
||||
/**
|
||||
* 预选的对照(服务端 ledger/reconcile._suggested):这一列单独比和口径取数的某一列等价(逐格证明了),口径卡上只读那一格的
|
||||
* 指标。界面照它预选、人可以改;老服务端不给
|
||||
*/
|
||||
suggested?: { ours: string; metric: string }[]
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- 认证队列(可沉淀的问题)
|
||||
|
||||
Reference in New Issue
Block a user