fix(题目列表): 同样两个知识点,有的题写「取余 · 选择结构」,有的写「选择结构 · 取余」
Deploy / deploy (push) Canceled after 0s

知识点一栏改成按左栏的顺序(题数多的在前)排,不再跟着标签挂上去的先后走。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-10 14:42:48 +08:00
1 parent afb52ce0f8
commit cdd69764c4
1 file changed
+7 -1
+7 -1
View File
@@ -361,8 +361,14 @@ const emptyText = computed(() => {
return `${where}没有同时符合这些条件的题`
})
// 按左栏的顺序(题数多的在前)排,同样几个知识点在每道题上的先后才一致
function knowledgeOf(row: ProblemRow) {
return row.tags.filter((name) => tagByName.value.get(name)?.category === "knowledge").join(" · ")
return row.tags
.map((name) => tagByName.value.get(name))
.filter((tag): tag is Tag => tag?.category === "knowledge")
.sort((a, b) => b.problemCount - a.problemCount)
.map((tag) => tag.name)
.join(" · ")
}
function mustDo(row: ProblemRow) {