fix: 分类树显示中文标签(通过CAT_MAP映射)

This commit is contained in:
Hermes CI Fix
2026-07-19 16:59:45 +08:00
parent 2b99b143a8
commit 51e50d8203
+4 -1
View File
@@ -447,7 +447,10 @@ async function loadCategories() {
try {
const r: any = await kpiApi.listCategories()
categoryTree.value = [
{ key: '_all', label: '全部', count: r.total, children: r.tree || [] }
{ key: '_all', label: '全部', count: r.total, children: (r.tree || []).map((dim: any) => ({
...dim,
children: (dim.children || []).map((cat: any) => ({ ...cat, label: CAT_MAP[cat.key] || cat.label }))
})) }
]
defaultExpanded.value = ['_all', ...(r.tree || []).map((n: any) => n.key)]
} catch (e) {