|
@@ -1,6 +1,6 @@
|
|
|
-import { createWebHistory, createRouter } from 'vue-router'
|
|
|
+import { createWebHistory, createRouter } from "vue-router";
|
|
|
/* Layout */
|
|
|
-import Layout from '@/layoutMain'
|
|
|
+import Layout from "@/layoutMain";
|
|
|
|
|
|
/**
|
|
|
* Note: 路由配置项
|
|
@@ -27,40 +27,40 @@ import Layout from '@/layoutMain'
|
|
|
// 公共路由
|
|
|
export const constantRoutes = [
|
|
|
{
|
|
|
- path: '/redirect',
|
|
|
+ path: "/redirect",
|
|
|
component: Layout,
|
|
|
hidden: true,
|
|
|
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(.*)*",
|
|
|
- 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,
|
|
|
- redirect: '/material',
|
|
|
+ redirect: "/material",
|
|
|
// children: [
|
|
|
// {
|
|
|
// path: 'index',
|
|
@@ -72,129 +72,142 @@ export const constantRoutes = [
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- path: '/',
|
|
|
+ path: "/",
|
|
|
component: Layout,
|
|
|
- meta: { title: '', icon: ''},
|
|
|
+ meta: { title: "", icon: "" },
|
|
|
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,
|
|
|
- meta: { title: '', icon: ''},
|
|
|
+ meta: { title: "", icon: "" },
|
|
|
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,
|
|
|
- meta: { title: '', icon: ''},
|
|
|
+ meta: { title: "", icon: "" },
|
|
|
hidden: true,
|
|
|
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 = [
|
|
|
{
|
|
|
- path: '/system/user-auth',
|
|
|
+ path: "/system/user-auth",
|
|
|
component: Layout,
|
|
|
hidden: true,
|
|
|
- permissions: ['system:user:edit'],
|
|
|
+ permissions: ["system:user:edit"],
|
|
|
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,
|
|
|
hidden: true,
|
|
|
- permissions: ['system:role:edit'],
|
|
|
+ permissions: ["system:role:edit"],
|
|
|
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,
|
|
|
hidden: true,
|
|
|
- permissions: ['system:dict:list'],
|
|
|
+ permissions: ["system:dict:list"],
|
|
|
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,
|
|
|
hidden: true,
|
|
|
- permissions: ['monitor:job:list'],
|
|
|
+ permissions: ["monitor:job:list"],
|
|
|
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,
|
|
|
hidden: true,
|
|
|
- permissions: ['tool:gen:edit'],
|
|
|
+ permissions: ["tool:gen:edit"],
|
|
|
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({
|
|
|
history: createWebHistory(),
|
|
|
routes: constantRoutes,
|
|
|
scrollBehavior(to, from, savedPosition) {
|
|
|
if (savedPosition) {
|
|
|
- return savedPosition
|
|
|
+ return savedPosition;
|
|
|
} else {
|
|
|
- return { top: 0 }
|
|
|
+ return { top: 0 };
|
|
|
}
|
|
|
},
|
|
|
});
|