Update prediction results workflow

This commit is contained in:
2026-07-20 13:47:39 +08:00
parent 8d347cfbc2
commit a20339d35e
10 changed files with 239 additions and 207 deletions
+13 -53
View File
@@ -23,25 +23,21 @@
</div>
<div class="grid items-stretch gap-6 lg:grid-cols-[minmax(0,1fr)_360px]">
<section class="rounded-lg border border-line bg-white p-5 shadow-panel sm:p-6">
<div class="mb-4">
<section class="flex h-full flex-col rounded-lg border border-line bg-white p-5 shadow-panel sm:p-6">
<div class="mb-4 shrink-0">
<h2 class="text-xl font-extrabold">管道剩余寿命动态评估</h2>
<p class="mt-1 text-sm text-textSub">生存概率随时间变化的阶梯曲线。</p>
<p class="mt-1 text-sm text-textSub">管道剩余寿命随时间变化的分析曲线。</p>
</div>
<div class="rounded-md border border-line bg-slate-50 p-3">
<img src="{{ result.image_url }}" alt="生存概率阶梯图" class="h-auto w-full rounded bg-white object-contain">
</div>
<div class="mt-4 rounded-md border border-blue-100 bg-blueSoft p-4 text-sm leading-6 text-textSub">
<span class="font-bold text-textMain">分析说明:</span>{{ result.analysis_text }}
<div class="flex min-h-[360px] flex-1 items-center justify-center rounded-md border border-line bg-slate-50 p-3">
<img src="{{ result.image_url }}" alt="管道的剩余寿命分析图" class="max-h-full w-full rounded bg-white object-contain">
</div>
</section>
<aside class="flex flex-col gap-6">
<aside class="flex h-full flex-col gap-6">
<section class="rounded-lg border border-line bg-white p-5 shadow-panel">
<h2 class="text-lg font-extrabold">报告摘要</h2>
<dl class="mt-4 space-y-3 text-sm">
<div class="flex justify-between gap-4"><dt class="text-textSub">样本数量</dt><dd class="font-bold">{{ result.sample_count }}</dd></div>
<div class="flex justify-between gap-4"><dt class="text-textSub">显示样本</dt><dd class="font-bold">{{ result.summary_rows|length }}</dd></div>
<div class="flex justify-between gap-4"><dt class="text-textSub">输出文件</dt><dd class="font-bold">电子表格</dd></div>
</dl>
<a href="{{ result.excel_url }}" class="ui-btn ui-btn-secondary mt-5 w-full text-primary">
@@ -51,52 +47,16 @@
</section>
<section class="flex flex-1 flex-col rounded-lg border border-line bg-white p-5 shadow-panel">
<h2 class="text-lg font-extrabold">结果展示</h2>
<div class="mt-4 overflow-hidden rounded-md border border-line">
<table class="w-full text-sm">
<thead class="bg-slate-50 text-xs font-bold text-textSub">
<tr>
<th class="px-3 py-3 text-left">编号</th>
<th class="px-3 py-3 text-left">管龄</th>
<th class="px-3 py-3 text-left">等级</th>
</tr>
</thead>
<tbody>
{% for item in result.summary_rows %}
<tr class="border-t border-line">
<td class="px-3 py-3 font-semibold">{{ item.pipe_id }}</td>
<td class="px-3 py-3 text-textSub">{{ item.pipe_age }}</td>
<td class="px-3 py-3"><span class="inline-flex rounded-full px-2.5 py-1 text-xs font-bold {{ item.grade_class }}">{{ item.grade_label }}</span></td>
</tr>
{% endfor %}
</tbody>
</table>
<h2 class="text-lg font-extrabold">健康等级说明</h2>
<div class="mt-4 grid gap-2 text-sm">
<div class="rounded-md border border-red-100 bg-dangerSoft p-3"><div class="font-extrabold text-dangerText">I级 · (0, 0.2]</div><p class="mt-1 text-xs leading-5">风险十分严重,需立刻抢修或更新改造。</p></div>
<div class="rounded-md border border-orange-100 bg-orange-50 p-3"><div class="font-extrabold text-orange-600">II级 · (0.2, 0.4]</div><p class="mt-1 text-xs leading-5">风险较为严重,需尽快检修并加频巡检。</p></div>
<div class="rounded-md border border-amber-100 bg-amber-50 p-3"><div class="font-extrabold text-amber-600">III级 · (0.4, 0.6]</div><p class="mt-1 text-xs leading-5">风险较低,安排定期巡检。</p></div>
<div class="rounded-md border border-blue-100 bg-blue-50 p-3"><div class="font-extrabold text-blue-600">IV级 · (0.6, 0.8]</div><p class="mt-1 text-xs leading-5">风险较小,维持常规巡视。</p></div>
<div class="rounded-md border border-blue-100 bg-blueSoft p-3"><div class="font-extrabold text-primary">V级 · (0.8, 1]</div><p class="mt-1 text-xs leading-5">管道安全,维持常规巡视。</p></div>
</div>
</section>
</aside>
{% if result.importance_url %}
<section class="rounded-lg border border-line bg-white p-5 shadow-panel sm:p-6">
<div class="mb-4">
<h2 class="text-xl font-extrabold">模型输入因素重要性排序</h2>
<p class="mt-1 text-sm text-textSub">各输入因素对预测结果的相对影响程度。</p>
</div>
<div class="rounded-md border border-line bg-slate-50 p-3">
<img src="{{ result.importance_url }}" alt="模型输入因素重要性排序图" class="h-auto w-full rounded bg-white object-contain">
</div>
</section>
{% endif %}
<aside class="flex flex-col rounded-lg border border-line bg-white p-5 shadow-panel lg:col-start-2">
<h2 class="text-lg font-extrabold">健康等级说明</h2>
<div class="mt-4 grid flex-1 gap-2 text-sm">
<div class="rounded-md border border-red-100 bg-dangerSoft p-3"><div class="font-extrabold text-dangerText">I级 · (0, 0.2]</div><p class="mt-1 text-xs leading-5">风险十分严重,需立刻抢修或更新改造。</p></div>
<div class="rounded-md border border-orange-100 bg-orange-50 p-3"><div class="font-extrabold text-orange-600">II级 · (0.2, 0.4]</div><p class="mt-1 text-xs leading-5">风险较为严重,需尽快检修并加频巡检。</p></div>
<div class="rounded-md border border-amber-100 bg-amber-50 p-3"><div class="font-extrabold text-amber-600">III级 · (0.4, 0.6]</div><p class="mt-1 text-xs leading-5">风险较低,安排定期巡检。</p></div>
<div class="rounded-md border border-blue-100 bg-blue-50 p-3"><div class="font-extrabold text-blue-600">IV级 · (0.6, 0.8]</div><p class="mt-1 text-xs leading-5">风险较小,维持常规巡视。</p></div>
<div class="rounded-md border border-blue-100 bg-blueSoft p-3"><div class="font-extrabold text-primary">V级 · (0.8, 1]</div><p class="mt-1 text-xs leading-5">管道安全,维持常规巡视。</p></div>
</div>
</aside>
</div>
{% else %}
<section class="rounded-lg border border-line bg-white p-10 text-center shadow-panel">