|
@@ -1,6 +1,6 @@
|
|
-import { createWebHistory, createRouter } from 'vue-router'
|
|
|
|
|
|
+import { createWebHistory, createRouter } from "vue-router";
|
|
/* Layout */
|
|
/* Layout */
|
|
-import Layout from '@/layoutMain'
|
|
|
|
|
|
+import Layout from "@/layoutMain";
|
|
|
|
|
|
/**
|
|
/**
|
|
* Note: 路由配置项
|
|
* Note: 路由配置项
|
|
@@ -27,40 +27,40 @@ import Layout from '@/layoutMain'
|
|
// 公共路由
|
|
// 公共路由
|
|
export const constantRoutes = [
|
|
export const constantRoutes = [
|
|
{
|
|
{
|
|
- path: '/redirect',
|
|
|
|
|
|
+ path: "/redirect",
|
|
component: Layout,
|
|
component: Layout,
|
|
hidden: true,
|
|
hidden: true,
|
|
children: [
|
|
children: [
|
|
{
|
|
{
|
|
- path: '/redirect/:path(.*)',
|
|
|
|
- component: () => import('@/views/redirect/index.vue')
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
|
|
+ path: "/redirect/:path(.*)",
|
|
|
|
+ component: () => import("@/views/redirect/index.vue"),
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: '/login',
|
|
|
|
- component: () => import('@/views/login'),
|
|
|
|
- hidden: true
|
|
|
|
|
|
+ path: "/login",
|
|
|
|
+ component: () => import("@/views/login"),
|
|
|
|
+ hidden: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: '/register',
|
|
|
|
- component: () => import('@/views/register'),
|
|
|
|
- hidden: true
|
|
|
|
|
|
+ path: "/register",
|
|
|
|
+ component: () => import("@/views/register"),
|
|
|
|
+ hidden: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
path: "/:pathMatch(.*)*",
|
|
path: "/:pathMatch(.*)*",
|
|
- component: () => import('@/views/error/404'),
|
|
|
|
- hidden: true
|
|
|
|
|
|
+ component: () => import("@/views/error/404"),
|
|
|
|
+ hidden: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: '/401',
|
|
|
|
- component: () => import('@/views/error/401'),
|
|
|
|
- hidden: true
|
|
|
|
|
|
+ path: "/401",
|
|
|
|
+ component: () => import("@/views/error/401"),
|
|
|
|
+ hidden: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: '/',
|
|
|
|
|
|
+ path: "/",
|
|
component: Layout,
|
|
component: Layout,
|
|
- redirect: '/material',
|
|
|
|
|
|
+ redirect: "/material",
|
|
// children: [
|
|
// children: [
|
|
// {
|
|
// {
|
|
// path: 'index',
|
|
// path: 'index',
|
|
@@ -72,129 +72,142 @@ export const constantRoutes = [
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
{
|
|
- path: '/',
|
|
|
|
|
|
+ path: "/",
|
|
component: Layout,
|
|
component: Layout,
|
|
- meta: { title: '', icon: ''},
|
|
|
|
|
|
+ meta: { title: "", icon: "" },
|
|
children: [
|
|
children: [
|
|
{
|
|
{
|
|
- path: 'material',
|
|
|
|
- component: () => import('@/views/material/index'),
|
|
|
|
- name: 'Material',
|
|
|
|
- meta: { noCache: true , title: '工具管理', icon: 'tool' },
|
|
|
|
|
|
+ path: "material",
|
|
|
|
+ component: () => import("@/views/material/index"),
|
|
|
|
+ name: "Material",
|
|
|
|
+ meta: { noCache: true, title: "工具管理", icon: "tool" },
|
|
},
|
|
},
|
|
- ]
|
|
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: '/',
|
|
|
|
|
|
+ path: "/",
|
|
component: Layout,
|
|
component: Layout,
|
|
- meta: { title: '', icon: ''},
|
|
|
|
|
|
+ meta: { title: "", icon: "" },
|
|
children: [
|
|
children: [
|
|
{
|
|
{
|
|
- path: 'classification',
|
|
|
|
- component: () => import('@/views/classification/index'),
|
|
|
|
- name: 'Classification',
|
|
|
|
- meta: { noCache: true ,title: '分类管理', icon: 'tree-table'}
|
|
|
|
|
|
+ path: "classification",
|
|
|
|
+ component: () => import("@/views/classification/index"),
|
|
|
|
+ name: "Classification",
|
|
|
|
+ meta: { noCache: true, title: "分类管理", icon: "tree-table" },
|
|
},
|
|
},
|
|
- ]
|
|
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: '/',
|
|
|
|
|
|
+ path: "/",
|
|
component: Layout,
|
|
component: Layout,
|
|
- meta: { title: '', icon: ''},
|
|
|
|
|
|
+ meta: { title: "", icon: "" },
|
|
hidden: true,
|
|
hidden: true,
|
|
children: [
|
|
children: [
|
|
{
|
|
{
|
|
- path: 'toolsMaterial',
|
|
|
|
- component: () => import('@/views/toolsMaterial/index'),
|
|
|
|
- name: 'toolsMaterial',
|
|
|
|
- meta: { title: '物料管理', icon: 'component' },
|
|
|
|
|
|
+ path: "toolsMaterial",
|
|
|
|
+ component: () => import("@/views/toolsMaterial/index"),
|
|
|
|
+ name: "toolsMaterial",
|
|
|
|
+ meta: { title: "物料管理", icon: "component" },
|
|
},
|
|
},
|
|
- ]
|
|
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
-]
|
|
|
|
|
|
+ // {
|
|
|
|
+ // path: "/",
|
|
|
|
+ // component: Layout,
|
|
|
|
+ // meta: { title: "", icon: "" },
|
|
|
|
+ // children: [
|
|
|
|
+ // {
|
|
|
|
+ // path: "commonTools",
|
|
|
|
+ // component: () => import("@/views/commonTools/index"),
|
|
|
|
+ // name: "CommonTools",
|
|
|
|
+ // meta: { noCache: true, title: "常用工具管理", icon: "system" },
|
|
|
|
+ // },
|
|
|
|
+ // ],
|
|
|
|
+ // },
|
|
|
|
+];
|
|
|
|
|
|
// 动态路由,基于用户权限动态去加载
|
|
// 动态路由,基于用户权限动态去加载
|
|
export const dynamicRoutes = [
|
|
export const dynamicRoutes = [
|
|
{
|
|
{
|
|
- path: '/system/user-auth',
|
|
|
|
|
|
+ path: "/system/user-auth",
|
|
component: Layout,
|
|
component: Layout,
|
|
hidden: true,
|
|
hidden: true,
|
|
- permissions: ['system:user:edit'],
|
|
|
|
|
|
+ permissions: ["system:user:edit"],
|
|
children: [
|
|
children: [
|
|
{
|
|
{
|
|
- path: 'role/:userId(\\d+)',
|
|
|
|
- component: () => import('@/views/system/user/authRole'),
|
|
|
|
- name: 'AuthRole',
|
|
|
|
- meta: { title: '分配角色', activeMenu: '/system/user' }
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
|
|
+ path: "role/:userId(\\d+)",
|
|
|
|
+ component: () => import("@/views/system/user/authRole"),
|
|
|
|
+ name: "AuthRole",
|
|
|
|
+ meta: { title: "分配角色", activeMenu: "/system/user" },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: '/system/role-auth',
|
|
|
|
|
|
+ path: "/system/role-auth",
|
|
component: Layout,
|
|
component: Layout,
|
|
hidden: true,
|
|
hidden: true,
|
|
- permissions: ['system:role:edit'],
|
|
|
|
|
|
+ permissions: ["system:role:edit"],
|
|
children: [
|
|
children: [
|
|
{
|
|
{
|
|
- path: 'user/:roleId(\\d+)',
|
|
|
|
- component: () => import('@/views/system/role/authUser'),
|
|
|
|
- name: 'AuthUser',
|
|
|
|
- meta: { title: '分配用户', activeMenu: '/system/role' }
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
|
|
+ path: "user/:roleId(\\d+)",
|
|
|
|
+ component: () => import("@/views/system/role/authUser"),
|
|
|
|
+ name: "AuthUser",
|
|
|
|
+ meta: { title: "分配用户", activeMenu: "/system/role" },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: '/system/dict-data',
|
|
|
|
|
|
+ path: "/system/dict-data",
|
|
component: Layout,
|
|
component: Layout,
|
|
hidden: true,
|
|
hidden: true,
|
|
- permissions: ['system:dict:list'],
|
|
|
|
|
|
+ permissions: ["system:dict:list"],
|
|
children: [
|
|
children: [
|
|
{
|
|
{
|
|
- path: 'index/:dictId(\\d+)',
|
|
|
|
- component: () => import('@/views/system/dict/data'),
|
|
|
|
- name: 'Data',
|
|
|
|
- meta: { title: '字典数据', activeMenu: '/system/dict' }
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
|
|
+ path: "index/:dictId(\\d+)",
|
|
|
|
+ component: () => import("@/views/system/dict/data"),
|
|
|
|
+ name: "Data",
|
|
|
|
+ meta: { title: "字典数据", activeMenu: "/system/dict" },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: '/monitor/job-log',
|
|
|
|
|
|
+ path: "/monitor/job-log",
|
|
component: Layout,
|
|
component: Layout,
|
|
hidden: true,
|
|
hidden: true,
|
|
- permissions: ['monitor:job:list'],
|
|
|
|
|
|
+ permissions: ["monitor:job:list"],
|
|
children: [
|
|
children: [
|
|
{
|
|
{
|
|
- path: 'index/:jobId(\\d+)',
|
|
|
|
- component: () => import('@/views/monitor/job/log'),
|
|
|
|
- name: 'JobLog',
|
|
|
|
- meta: { title: '调度日志', activeMenu: '/monitor/job' }
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
|
|
+ path: "index/:jobId(\\d+)",
|
|
|
|
+ component: () => import("@/views/monitor/job/log"),
|
|
|
|
+ name: "JobLog",
|
|
|
|
+ meta: { title: "调度日志", activeMenu: "/monitor/job" },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: '/tool/gen-edit',
|
|
|
|
|
|
+ path: "/tool/gen-edit",
|
|
component: Layout,
|
|
component: Layout,
|
|
hidden: true,
|
|
hidden: true,
|
|
- permissions: ['tool:gen:edit'],
|
|
|
|
|
|
+ permissions: ["tool:gen:edit"],
|
|
children: [
|
|
children: [
|
|
{
|
|
{
|
|
- path: 'index/:tableId(\\d+)',
|
|
|
|
- component: () => import('@/views/tool/gen/editTable'),
|
|
|
|
- name: 'GenEdit',
|
|
|
|
- meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
-]
|
|
|
|
|
|
+ path: "index/:tableId(\\d+)",
|
|
|
|
+ component: () => import("@/views/tool/gen/editTable"),
|
|
|
|
+ name: "GenEdit",
|
|
|
|
+ meta: { title: "修改生成配置", activeMenu: "/tool/gen" },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+];
|
|
|
|
|
|
const router = createRouter({
|
|
const router = createRouter({
|
|
history: createWebHistory(),
|
|
history: createWebHistory(),
|
|
routes: constantRoutes,
|
|
routes: constantRoutes,
|
|
scrollBehavior(to, from, savedPosition) {
|
|
scrollBehavior(to, from, savedPosition) {
|
|
if (savedPosition) {
|
|
if (savedPosition) {
|
|
- return savedPosition
|
|
|
|
|
|
+ return savedPosition;
|
|
} else {
|
|
} else {
|
|
- return { top: 0 }
|
|
|
|
|
|
+ return { top: 0 };
|
|
}
|
|
}
|
|
},
|
|
},
|
|
});
|
|
});
|