fix(admin): 优化数据报表

This commit is contained in:
sophie committed 2026-07-14 14:35:52 +08:00
1 parent 49c149eb3e
commit cd81911514
10 files changed
+327 -178

No files matched your search

@@ -1,9 +1,10 @@
/**
* features/admin/stores/admin-nav.store.ts
* 管理后台导航 UI 状态(侧栏折叠、报表展开、角标)。
* 管理后台导航 UI 状态(侧栏折叠、报表/企微子菜单展开、角标)。
*
* 角标数据来自 GET /api/admin/dashboard/badges,在 store 内做 TTL 缓存与 in-flight 去重,
* 避免切换 admin 子路由时重复请求(AdminLayout 挂载一次即可)。
* 报表与企业微信子菜单默认折叠,进入对应模块时由 AdminNav 展开。
*/
import { defineStore } from 'pinia';
import { ref } from 'vue';
@@ -15,8 +16,10 @@ const BADGE_CACHE_TTL_MS = 60_000;
export const useAdminNavStore = defineStore('adminNav', () => {
const sidebarCollapsed = ref(false);
const reportsExpanded = ref(true);
const wecomExpanded = ref(true);
/** 数据报表子菜单:默认折叠 */
const reportsExpanded = ref(false);
/** 企业微信子菜单:默认折叠 */
const wecomExpanded = ref(false);
/** 「用户审批」导航角标:pending 注册用户数 */
const pendingApprovalsCount = ref(0);
/** 「权限申请」导航角标:pending 权限申请数 */