feat: layout调整
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
import { appRoutes, appExternalRoutes } from '../routes';
|
||||
/*
|
||||
* @Author: RenXiaoDong
|
||||
* @Date: 2025-06-19 01:45:53
|
||||
*/
|
||||
import { appRoutes } from '../routes';
|
||||
|
||||
const mixinRoutes = [...appRoutes, ...appExternalRoutes];
|
||||
const mixinRoutes = [...appRoutes];
|
||||
|
||||
const appClientMenus = mixinRoutes.map((el) => {
|
||||
const { name, path, meta, redirect, children } = el;
|
||||
|
||||
@ -16,3 +16,9 @@ export const DEFAULT_ROUTE = {
|
||||
name: DEFAULT_ROUTE_NAME,
|
||||
fullPath: '/',
|
||||
};
|
||||
|
||||
export const MENU_GROUP_IDS = {
|
||||
DATA_ENGINE_ID: 1,
|
||||
MANAGEMENT_ID: -1,
|
||||
WORK_BENCH_ID: -99,
|
||||
};
|
||||
|
||||
@ -24,8 +24,8 @@ const router = createRouter({
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/workplace',
|
||||
name: 'workplace',
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
component: () => import('@/views/components/workplace'),
|
||||
meta: {
|
||||
hideSidebar: true,
|
||||
@ -50,8 +50,7 @@ const router = createRouter({
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
redirect: '/dataEngine/hotTranslation',
|
||||
name: '',
|
||||
children: [...appRoutes, REDIRECT_MAIN, NOT_FOUND_ROUTE],
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import type { RouteRecordNormalized } from 'vue-router';
|
||||
|
||||
const modules = import.meta.glob('./modules/*.ts', { eager: true });
|
||||
const externalModules = import.meta.glob('./externalModules/*.ts', {
|
||||
eager: true,
|
||||
});
|
||||
// const externalModules = import.meta.glob('./externalModules/*.ts', {
|
||||
// eager: true,
|
||||
// });
|
||||
|
||||
function formatModules(_modules: any, result: RouteRecordNormalized[]) {
|
||||
Object.keys(_modules).forEach((key) => {
|
||||
@ -17,4 +17,4 @@ function formatModules(_modules: any, result: RouteRecordNormalized[]) {
|
||||
|
||||
export const appRoutes: RouteRecordNormalized[] = formatModules(modules, []);
|
||||
|
||||
export const appExternalRoutes: RouteRecordNormalized[] = formatModules(externalModules, []);
|
||||
// export const appExternalRoutes: RouteRecordNormalized[] = formatModules(externalModules, []);
|
||||
|
||||
@ -1,15 +1,22 @@
|
||||
/*
|
||||
* @Author: RenXiaoDong
|
||||
* @Date: 2025-06-23 06:39:28
|
||||
*/
|
||||
import { IconBookmark } from '@arco-design/web-vue/es/icon';
|
||||
import type { AppRouteRecordRaw } from '../types';
|
||||
import { MENU_GROUP_IDS } from '@/router/constants';
|
||||
|
||||
const COMPONENTS: AppRouteRecordRaw = {
|
||||
path: 'dataEngine',
|
||||
name: 'dataEngine',
|
||||
redirect: 'dataEngine/hotTranslation',
|
||||
meta: {
|
||||
locale: '全域数据引擎',
|
||||
icon: IconBookmark,
|
||||
requiresAuth: true,
|
||||
roles: ['*'],
|
||||
requiresSidebar: true,
|
||||
id: MENU_GROUP_IDS.DATA_ENGINE_ID,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
|
||||
@ -4,16 +4,19 @@
|
||||
*/
|
||||
import { IconBookmark } from '@arco-design/web-vue/es/icon';
|
||||
import type { AppRouteRecordRaw } from '../types';
|
||||
import { MENU_GROUP_IDS } from '@/router/constants';
|
||||
|
||||
const COMPONENTS: AppRouteRecordRaw = {
|
||||
path: 'management',
|
||||
name: 'management',
|
||||
redirect: 'management/person',
|
||||
meta: {
|
||||
locale: '管理中心',
|
||||
icon: IconBookmark,
|
||||
requiresAuth: true,
|
||||
roles: ['*'],
|
||||
requiresSidebar: true,
|
||||
id: MENU_GROUP_IDS.MANAGEMENT_ID,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
|
||||
@ -1,6 +1,11 @@
|
||||
/*
|
||||
* @Author: RenXiaoDong
|
||||
* @Date: 2025-06-19 01:45:53
|
||||
*/
|
||||
import type { RouteMeta, NavigationGuard, RouteComponent } from 'vue-router';
|
||||
|
||||
export interface AppRouteRecordRaw {
|
||||
id?: number;
|
||||
path: string;
|
||||
name?: string | symbol;
|
||||
meta?: RouteMeta;
|
||||
|
||||
Reference in New Issue
Block a user