From 4b345d2100e09ca6f4512e34447bf9b9e737c389 Mon Sep 17 00:00:00 2001 From: maoshen Date: Tue, 14 Apr 2026 12:35:18 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AF=84=E5=88=86=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=94=BE=E5=9C=A8=E6=AF=8F=E4=B8=AA=E6=9D=A1=E7=9B=AE=E5=90=8E?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/index.html | 53 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/frontend/index.html b/frontend/index.html index 115edc7..6685ad5 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -413,6 +413,57 @@ } } + function renderItemRatingStats(comments) { + if (!comments || comments.length === 0) return ''; + + const stats = { quality: [], efficiency: [], creativity: [], learning: [] }; + comments.forEach(c => { + if (c.quality) stats.quality.push(c.quality); + if (c.efficiency) stats.efficiency.push(c.efficiency); + if (c.creativity) stats.creativity.push(c.creativity); + if (c.learning) stats.learning.push(c.learning); + }); + + const hasAnyScore = stats.quality.length > 0 || stats.efficiency.length > 0 || + stats.creativity.length > 0 || stats.learning.length > 0; + + if (!hasAnyScore) return ''; + + const avg = (arr) => arr.length > 0 ? (arr.reduce((a,b) => a+b, 0) / arr.length).toFixed(1) : '-'; + + return ` +
+

๐Ÿ“Š ๆœฌ้กน่ฏ„ๅˆ†็ปŸ่ฎก

+
+ ${stats.quality.length > 0 ? ` +
+
๐Ÿ“ ่ดจ้‡
+
${avg(stats.quality)}
+
+ ` : ''} + ${stats.efficiency.length > 0 ? ` +
+
โšก ๆ•ˆ็އ
+
${avg(stats.efficiency)}
+
+ ` : ''} + ${stats.creativity.length > 0 ? ` +
+
๐Ÿ’ก ๅˆ›ๆ–ฐ
+
${avg(stats.creativity)}
+
+ ` : ''} + ${stats.learning.length > 0 ? ` +
+
๐Ÿ“š ๅญฆไน 
+
${avg(stats.learning)}
+
+ ` : ''} +
+
+ `; + } + function renderEmbeddedComments(contentType, objectId, comments) { if (!comments || comments.length === 0) return ''; @@ -438,6 +489,7 @@ `; }).join('')} + ${renderItemRatingStats(comments)} `; } @@ -612,7 +664,6 @@

${state.taskStats.completion_rate || 0}%

ๅฎŒๆˆ็އ

${state.expStats.total_experiences || 0}

็ป้ชŒ

- ${renderRatingStats()} ${content} `; }