fix: restore workbench and message routes

This commit is contained in:
2026-06-21 21:31:34 +08:00
parent 9647a227da
commit 46401e1a4e
5 changed files with 31 additions and 13 deletions
@@ -9,6 +9,7 @@ export const LIGHT_MENU_NAMES = new Set([
'AnnouncementList',
'AnnouncementManage',
'CodexAgentChat',
'Message',
'MessageCenter',
'MessageList',
'KnowledgeBase',
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { defineAsyncComponent, onMounted, ref, watch } from 'vue';
import { computed, defineAsyncComponent, onMounted, ref, watch } from 'vue';
import { useRoute } from 'vue-router';
import { ElEmpty, ElMessage, ElScrollbar } from 'element-plus';
@@ -12,10 +12,14 @@ const route = useRoute();
const DashboardRenderer = defineAsyncComponent(
() => import('#/components/dashboard-design/DashboardRenderer.vue'),
);
const DashboardWorkspace = defineAsyncComponent(
() => import('#/views/dashboard/workspace/index.vue'),
);
const loading = ref(false);
const pageConfig = ref<string>('');
const pageName = ref('');
const pageCode = ref('');
const isWorkbenchHome = computed(() => getPageCode() === 'main_home');
// 获取页面编码
function getPageCode(): string {
@@ -48,6 +52,13 @@ async function loadPageData() {
}
pageCode.value = code;
if (code === 'main_home') {
pageName.value = '控制中心';
pageConfig.value = '';
loading.value = false;
return;
}
loading.value = true;
try {
@@ -78,7 +89,8 @@ watch(
</script>
<template>
<ElScrollbar class="rounded-[8px] py-3">
<DashboardWorkspace v-if="isWorkbenchHome" />
<ElScrollbar v-else class="rounded-[8px] py-3">
<div v-loading="loading" class="h-[calc(100vh-120px)] rounded-[8px] px-3">
<DashboardRenderer v-if="pageConfig" :config="pageConfig" />
<ElEmpty v-else-if="!loading" description="暂无页面配置" />
@@ -235,8 +235,8 @@ function navTo(nav: WorkbenchProjectItem | WorkbenchQuickNavItem) {
</template>
</WorkbenchHeader>
<div class="mt-5 flex flex-col lg:flex-row">
<div class="mr-4 w-full lg:w-3/5">
<div class="mt-5 flex flex-col gap-4 lg:flex-row">
<div class="w-full lg:w-3/5">
<WorkbenchProject
:items="projectItems"
title="核心入口"
@@ -251,7 +251,6 @@ function navTo(nav: WorkbenchProjectItem | WorkbenchQuickNavItem) {
<div class="w-full lg:w-2/5">
<WorkbenchQuickNav
:items="quickNavItems"
class="mt-5 lg:mt-0"
title="基础管理"
@click="navTo"
/>