feat: 增加知识图谱的数值

This commit is contained in:
王天骄
2026-06-23 16:44:01 +08:00
parent d2669fb11e
commit 89f6d06710
32 changed files with 135 additions and 57 deletions
+33 -2
View File
@@ -81,7 +81,8 @@
class="radar-label dynamic-label"
:style="{ left: item.labelLeft, top: item.labelTop }"
>
{{ item.dimension }}
<text class="radar-label-name">{{ item.dimension }}</text>
<text class="radar-label-score">{{ item.displayScore }}</text>
</view>
<svg class="radar-svg" viewBox="0 0 100 100">
@@ -225,6 +226,7 @@ const radarItems = computed(() => {
return {
dimension: item.dimension,
displayScore: formatRadarScore(item.score),
pointX: roundSvgValue(50 + Math.cos(angle) * pointRadius),
pointY: roundSvgValue(50 + Math.sin(angle) * pointRadius),
labelLeft: `${boundedLabelX}%`,
@@ -303,6 +305,11 @@ function clampScore(value: number) {
return Math.max(0, Math.min(100, Math.round(value)))
}
function formatRadarScore(score: number) {
if (!Number.isFinite(score)) return '--'
return Number.isInteger(score) ? String(score) : score.toFixed(1)
}
function roundSvgValue(value: number) {
return Math.round(value * 100) / 100
}
@@ -701,7 +708,7 @@ page {
position: absolute;
color: #424752;
font-size: 16px;
line-height: 24px;
line-height: 20px;
font-weight: 500;
letter-spacing: 0;
}
@@ -712,6 +719,30 @@ page {
text-align: center;
word-break: break-all;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
}
.radar-label-name,
.radar-label-score {
display: block;
width: 100%;
}
.radar-label-name {
color: #424752;
font-size: 14px;
line-height: 18px;
font-weight: 500;
}
.radar-label-score {
color: #00478d;
font-size: 12px;
line-height: 16px;
font-weight: 700;
}
.label-top {