This commit is contained in:
2025-12-18 16:37:33 +08:00
commit e974bf361d
4183 changed files with 497339 additions and 0 deletions

View File

@@ -0,0 +1,114 @@
import type { RouteRecordRaw } from 'vue-router';
import { LOGIN_PATH } from '@vben/constants';
import { preferences } from '@vben/preferences';
import { $t } from '#/locales';
const BasicLayout = () => import('#/layouts/basic.vue');
const AuthPageLayout = () => import('#/layouts/auth.vue');
/** 全局404页面 */
const fallbackNotFoundRoute: RouteRecordRaw = {
component: () => import('#/views/_core/fallback/not-found.vue'),
meta: {
hideInBreadcrumb: true,
hideInMenu: true,
hideInTab: true,
title: '404',
},
name: 'FallbackNotFound',
path: '/:path(.*)*',
};
/** 基本路由,这些路由是必须存在的 */
const coreRoutes: RouteRecordRaw[] = [
/**
* 根路由
* 使用基础布局作为所有页面的父级容器子级就不必配置BasicLayout。
* 此路由必须存在,且不应修改
*/
{
component: BasicLayout,
meta: {
hideInBreadcrumb: true,
title: 'Root',
},
name: 'Root',
path: '/',
redirect: preferences.app.defaultHomePath,
children: [],
},
{
component: AuthPageLayout,
meta: {
hideInTab: true,
title: 'Authentication',
},
name: 'Authentication',
path: '/auth',
redirect: LOGIN_PATH,
children: [
{
name: 'Login',
path: 'login',
component: () => import('#/views/_core/authentication/login.vue'),
meta: {
title: $t('page.auth.login'),
},
},
{
name: 'CodeLogin',
path: 'code-login',
component: () => import('#/views/_core/authentication/code-login.vue'),
meta: {
title: $t('page.auth.codeLogin'),
},
},
{
name: 'QrCodeLogin',
path: 'qrcode-login',
component: () =>
import('#/views/_core/authentication/qrcode-login.vue'),
meta: {
title: $t('page.auth.qrcodeLogin'),
},
},
{
name: 'ForgetPassword',
path: 'forget-password',
component: () =>
import('#/views/_core/authentication/forget-password.vue'),
meta: {
title: $t('page.auth.forgetPassword'),
},
},
{
name: 'Register',
path: 'register',
component: () => import('#/views/_core/authentication/register.vue'),
meta: {
title: $t('page.auth.register'),
},
},
{
name: 'SocialLogin',
path: 'social-login',
component: () =>
import('#/views/_core/authentication/social-login.vue'),
meta: {
title: $t('page.auth.login'),
},
},
{
name: 'SSOLogin',
path: 'sso-login',
component: () => import('#/views/_core/authentication/sso-login.vue'),
meta: {
title: $t('page.auth.login'),
},
},
],
},
];
export { coreRoutes, fallbackNotFoundRoute };

View File

@@ -0,0 +1,47 @@
import type { RouteRecordRaw } from 'vue-router';
import { mergeRouteModules, traverseTreeValues } from '@vben/utils';
import { coreRoutes, fallbackNotFoundRoute } from './core';
const dynamicRouteFiles = import.meta.glob('./modules/**/*.ts', {
eager: true,
});
// 有需要可以自行打开注释,并创建文件夹
// const externalRouteFiles = import.meta.glob('./external/**/*.ts', { eager: true });
// const staticRouteFiles = import.meta.glob('./static/**/*.ts', { eager: true });
/** 动态路由 */
const dynamicRoutes: RouteRecordRaw[] = mergeRouteModules(dynamicRouteFiles);
/** 外部路由列表访问这些页面可以不需要Layout可能用于内嵌在别的系统(不会显示在菜单中) */
// const externalRoutes: RouteRecordRaw[] = mergeRouteModules(externalRouteFiles);
// const staticRoutes: RouteRecordRaw[] = mergeRouteModules(staticRouteFiles);
const staticRoutes: RouteRecordRaw[] = [];
const externalRoutes: RouteRecordRaw[] = [];
/** 路由列表由基本路由、外部路由和404兜底路由组成
* 无需走权限验证(会一直显示在菜单中) */
const routes: RouteRecordRaw[] = [
...coreRoutes,
...externalRoutes,
fallbackNotFoundRoute,
];
/** 基本路由列表,这些路由不需要进入权限拦截 */
const coreRouteNames = traverseTreeValues(coreRoutes, (route) => route.name);
/** 有权限校验的路由列表,包含动态路由和静态路由 */
const accessRoutes = [...dynamicRoutes, ...staticRoutes];
// add by 芋艿from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/router/routes/index.ts#L38-L45
const componentKeys: string[] = Object.keys(
import.meta.glob('../../views/**/*.vue'),
)
.filter((item) => !item.includes('/modules/'))
.map((v) => {
const path = v.replace('../../views/', '/');
return path.endsWith('.vue') ? path.slice(0, -4) : path;
});
export { accessRoutes, componentKeys, coreRouteNames, routes };

View File

@@ -0,0 +1,113 @@
import type { RouteRecordRaw } from 'vue-router';
const routes: RouteRecordRaw[] = [
{
path: '/ai',
name: 'Ai',
meta: {
title: 'Ai',
hideInMenu: true,
},
children: [
{
path: 'image/square',
component: () => import('#/views/ai/image/square/index.vue'),
name: 'AiImageSquare',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '绘图作品',
activePath: '/ai/image',
},
},
{
path: 'knowledge/document',
component: () => import('#/views/ai/knowledge/document/index.vue'),
name: 'AiKnowledgeDocument',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '知识库文档',
activePath: '/ai/knowledge',
},
},
{
path: 'knowledge/document/create',
component: () => import('#/views/ai/knowledge/document/form/index.vue'),
name: 'AiKnowledgeDocumentCreate',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '创建文档',
activePath: '/ai/knowledge',
},
},
{
path: 'knowledge/document/update',
component: () => import('#/views/ai/knowledge/document/form/index.vue'),
name: 'AiKnowledgeDocumentUpdate',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '修改文档',
activePath: '/ai/knowledge',
},
},
{
path: 'knowledge/retrieval',
component: () =>
import('#/views/ai/knowledge/knowledge/retrieval/index.vue'),
name: 'AiKnowledgeRetrieval',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '文档召回测试',
activePath: '/ai/knowledge',
},
},
{
path: 'knowledge/segment',
component: () => import('#/views/ai/knowledge/segment/index.vue'),
name: 'AiKnowledgeSegment',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '知识库分段',
activePath: '/ai/knowledge',
},
},
{
path: String.raw`workflow/create/:id(\d+)/:type(update|create)`,
component: () => import('#/views/ai/workflow/form/index.vue'),
name: 'AiWorkflowCreate',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '设计 AI 工作流',
activePath: '/ai/workflow',
},
},
{
path: 'console/workflow/:type/:id',
component: () => import('#/views/ai/workflow/form/index.vue'),
name: 'AiWorkflowUpdate',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '设计 AI 工作流',
activePath: '/ai/workflow',
},
},
],
},
];
export default routes;

View File

@@ -0,0 +1,117 @@
import type { RouteRecordRaw } from 'vue-router';
const routes: RouteRecordRaw[] = [
{
path: '/bpm',
name: 'bpm',
meta: {
title: '工作流',
hideInMenu: true,
},
children: [
{
path: 'task',
name: 'BpmTask',
meta: {
title: '审批中心',
icon: 'ant-design:history-outlined',
},
children: [
{
path: 'my',
name: 'BpmTaskMy',
component: () => import('#/views/bpm/processInstance/index.vue'),
meta: {
title: '我的流程',
},
},
],
},
{
path: 'process-instance/detail',
component: () => import('#/views/bpm/processInstance/detail/index.vue'),
name: 'BpmProcessInstanceDetail',
meta: {
title: '流程详情',
activePath: '/bpm/task/my',
icon: 'ant-design:history-outlined',
keepAlive: false,
hideInMenu: true,
},
props: (route) => {
return {
id: route.query.id,
taskId: route.query.taskId,
activityId: route.query.activityId,
};
},
},
{
path: '/bpm/manager/form/edit',
name: 'BpmFormEditor',
component: () => import('#/views/bpm/form/designer/index.vue'),
meta: {
title: '设计流程表单',
activePath: '/bpm/manager/form',
},
props: (route) => {
return {
id: route.query.id,
type: route.query.type,
copyId: route.query.copyId,
};
},
},
{
path: 'manager/model/create',
component: () => import('#/views/bpm/model/form/index.vue'),
name: 'BpmModelCreate',
meta: {
title: '创建流程',
activePath: '/bpm/manager/model',
icon: 'carbon:flow-connection',
hideInMenu: true,
keepAlive: true,
},
},
{
path: 'manager/model/:type/:id',
component: () => import('#/views/bpm/model/form/index.vue'),
name: 'BpmModelUpdate',
meta: {
title: '修改流程',
activePath: '/bpm/manager/model',
icon: 'carbon:flow-connection',
hideInMenu: true,
keepAlive: true,
},
},
{
path: 'manager/definition',
component: () => import('#/views/bpm/model/definition/index.vue'),
name: 'BpmProcessDefinition',
meta: {
title: '流程定义',
activePath: '/bpm/manager/model',
icon: 'carbon:flow-modeler',
hideInMenu: true,
keepAlive: true,
},
},
{
path: 'process-instance/report',
component: () => import('#/views/bpm/processInstance/report/index.vue'),
name: 'BpmProcessInstanceReport',
meta: {
title: '数据报表',
activePath: '/bpm/manager/model',
icon: 'carbon:data-2',
hideInMenu: true,
keepAlive: true,
},
},
],
},
];
export default routes;

View File

@@ -0,0 +1,135 @@
import type { RouteRecordRaw } from 'vue-router';
const routes: RouteRecordRaw[] = [
{
path: '/crm',
name: 'CrmCenter',
meta: {
title: '客户管理',
icon: 'simple-icons:civicrm',
keepAlive: true,
hideInMenu: true,
},
children: [
{
path: 'clue/detail/:id',
name: 'CrmClueDetail',
meta: {
title: '线索详情',
activePath: '/crm/clue',
},
component: () => import('#/views/crm/clue/detail/index.vue'),
},
{
path: 'customer/detail/:id',
name: 'CrmCustomerDetail',
meta: {
title: '客户详情',
activePath: '/crm/customer',
},
component: () => import('#/views/crm/customer/detail/index.vue'),
},
{
path: 'business/detail/:id',
name: 'CrmBusinessDetail',
meta: {
title: '商机详情',
activePath: '/crm/business',
},
component: () => import('#/views/crm/business/detail/index.vue'),
},
{
path: 'contract/detail/:id',
name: 'CrmContractDetail',
meta: {
title: '合同详情',
activePath: '/crm/contract',
},
component: () => import('#/views/crm/contract/detail/index.vue'),
},
{
path: 'receivable-plan/detail/:id',
name: 'CrmReceivablePlanDetail',
meta: {
title: '回款计划详情',
activePath: '/crm/receivable-plan',
},
component: () => import('#/views/crm/receivable/plan/detail/index.vue'),
},
{
path: 'receivable/detail/:id',
name: 'CrmReceivableDetail',
meta: {
title: '回款详情',
activePath: '/crm/receivable',
},
component: () => import('#/views/crm/receivable/detail/index.vue'),
},
{
path: 'contact/detail/:id',
name: 'CrmContactDetail',
meta: {
title: '联系人详情',
activePath: '/crm/contact',
},
component: () => import('#/views/crm/contact/detail/index.vue'),
},
{
path: 'product/detail/:id',
name: 'CrmProductDetail',
meta: {
title: '产品详情',
activePath: '/crm/product',
},
component: () => import('#/views/crm/product/detail/index.vue'),
},
{
path: 'statistics/customer',
name: 'CrmStatisticsCustomer',
meta: {
title: '客户统计',
activePath: '/crm/statistics/customer',
},
component: () => import('#/views/crm/statistics/customer/index.vue'),
},
{
path: 'statistics/funnel',
name: 'CrmStatisticsFunnel',
meta: {
title: '销售漏斗',
activePath: '/crm/statistics/funnel',
},
component: () => import('#/views/crm/statistics/funnel/index.vue'),
},
{
path: 'statistics/performance',
name: 'CrmStatisticsPerformance',
meta: {
title: '员工业绩',
activePath: '/crm/statistics/performance',
},
component: () => import('#/views/crm/statistics/performance/index.vue'),
},
{
path: 'statistics/portrait',
name: 'CrmStatisticsPortrait',
meta: {
title: '客户画像',
activePath: '/crm/statistics/portrait',
},
component: () => import('#/views/crm/statistics/portrait/index.vue'),
},
{
path: 'statistics/rank',
name: 'CrmStatisticsRank',
meta: {
title: '排行榜',
activePath: '/crm/statistics/rank',
},
component: () => import('#/views/crm/statistics/rank/index.vue'),
},
],
},
];
export default routes;

View File

@@ -0,0 +1,48 @@
import type { RouteRecordRaw } from 'vue-router';
import { $t } from '#/locales';
const routes: RouteRecordRaw[] = [
{
meta: {
icon: 'lucide:layout-dashboard',
order: -1,
title: $t('page.dashboard.title'),
},
name: 'Dashboard',
path: '/dashboard',
children: [
{
name: 'Workspace',
path: '/workspace',
component: () => import('#/views/dashboard/workspace/index.vue'),
meta: {
icon: 'carbon:workspace',
title: $t('page.dashboard.workspace'),
},
},
{
name: 'Analytics',
path: '/analytics',
component: () => import('#/views/dashboard/analytics/index.vue'),
meta: {
affixTab: true,
icon: 'lucide:area-chart',
title: $t('page.dashboard.analytics'),
},
},
],
},
{
name: 'Profile',
path: '/profile',
component: () => import('#/views/_core/profile/index.vue'),
meta: {
icon: 'ant-design:profile-outlined',
title: $t('ui.widgets.profile'),
hideInMenu: true,
},
},
];
export default routes;

View File

@@ -0,0 +1,30 @@
import type { RouteRecordRaw } from 'vue-router';
const routes: RouteRecordRaw[] = [
{
path: '/infra/job/log',
component: () => import('#/views/infra/job/logger/index.vue'),
name: 'InfraJobLog',
meta: {
title: '调度日志',
icon: 'ant-design:history-outlined',
activePath: '/infra/job',
keepAlive: false,
hideInMenu: true,
},
},
{
path: '/infra/codegen/edit',
component: () => import('#/views/infra/codegen/edit/index.vue'),
name: 'InfraCodegenEdit',
meta: {
title: '生成配置修改',
icon: 'ic:baseline-view-in-ar',
activePath: '/infra/codegen',
keepAlive: true,
hideInMenu: true,
},
},
];
export default routes;

View File

@@ -0,0 +1,119 @@
import type { RouteRecordRaw } from 'vue-router';
const routes: RouteRecordRaw[] = [
{
path: '/mall/product',
name: 'ProductCenter',
meta: {
title: '商品中心',
icon: 'lucide:shopping-bag',
keepAlive: true,
hideInMenu: true,
},
children: [
{
path: 'spu/add',
name: 'ProductSpuAdd',
meta: {
title: '商品添加',
activePath: '/mall/product/spu',
},
component: () => import('#/views/mall/product/spu/modules/form.vue'),
},
{
path: String.raw`spu/edit/:id(\d+)`,
name: 'ProductSpuEdit',
meta: {
title: '商品编辑',
activePath: '/mall/product/spu',
},
component: () => import('#/views/mall/product/spu/modules/form.vue'),
},
{
path: String.raw`spu/detail/:id(\d+)`,
name: 'ProductSpuDetail',
meta: {
title: '商品详情',
activePath: '/crm/business',
},
component: () => import('#/views/mall/product/spu/modules/detail.vue'),
},
{
path: '/product/spu',
name: 'ProductSpu',
meta: {
title: '商品列表',
activePath: '/mall/product/spu',
},
component: () => import('#/views/mall/product/spu/index.vue'),
},
],
},
{
path: '/mall/trade',
name: 'TradeCenter',
meta: {
title: '交易中心',
icon: 'lucide:shopping-cart',
keepAlive: true,
hideInMenu: true,
},
children: [
{
path: String.raw`order/detail/:id(\d+)`,
name: 'TradeOrderDetail',
meta: {
title: '订单详情',
activePath: '/mall/trade/order',
},
component: () => import('#/views/mall/trade/order/detail/index.vue'),
},
{
path: String.raw`after-sale/detail/:id(\d+)`,
name: 'TradeAfterSaleDetail',
meta: {
title: '退款详情',
activePath: '/mall/trade/after-sale',
},
component: () =>
import('#/views/mall/trade/afterSale/detail/index.vue'),
},
],
},
{
path: '/diy',
name: 'DiyCenter',
meta: {
title: '营销中心',
icon: 'lucide:shopping-bag',
keepAlive: true,
hideInMenu: true,
},
children: [
{
path: String.raw`template/decorate/:id(\d+)`,
name: 'DiyTemplateDecorate',
meta: {
title: '模板装修',
activePath: '/mall/promotion/diy-template/diy-template',
},
component: () =>
import('#/views/mall/promotion/diy/template/decorate/index.vue'),
},
{
path: 'page/decorate/:id',
name: 'DiyPageDecorate',
meta: {
title: '页面装修',
noCache: false,
hidden: true,
activePath: '/mall/promotion/diy-template/diy-page',
},
component: () =>
import('#/views/mall/promotion/diy/page/decorate/index.vue'),
},
],
},
];
export default routes;

View File

@@ -0,0 +1,17 @@
import type { RouteRecordRaw } from 'vue-router';
const routes: RouteRecordRaw[] = [
{
path: '/member/user/detail',
component: () => import('#/views/member/user/detail/index.vue'),
name: 'MemberUserDetail',
meta: {
title: '会员详情',
icon: 'lucide:user',
activePath: '/member/user',
hideInMenu: true,
},
},
];
export default routes;

View File

@@ -0,0 +1,16 @@
import type { RouteRecordRaw } from 'vue-router';
const routes: RouteRecordRaw[] = [
{
path: '/pay/cashier',
component: () => import('#/views/pay/cashier/index.vue'),
name: 'PayCashier',
meta: {
title: '收银台',
icon: 'lucide:badge-japanese-yen',
hideInMenu: true,
},
},
];
export default routes;

View File

@@ -0,0 +1,16 @@
import type { RouteRecordRaw } from 'vue-router';
const routes: RouteRecordRaw[] = [
{
path: '/system/notify-message',
component: () => import('#/views/system/notify/my/index.vue'),
name: 'MyNotifyMessage',
meta: {
title: '我的站内信',
icon: 'ant-design:message-filled',
hideInMenu: true,
},
},
];
export default routes;