新增前端vue
This commit is contained in:
73
web-vue/packages/core/router/routes/basic.ts
Normal file
73
web-vue/packages/core/router/routes/basic.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
import type { AppRouteRecordRaw } from '@jeesite/core/router/types';
|
||||
import { t } from '@jeesite/core/hooks/web/useI18n';
|
||||
import { REDIRECT_NAME, LAYOUT, EXCEPTION_COMPONENT, PAGE_NOT_FOUND_NAME } from '@jeesite/core/router/constant';
|
||||
|
||||
// 404 on a page
|
||||
export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
|
||||
path: '/:path(.*)*',
|
||||
name: PAGE_NOT_FOUND_NAME,
|
||||
component: LAYOUT,
|
||||
meta: {
|
||||
title: 'ErrorPage',
|
||||
hideBreadcrumb: true,
|
||||
hideMenu: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/404/:path(.*)*',
|
||||
name: PAGE_NOT_FOUND_NAME + '404',
|
||||
component: EXCEPTION_COMPONENT,
|
||||
meta: {
|
||||
title: '404',
|
||||
hideBreadcrumb: true,
|
||||
hideMenu: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const REDIRECT_ROUTE: AppRouteRecordRaw = {
|
||||
path: '/redirect',
|
||||
component: LAYOUT,
|
||||
name: 'RedirectTo',
|
||||
meta: {
|
||||
title: REDIRECT_NAME,
|
||||
hideBreadcrumb: true,
|
||||
hideMenu: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/redirect/:path(.*)',
|
||||
name: REDIRECT_NAME,
|
||||
component: () => import('@jeesite/core/layouts/views/redirect/index.vue'),
|
||||
meta: {
|
||||
title: '',
|
||||
hideBreadcrumb: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const ERROR_LOG_ROUTE: AppRouteRecordRaw = {
|
||||
path: '/errorLog',
|
||||
name: 'ErrorLog',
|
||||
component: LAYOUT,
|
||||
redirect: '/errorLog/list',
|
||||
meta: {
|
||||
title: 'ErrorLog',
|
||||
hideBreadcrumb: true,
|
||||
hideChildrenInMenu: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
name: 'ErrorLogList',
|
||||
component: () => import('@jeesite/core/layouts/views/errorLog/index.vue'),
|
||||
meta: {
|
||||
title: t('routes.basic.errorLogList'),
|
||||
hideBreadcrumb: true,
|
||||
currentActiveMenu: '/errorLog',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
50
web-vue/packages/core/router/routes/index.ts
Normal file
50
web-vue/packages/core/router/routes/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import type { AppRouteRecordRaw, AppRouteModule } from '@jeesite/core/router/types';
|
||||
|
||||
import { PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '@jeesite/core/router/routes/basic';
|
||||
|
||||
import { mainOutRoutes } from './mainOut';
|
||||
import { PageEnum } from '@jeesite/core/enums/pageEnum';
|
||||
import { t } from '@jeesite/core/hooks/web/useI18n';
|
||||
|
||||
const modules = import.meta.glob('./modules/**/*.ts', { eager: true });
|
||||
|
||||
const routeModuleList: AppRouteModule[] = [];
|
||||
|
||||
Object.keys(modules).forEach((key) => {
|
||||
const mod = (modules as Recordable)[key].default || {};
|
||||
const modList = Array.isArray(mod) ? [...mod] : [mod];
|
||||
routeModuleList.push(...modList);
|
||||
});
|
||||
|
||||
export const asyncRoutes = [PAGE_NOT_FOUND_ROUTE, ...routeModuleList];
|
||||
|
||||
export const RootRoute: AppRouteRecordRaw = {
|
||||
path: '/',
|
||||
name: 'Root',
|
||||
redirect: PageEnum.BASE_LOGIN,
|
||||
meta: {
|
||||
title: 'Root',
|
||||
},
|
||||
};
|
||||
|
||||
export const LoginRoute: AppRouteRecordRaw = {
|
||||
path: '/login',
|
||||
name: 'Login',
|
||||
component: () => import('@jeesite/core/layouts/views/login/Login.vue'),
|
||||
meta: {
|
||||
title: t('routes.basic.login'),
|
||||
},
|
||||
};
|
||||
|
||||
const ModPwdRoute: AppRouteModule = {
|
||||
path: '/modPwd',
|
||||
name: 'ModPwd',
|
||||
component: () => import('@jeesite/core/layouts/views/account/modPwd.vue'),
|
||||
meta: {
|
||||
icon: 'i-ant-design:key-outlined',
|
||||
title: t('sys.account.modifyPwd'),
|
||||
},
|
||||
};
|
||||
|
||||
// Basic routing without permission
|
||||
export const basicRoutes = [LoginRoute, ModPwdRoute, RootRoute, ...mainOutRoutes, REDIRECT_ROUTE, PAGE_NOT_FOUND_ROUTE];
|
||||
12
web-vue/packages/core/router/routes/mainOut.ts
Normal file
12
web-vue/packages/core/router/routes/mainOut.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
The routing of this file will not show the layout.
|
||||
It is an independent new page.
|
||||
the contents of the file still need to log in to access
|
||||
*/
|
||||
import type { AppRouteModule } from '@jeesite/core/router/types';
|
||||
|
||||
// test
|
||||
// http:ip:port/main-out
|
||||
export const mainOutRoutes: AppRouteModule[] = [];
|
||||
|
||||
export const mainOutRouteNames = mainOutRoutes.map((item) => item.name);
|
||||
47
web-vue/packages/core/router/routes/modules/account.ts
Normal file
47
web-vue/packages/core/router/routes/modules/account.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { AppRouteModule } from '@jeesite/core/router/types';
|
||||
|
||||
import { LAYOUT } from '@jeesite/core/router/constant';
|
||||
import { t } from '@jeesite/core/hooks/web/useI18n';
|
||||
|
||||
const account: AppRouteModule = {
|
||||
path: '/account',
|
||||
name: 'Account',
|
||||
component: LAYOUT,
|
||||
redirect: '/account/center',
|
||||
meta: {
|
||||
icon: 'i-ion:person-outline',
|
||||
title: t('sys.account.center'),
|
||||
orderNo: 100000,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'center',
|
||||
name: 'AccountCenter',
|
||||
component: () => import('@jeesite/core/layouts/views/account/center.vue'),
|
||||
meta: {
|
||||
icon: 'i-ion:person-outline',
|
||||
title: t('sys.account.center'),
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'modPwd',
|
||||
name: 'AccountModPwd',
|
||||
component: () => import('@jeesite/core/layouts/views/account/modPwd.vue'),
|
||||
meta: {
|
||||
icon: 'i-ant-design:key-outlined',
|
||||
title: t('sys.account.modifyPwd'),
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'modPwdQuestion',
|
||||
name: 'AccountModPwdQuestion',
|
||||
component: () => import('@jeesite/core/layouts/views/account/modPwdQuestion.vue'),
|
||||
meta: {
|
||||
icon: 'i-ant-design:key-outlined',
|
||||
title: t('sys.account.modifyPqa'),
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default account;
|
||||
50
web-vue/packages/core/router/routes/modules/desktop.ts
Normal file
50
web-vue/packages/core/router/routes/modules/desktop.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import type { AppRouteModule } from '@jeesite/core/router/types';
|
||||
|
||||
import { LAYOUT } from '@jeesite/core/router/constant';
|
||||
import { t } from '@jeesite/core/hooks/web/useI18n';
|
||||
|
||||
const desktop: AppRouteModule = {
|
||||
path: '/desktop',
|
||||
name: 'Desktop',
|
||||
component: LAYOUT,
|
||||
redirect: '/desktop/analysis',
|
||||
meta: {
|
||||
orderNo: 10,
|
||||
icon: 'i-ant-design:home-outlined',
|
||||
title: t('routes.dashboard.dashboard'),
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'analysis',
|
||||
name: 'Analysis',
|
||||
component: () => import('@jeesite/core/layouts/views/desktop/analysis/index.vue'),
|
||||
meta: {
|
||||
// affix: true,
|
||||
icon: 'i-ant-design:home-outlined',
|
||||
tabIcon: 'i-ant-design:home-outlined',
|
||||
title: t('routes.dashboard.analysis'),
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'workbench',
|
||||
name: 'Workbench',
|
||||
component: () => import('@jeesite/core/layouts/views/desktop/workbench/index.vue'),
|
||||
meta: {
|
||||
icon: 'i-ant-design:read-outlined',
|
||||
title: t('routes.dashboard.workbench'),
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'about',
|
||||
name: 'AboutPage',
|
||||
component: () => import('@jeesite/core/layouts/views/desktop/about/index.vue'),
|
||||
meta: {
|
||||
title: t('routes.dashboard.about'),
|
||||
icon: 'i-ant-design:tag-outlined',
|
||||
hideMenu: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default desktop;
|
||||
Reference in New Issue
Block a user