fix(desktop): align AI platform sidebar badge with media-account semantics

The AI 平台 badge counted distinct platforms with at least one
active-auth account, while 媒体账号 counted raw account rows
regardless of auth state. The two numbers shared a slot but meant
different things, which made them not comparable at a glance.

Switch the AI 平台 count to mirror 媒体账号: account-level count
of accounts whose platform falls in the monitoring catalog, with
no authState filter.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-08 19:14:16 +08:00
parent 94c6b5d5a5
commit 1fb6d28102
@@ -30,9 +30,7 @@ const navItems = computed(() => {
const data = snapshot.value
const accounts = data?.accounts ?? []
const publishIDs = new Set(desktopPublishMediaCatalog.map((item) => item.id))
const authorizedMonitoringCount = desktopMonitoringMediaCatalog.filter((platform) =>
accounts.find((account) => account.platform === platform.id)?.authState === 'active',
).length
const monitoringIDs = new Set(desktopMonitoringMediaCatalog.map((item) => item.id))
return [
{
@@ -60,7 +58,7 @@ const navItems = computed(() => {
to: '/ai-platforms',
title: 'AI 平台',
description: 'AI 平台一平台一授权,按卡片查看状态与归属',
count: authorizedMonitoringCount,
count: accounts.filter((item) => monitoringIDs.has(item.platform)).length,
icon: RobotOutlined,
},
]