fix: restore workbench and message routes
This commit is contained in:
@@ -17,7 +17,7 @@ from core.menu.schema import MenuCreate, MenuUpdate
|
|||||||
menu_cache = CacheManager(prefix="menu:")
|
menu_cache = CacheManager(prefix="menu:")
|
||||||
|
|
||||||
# 缓存key
|
# 缓存key
|
||||||
AI_AGENT_ADMIN_MENU_CACHE_VERSION = "v12"
|
AI_AGENT_ADMIN_MENU_CACHE_VERSION = "v13"
|
||||||
MENU_TREE_CACHE_KEY = f"tree:ai_agent_admin:{AI_AGENT_ADMIN_MENU_CACHE_VERSION}"
|
MENU_TREE_CACHE_KEY = f"tree:ai_agent_admin:{AI_AGENT_ADMIN_MENU_CACHE_VERSION}"
|
||||||
USER_ROUTE_CACHE_PREFIX = f"user_route:ai_agent_admin:{AI_AGENT_ADMIN_MENU_CACHE_VERSION}:"
|
USER_ROUTE_CACHE_PREFIX = f"user_route:ai_agent_admin:{AI_AGENT_ADMIN_MENU_CACHE_VERSION}:"
|
||||||
|
|
||||||
@@ -35,6 +35,8 @@ AI_AGENT_ADMIN_MENU_NAMES = {
|
|||||||
"UserManagement",
|
"UserManagement",
|
||||||
"SystemMenu",
|
"SystemMenu",
|
||||||
"SystemRole",
|
"SystemRole",
|
||||||
|
"Message",
|
||||||
|
"MessageList",
|
||||||
"AnnouncementList",
|
"AnnouncementList",
|
||||||
"AnnouncementManage",
|
"AnnouncementManage",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export const LIGHT_MENU_NAMES = new Set([
|
|||||||
'AnnouncementList',
|
'AnnouncementList',
|
||||||
'AnnouncementManage',
|
'AnnouncementManage',
|
||||||
'CodexAgentChat',
|
'CodexAgentChat',
|
||||||
|
'Message',
|
||||||
'MessageCenter',
|
'MessageCenter',
|
||||||
'MessageList',
|
'MessageList',
|
||||||
'KnowledgeBase',
|
'KnowledgeBase',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<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 { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import { ElEmpty, ElMessage, ElScrollbar } from 'element-plus';
|
import { ElEmpty, ElMessage, ElScrollbar } from 'element-plus';
|
||||||
@@ -12,10 +12,14 @@ const route = useRoute();
|
|||||||
const DashboardRenderer = defineAsyncComponent(
|
const DashboardRenderer = defineAsyncComponent(
|
||||||
() => import('#/components/dashboard-design/DashboardRenderer.vue'),
|
() => import('#/components/dashboard-design/DashboardRenderer.vue'),
|
||||||
);
|
);
|
||||||
|
const DashboardWorkspace = defineAsyncComponent(
|
||||||
|
() => import('#/views/dashboard/workspace/index.vue'),
|
||||||
|
);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const pageConfig = ref<string>('');
|
const pageConfig = ref<string>('');
|
||||||
const pageName = ref('');
|
const pageName = ref('');
|
||||||
const pageCode = ref('');
|
const pageCode = ref('');
|
||||||
|
const isWorkbenchHome = computed(() => getPageCode() === 'main_home');
|
||||||
|
|
||||||
// 获取页面编码
|
// 获取页面编码
|
||||||
function getPageCode(): string {
|
function getPageCode(): string {
|
||||||
@@ -48,6 +52,13 @@ async function loadPageData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pageCode.value = code;
|
pageCode.value = code;
|
||||||
|
if (code === 'main_home') {
|
||||||
|
pageName.value = '控制中心';
|
||||||
|
pageConfig.value = '';
|
||||||
|
loading.value = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -78,7 +89,8 @@ watch(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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">
|
<div v-loading="loading" class="h-[calc(100vh-120px)] rounded-[8px] px-3">
|
||||||
<DashboardRenderer v-if="pageConfig" :config="pageConfig" />
|
<DashboardRenderer v-if="pageConfig" :config="pageConfig" />
|
||||||
<ElEmpty v-else-if="!loading" description="暂无页面配置" />
|
<ElEmpty v-else-if="!loading" description="暂无页面配置" />
|
||||||
|
|||||||
@@ -235,8 +235,8 @@ function navTo(nav: WorkbenchProjectItem | WorkbenchQuickNavItem) {
|
|||||||
</template>
|
</template>
|
||||||
</WorkbenchHeader>
|
</WorkbenchHeader>
|
||||||
|
|
||||||
<div class="mt-5 flex flex-col lg:flex-row">
|
<div class="mt-5 flex flex-col gap-4 lg:flex-row">
|
||||||
<div class="mr-4 w-full lg:w-3/5">
|
<div class="w-full lg:w-3/5">
|
||||||
<WorkbenchProject
|
<WorkbenchProject
|
||||||
:items="projectItems"
|
:items="projectItems"
|
||||||
title="核心入口"
|
title="核心入口"
|
||||||
@@ -251,7 +251,6 @@ function navTo(nav: WorkbenchProjectItem | WorkbenchQuickNavItem) {
|
|||||||
<div class="w-full lg:w-2/5">
|
<div class="w-full lg:w-2/5">
|
||||||
<WorkbenchQuickNav
|
<WorkbenchQuickNav
|
||||||
:items="quickNavItems"
|
:items="quickNavItems"
|
||||||
class="mt-5 lg:mt-0"
|
|
||||||
title="基础管理"
|
title="基础管理"
|
||||||
@click="navTo"
|
@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"
|
class="border-border group min-w-0 cursor-pointer border-t p-4 transition-all hover:shadow-xl"
|
||||||
@click="$emit('click', item)"
|
@click="$emit('click', item)"
|
||||||
>
|
>
|
||||||
<div class="flex items-center">
|
<div class="flex min-w-0 items-center">
|
||||||
<VbenIcon
|
<VbenIcon
|
||||||
:color="item.color"
|
:color="item.color"
|
||||||
:icon="item.icon"
|
: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>
|
||||||
<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 }}
|
{{ item.content }}
|
||||||
</div>
|
</div>
|
||||||
<div class="text-foreground/80 flex justify-between">
|
<div
|
||||||
<span>{{ item.group }}</span>
|
class="text-foreground/80 mt-4 flex flex-wrap items-center justify-between gap-x-4 gap-y-1 text-sm"
|
||||||
<span>{{ item.date }}</span>
|
>
|
||||||
|
<span class="whitespace-nowrap">{{ item.group }}</span>
|
||||||
|
<span class="whitespace-nowrap">{{ item.date }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user