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"
/>
@@ -41,20 +41,24 @@ defineEmits(['click']);
class="border-border group min-w-0 cursor-pointer border-t p-4 transition-all hover:shadow-xl"
@click="$emit('click', item)"
>
<div class="flex items-center">
<div class="flex min-w-0 items-center">
<VbenIcon
:color="item.color"
:icon="item.icon"
class="size-8 transition-all duration-300 group-hover:scale-110"
class="size-8 shrink-0 transition-all duration-300 group-hover:scale-110"
/>
<span class="ml-4 text-lg font-medium">{{ item.title }}</span>
<span class="ml-4 min-w-0 truncate text-lg font-medium">
{{ item.title }}
</span>
</div>
<div class="text-foreground/80 mt-4 flex min-h-12 leading-6">
<div class="text-foreground/80 mt-4 min-h-12 break-words leading-6">
{{ item.content }}
</div>
<div class="text-foreground/80 flex justify-between">
<span>{{ item.group }}</span>
<span>{{ item.date }}</span>
<div
class="text-foreground/80 mt-4 flex flex-wrap items-center justify-between gap-x-4 gap-y-1 text-sm"
>
<span class="whitespace-nowrap">{{ item.group }}</span>
<span class="whitespace-nowrap">{{ item.date }}</span>
</div>
</div>
</template>