diff --git a/src/modules/other/category/CategoryDeepListView.vue b/src/modules/other/category/CategoryDeepListView.vue index e79145c..4bc8585 100644 --- a/src/modules/other/category/CategoryDeepListView.vue +++ b/src/modules/other/category/CategoryDeepListView.vue @@ -72,6 +72,28 @@ function filterTree(nodes: Category[], kw: string): Category[] { } const displayList = computed(() => filterTree(LIST.value, search.name.trim())) +// 统计: 顶数 / 1级分类数 / 最深层级 / 已停用数 +const stats = computed(() => { + const total = LIST.value.length + const roots = LIST.value.length + let maxDepth = 1 + const flatten = (ns: Category[], d: number) => { + for (const n of ns) { if (d > maxDepth) maxDepth = d; if (n.children?.length) flatten(n.children, d + 1) } + } + flatten(LIST.value, 1) + let disabled = 0 + const count = (ns: Category[]) => { + for (const n of ns) { if (n.status === 1) disabled++; if (n.children?.length) count(n.children) } + } + count(LIST.value) + return [ + { label: '分类总数', value: total, icon: 'Files', color: 'var(--brand)' }, + { label: '一级分类', value: roots, icon: 'FolderOpened', color: 'var(--green)' }, + { label: '最大层级', value: 'Lv' + maxDepth, icon: 'Histogram', color: 'var(--amber)' }, + { label: '已停用', value: disabled, icon: 'CircleClose', color: 'var(--red)' } + ] +}) + async function load() { loading.value = true try { @@ -189,6 +211,19 @@ onMounted(load) + +
+
+
+ +
+
+
{{ s.label }}
+
{{ s.value }}
+
+
+
+ .rr-page { max-width: 1400px; } + +/* 顶部统计卡 */ +.stats-grid { + display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; + margin-bottom: 16px; +} +.stat-card { + background: var(--surface); border: 1px solid var(--border); + border-radius: var(--radius-lg); padding: 16px 18px; + display: flex; align-items: center; gap: 12px; + transition: all .15s; + &:hover { border-color: var(--border-strong); box-shadow: var(--shadow); } +} +.stat-icon { + width: 40px; height: 40px; border-radius: 10px; + display: flex; align-items: center; justify-content: center; + font-size: 20px; +} +.stat-info { flex: 1; min-width: 0; } +.stat-label { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; } +.stat-value { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; } + .rr-list-card { background: var(--surface); border-radius: 12px; overflow: hidden; } diff --git a/src/modules/user/enterpriselevel/EnterpriselevelListView.vue b/src/modules/user/enterpriselevel/EnterpriselevelListView.vue index 8503612..4984f00 100644 --- a/src/modules/user/enterpriselevel/EnterpriselevelListView.vue +++ b/src/modules/user/enterpriselevel/EnterpriselevelListView.vue @@ -1,8 +1,6 @@