refactor(frontend): 重构RAG页面结构并收敛无效入口

This commit is contained in:
2026-05-24 22:03:42 +08:00
parent cfa5d1f4e1
commit e51903efbe
14 changed files with 1066 additions and 695 deletions

View File

@@ -7,11 +7,11 @@ describe('router', () => {
const paths = routes.map((route) => route.path);
expect(paths).toContain('/');
expect(paths).toContain('/dashboard');
expect(paths).toContain('/system/enums');
expect(paths).toContain('/system/attachments');
expect(paths).toContain('/rag/stores');
expect(paths).toContain('/rag/workbench');
expect(paths).toContain('/rag/documents');
expect(paths).toContain('/rag/tasks/chunk');
expect(paths).toContain('/system/enums');
expect(paths).toContain('/:pathMatch(.*)*');
});
});

View File

@@ -1,24 +1,18 @@
import type { RouteRecordRaw } from 'vue-router';
import { createRouter, createWebHistory } from 'vue-router';
import DashboardPage from '@/pages/dashboard/DashboardPage.vue';
import NotFoundPage from '@/pages/common/NotFoundPage.vue';
import RagDocumentsPage from '@/pages/rag/RagDocumentsPage.vue';
import RagStoresPage from '@/pages/rag/RagStoresPage.vue';
import SystemAttachmentsPage from '@/pages/system/SystemAttachmentsPage.vue';
import RagChunkTasksPage from '@/pages/rag/tasks/RagChunkTasksPage.vue';
import RagWorkbenchPage from '@/pages/rag/workbench/RagWorkbenchPage.vue';
import SystemEnumsPage from '@/pages/system/SystemEnumsPage.vue';
import AdminLayout from '@/layouts/AdminLayout.vue';
export const routes: RouteRecordRaw[] = [
{
path: '/',
redirect: '/dashboard',
},
{
path: '/dashboard',
name: 'dashboard',
component: DashboardPage,
meta: { title: '工作台' },
redirect: '/rag/workbench',
},
{
path: '/system/enums',
@@ -26,24 +20,30 @@ export const routes: RouteRecordRaw[] = [
component: SystemEnumsPage,
meta: { title: '系统枚举' },
},
{
path: '/system/attachments',
name: 'system-attachments',
component: SystemAttachmentsPage,
meta: { title: '附件管理' },
},
{
path: '/rag/stores',
name: 'rag-stores',
component: RagStoresPage,
meta: { title: '知识库' },
},
{
path: '/rag/workbench',
name: 'rag-workbench',
component: RagWorkbenchPage,
meta: { title: 'RAG工作台' },
},
{
path: '/rag/documents',
name: 'rag-documents',
component: RagDocumentsPage,
meta: { title: '知识文档' },
},
{
path: '/rag/tasks/chunk',
name: 'rag-chunk-tasks',
component: RagChunkTasksPage,
meta: { title: '切片任务' },
},
{
path: '/:pathMatch(.*)*',
name: 'not-found',
@@ -55,42 +55,42 @@ export const routes: RouteRecordRaw[] = [
const routerRoutes: RouteRecordRaw[] = [
{
path: '/',
redirect: '/dashboard',
redirect: '/rag/workbench',
},
{
path: '/',
component: AdminLayout,
children: [
{
path: 'dashboard',
name: 'dashboard',
component: DashboardPage,
meta: { title: '工作台' },
},
{
path: 'system/enums',
name: 'system-enums',
component: SystemEnumsPage,
meta: { title: '系统枚举' },
},
{
path: 'system/attachments',
name: 'system-attachments',
component: SystemAttachmentsPage,
meta: { title: '附件管理' },
},
{
path: 'rag/stores',
name: 'rag-stores',
component: RagStoresPage,
meta: { title: '知识库' },
},
{
path: 'rag/workbench',
name: 'rag-workbench',
component: RagWorkbenchPage,
meta: { title: 'RAG工作台' },
},
{
path: 'rag/documents',
name: 'rag-documents',
component: RagDocumentsPage,
meta: { title: '知识文档' },
},
{
path: 'rag/tasks/chunk',
name: 'rag-chunk-tasks',
component: RagChunkTasksPage,
meta: { title: '切片任务' },
},
],
},
{