refactor(projects): 路由声明重构,添加composables,BaseLayout进行中,文件夹规范

This commit is contained in:
Soybean
2021-11-19 01:33:36 +08:00
parent 1c5fdca596
commit 1e84d13d54
75 changed files with 668 additions and 565 deletions

View File

@ -0,0 +1 @@
export * from './auth';

View File

@ -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;
}

View File

@ -0,0 +1,2 @@
export * from './system';
export * from './route';

View 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';

View 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;
}

View File

@ -1,3 +1,3 @@
export * from './common';
export * from './business';
export * from './theme';
export * from './common';