From 5c0ba37eda80d39e6ceca59bb1d5f4942f858995 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Thu, 17 Sep 2026 14:32:37 +0800 Subject: chore: establish Strategy Lab source baseline (development, not release) --- frontend/src/components/DatasetCard.svelte | 157 +++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 frontend/src/components/DatasetCard.svelte (limited to 'frontend/src/components/DatasetCard.svelte') diff --git a/frontend/src/components/DatasetCard.svelte b/frontend/src/components/DatasetCard.svelte new file mode 100644 index 0000000..7b38874 --- /dev/null +++ b/frontend/src/components/DatasetCard.svelte @@ -0,0 +1,157 @@ + + +
+ {#if ds} +
+
+ {ds.name ?? '未命名数据集'} + {#if ds.manifest_hash}manifest {ds.manifest_hash.slice(0, 10)}…{/if} + {#if ds.cache_hit}缓存命中 · 复用现有物化对象{/if} +
+ + {datasetStatusLabel[ds.status]} + +
+ + + + + + + +
请求标的{(ds.request.instruments ?? []).map(instrumentLabel).join(';')}
范围{ds.request.start_date} ~ {ds.request.end_date} · {ds.request.frequency} · {adjustmentLabel[ds.request.adjustment] ?? ds.request.adjustment}
字段{(ds.request.fields ?? []).join(', ')}
创建时间{fmtDate(ds.created_at)}
+ {#if ds.status === 'failed'} + + {/if} + {#if ds.status !== 'ready'} +

{ds.status === 'pending' || ds.status === 'running' ? '获取中,完成后可预览覆盖情况' : ''}

+ {/if} + {#if ds.status === 'ready'} +
+ +
+ {#if showPreview} +
+ + {#if preview} + {@const cov = summarizeCoverage(preview.coverage ?? [])} + {#if cov.warnings.length > 0} + + {:else if cov.common.start} + + {/if} + + + {#each preview.columns as c (c)}{/each} + + + {#each preview.rows as row, i (i)} + {#each preview.columns as c (c)}{/each} + {/each} + +
{c}
{row[c]}
+ {#if preview.truncated} +

预览仅展示部分行

+ {/if} + {/if} +
+ {/if} + {/if} + {:else} + + {/if} +
+ + -- cgit v1.2.3