xq feat:"修改了数据接入"

This commit is contained in:
2025-07-04 15:54:18 +08:00
parent 2642914335
commit e02f16c2f6
4 changed files with 40 additions and 3 deletions

View File

@ -12,6 +12,7 @@
:active-text-color="theme"
:collapse-transition="false"
mode="vertical"
v-if="showSide"
>
<sidebar-item v-for="(r, index) in sidebarRouters" :key="r.path + index" :item="r" :base-path="r.path" />
</el-menu>
@ -28,6 +29,7 @@ import { useAppStore } from '@/store/modules/app';
import { useSettingsStore } from '@/store/modules/settings';
import { usePermissionStore } from '@/store/modules/permission';
import { RouteRecordRaw } from 'vue-router';
import { useProgram } from '@/store/modules/program';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -41,6 +43,26 @@ const sideTheme = computed(() => settingsStore.sideTheme);
const theme = computed(() => settingsStore.theme);
const isCollapse = computed(() => !appStore.sidebar.opened);
const programState = useProgram();
const programID = computed(() => {
return programState.programID;
});
const showSide = ref(true);
watch(
programID,
(nv, ov) => {
if (nv !== ov) {
showSide.value = false;
setTimeout(() => {
showSide.value = true;
}, 200);
}
},
{ deep: true }
);
const activeMenu = computed(() => {
const { meta, path } = route;
// if set path, the sidebar will highlight the path you set