mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
refactor(projects): 路由声明重构,添加composables,BaseLayout进行中,文件夹规范
This commit is contained in:
1
src/interface/business/index.ts
Normal file
1
src/interface/business/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './auth';
|
@ -1,40 +0,0 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
import type { MenuOption } from 'naive-ui';
|
||||
import { EnumRoutePath, EnumLoginModule } from '@/enum';
|
||||
|
||||
/** 路由描述 */
|
||||
interface RouteMeta {
|
||||
/** 路由名称 */
|
||||
title?: string;
|
||||
/** 缓存页面 */
|
||||
keepAlive?: boolean;
|
||||
/** 页面100%视高 */
|
||||
fullPage?: boolean;
|
||||
/** 不作为菜单 */
|
||||
isNotMenu?: boolean;
|
||||
/** 菜单和面包屑对应的图标 */
|
||||
icon?: string;
|
||||
/** 路由作为菜单时的排序 */
|
||||
order?: number;
|
||||
}
|
||||
|
||||
/** 路由配置 */
|
||||
export type CustomRoute = RouteRecordRaw & { meta: RouteMeta };
|
||||
|
||||
/** 路由路径 */
|
||||
export type RoutePathKey = keyof typeof EnumRoutePath;
|
||||
|
||||
/** 菜单项配置 */
|
||||
export type GlobalMenuOption = MenuOption & {
|
||||
routeName: string;
|
||||
routePath: string;
|
||||
};
|
||||
|
||||
/** 登录模块 */
|
||||
export type LoginModuleType = keyof typeof EnumLoginModule;
|
||||
|
||||
/** npm依赖包版本信息 */
|
||||
export interface VersionInfo {
|
||||
name: string;
|
||||
version: string;
|
||||
}
|
2
src/interface/common/index.ts
Normal file
2
src/interface/common/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './system';
|
||||
export * from './route';
|
55
src/interface/common/route.ts
Normal file
55
src/interface/common/route.ts
Normal file
@ -0,0 +1,55 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
/** 路由描述 */
|
||||
interface RouteMeta {
|
||||
/** 路由名称 */
|
||||
title?: string;
|
||||
/** 缓存页面 */
|
||||
keepAlive?: boolean;
|
||||
/** 页面100%视高 */
|
||||
fullPage?: boolean;
|
||||
/** 不作为菜单 */
|
||||
isNotMenu?: boolean;
|
||||
/** 菜单和面包屑对应的图标 */
|
||||
icon?: string;
|
||||
/** 路由作为菜单时的排序 */
|
||||
order?: number;
|
||||
}
|
||||
|
||||
/** 路由配置 */
|
||||
export type CustomRoute = RouteRecordRaw & { meta: RouteMeta };
|
||||
|
||||
/** 路由声明的key */
|
||||
export type RouteKey =
|
||||
| 'root'
|
||||
| 'login'
|
||||
| 'not-found'
|
||||
| 'no-permission'
|
||||
| 'service-error'
|
||||
// 自定义路由
|
||||
| 'dashboard'
|
||||
| 'dashboard_analysis'
|
||||
| 'dashboard_workbench'
|
||||
| 'document'
|
||||
| 'document_vue'
|
||||
| 'document_vite'
|
||||
| 'document_naive'
|
||||
| 'component'
|
||||
| 'component_map'
|
||||
| 'component_video'
|
||||
| 'component_editor'
|
||||
| 'component_editor_quill'
|
||||
| 'component_editor_markdown'
|
||||
| 'component_swiper'
|
||||
| 'feat'
|
||||
| 'feat_copy'
|
||||
| 'feat_icon'
|
||||
| 'feat_print'
|
||||
| 'multi-menu'
|
||||
| 'multi-menu_first'
|
||||
| 'multi-menu_first_second'
|
||||
| 'exception'
|
||||
| 'exception_403'
|
||||
| 'exception_404'
|
||||
| 'exception_500'
|
||||
| 'about';
|
17
src/interface/common/system.ts
Normal file
17
src/interface/common/system.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import type { MenuOption } from 'naive-ui';
|
||||
import { EnumLoginModule } from '@/enum';
|
||||
|
||||
/** 菜单项配置 */
|
||||
export type GlobalMenuOption = MenuOption & {
|
||||
routeName: string;
|
||||
routePath: string;
|
||||
};
|
||||
|
||||
/** 登录模块 */
|
||||
export type LoginModuleType = keyof typeof EnumLoginModule;
|
||||
|
||||
/** npm依赖包版本信息 */
|
||||
export interface VersionInfo {
|
||||
name: string;
|
||||
version: string;
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
export * from './common';
|
||||
export * from './business';
|
||||
export * from './theme';
|
||||
export * from './common';
|
||||
|
Reference in New Issue
Block a user