fix: 分类树显示中文标签(通过CAT_MAP映射)
This commit is contained in:
@@ -447,7 +447,10 @@ async function loadCategories() {
|
|||||||
try {
|
try {
|
||||||
const r: any = await kpiApi.listCategories()
|
const r: any = await kpiApi.listCategories()
|
||||||
categoryTree.value = [
|
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)]
|
defaultExpanded.value = ['_all', ...(r.tree || []).map((n: any) => n.key)]
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user