mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2026-02-03 20:55:59 +08:00
reafctor(projects): use new elegant-router plugin
This commit is contained in:
60
src/router/_generated/imports.ts
Normal file
60
src/router/_generated/imports.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// biome-ignore lint: disable
|
||||
// Generated by elegant-router
|
||||
// Read more: https://github.com/soybeanjs/elegant-router
|
||||
|
||||
import type { RouteFileKey, RouteLayoutKey, RawRouteComponent } from "@elegant-router/types";
|
||||
|
||||
export const layouts: Record<RouteLayoutKey, RawRouteComponent> = {
|
||||
base: () => import("@/layouts/base-layout/index.vue"),
|
||||
blank: () => import("@/layouts/blank-layout/index.vue"),
|
||||
};
|
||||
|
||||
export const views: Record<RouteFileKey, RawRouteComponent> = {
|
||||
403: () => import("@/views/(builtin)/403/index.vue"),
|
||||
404: () => import("@/views/(builtin)/404/index.vue"),
|
||||
500: () => import("@/views/(builtin)/500/index.vue"),
|
||||
About: () => import("@/views/about/index.vue"),
|
||||
AlovaRequest: () => import("@/views/alova/request/index.vue"),
|
||||
AlovaScenes: () => import("@/views/alova/scenes/index.vue"),
|
||||
FunctionMultiTab: () => import("@/views/function/multi-tab/index.vue"),
|
||||
FunctionRequest: () => import("@/views/function/request/index.vue"),
|
||||
FunctionSuperPage: () => import("@/views/function/super-page/index.vue"),
|
||||
FunctionTab: () => import("@/views/function/tab/index.vue"),
|
||||
FunctionToggleAuth: () => import("@/views/function/toggle-auth/index.vue"),
|
||||
Home: () => import("@/views/home/index.vue"),
|
||||
IframePageUrl: () => import("@/views/(builtin)/iframe-page/[url].vue"),
|
||||
Login: () => import("@/views/(builtin)/login/index.vue"),
|
||||
ManageMenu: () => import("@/views/manage/menu/index.vue"),
|
||||
ManageRole: () => import("@/views/manage/role/index.vue"),
|
||||
ManageUser: () => import("@/views/manage/user/index.vue"),
|
||||
ManageUserDetailId: () => import("@/views/manage/user-detail/[id].vue"),
|
||||
PluginBarcode: () => import("@/views/plugin/barcode/index.vue"),
|
||||
PluginChartsAntv: () => import("@/views/plugin/charts/antv/index.vue"),
|
||||
PluginChartsEcharts: () => import("@/views/plugin/charts/echarts/index.vue"),
|
||||
PluginChartsVchart: () => import("@/views/plugin/charts/vchart/index.vue"),
|
||||
PluginCopy: () => import("@/views/plugin/copy/index.vue"),
|
||||
PluginEditorMarkdown: () => import("@/views/plugin/editor/markdown/index.vue"),
|
||||
PluginEditorQuill: () => import("@/views/plugin/editor/quill/index.vue"),
|
||||
PluginExcel: () => import("@/views/plugin/excel/index.vue"),
|
||||
PluginGanttDhtmlx: () => import("@/views/plugin/gantt/dhtmlx/index.vue"),
|
||||
PluginGanttVtable: () => import("@/views/plugin/gantt/vtable/index.vue"),
|
||||
PluginIcon: () => import("@/views/plugin/icon/index.vue"),
|
||||
PluginMap: () => import("@/views/plugin/map/index.vue"),
|
||||
PluginPdf: () => import("@/views/plugin/pdf/index.vue"),
|
||||
PluginPinyin: () => import("@/views/plugin/pinyin/index.vue"),
|
||||
PluginPrint: () => import("@/views/plugin/print/index.vue"),
|
||||
PluginSwiper: () => import("@/views/plugin/swiper/index.vue"),
|
||||
PluginTablesVtable: () => import("@/views/plugin/tables/vtable/index.vue"),
|
||||
PluginTypeit: () => import("@/views/plugin/typeit/index.vue"),
|
||||
PluginVideo: () => import("@/views/plugin/video/index.vue"),
|
||||
ProNaiveConfigProvider: () => import("@/views/pro-naive/ConfigProvider.vue"),
|
||||
ProNaiveFormBasic: () => import("@/views/pro-naive/form/basic/index.vue"),
|
||||
ProNaiveFormQuery: () => import("@/views/pro-naive/form/query/index.vue"),
|
||||
ProNaiveFormStep: () => import("@/views/pro-naive/form/step/index.vue"),
|
||||
ProNaiveTableRemote: () => import("@/views/pro-naive/table/remote/index.vue"),
|
||||
ProNaiveTableRowEdit: () => import("@/views/pro-naive/table/row-edit/index.vue"),
|
||||
UserCenter: () => import("@/views/user-center/index.vue"),
|
||||
Wip: () => import("@/views/(builtin)/wip/index.vue"),
|
||||
};
|
||||
553
src/router/_generated/routes.ts
Normal file
553
src/router/_generated/routes.ts
Normal file
@@ -0,0 +1,553 @@
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// biome-ignore lint: disable
|
||||
// Generated by elegant-router
|
||||
// Read more: https://github.com/soybeanjs/elegant-router
|
||||
|
||||
import type { AutoRouterRoute } from '@elegant-router/types';
|
||||
|
||||
export const routes: AutoRouterRoute[] = [
|
||||
{
|
||||
name: 'Root',
|
||||
path: '/',
|
||||
redirect: '/home',
|
||||
meta: {
|
||||
title: "Root"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'NotFound',
|
||||
path: '/:pathMatch(.*)*',
|
||||
layout: 'base',
|
||||
component: '404',
|
||||
meta: {
|
||||
title: "NotFound"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '403',
|
||||
path: '/403',
|
||||
layout: 'base',
|
||||
component: '403',
|
||||
meta: {
|
||||
title: "403",
|
||||
constant: true
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '404',
|
||||
path: '/404',
|
||||
layout: 'base',
|
||||
component: '404',
|
||||
meta: {
|
||||
title: "404",
|
||||
constant: true
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '500',
|
||||
path: '/500',
|
||||
layout: 'base',
|
||||
component: '500',
|
||||
meta: {
|
||||
title: "500",
|
||||
constant: true
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'About',
|
||||
path: '/about',
|
||||
layout: 'base',
|
||||
component: 'About',
|
||||
meta: {
|
||||
title: "About"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'AlovaRequest',
|
||||
path: '/alova/request',
|
||||
layout: 'base',
|
||||
component: 'AlovaRequest',
|
||||
meta: {
|
||||
title: "AlovaRequest"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'AlovaScenes',
|
||||
path: '/alova/scenes',
|
||||
layout: 'base',
|
||||
component: 'AlovaScenes',
|
||||
meta: {
|
||||
title: "AlovaScenes"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'DocumentAlova',
|
||||
path: '/document/alova',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "DocumentAlova"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'DocumentAntd',
|
||||
path: '/document/antd',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "DocumentAntd"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'DocumentNaive',
|
||||
path: '/document/naive',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "DocumentNaive"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'DocumentProject',
|
||||
path: '/document/project',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "DocumentProject"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'DocumentProjectLink',
|
||||
path: '/document/project-link',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "DocumentProjectLink"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'DocumentProNaive',
|
||||
path: '/document/pro-naive',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "DocumentProNaive"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'DocumentUnocss',
|
||||
path: '/document/unocss',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "DocumentUnocss"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'DocumentVideo',
|
||||
path: '/document/video',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "DocumentVideo"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'DocumentVite',
|
||||
path: '/document/vite',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "DocumentVite"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'DocumentVue',
|
||||
path: '/document/vue',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "DocumentVue"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Exception403',
|
||||
path: '/exception/403',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "Exception403"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Exception404',
|
||||
path: '/exception/404',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "Exception404"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Exception500',
|
||||
path: '/exception/500',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "Exception500"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'FunctionMultiTab',
|
||||
path: '/function/multi-tab',
|
||||
layout: 'base',
|
||||
component: 'FunctionMultiTab',
|
||||
meta: {
|
||||
title: "FunctionMultiTab"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'FunctionRequest',
|
||||
path: '/function/request',
|
||||
layout: 'base',
|
||||
component: 'FunctionRequest',
|
||||
meta: {
|
||||
title: "FunctionRequest"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'FunctionSuperPage',
|
||||
path: '/function/super-page',
|
||||
layout: 'base',
|
||||
component: 'FunctionSuperPage',
|
||||
meta: {
|
||||
title: "FunctionSuperPage"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'FunctionTab',
|
||||
path: '/function/tab',
|
||||
layout: 'base',
|
||||
component: 'FunctionTab',
|
||||
meta: {
|
||||
title: "FunctionTab"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'FunctionToggleAuth',
|
||||
path: '/function/toggle-auth',
|
||||
layout: 'base',
|
||||
component: 'FunctionToggleAuth',
|
||||
meta: {
|
||||
title: "FunctionToggleAuth"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Home',
|
||||
path: '/home',
|
||||
layout: 'base',
|
||||
component: 'Home',
|
||||
meta: {
|
||||
title: "Home"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'IframePageUrl',
|
||||
path: '/iframe-page/:url',
|
||||
layout: 'base',
|
||||
component: 'IframePageUrl',
|
||||
meta: {
|
||||
title: "IframePageUrl"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Login',
|
||||
path: '/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?',
|
||||
layout: 'base',
|
||||
component: 'Login',
|
||||
meta: {
|
||||
title: "Login",
|
||||
constant: true
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ManageMenu',
|
||||
path: '/manage/menu',
|
||||
layout: 'base',
|
||||
component: 'ManageMenu',
|
||||
meta: {
|
||||
title: "ManageMenu"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ManageRole',
|
||||
path: '/manage/role',
|
||||
layout: 'base',
|
||||
component: 'ManageRole',
|
||||
meta: {
|
||||
title: "ManageRole"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ManageUser',
|
||||
path: '/manage/user',
|
||||
layout: 'base',
|
||||
component: 'ManageUser',
|
||||
meta: {
|
||||
title: "ManageUser"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ManageUserDetailId',
|
||||
path: '/manage/user-detail/:id',
|
||||
layout: 'base',
|
||||
component: 'ManageUserDetailId',
|
||||
meta: {
|
||||
title: "ManageUserDetailId"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginBarcode',
|
||||
path: '/plugin/barcode',
|
||||
layout: 'base',
|
||||
component: 'PluginBarcode',
|
||||
meta: {
|
||||
title: "PluginBarcode"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginChartsAntv',
|
||||
path: '/plugin/charts/antv',
|
||||
layout: 'base',
|
||||
component: 'PluginChartsAntv',
|
||||
meta: {
|
||||
title: "PluginChartsAntv"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginChartsEcharts',
|
||||
path: '/plugin/charts/echarts',
|
||||
layout: 'base',
|
||||
component: 'PluginChartsEcharts',
|
||||
meta: {
|
||||
title: "PluginChartsEcharts"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginChartsVchart',
|
||||
path: '/plugin/charts/vchart',
|
||||
layout: 'base',
|
||||
component: 'PluginChartsVchart',
|
||||
meta: {
|
||||
title: "PluginChartsVchart"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginCopy',
|
||||
path: '/plugin/copy',
|
||||
layout: 'base',
|
||||
component: 'PluginCopy',
|
||||
meta: {
|
||||
title: "PluginCopy"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginEditorMarkdown',
|
||||
path: '/plugin/editor/markdown',
|
||||
layout: 'base',
|
||||
component: 'PluginEditorMarkdown',
|
||||
meta: {
|
||||
title: "PluginEditorMarkdown"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginEditorQuill',
|
||||
path: '/plugin/editor/quill',
|
||||
layout: 'base',
|
||||
component: 'PluginEditorQuill',
|
||||
meta: {
|
||||
title: "PluginEditorQuill"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginExcel',
|
||||
path: '/plugin/excel',
|
||||
layout: 'base',
|
||||
component: 'PluginExcel',
|
||||
meta: {
|
||||
title: "PluginExcel"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginGanttDhtmlx',
|
||||
path: '/plugin/gantt/dhtmlx',
|
||||
layout: 'base',
|
||||
component: 'PluginGanttDhtmlx',
|
||||
meta: {
|
||||
title: "PluginGanttDhtmlx"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginGanttVtable',
|
||||
path: '/plugin/gantt/vtable',
|
||||
layout: 'base',
|
||||
component: 'PluginGanttVtable',
|
||||
meta: {
|
||||
title: "PluginGanttVtable"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginIcon',
|
||||
path: '/plugin/icon',
|
||||
layout: 'base',
|
||||
component: 'PluginIcon',
|
||||
meta: {
|
||||
title: "PluginIcon"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginMap',
|
||||
path: '/plugin/map',
|
||||
layout: 'base',
|
||||
component: 'PluginMap',
|
||||
meta: {
|
||||
title: "PluginMap"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginPdf',
|
||||
path: '/plugin/pdf',
|
||||
layout: 'base',
|
||||
component: 'PluginPdf',
|
||||
meta: {
|
||||
title: "PluginPdf"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginPinyin',
|
||||
path: '/plugin/pinyin',
|
||||
layout: 'base',
|
||||
component: 'PluginPinyin',
|
||||
meta: {
|
||||
title: "PluginPinyin"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginPrint',
|
||||
path: '/plugin/print',
|
||||
layout: 'base',
|
||||
component: 'PluginPrint',
|
||||
meta: {
|
||||
title: "PluginPrint"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginSwiper',
|
||||
path: '/plugin/swiper',
|
||||
layout: 'base',
|
||||
component: 'PluginSwiper',
|
||||
meta: {
|
||||
title: "PluginSwiper"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginTablesVtable',
|
||||
path: '/plugin/tables/vtable',
|
||||
layout: 'base',
|
||||
component: 'PluginTablesVtable',
|
||||
meta: {
|
||||
title: "PluginTablesVtable"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginTypeit',
|
||||
path: '/plugin/typeit',
|
||||
layout: 'base',
|
||||
component: 'PluginTypeit',
|
||||
meta: {
|
||||
title: "PluginTypeit"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PluginVideo',
|
||||
path: '/plugin/video',
|
||||
layout: 'base',
|
||||
component: 'PluginVideo',
|
||||
meta: {
|
||||
title: "PluginVideo"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ProNaiveConfigProvider',
|
||||
path: '/pro-naive/ConfigProvider',
|
||||
layout: 'base',
|
||||
component: 'ProNaiveConfigProvider',
|
||||
meta: {
|
||||
title: "ProNaiveConfigProvider"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ProNaiveFormBasic',
|
||||
path: '/pro-naive/form/basic',
|
||||
layout: 'base',
|
||||
component: 'ProNaiveFormBasic',
|
||||
meta: {
|
||||
title: "ProNaiveFormBasic"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ProNaiveFormQuery',
|
||||
path: '/pro-naive/form/query',
|
||||
layout: 'base',
|
||||
component: 'ProNaiveFormQuery',
|
||||
meta: {
|
||||
title: "ProNaiveFormQuery"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ProNaiveFormStep',
|
||||
path: '/pro-naive/form/step',
|
||||
layout: 'base',
|
||||
component: 'ProNaiveFormStep',
|
||||
meta: {
|
||||
title: "ProNaiveFormStep"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ProNaiveTableRemote',
|
||||
path: '/pro-naive/table/remote',
|
||||
layout: 'base',
|
||||
component: 'ProNaiveTableRemote',
|
||||
meta: {
|
||||
title: "ProNaiveTableRemote"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ProNaiveTableRowEdit',
|
||||
path: '/pro-naive/table/row-edit',
|
||||
layout: 'base',
|
||||
component: 'ProNaiveTableRowEdit',
|
||||
meta: {
|
||||
title: "ProNaiveTableRowEdit"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'UserCenter',
|
||||
path: '/user-center',
|
||||
layout: 'base',
|
||||
component: 'UserCenter',
|
||||
meta: {
|
||||
title: "UserCenter"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Wip',
|
||||
path: '/wip',
|
||||
layout: 'base',
|
||||
component: 'Wip',
|
||||
meta: {
|
||||
title: "Wip"
|
||||
},
|
||||
}
|
||||
];
|
||||
78
src/router/_generated/shared.ts
Normal file
78
src/router/_generated/shared.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// biome-ignore lint: disable
|
||||
// Generated by elegant-router
|
||||
// Read more: https://github.com/soybeanjs/elegant-router
|
||||
|
||||
import type { RouteKey, RoutePath, RoutePathMap } from '@elegant-router/types';
|
||||
|
||||
const routePathMap: RoutePathMap = {
|
||||
"Root": "/",
|
||||
"NotFound": "/:pathMatch(.*)*",
|
||||
"403": "/403",
|
||||
"404": "/404",
|
||||
"500": "/500",
|
||||
"About": "/about",
|
||||
"AlovaRequest": "/alova/request",
|
||||
"AlovaScenes": "/alova/scenes",
|
||||
"DocumentAlova": "/document/alova",
|
||||
"DocumentAntd": "/document/antd",
|
||||
"DocumentNaive": "/document/naive",
|
||||
"DocumentProject": "/document/project",
|
||||
"DocumentProjectLink": "/document/project-link",
|
||||
"DocumentProNaive": "/document/pro-naive",
|
||||
"DocumentUnocss": "/document/unocss",
|
||||
"DocumentVideo": "/document/video",
|
||||
"DocumentVite": "/document/vite",
|
||||
"DocumentVue": "/document/vue",
|
||||
"Exception403": "/exception/403",
|
||||
"Exception404": "/exception/404",
|
||||
"Exception500": "/exception/500",
|
||||
"FunctionMultiTab": "/function/multi-tab",
|
||||
"FunctionRequest": "/function/request",
|
||||
"FunctionSuperPage": "/function/super-page",
|
||||
"FunctionTab": "/function/tab",
|
||||
"FunctionToggleAuth": "/function/toggle-auth",
|
||||
"Home": "/home",
|
||||
"IframePageUrl": "/iframe-page/:url",
|
||||
"Login": "/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?",
|
||||
"ManageMenu": "/manage/menu",
|
||||
"ManageRole": "/manage/role",
|
||||
"ManageUser": "/manage/user",
|
||||
"ManageUserDetailId": "/manage/user-detail/:id",
|
||||
"PluginBarcode": "/plugin/barcode",
|
||||
"PluginChartsAntv": "/plugin/charts/antv",
|
||||
"PluginChartsEcharts": "/plugin/charts/echarts",
|
||||
"PluginChartsVchart": "/plugin/charts/vchart",
|
||||
"PluginCopy": "/plugin/copy",
|
||||
"PluginEditorMarkdown": "/plugin/editor/markdown",
|
||||
"PluginEditorQuill": "/plugin/editor/quill",
|
||||
"PluginExcel": "/plugin/excel",
|
||||
"PluginGanttDhtmlx": "/plugin/gantt/dhtmlx",
|
||||
"PluginGanttVtable": "/plugin/gantt/vtable",
|
||||
"PluginIcon": "/plugin/icon",
|
||||
"PluginMap": "/plugin/map",
|
||||
"PluginPdf": "/plugin/pdf",
|
||||
"PluginPinyin": "/plugin/pinyin",
|
||||
"PluginPrint": "/plugin/print",
|
||||
"PluginSwiper": "/plugin/swiper",
|
||||
"PluginTablesVtable": "/plugin/tables/vtable",
|
||||
"PluginTypeit": "/plugin/typeit",
|
||||
"PluginVideo": "/plugin/video",
|
||||
"ProNaiveConfigProvider": "/pro-naive/ConfigProvider",
|
||||
"ProNaiveFormBasic": "/pro-naive/form/basic",
|
||||
"ProNaiveFormQuery": "/pro-naive/form/query",
|
||||
"ProNaiveFormStep": "/pro-naive/form/step",
|
||||
"ProNaiveTableRemote": "/pro-naive/table/remote",
|
||||
"ProNaiveTableRowEdit": "/pro-naive/table/row-edit",
|
||||
"UserCenter": "/user-center",
|
||||
"Wip": "/wip",
|
||||
};
|
||||
|
||||
export function getRoutePath(key: RouteKey) {
|
||||
return routePathMap[key];
|
||||
}
|
||||
|
||||
export function getRouteName(path: RoutePath) {
|
||||
return Object.keys(routePathMap).find(key => routePathMap[key as RouteKey] === path) as RouteKey;
|
||||
}
|
||||
69
src/router/_generated/transformer.ts
Normal file
69
src/router/_generated/transformer.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// biome-ignore lint: disable
|
||||
// Generated by elegant-router
|
||||
// Read more: https://github.com/soybeanjs/elegant-router
|
||||
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
import type {
|
||||
AutoRouterRedirect,
|
||||
AutoRouterRoute,
|
||||
AutoRouterSingleView,
|
||||
RawRouteComponent,
|
||||
RouteFileKey,
|
||||
RouteLayoutKey
|
||||
} from '@elegant-router/types';
|
||||
|
||||
export function transformToVueRoutes(
|
||||
routes: AutoRouterRoute[],
|
||||
layouts: Record<RouteLayoutKey, RawRouteComponent>,
|
||||
views: Record<RouteFileKey, RawRouteComponent>
|
||||
) {
|
||||
const { redirects, groupedRoutes } = getFormattedRoutes(routes);
|
||||
|
||||
const vueRoutes: RouteRecordRaw[] = [...redirects];
|
||||
|
||||
groupedRoutes.forEach((items, layout) => {
|
||||
const layoutRoute: RouteRecordRaw = {
|
||||
path: `/${layout}-layout`,
|
||||
component: layouts[layout],
|
||||
children: items.map(item => {
|
||||
const { layout: _, component, ...rest } = item;
|
||||
|
||||
return {
|
||||
component: views[component],
|
||||
...rest
|
||||
};
|
||||
})
|
||||
};
|
||||
|
||||
vueRoutes.push(layoutRoute);
|
||||
});
|
||||
|
||||
return vueRoutes;
|
||||
}
|
||||
|
||||
function getFormattedRoutes(routes: AutoRouterRoute[]) {
|
||||
const groupedRoutes = new Map<RouteLayoutKey, AutoRouterSingleView[]>();
|
||||
const redirects: AutoRouterRedirect[] = [];
|
||||
|
||||
routes.forEach(route => {
|
||||
if (isAutoRouterRedirect(route)) {
|
||||
redirects.push(route);
|
||||
return;
|
||||
}
|
||||
|
||||
const items = groupedRoutes.get(route.layout) || [];
|
||||
items.push(route);
|
||||
groupedRoutes.set(route.layout, items);
|
||||
});
|
||||
|
||||
return {
|
||||
redirects,
|
||||
groupedRoutes
|
||||
};
|
||||
}
|
||||
|
||||
function isAutoRouterRedirect(route: AutoRouterRoute): route is AutoRouterRedirect {
|
||||
return 'redirect' in route;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// Generated by elegant-router
|
||||
// Read more: https://github.com/soybeanjs/elegant-router
|
||||
|
||||
import type { RouteComponent } from "vue-router";
|
||||
import type { LastLevelRouteKey, RouteLayout } from "@elegant-router/types";
|
||||
|
||||
import BaseLayout from "@/layouts/base-layout/index.vue";
|
||||
import BlankLayout from "@/layouts/blank-layout/index.vue";
|
||||
|
||||
export const layouts: Record<RouteLayout, RouteComponent | (() => Promise<RouteComponent>)> = {
|
||||
base: BaseLayout,
|
||||
blank: BlankLayout,
|
||||
};
|
||||
|
||||
export const views: Record<LastLevelRouteKey, RouteComponent | (() => Promise<RouteComponent>)> = {
|
||||
403: () => import("@/views/_builtin/403/index.vue"),
|
||||
404: () => import("@/views/_builtin/404/index.vue"),
|
||||
500: () => import("@/views/_builtin/500/index.vue"),
|
||||
"iframe-page": () => import("@/views/_builtin/iframe-page/[url].vue"),
|
||||
login: () => import("@/views/_builtin/login/index.vue"),
|
||||
home: () => import("@/views/home/index.vue"),
|
||||
};
|
||||
@@ -1,78 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// Generated by elegant-router
|
||||
// Read more: https://github.com/soybeanjs/elegant-router
|
||||
|
||||
import type { GeneratedRoute } from '@elegant-router/types';
|
||||
|
||||
export const generatedRoutes: GeneratedRoute[] = [
|
||||
{
|
||||
name: '403',
|
||||
path: '/403',
|
||||
component: 'layout.blank$view.403',
|
||||
meta: {
|
||||
title: '403',
|
||||
i18nKey: 'route.403',
|
||||
constant: true,
|
||||
hideInMenu: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '404',
|
||||
path: '/404',
|
||||
component: 'layout.blank$view.404',
|
||||
meta: {
|
||||
title: '404',
|
||||
i18nKey: 'route.404',
|
||||
constant: true,
|
||||
hideInMenu: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '500',
|
||||
path: '/500',
|
||||
component: 'layout.blank$view.500',
|
||||
meta: {
|
||||
title: '500',
|
||||
i18nKey: 'route.500',
|
||||
constant: true,
|
||||
hideInMenu: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'home',
|
||||
path: '/home',
|
||||
component: 'layout.base$view.home',
|
||||
meta: {
|
||||
title: 'home',
|
||||
i18nKey: 'route.home',
|
||||
icon: 'mdi:monitor-dashboard',
|
||||
order: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'iframe-page',
|
||||
path: '/iframe-page/:url',
|
||||
component: 'layout.base$view.iframe-page',
|
||||
props: true,
|
||||
meta: {
|
||||
title: 'iframe-page',
|
||||
i18nKey: 'route.iframe-page',
|
||||
constant: true,
|
||||
hideInMenu: true,
|
||||
keepAlive: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'login',
|
||||
path: '/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?',
|
||||
component: 'layout.blank$view.login',
|
||||
props: true,
|
||||
meta: {
|
||||
title: 'login',
|
||||
i18nKey: 'route.login',
|
||||
constant: true,
|
||||
hideInMenu: true
|
||||
}
|
||||
}
|
||||
];
|
||||
@@ -1,192 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// Generated by elegant-router
|
||||
// Read more: https://github.com/soybeanjs/elegant-router
|
||||
|
||||
import type { RouteRecordRaw, RouteComponent } from 'vue-router';
|
||||
import type { ElegantConstRoute } from '@elegant-router/vue';
|
||||
import type { RouteMap, RouteKey, RoutePath } from '@elegant-router/types';
|
||||
|
||||
/**
|
||||
* transform elegant const routes to vue routes
|
||||
* @param routes elegant const routes
|
||||
* @param layouts layout components
|
||||
* @param views view components
|
||||
*/
|
||||
export function transformElegantRoutesToVueRoutes(
|
||||
routes: ElegantConstRoute[],
|
||||
layouts: Record<string, RouteComponent | (() => Promise<RouteComponent>)>,
|
||||
views: Record<string, RouteComponent | (() => Promise<RouteComponent>)>
|
||||
) {
|
||||
return routes.flatMap(route => transformElegantRouteToVueRoute(route, layouts, views));
|
||||
}
|
||||
|
||||
/**
|
||||
* transform elegant route to vue route
|
||||
* @param route elegant const route
|
||||
* @param layouts layout components
|
||||
* @param views view components
|
||||
*/
|
||||
function transformElegantRouteToVueRoute(
|
||||
route: ElegantConstRoute,
|
||||
layouts: Record<string, RouteComponent | (() => Promise<RouteComponent>)>,
|
||||
views: Record<string, RouteComponent | (() => Promise<RouteComponent>)>
|
||||
) {
|
||||
const LAYOUT_PREFIX = 'layout.';
|
||||
const VIEW_PREFIX = 'view.';
|
||||
const ROUTE_DEGREE_SPLITTER = '_';
|
||||
const FIRST_LEVEL_ROUTE_COMPONENT_SPLIT = '$';
|
||||
|
||||
function isLayout(component: string) {
|
||||
return component.startsWith(LAYOUT_PREFIX);
|
||||
}
|
||||
|
||||
function getLayoutName(component: string) {
|
||||
const layout = component.replace(LAYOUT_PREFIX, '');
|
||||
|
||||
if(!layouts[layout]) {
|
||||
throw new Error(`Layout component "${layout}" not found`);
|
||||
}
|
||||
|
||||
return layout;
|
||||
}
|
||||
|
||||
function isView(component: string) {
|
||||
return component.startsWith(VIEW_PREFIX);
|
||||
}
|
||||
|
||||
function getViewName(component: string) {
|
||||
const view = component.replace(VIEW_PREFIX, '');
|
||||
|
||||
if(!views[view]) {
|
||||
throw new Error(`View component "${view}" not found`);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
function isFirstLevelRoute(item: ElegantConstRoute) {
|
||||
return !item.name.includes(ROUTE_DEGREE_SPLITTER);
|
||||
}
|
||||
|
||||
function isSingleLevelRoute(item: ElegantConstRoute) {
|
||||
return isFirstLevelRoute(item) && !item.children?.length;
|
||||
}
|
||||
|
||||
function getSingleLevelRouteComponent(component: string) {
|
||||
const [layout, view] = component.split(FIRST_LEVEL_ROUTE_COMPONENT_SPLIT);
|
||||
|
||||
return {
|
||||
layout: getLayoutName(layout),
|
||||
view: getViewName(view)
|
||||
};
|
||||
}
|
||||
|
||||
const vueRoutes: RouteRecordRaw[] = [];
|
||||
|
||||
// add props: true to route
|
||||
if (route.path.includes(':') && !route.props) {
|
||||
route.props = true;
|
||||
}
|
||||
|
||||
const { name, path, component, children, ...rest } = route;
|
||||
|
||||
const vueRoute = { name, path, ...rest } as RouteRecordRaw;
|
||||
|
||||
try {
|
||||
if (component) {
|
||||
if (isSingleLevelRoute(route)) {
|
||||
const { layout, view } = getSingleLevelRouteComponent(component);
|
||||
|
||||
const singleLevelRoute: RouteRecordRaw = {
|
||||
path,
|
||||
component: layouts[layout],
|
||||
meta: {
|
||||
title: route.meta?.title || ''
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name,
|
||||
path: '',
|
||||
component: views[view],
|
||||
...rest
|
||||
} as RouteRecordRaw
|
||||
]
|
||||
};
|
||||
|
||||
return [singleLevelRoute];
|
||||
}
|
||||
|
||||
if (isLayout(component)) {
|
||||
const layoutName = getLayoutName(component);
|
||||
|
||||
vueRoute.component = layouts[layoutName];
|
||||
}
|
||||
|
||||
if (isView(component)) {
|
||||
const viewName = getViewName(component);
|
||||
|
||||
vueRoute.component = views[viewName];
|
||||
}
|
||||
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error(`Error transforming route "${route.name}": ${error.toString()}`);
|
||||
return [];
|
||||
}
|
||||
|
||||
// add redirect to child
|
||||
if (children?.length && !vueRoute.redirect) {
|
||||
vueRoute.redirect = {
|
||||
name: children[0].name
|
||||
};
|
||||
}
|
||||
|
||||
if (children?.length) {
|
||||
const childRoutes = children.flatMap(child => transformElegantRouteToVueRoute(child, layouts, views));
|
||||
|
||||
if(isFirstLevelRoute(route)) {
|
||||
vueRoute.children = childRoutes;
|
||||
} else {
|
||||
vueRoutes.push(...childRoutes);
|
||||
}
|
||||
}
|
||||
|
||||
vueRoutes.unshift(vueRoute);
|
||||
|
||||
return vueRoutes;
|
||||
}
|
||||
|
||||
/**
|
||||
* map of route name and route path
|
||||
*/
|
||||
const routeMap: RouteMap = {
|
||||
"root": "/",
|
||||
"not-found": "/:pathMatch(.*)*",
|
||||
"403": "/403",
|
||||
"404": "/404",
|
||||
"500": "/500",
|
||||
"home": "/home",
|
||||
"iframe-page": "/iframe-page/:url",
|
||||
"login": "/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?"
|
||||
};
|
||||
|
||||
/**
|
||||
* get route path by route name
|
||||
* @param name route name
|
||||
*/
|
||||
export function getRoutePath<T extends RouteKey>(name: T) {
|
||||
return routeMap[name];
|
||||
}
|
||||
|
||||
/**
|
||||
* get route name by route path
|
||||
* @param path route path
|
||||
*/
|
||||
export function getRouteName(path: RoutePath) {
|
||||
const routeEntries = Object.entries(routeMap) as [RouteKey, RoutePath][];
|
||||
|
||||
const routeName: RouteKey | null = routeEntries.find(([, routePath]) => routePath === path)?.[0] || null;
|
||||
|
||||
return routeName;
|
||||
}
|
||||
231
src/typings/elegant-router.d.ts
vendored
231
src/typings/elegant-router.d.ts
vendored
@@ -1,240 +1,95 @@
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// biome-ignore lint: disable
|
||||
// Generated by elegant-router
|
||||
// Read more: https://github.com/soybeanjs/elegant-router
|
||||
|
||||
declare module "@elegant-router/types" {
|
||||
type ElegantConstRoute = import('@elegant-router/vue').ElegantConstRoute;
|
||||
type RouteRecordSingleView = import("vue-router").RouteRecordSingleView;
|
||||
type RouteRecordRedirect = import("vue-router").RouteRecordRedirect;
|
||||
type RouteComponent = import("vue-router").RouteComponent;
|
||||
|
||||
type Lazy<T> = () => Promise<T>;
|
||||
|
||||
export type RawRouteComponent = RouteComponent | Lazy<RouteComponent>;
|
||||
|
||||
/**
|
||||
* route layout
|
||||
* route layout key
|
||||
*/
|
||||
export type RouteLayout = "base" | "blank";
|
||||
export type RouteLayoutKey = "base" | "blank";
|
||||
|
||||
/**
|
||||
* route map
|
||||
* route path map
|
||||
*/
|
||||
export type RouteMap = {
|
||||
"root": "/";
|
||||
"not-found": "/:pathMatch(.*)*";
|
||||
export type RoutePathMap = {
|
||||
"Root": "/";
|
||||
"NotFound": "/:pathMatch(.*)*";
|
||||
"403": "/403";
|
||||
"404": "/404";
|
||||
"500": "/500";
|
||||
"home": "/home";
|
||||
"iframe-page": "/iframe-page/:url";
|
||||
"login": "/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?";
|
||||
"Home": "/home";
|
||||
"IframeUrl": "/iframe/:url";
|
||||
"Login": "/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?";
|
||||
"Wip": "/wip";
|
||||
};
|
||||
|
||||
/**
|
||||
* route key
|
||||
*/
|
||||
export type RouteKey = keyof RouteMap;
|
||||
export type RouteKey = keyof RoutePathMap;
|
||||
|
||||
/**
|
||||
* route path
|
||||
*/
|
||||
export type RoutePath = RouteMap[RouteKey];
|
||||
export type RoutePath = RoutePathMap[RouteKey];
|
||||
|
||||
/**
|
||||
* custom route key
|
||||
* root route key
|
||||
*/
|
||||
export type CustomRouteKey = Extract<
|
||||
RouteKey,
|
||||
| "root"
|
||||
| "not-found"
|
||||
>;
|
||||
export type RootRouteKey = 'Root';
|
||||
|
||||
/**
|
||||
* the generated route key
|
||||
* not found route key
|
||||
*/
|
||||
export type GeneratedRouteKey = Exclude<RouteKey, CustomRouteKey>;
|
||||
export type NotFoundRouteKey = 'NotFound';
|
||||
|
||||
/**
|
||||
* the first level route key, which contain the layout of the route
|
||||
* builtin route key
|
||||
*/
|
||||
export type FirstLevelRouteKey = Extract<
|
||||
RouteKey,
|
||||
| "403"
|
||||
| "404"
|
||||
| "500"
|
||||
| "home"
|
||||
| "iframe-page"
|
||||
| "login"
|
||||
>;
|
||||
export type BuiltinRouteKey = RootRouteKey | NotFoundRouteKey;
|
||||
|
||||
/**
|
||||
* the custom first level route key
|
||||
* reuse route key
|
||||
*/
|
||||
export type CustomFirstLevelRouteKey = Extract<
|
||||
CustomRouteKey,
|
||||
| "root"
|
||||
| "not-found"
|
||||
>;
|
||||
export type ReuseRouteKey = never;
|
||||
|
||||
/**
|
||||
* the last level route key, which has the page file
|
||||
* the route file key, which has it's own file
|
||||
*/
|
||||
export type LastLevelRouteKey = Extract<
|
||||
RouteKey,
|
||||
| "403"
|
||||
| "404"
|
||||
| "500"
|
||||
| "iframe-page"
|
||||
| "login"
|
||||
| "home"
|
||||
>;
|
||||
export type RouteFileKey = Exclude<RouteKey, BuiltinRouteKey | ReuseRouteKey>;
|
||||
|
||||
/**
|
||||
* the custom last level route key
|
||||
* mapped name and path
|
||||
*/
|
||||
export type CustomLastLevelRouteKey = Extract<
|
||||
CustomRouteKey,
|
||||
| "root"
|
||||
| "not-found"
|
||||
>;
|
||||
type MappedNamePath = {
|
||||
[K in RouteKey]: { name: K; path: RoutePathMap[K] };
|
||||
}[RouteKey];
|
||||
|
||||
/**
|
||||
* the single level route key
|
||||
* auto router single view
|
||||
*/
|
||||
export type SingleLevelRouteKey = FirstLevelRouteKey & LastLevelRouteKey;
|
||||
export type AutoRouterSingleView = Omit<RouteRecordSingleView, 'component' | 'name' | 'path'> & {
|
||||
component: RouteFileKey;
|
||||
layout: RouteLayoutKey;
|
||||
} & MappedNamePath;
|
||||
|
||||
/**
|
||||
* the custom single level route key
|
||||
* auto router redirect
|
||||
*/
|
||||
export type CustomSingleLevelRouteKey = CustomFirstLevelRouteKey & CustomLastLevelRouteKey;
|
||||
export type AutoRouterRedirect = Omit<RouteRecordRedirect, 'children' | 'name' | 'path'> & MappedNamePath;
|
||||
|
||||
/**
|
||||
* the first level route key, but not the single level
|
||||
*/
|
||||
export type FirstLevelRouteNotSingleKey = Exclude<FirstLevelRouteKey, SingleLevelRouteKey>;
|
||||
|
||||
/**
|
||||
* the custom first level route key, but not the single level
|
||||
* auto router route
|
||||
*/
|
||||
export type CustomFirstLevelRouteNotSingleKey = Exclude<CustomFirstLevelRouteKey, CustomSingleLevelRouteKey>;
|
||||
|
||||
/**
|
||||
* the center level route key
|
||||
*/
|
||||
export type CenterLevelRouteKey = Exclude<GeneratedRouteKey, FirstLevelRouteKey | LastLevelRouteKey>;
|
||||
|
||||
/**
|
||||
* the custom center level route key
|
||||
*/
|
||||
export type CustomCenterLevelRouteKey = Exclude<CustomRouteKey, CustomFirstLevelRouteKey | CustomLastLevelRouteKey>;
|
||||
|
||||
/**
|
||||
* the center level route key
|
||||
*/
|
||||
type GetChildRouteKey<K extends RouteKey, T extends RouteKey = RouteKey> = T extends `${K}_${infer R}`
|
||||
? R extends `${string}_${string}`
|
||||
? never
|
||||
: T
|
||||
: never;
|
||||
|
||||
/**
|
||||
* the single level route
|
||||
*/
|
||||
type SingleLevelRoute<K extends SingleLevelRouteKey = SingleLevelRouteKey> = K extends string
|
||||
? Omit<ElegantConstRoute, 'children'> & {
|
||||
name: K;
|
||||
path: RouteMap[K];
|
||||
component: `layout.${RouteLayout}$view.${K}`;
|
||||
}
|
||||
: never;
|
||||
|
||||
/**
|
||||
* the last level route
|
||||
*/
|
||||
type LastLevelRoute<K extends GeneratedRouteKey> = K extends LastLevelRouteKey
|
||||
? Omit<ElegantConstRoute, 'children'> & {
|
||||
name: K;
|
||||
path: RouteMap[K];
|
||||
component: `view.${K}`;
|
||||
}
|
||||
: never;
|
||||
|
||||
/**
|
||||
* the center level route
|
||||
*/
|
||||
type CenterLevelRoute<K extends GeneratedRouteKey> = K extends CenterLevelRouteKey
|
||||
? Omit<ElegantConstRoute, 'component'> & {
|
||||
name: K;
|
||||
path: RouteMap[K];
|
||||
children: (CenterLevelRoute<GetChildRouteKey<K>> | LastLevelRoute<GetChildRouteKey<K>>)[];
|
||||
}
|
||||
: never;
|
||||
|
||||
/**
|
||||
* the multi level route
|
||||
*/
|
||||
type MultiLevelRoute<K extends FirstLevelRouteNotSingleKey = FirstLevelRouteNotSingleKey> = K extends string
|
||||
? ElegantConstRoute & {
|
||||
name: K;
|
||||
path: RouteMap[K];
|
||||
component: `layout.${RouteLayout}`;
|
||||
children: (CenterLevelRoute<GetChildRouteKey<K>> | LastLevelRoute<GetChildRouteKey<K>>)[];
|
||||
}
|
||||
: never;
|
||||
|
||||
/**
|
||||
* the custom first level route
|
||||
*/
|
||||
type CustomSingleLevelRoute<K extends CustomFirstLevelRouteKey = CustomFirstLevelRouteKey> = K extends string
|
||||
? Omit<ElegantConstRoute, 'children'> & {
|
||||
name: K;
|
||||
path: RouteMap[K];
|
||||
component?: `layout.${RouteLayout}$view.${LastLevelRouteKey}`;
|
||||
}
|
||||
: never;
|
||||
|
||||
/**
|
||||
* the custom last level route
|
||||
*/
|
||||
type CustomLastLevelRoute<K extends CustomRouteKey> = K extends CustomLastLevelRouteKey
|
||||
? Omit<ElegantConstRoute, 'children'> & {
|
||||
name: K;
|
||||
path: RouteMap[K];
|
||||
component?: `view.${LastLevelRouteKey}`;
|
||||
}
|
||||
: never;
|
||||
|
||||
/**
|
||||
* the custom center level route
|
||||
*/
|
||||
type CustomCenterLevelRoute<K extends CustomRouteKey> = K extends CustomCenterLevelRouteKey
|
||||
? Omit<ElegantConstRoute, 'component'> & {
|
||||
name: K;
|
||||
path: RouteMap[K];
|
||||
children: (CustomCenterLevelRoute<GetChildRouteKey<K>> | CustomLastLevelRoute<GetChildRouteKey<K>>)[];
|
||||
}
|
||||
: never;
|
||||
|
||||
/**
|
||||
* the custom multi level route
|
||||
*/
|
||||
type CustomMultiLevelRoute<K extends CustomFirstLevelRouteNotSingleKey = CustomFirstLevelRouteNotSingleKey> =
|
||||
K extends string
|
||||
? ElegantConstRoute & {
|
||||
name: K;
|
||||
path: RouteMap[K];
|
||||
component: `layout.${RouteLayout}`;
|
||||
children: (CustomCenterLevelRoute<GetChildRouteKey<K>> | CustomLastLevelRoute<GetChildRouteKey<K>>)[];
|
||||
}
|
||||
: never;
|
||||
|
||||
/**
|
||||
* the custom route
|
||||
*/
|
||||
type CustomRoute = CustomSingleLevelRoute | CustomMultiLevelRoute;
|
||||
|
||||
/**
|
||||
* the generated route
|
||||
*/
|
||||
type GeneratedRoute = SingleLevelRoute | MultiLevelRoute;
|
||||
|
||||
/**
|
||||
* the elegant route
|
||||
*/
|
||||
type ElegantRoute = GeneratedRoute | CustomRoute;
|
||||
export type AutoRouterRoute = AutoRouterSingleView | AutoRouterRedirect;
|
||||
}
|
||||
|
||||
4
src/typings/router.d.ts
vendored
4
src/typings/router.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
import 'vue-router';
|
||||
export {};
|
||||
|
||||
declare module 'vue-router' {
|
||||
interface RouteMeta {
|
||||
export interface RouteMeta {
|
||||
/**
|
||||
* Title of the route
|
||||
*
|
||||
|
||||
86
src/typings/typed-router.d.ts
vendored
Normal file
86
src/typings/typed-router.d.ts
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
/* prettier-ignore */
|
||||
// biome-ignore lint: disable
|
||||
// Generated by elegant-router
|
||||
// Read more: https://github.com/soybeanjs/elegant-router
|
||||
|
||||
export {}
|
||||
|
||||
declare module "vue-router" {
|
||||
type RouteNamedMap = import("vue-router/auto-routes").RouteNamedMap;
|
||||
|
||||
export interface TypesConfig {
|
||||
RouteNamedMap: RouteNamedMap;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "vue-router/auto-routes" {
|
||||
import type { RouteParamsRawGeneric, RouteParamsGeneric, RouteMeta, RouteRecordInfo, ParamValue, ParamValueZeroOrOne } from "vue-router";
|
||||
|
||||
/**
|
||||
* route named map
|
||||
*/
|
||||
export interface RouteNamedMap {
|
||||
"Root": RouteRecordInfo<"Root", "/", Record<never, never>, Record<never, never>>;
|
||||
"NotFound": RouteRecordInfo<"NotFound", "/:pathMatch(.*)*", Record<never, never>, Record<never, never>>;
|
||||
"403": RouteRecordInfo<"403", "/403", Record<never, never>, Record<never, never>>;
|
||||
"404": RouteRecordInfo<"404", "/404", Record<never, never>, Record<never, never>>;
|
||||
"500": RouteRecordInfo<"500", "/500", Record<never, never>, Record<never, never>>;
|
||||
"About": RouteRecordInfo<"About", "/about", Record<never, never>, Record<never, never>>;
|
||||
"AlovaRequest": RouteRecordInfo<"AlovaRequest", "/alova/request", Record<never, never>, Record<never, never>>;
|
||||
"AlovaScenes": RouteRecordInfo<"AlovaScenes", "/alova/scenes", Record<never, never>, Record<never, never>>;
|
||||
"DocumentAlova": RouteRecordInfo<"DocumentAlova", "/document/alova", Record<never, never>, Record<never, never>>;
|
||||
"DocumentAntd": RouteRecordInfo<"DocumentAntd", "/document/antd", Record<never, never>, Record<never, never>>;
|
||||
"DocumentNaive": RouteRecordInfo<"DocumentNaive", "/document/naive", Record<never, never>, Record<never, never>>;
|
||||
"DocumentProject": RouteRecordInfo<"DocumentProject", "/document/project", Record<never, never>, Record<never, never>>;
|
||||
"DocumentProjectLink": RouteRecordInfo<"DocumentProjectLink", "/document/project-link", Record<never, never>, Record<never, never>>;
|
||||
"DocumentProNaive": RouteRecordInfo<"DocumentProNaive", "/document/pro-naive", Record<never, never>, Record<never, never>>;
|
||||
"DocumentUnocss": RouteRecordInfo<"DocumentUnocss", "/document/unocss", Record<never, never>, Record<never, never>>;
|
||||
"DocumentVideo": RouteRecordInfo<"DocumentVideo", "/document/video", Record<never, never>, Record<never, never>>;
|
||||
"DocumentVite": RouteRecordInfo<"DocumentVite", "/document/vite", Record<never, never>, Record<never, never>>;
|
||||
"DocumentVue": RouteRecordInfo<"DocumentVue", "/document/vue", Record<never, never>, Record<never, never>>;
|
||||
"Exception403": RouteRecordInfo<"Exception403", "/exception/403", Record<never, never>, Record<never, never>>;
|
||||
"Exception404": RouteRecordInfo<"Exception404", "/exception/404", Record<never, never>, Record<never, never>>;
|
||||
"Exception500": RouteRecordInfo<"Exception500", "/exception/500", Record<never, never>, Record<never, never>>;
|
||||
"FunctionMultiTab": RouteRecordInfo<"FunctionMultiTab", "/function/multi-tab", Record<never, never>, Record<never, never>>;
|
||||
"FunctionRequest": RouteRecordInfo<"FunctionRequest", "/function/request", Record<never, never>, Record<never, never>>;
|
||||
"FunctionSuperPage": RouteRecordInfo<"FunctionSuperPage", "/function/super-page", Record<never, never>, Record<never, never>>;
|
||||
"FunctionTab": RouteRecordInfo<"FunctionTab", "/function/tab", Record<never, never>, Record<never, never>>;
|
||||
"FunctionToggleAuth": RouteRecordInfo<"FunctionToggleAuth", "/function/toggle-auth", Record<never, never>, Record<never, never>>;
|
||||
"Home": RouteRecordInfo<"Home", "/home", Record<never, never>, Record<never, never>>;
|
||||
"IframePageUrl": RouteRecordInfo<"IframePageUrl", "/iframe-page/:url", { url: ParamValue<true> }, { url: ParamValue<false> }>;
|
||||
"Login": RouteRecordInfo<"Login", "/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?", { module?: ParamValueZeroOrOne<true> }, { module?: ParamValueZeroOrOne<false> }>;
|
||||
"ManageMenu": RouteRecordInfo<"ManageMenu", "/manage/menu", Record<never, never>, Record<never, never>>;
|
||||
"ManageRole": RouteRecordInfo<"ManageRole", "/manage/role", Record<never, never>, Record<never, never>>;
|
||||
"ManageUser": RouteRecordInfo<"ManageUser", "/manage/user", Record<never, never>, Record<never, never>>;
|
||||
"ManageUserDetailId": RouteRecordInfo<"ManageUserDetailId", "/manage/user-detail/:id", { id: ParamValue<true> }, { id: ParamValue<false> }>;
|
||||
"PluginBarcode": RouteRecordInfo<"PluginBarcode", "/plugin/barcode", Record<never, never>, Record<never, never>>;
|
||||
"PluginChartsAntv": RouteRecordInfo<"PluginChartsAntv", "/plugin/charts/antv", Record<never, never>, Record<never, never>>;
|
||||
"PluginChartsEcharts": RouteRecordInfo<"PluginChartsEcharts", "/plugin/charts/echarts", Record<never, never>, Record<never, never>>;
|
||||
"PluginChartsVchart": RouteRecordInfo<"PluginChartsVchart", "/plugin/charts/vchart", Record<never, never>, Record<never, never>>;
|
||||
"PluginCopy": RouteRecordInfo<"PluginCopy", "/plugin/copy", Record<never, never>, Record<never, never>>;
|
||||
"PluginEditorMarkdown": RouteRecordInfo<"PluginEditorMarkdown", "/plugin/editor/markdown", Record<never, never>, Record<never, never>>;
|
||||
"PluginEditorQuill": RouteRecordInfo<"PluginEditorQuill", "/plugin/editor/quill", Record<never, never>, Record<never, never>>;
|
||||
"PluginExcel": RouteRecordInfo<"PluginExcel", "/plugin/excel", Record<never, never>, Record<never, never>>;
|
||||
"PluginGanttDhtmlx": RouteRecordInfo<"PluginGanttDhtmlx", "/plugin/gantt/dhtmlx", Record<never, never>, Record<never, never>>;
|
||||
"PluginGanttVtable": RouteRecordInfo<"PluginGanttVtable", "/plugin/gantt/vtable", Record<never, never>, Record<never, never>>;
|
||||
"PluginIcon": RouteRecordInfo<"PluginIcon", "/plugin/icon", Record<never, never>, Record<never, never>>;
|
||||
"PluginMap": RouteRecordInfo<"PluginMap", "/plugin/map", Record<never, never>, Record<never, never>>;
|
||||
"PluginPdf": RouteRecordInfo<"PluginPdf", "/plugin/pdf", Record<never, never>, Record<never, never>>;
|
||||
"PluginPinyin": RouteRecordInfo<"PluginPinyin", "/plugin/pinyin", Record<never, never>, Record<never, never>>;
|
||||
"PluginPrint": RouteRecordInfo<"PluginPrint", "/plugin/print", Record<never, never>, Record<never, never>>;
|
||||
"PluginSwiper": RouteRecordInfo<"PluginSwiper", "/plugin/swiper", Record<never, never>, Record<never, never>>;
|
||||
"PluginTablesVtable": RouteRecordInfo<"PluginTablesVtable", "/plugin/tables/vtable", Record<never, never>, Record<never, never>>;
|
||||
"PluginTypeit": RouteRecordInfo<"PluginTypeit", "/plugin/typeit", Record<never, never>, Record<never, never>>;
|
||||
"PluginVideo": RouteRecordInfo<"PluginVideo", "/plugin/video", Record<never, never>, Record<never, never>>;
|
||||
"ProNaiveConfigProvider": RouteRecordInfo<"ProNaiveConfigProvider", "/pro-naive/ConfigProvider", Record<never, never>, Record<never, never>>;
|
||||
"ProNaiveFormBasic": RouteRecordInfo<"ProNaiveFormBasic", "/pro-naive/form/basic", Record<never, never>, Record<never, never>>;
|
||||
"ProNaiveFormQuery": RouteRecordInfo<"ProNaiveFormQuery", "/pro-naive/form/query", Record<never, never>, Record<never, never>>;
|
||||
"ProNaiveFormStep": RouteRecordInfo<"ProNaiveFormStep", "/pro-naive/form/step", Record<never, never>, Record<never, never>>;
|
||||
"ProNaiveTableRemote": RouteRecordInfo<"ProNaiveTableRemote", "/pro-naive/table/remote", Record<never, never>, Record<never, never>>;
|
||||
"ProNaiveTableRowEdit": RouteRecordInfo<"ProNaiveTableRowEdit", "/pro-naive/table/row-edit", Record<never, never>, Record<never, never>>;
|
||||
"UserCenter": RouteRecordInfo<"UserCenter", "/user-center", Record<never, never>, Record<never, never>>;
|
||||
"Wip": RouteRecordInfo<"Wip", "/wip", Record<never, never>, Record<never, never>>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user