实现结果总览前两块静态页面

This commit is contained in:
wkc
2026-03-19 10:36:45 +08:00
parent 01ba288581
commit 75dbb76e0c
5 changed files with 365 additions and 24 deletions

View File

@@ -0,0 +1,152 @@
<template>
<section class="overview-stats">
<div class="section-card">
<div class="section-header">
<div class="section-title-group">
<div class="section-title">{{ summary.title || "风险总览" }}</div>
<div class="section-subtitle">{{ summary.subtitle || "风险总体数据概览" }}</div>
</div>
<div class="section-actions">
<el-button
v-for="action in summary.actions || []"
:key="action.key"
size="mini"
:type="action.type || 'primary'"
:plain="action.plain !== false"
>
{{ action.label }}
</el-button>
</div>
</div>
<div class="stats-grid">
<div
v-for="item in summary.stats || []"
:key="item.key"
class="stats-card"
>
<div class="stats-icon" :class="`stats-icon-${item.tone || 'blue'}`">
<i :class="item.icon || 'el-icon-data-analysis'" />
</div>
<div class="stats-content">
<div class="stats-label">{{ item.label }}</div>
<div class="stats-value">{{ item.value }}</div>
</div>
</div>
</div>
</div>
</section>
</template>
<script>
export default {
name: "OverviewStats",
props: {
summary: {
type: Object,
default: () => ({}),
},
},
};
</script>
<style lang="scss" scoped>
.overview-stats {
margin-bottom: 16px;
}
.section-card {
padding: 20px;
border-radius: 16px;
background: #fff;
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 18px;
gap: 16px;
}
.section-title {
font-size: 16px;
font-weight: 600;
color: #1f2937;
}
.section-subtitle {
margin-top: 4px;
font-size: 12px;
color: #94a3b8;
}
.section-actions {
display: flex;
gap: 8px;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(5, minmax(0, 1fr));
gap: 14px;
}
.stats-card {
display: flex;
align-items: center;
gap: 14px;
padding: 18px 16px;
border: 1px solid #eef2ff;
border-radius: 14px;
background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.stats-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 42px;
height: 42px;
border-radius: 12px;
font-size: 18px;
}
.stats-icon-blue {
color: #2563eb;
background: rgba(37, 99, 235, 0.12);
}
.stats-icon-red {
color: #ef4444;
background: rgba(239, 68, 68, 0.12);
}
.stats-icon-amber {
color: #f59e0b;
background: rgba(245, 158, 11, 0.14);
}
.stats-icon-green {
color: #10b981;
background: rgba(16, 185, 129, 0.14);
}
.stats-content {
min-width: 0;
}
.stats-label {
font-size: 12px;
color: #94a3b8;
}
.stats-value {
margin-top: 8px;
font-size: 26px;
line-height: 1;
font-weight: 700;
color: #0f172a;
}
</style>