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,11 @@
/**
* features/admin/components/AdminNav.vue
* 管理后台左侧导航,使用子路由跳转。
* 依赖:admin-nav.store、modules 常量、vue-router。
* 逻辑:报表/企微子菜单默认折叠;当前路由落在对应模块时自动展开以便看到激活项。
*/
<script setup lang="ts">
import { computed } from 'vue';
import { computed, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router';
import {
@@ -76,6 +78,25 @@ const navigateModule = (routeName: string): void => {
const navigateReport = (table: string): void => {
router.push({ name: 'AdminReports', params: { table } });
};
/**
* 进入报表/企微模块时自动展开子菜单,避免当前页在折叠状态下不可见。
*/
watch(
isReportsActive,
(active) => {
if (active) navStore.reportsExpanded = true;
},
{ immediate: true },
);
watch(
isWecomActive,
(active) => {
if (active) navStore.wecomExpanded = true;
},
{ immediate: true },
);
</script>
<template>