mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-12 21:53:48 +08:00
v1.0.4
This commit is contained in:
17
smart-admin-web/src/router/before-close.js
Normal file
17
smart-admin-web/src/router/before-close.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Modal } from 'iview';
|
||||
|
||||
const beforeClose = {
|
||||
before_close_normal: resolve => {
|
||||
Modal.confirm({
|
||||
title: '确定要关闭这一页吗',
|
||||
onOk: () => {
|
||||
resolve(true);
|
||||
},
|
||||
onCancel: () => {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default beforeClose;
|
||||
149
smart-admin-web/src/router/index.js
Normal file
149
smart-admin-web/src/router/index.js
Normal file
@@ -0,0 +1,149 @@
|
||||
import Vue from 'vue';
|
||||
import Router from 'vue-router';
|
||||
import { routers } from './routers';
|
||||
import store from '@/store';
|
||||
import iView from 'iview';
|
||||
import cookie from '@/lib/cookie';
|
||||
import { localRead } from '@/lib/local';
|
||||
import { setTitle } from '@/lib/menu-func';
|
||||
import config from '@/config';
|
||||
|
||||
const { homeName } = config;
|
||||
|
||||
Vue.use(Router);
|
||||
const router = new Router({
|
||||
routes: routers
|
||||
// mode: 'history'
|
||||
});
|
||||
const LOGIN_PAGE_NAME = 'login';
|
||||
|
||||
// 防止用户刷新丢失登录信息
|
||||
if (
|
||||
Object.keys(store.state.user.userLoginInfo).length === 0 &&
|
||||
localRead('userLoginInfo')
|
||||
) {
|
||||
store.commit('setUserLoginInfo', JSON.parse(localRead('userLoginInfo')));
|
||||
}
|
||||
// 解决路由跳转相同的地址报错
|
||||
const originalPush = Router.prototype.push;
|
||||
Router.prototype.push = function (location) {
|
||||
try {
|
||||
return originalPush.call(this, location).catch(err => err);
|
||||
} catch (error) {
|
||||
// TODO zhuoda sentry
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
|
||||
// 关于当前页面
|
||||
Router.prototype.closeCurrentPage = function () {
|
||||
let current = this.history.current;
|
||||
store.commit('closeTag', current);
|
||||
store.commit('deleteKeepAliveIncludes', current.name);
|
||||
};
|
||||
|
||||
// 关闭当前页面然后跳转到指定页面
|
||||
Router.prototype.closeCurrentPageAndPush = function (pushParam) {
|
||||
let current = this.history.current;
|
||||
store.commit('closeTagNotPushNextRoute', current);
|
||||
store.commit('deleteKeepAliveIncludes', current.name);
|
||||
this.push(pushParam);
|
||||
};
|
||||
let storeSelf = store;
|
||||
router.beforeEach((to, from, next) => {
|
||||
console.log(to);
|
||||
iView.LoadingBar.start();
|
||||
const token = cookie.getToken();
|
||||
if (!token && to.name !== LOGIN_PAGE_NAME) {
|
||||
// 未登录且要跳转的页面不是登录页
|
||||
next({
|
||||
name: LOGIN_PAGE_NAME // 跳转到登录页
|
||||
});
|
||||
} else if (!token && to.name === LOGIN_PAGE_NAME) {
|
||||
// 未登陆且要跳转的页面是登录页
|
||||
next(); // 跳转
|
||||
} else if (token && to.name === LOGIN_PAGE_NAME) {
|
||||
// 已登录且要跳转的页面是登录页
|
||||
next({
|
||||
// 跳转到home页
|
||||
name: homeName
|
||||
});
|
||||
setTitle(to, router.app);
|
||||
iView.LoadingBar.finish();
|
||||
window.scrollTo(0, 0);
|
||||
} else {
|
||||
// 特殊页面直接放行
|
||||
if (to.meta.access) {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
||||
// 去掉/之后第一个字母
|
||||
let key = to.path.substr(1, 1);
|
||||
let pathArray = storeSelf.state.user.privilegeRouterPathMap.get(key);
|
||||
if (!(pathArray && pathArray.indexOf(to.path) >= 0)) {
|
||||
next({
|
||||
name: 'Error401'
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
router.afterEach(to => {
|
||||
setTitle(to, router.app);
|
||||
iView.LoadingBar.finish();
|
||||
window.scrollTo(0, 0);
|
||||
});
|
||||
|
||||
let tempCheckObj = {
|
||||
checkRouterNameMap: new Map(),
|
||||
checkRouterPathMap: new Map()
|
||||
};
|
||||
|
||||
function recursionRouter (routerArray) {
|
||||
for (let routerItem of routerArray) {
|
||||
if (!routerItem.name) {
|
||||
console.error('没有配置router name', routerItem);
|
||||
} else {
|
||||
let existNameRouter = tempCheckObj.checkRouterNameMap.get(
|
||||
routerItem.name
|
||||
);
|
||||
if (typeof existNameRouter !== 'undefined') {
|
||||
console.error('存在相同的router name', routerItem, existNameRouter);
|
||||
} else {
|
||||
tempCheckObj.checkRouterNameMap.set(routerItem.name, routerItem);
|
||||
}
|
||||
}
|
||||
|
||||
if (!routerItem.path) {
|
||||
console.error('没有配置router path', routerItem);
|
||||
} else {
|
||||
// path必须以 / 开头
|
||||
if (routerItem.path !== '*' && routerItem.path.indexOf('/') !== 0) {
|
||||
console.error('path 没有以/开头 ', routerItem);
|
||||
}
|
||||
|
||||
let existPathRouter = tempCheckObj.checkRouterPathMap.get(
|
||||
routerItem.path
|
||||
);
|
||||
if (typeof existPathRouter !== 'undefined') {
|
||||
console.error('存在相同的router path', routerItem, existPathRouter);
|
||||
} else {
|
||||
tempCheckObj.checkRouterPathMap.set(routerItem.path, routerItem);
|
||||
}
|
||||
}
|
||||
|
||||
if (routerItem.children) {
|
||||
recursionRouter(routerItem.children);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
recursionRouter(routers);
|
||||
|
||||
delete tempCheckObj.checkRouterNameMap;
|
||||
delete tempCheckObj.checkRouterPathMap;
|
||||
|
||||
export default router;
|
||||
25
smart-admin-web/src/router/module/api-doc.js
Normal file
25
smart-admin-web/src/router/module/api-doc.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import Main from '@/components/main';
|
||||
// 接口文档
|
||||
export const apiDoc = [
|
||||
{
|
||||
path: '/api-doc',
|
||||
component: Main,
|
||||
name: 'ApiDoc',
|
||||
meta: {
|
||||
title: '接口文档',
|
||||
icon: 'icon iconfont iconjiekouwendang'
|
||||
},
|
||||
|
||||
children: [
|
||||
{
|
||||
path: '/api-doc/swagger',
|
||||
name: 'Swagger',
|
||||
meta: {
|
||||
title: 'Swagger接口文档',
|
||||
icon: 'icon iconfont iconjiekouwendang'
|
||||
},
|
||||
component: () => import('@/views/api-doc/swagger.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
40
smart-admin-web/src/router/module/email.js
Normal file
40
smart-admin-web/src/router/module/email.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import Main from '@/components/main';
|
||||
// 基础设置
|
||||
export const emailSetting = [
|
||||
{
|
||||
path: '/email',
|
||||
name: 'Email',
|
||||
component: Main,
|
||||
meta: {
|
||||
title: '邮件管理',
|
||||
icon: 'icon iconfont iconyoujianguanli'
|
||||
},
|
||||
children: [
|
||||
// 发送email
|
||||
{
|
||||
path: '/email/email-list',
|
||||
name: 'EmailList',
|
||||
meta: {
|
||||
title: '邮件管理',
|
||||
childrenPoints: [
|
||||
{ title: '查询', name: 'email-query' },
|
||||
{ title: '新增', name: 'email-add' },
|
||||
{ title: '编辑', name: 'email-update' },
|
||||
{ title: '删除', name: 'email-delete' }
|
||||
]
|
||||
},
|
||||
component: () => import('@/views/email/email-list.vue')
|
||||
},
|
||||
// 发送email
|
||||
{
|
||||
path: '/email/send-mail',
|
||||
name: 'SendMail',
|
||||
meta: {
|
||||
title: '发送邮件',
|
||||
childrenPoints: [{ title: '发送', name: 'email-send' }]
|
||||
},
|
||||
component: () => import('@/views/email/send-mail.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
149
smart-admin-web/src/router/module/employee.js
Normal file
149
smart-admin-web/src/router/module/employee.js
Normal file
@@ -0,0 +1,149 @@
|
||||
import Main from '@/components/main';
|
||||
// 基础设置
|
||||
export const employee = [
|
||||
{
|
||||
path: '/employee',
|
||||
component: Main,
|
||||
name: 'Employee',
|
||||
meta: {
|
||||
title: '人员管理',
|
||||
icon: 'icon iconfont iconrenyuanguanli'
|
||||
},
|
||||
children: [
|
||||
// 角色管理页面路由
|
||||
{
|
||||
path: '/employee/role',
|
||||
name: 'RoleManage',
|
||||
meta: {
|
||||
title: '角色管理',
|
||||
childrenPoints: [
|
||||
{
|
||||
title: '添加角色',
|
||||
name: 'add-role'
|
||||
},
|
||||
{
|
||||
title: '删除角色',
|
||||
name: 'delete-role'
|
||||
},
|
||||
{
|
||||
title: '编辑角色',
|
||||
name: 'update-role'
|
||||
},
|
||||
{
|
||||
title: '修改角色权限',
|
||||
name: 'update-role-privilege'
|
||||
},
|
||||
{
|
||||
title: '添加成员',
|
||||
name: 'add-employee-role'
|
||||
},
|
||||
{
|
||||
title: '移除成员',
|
||||
name: 'delete-employee-role'
|
||||
},
|
||||
{
|
||||
title: '批量移除',
|
||||
name: 'delete-employee-role-batch'
|
||||
},
|
||||
{
|
||||
title: '查询成员',
|
||||
name: 'search-employee-list'
|
||||
},
|
||||
{
|
||||
title: '查询数据范围',
|
||||
name: 'query-data-scope'
|
||||
},
|
||||
{
|
||||
title: '更新数据范围',
|
||||
name: 'update-data-scope'
|
||||
}
|
||||
]
|
||||
},
|
||||
component: () => import('@/views/employee/role/role-manage.vue')
|
||||
},
|
||||
// 岗位管理页面路由 新
|
||||
{
|
||||
path: '/employee/position',
|
||||
name: 'PositionList',
|
||||
meta: {
|
||||
title: '岗位管理',
|
||||
childrenPoints: [
|
||||
{
|
||||
title: '查询',
|
||||
name: 'search-position'
|
||||
},
|
||||
{
|
||||
title: '添加',
|
||||
name: 'add-position'
|
||||
},
|
||||
{
|
||||
title: '修改',
|
||||
name: 'update-position'
|
||||
},
|
||||
{
|
||||
title: '删除',
|
||||
name: 'delete-position'
|
||||
}
|
||||
]
|
||||
},
|
||||
component: () => import('@/views/employee/position/position-list.vue')
|
||||
},
|
||||
// 人员管理页面路由
|
||||
{
|
||||
path: '/employee/role-employee-manage',
|
||||
name: 'RoleEmployeeManage',
|
||||
meta: {
|
||||
title: '员工管理',
|
||||
childrenPoints: [
|
||||
{
|
||||
title: '添加部门',
|
||||
name: 'add-department'
|
||||
},
|
||||
{
|
||||
title: '编辑部门',
|
||||
name: 'update-department'
|
||||
},
|
||||
{
|
||||
title: '删除部门',
|
||||
name: 'delete-department'
|
||||
},
|
||||
{
|
||||
title: '查询',
|
||||
name: 'search-department'
|
||||
},
|
||||
{
|
||||
title: '添加成员',
|
||||
name: 'add-employee'
|
||||
},
|
||||
{
|
||||
title: '编辑成员',
|
||||
name: 'update-employee'
|
||||
},
|
||||
{
|
||||
title: '禁用',
|
||||
name: 'disabled-employee'
|
||||
},
|
||||
{
|
||||
title: '批量操作',
|
||||
name: 'disabled-employee-batch'
|
||||
},
|
||||
{
|
||||
title: '员工角色编辑',
|
||||
name: 'update-employee-role'
|
||||
},
|
||||
{
|
||||
title: '删除员工',
|
||||
name: 'delete-employee'
|
||||
},
|
||||
{
|
||||
title: '重置密码',
|
||||
name: 'reset-employee-password'
|
||||
}
|
||||
]
|
||||
},
|
||||
component: () =>
|
||||
import('@/views/employee/role-employee/role-employee-manage.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
30
smart-admin-web/src/router/module/error.js
Normal file
30
smart-admin-web/src/router/module/error.js
Normal file
@@ -0,0 +1,30 @@
|
||||
// 错误页
|
||||
export const error = [
|
||||
{
|
||||
path: '/401',
|
||||
name: 'Error401',
|
||||
meta: {
|
||||
hideInMenu: true,
|
||||
access: true
|
||||
},
|
||||
component: () => import('@/views/error-page/401.vue')
|
||||
},
|
||||
{
|
||||
path: '/500',
|
||||
name: 'Error500',
|
||||
meta: {
|
||||
hideInMenu: true,
|
||||
access: true
|
||||
},
|
||||
component: () => import('@/views/error-page/500.vue')
|
||||
},
|
||||
{
|
||||
path: '*',
|
||||
name: 'http://localhost:8080/#employee/role-employee-manage',
|
||||
meta: {
|
||||
hideInMenu: true,
|
||||
access: true
|
||||
},
|
||||
component: () => import('@/views/error-page/404.vue')
|
||||
}
|
||||
];
|
||||
29
smart-admin-web/src/router/module/file.js
Normal file
29
smart-admin-web/src/router/module/file.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import Main from '@/components/main';
|
||||
// 文件服务
|
||||
export const file = [
|
||||
{
|
||||
path: '/file',
|
||||
name: 'File',
|
||||
component: Main,
|
||||
meta: {
|
||||
title: '文件服务',
|
||||
icon: 'ios-cloud-upload'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/file/file-list',
|
||||
name: 'FileList',
|
||||
meta: {
|
||||
title: '文件列表',
|
||||
icon: 'ios-cloud-upload',
|
||||
childrenPoints: [
|
||||
{ title: '查询', name: 'file-filePage-query' },
|
||||
{ title: '上传', name: 'file-filePage-upload' },
|
||||
{ title: '下载', name: 'file-filePage-download' }
|
||||
]
|
||||
},
|
||||
component: () => import('@/views/file/file-list.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
31
smart-admin-web/src/router/module/heart-beat.js
Normal file
31
smart-admin-web/src/router/module/heart-beat.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import Main from '@/components/main';
|
||||
// 心跳服务
|
||||
export const heartBeat = [
|
||||
{
|
||||
path: '/heart-beat',
|
||||
name: 'HeartBeat',
|
||||
component: Main,
|
||||
meta: {
|
||||
title: '心跳服务',
|
||||
icon: 'icon iconfont icondingshirenwu'
|
||||
},
|
||||
|
||||
children: [
|
||||
{
|
||||
path: '/heart-beat/heart-beat-list',
|
||||
name: 'HeartBeatList',
|
||||
meta: {
|
||||
title: '心跳服务',
|
||||
icon: 'icon iconfont icondingshirenwu',
|
||||
childrenPoints: [
|
||||
{
|
||||
title: '查询任务',
|
||||
name: 'heart-beat-query'
|
||||
}
|
||||
]
|
||||
},
|
||||
component: () => import('@/views/heart-beat/heart-beat-list.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
28
smart-admin-web/src/router/module/home.js
Normal file
28
smart-admin-web/src/router/module/home.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import Main from '@/components/main';
|
||||
// 首页
|
||||
export const home = [
|
||||
{
|
||||
path: '/',
|
||||
name: '_home',
|
||||
redirect: '/home',
|
||||
component: Main,
|
||||
meta: {
|
||||
noKeepAlive: true,
|
||||
hideInMenu: true,
|
||||
access: true,
|
||||
icon: 'icon iconfont iconxitongshezhi'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/home',
|
||||
name: 'Home',
|
||||
meta: {
|
||||
title: '首页',
|
||||
access: true,
|
||||
noKeepAlive: true
|
||||
},
|
||||
component: () => import('@/views/home')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
31
smart-admin-web/src/router/module/keep-alive.js
Normal file
31
smart-admin-web/src/router/module/keep-alive.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import Main from '@/components/main';
|
||||
// 接口文档
|
||||
export const keepAlive = [
|
||||
{
|
||||
path: '/keep-alive',
|
||||
name: 'KeepAlive',
|
||||
component: Main,
|
||||
meta: {
|
||||
title: 'KeepAlive',
|
||||
icon: 'icon iconfont iconxitongshezhi'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/keep-alive/content-list',
|
||||
name: 'KeepAliveContentList',
|
||||
meta: {
|
||||
title: 'KeepAlive列表'
|
||||
},
|
||||
component: () => import('@/views/keep-alive/content-list.vue')
|
||||
},
|
||||
{
|
||||
path: '/keep-alive/add-content',
|
||||
name: 'KeepAliveAddContent',
|
||||
meta: {
|
||||
title: 'KeepAlive表单'
|
||||
},
|
||||
component: () => import('@/views/keep-alive/add-content.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
33
smart-admin-web/src/router/module/monitor.js
Normal file
33
smart-admin-web/src/router/module/monitor.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import Main from '@/components/main';
|
||||
// 系统监控
|
||||
export const monitor = [
|
||||
{
|
||||
path: '/monitor',
|
||||
component: Main,
|
||||
name: 'Monitor',
|
||||
meta: {
|
||||
title: '系统监控',
|
||||
icon: 'icon iconfont iconxitongjiankong'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/monitor/online-user',
|
||||
name: 'OnlineUser',
|
||||
meta: {
|
||||
title: '在线人数',
|
||||
childrenPoints: [{ title: '查询', name: 'online-user-search' }]
|
||||
},
|
||||
component: () => import('@/views/monitor/online-user.vue')
|
||||
},
|
||||
// SQL监控
|
||||
{
|
||||
path: '/monitor/sql',
|
||||
name: 'Sql',
|
||||
meta: {
|
||||
title: 'SQL监控'
|
||||
},
|
||||
component: () => import('@/views/monitor/sql.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
43
smart-admin-web/src/router/module/notice.js
Normal file
43
smart-admin-web/src/router/module/notice.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import Main from '@/components/main';
|
||||
// 消息管理
|
||||
export const notice = [
|
||||
{
|
||||
path: '/notice',
|
||||
name: 'Notice',
|
||||
component: Main,
|
||||
meta: {
|
||||
title: '消息管理',
|
||||
icon: 'icon iconfont iconnews'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/notice/notice-list',
|
||||
name: 'NoticeList',
|
||||
meta: {
|
||||
title: '通知管理',
|
||||
childrenPoints: [
|
||||
{ title: '查询', name: 'notice-query' },
|
||||
{ title: '添加', name: 'notice-add' },
|
||||
{ title: '修改', name: 'notice-edit' },
|
||||
{ title: '删除', name: 'notice-delete' },
|
||||
{ title: '详情', name: 'notice-detail' },
|
||||
{ title: '发送', name: 'notice-send' }
|
||||
]
|
||||
},
|
||||
component: () => import('@/views/notice/notice-list.vue')
|
||||
},
|
||||
{
|
||||
path: '/notice/person-notice',
|
||||
name: 'PersonNotice',
|
||||
meta: {
|
||||
title: '个人消息',
|
||||
childrenPoints: [
|
||||
{ title: '查询', name: 'person-notice-query' },
|
||||
{ title: '详情', name: 'person-notice-detail' }
|
||||
]
|
||||
},
|
||||
component: () => import('@/views/notice/person-notice.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
40
smart-admin-web/src/router/module/reload.js
Normal file
40
smart-admin-web/src/router/module/reload.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import Main from '@/components/main';
|
||||
// 动态加载
|
||||
export const reload = [
|
||||
{
|
||||
path: '/reload',
|
||||
name: 'Reload',
|
||||
component: Main,
|
||||
meta: {
|
||||
title: '动态加载',
|
||||
icon: 'icon iconfont icondongtaijiazai'
|
||||
},
|
||||
|
||||
children: [
|
||||
{
|
||||
path: '/reload/smart-reload-list',
|
||||
name: 'SmartReloadList',
|
||||
meta: {
|
||||
title: 'SmartReload',
|
||||
icon: 'icon iconfont icondongtaijiazai',
|
||||
childrenPoints: [
|
||||
{
|
||||
title: '查询',
|
||||
name: 'smart-reload-search'
|
||||
},
|
||||
{
|
||||
title: '执行reload',
|
||||
name: 'smart-reload-update'
|
||||
},
|
||||
{
|
||||
title: '查看执行结果',
|
||||
name: 'smart-reload-result'
|
||||
}
|
||||
]
|
||||
},
|
||||
component: () =>
|
||||
import('@/views/reload/smart-reload/smart-reload-list.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
62
smart-admin-web/src/router/module/system-setting.js
Normal file
62
smart-admin-web/src/router/module/system-setting.js
Normal file
@@ -0,0 +1,62 @@
|
||||
import Main from '@/components/main';
|
||||
// 基础设置
|
||||
export const systemSetting = [
|
||||
{
|
||||
path: '/system-setting',
|
||||
name: 'SystemSetting',
|
||||
component: Main,
|
||||
meta: {
|
||||
title: '系统设置',
|
||||
icon: 'icon iconfont iconxitongshezhi'
|
||||
},
|
||||
|
||||
children: [
|
||||
{
|
||||
path: '/system-setting/system-config',
|
||||
name: 'SystemConfig',
|
||||
meta: {
|
||||
title: '系统参数',
|
||||
childrenPoints: [
|
||||
{
|
||||
title: '查询系统参数',
|
||||
name: 'system-params-search'
|
||||
},
|
||||
{
|
||||
title: '添加系统参数',
|
||||
name: 'system-params-add'
|
||||
},
|
||||
{
|
||||
title: '修改系统参数',
|
||||
name: 'system-config-update'
|
||||
},
|
||||
{
|
||||
title: '搜索系统参数',
|
||||
name: 'system-config-search'
|
||||
}
|
||||
]
|
||||
},
|
||||
component: () =>
|
||||
import('@/views/system-setting/system-config/system-config.vue')
|
||||
},
|
||||
{
|
||||
path: '/system-setting/system-privilege',
|
||||
name: 'SystemPrivilege',
|
||||
meta: {
|
||||
title: '菜单管理',
|
||||
childrenPoints: [
|
||||
{
|
||||
title: '编辑',
|
||||
name: 'privilege-main-update'
|
||||
},
|
||||
{
|
||||
title: '查询',
|
||||
name: 'privilege-main-search'
|
||||
}
|
||||
]
|
||||
},
|
||||
component: () =>
|
||||
import('@/views/system-setting/system-privilege/system-privilege.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
63
smart-admin-web/src/router/module/task.js
Normal file
63
smart-admin-web/src/router/module/task.js
Normal file
@@ -0,0 +1,63 @@
|
||||
import Main from '@/components/main';
|
||||
// 任务调度
|
||||
export const task = [
|
||||
{
|
||||
path: '/task',
|
||||
name: 'Task',
|
||||
component: Main,
|
||||
meta: {
|
||||
title: '定时任务',
|
||||
icon: 'icon iconfont icondingshirenwu'
|
||||
},
|
||||
|
||||
children: [
|
||||
{
|
||||
path: '/system-setting/task-list',
|
||||
name: 'TaskList',
|
||||
meta: {
|
||||
title: '任务管理',
|
||||
icon: 'icon iconfont icondingshirenwu',
|
||||
childrenPoints: [
|
||||
{
|
||||
title: '查询任务',
|
||||
name: 'task-search'
|
||||
},
|
||||
{
|
||||
title: '刷新任务',
|
||||
name: 'task-refresh'
|
||||
},
|
||||
{
|
||||
title: '添加任务',
|
||||
name: 'task-add'
|
||||
},
|
||||
{
|
||||
title: '编辑任务',
|
||||
name: 'task-update'
|
||||
},
|
||||
{
|
||||
title: '暂停任务',
|
||||
name: 'task-pause'
|
||||
},
|
||||
{
|
||||
title: '恢复任务',
|
||||
name: 'task-resume'
|
||||
},
|
||||
{
|
||||
title: '立即运行任务',
|
||||
name: 'task-run'
|
||||
},
|
||||
{
|
||||
title: '查看任务日志',
|
||||
name: 'task-query-log'
|
||||
},
|
||||
{
|
||||
title: '删除任务',
|
||||
name: 'task-delete'
|
||||
}
|
||||
]
|
||||
},
|
||||
component: () => import('@/views/task/task-list.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
62
smart-admin-web/src/router/module/three-router.js
Normal file
62
smart-admin-web/src/router/module/three-router.js
Normal file
@@ -0,0 +1,62 @@
|
||||
import Main from '@/components/main';
|
||||
// 三级路由演示
|
||||
export const threeRouter = [
|
||||
{
|
||||
path: '/three-router',
|
||||
name: 'ThreeRouter',
|
||||
component: Main,
|
||||
meta: {
|
||||
title: '三级路由',
|
||||
icon: 'icon iconfont iconzujian'
|
||||
},
|
||||
children: [
|
||||
// 最大支持到三级菜单
|
||||
{
|
||||
path: '/three-router/level-two',
|
||||
name: 'LevelTwo',
|
||||
meta: {
|
||||
title: '三级菜单'
|
||||
},
|
||||
component: () => import('@/views/home'),
|
||||
children: [
|
||||
{
|
||||
path: '/three-router/level-two/level-three1',
|
||||
name: 'RoleOneTwo',
|
||||
meta: {
|
||||
title: '三级A',
|
||||
childrenPoints: [
|
||||
{ title: '添加', name: 'roleOneTwo-add' },
|
||||
{ title: '删除', name: 'roleOneTwo-delete' }
|
||||
]
|
||||
},
|
||||
component: () => import('@/views/home')
|
||||
},
|
||||
{
|
||||
path: '/three-router/level-two/level-three2',
|
||||
name: 'RoleTwoTwo',
|
||||
meta: {
|
||||
title: '三级B',
|
||||
childrenPoints: [
|
||||
{ title: '添加', name: 'roleTwoTwo-add' },
|
||||
{ title: '删除', name: 'roleTwoTwo-delete' }
|
||||
]
|
||||
},
|
||||
component: () => import('@/views/home')
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/three-router/level-two2',
|
||||
name: 'RoleOneOne',
|
||||
meta: {
|
||||
title: '二级菜单',
|
||||
childrenPoints: [
|
||||
{ title: '添加', name: 'roleOneOne-add' },
|
||||
{ title: '删除', name: 'roleOneOne-delete' }
|
||||
]
|
||||
},
|
||||
component: () => import('@/views/home')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
42
smart-admin-web/src/router/module/user-log.js
Normal file
42
smart-admin-web/src/router/module/user-log.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import Main from '@/components/main';
|
||||
// 用户日志
|
||||
export const userLog = [
|
||||
{
|
||||
path: '/user-log',
|
||||
name: 'UserLog',
|
||||
component: Main,
|
||||
meta: {
|
||||
title: '用户日志',
|
||||
icon: 'ios-paper-outline'
|
||||
},
|
||||
children: [
|
||||
// 发送email
|
||||
{
|
||||
path: '/user-log/user-operate-log',
|
||||
name: 'UserOperateLog',
|
||||
meta: {
|
||||
title: '用户操作日志',
|
||||
childrenPoints: [
|
||||
{ title: '查询', name: 'user-operate-log-search' },
|
||||
{ title: '详情', name: 'user-operate-log-detail' },
|
||||
{ title: '删除', name: 'user-operate-log-delete' }
|
||||
]
|
||||
},
|
||||
component: () => import('@/views/user-log/user-operate-log.vue')
|
||||
},
|
||||
// 人员管理页面路由
|
||||
{
|
||||
path: '/user-log/user-login-log',
|
||||
name: 'UserLoginLog',
|
||||
meta: {
|
||||
title: '用户登录日志',
|
||||
childrenPoints: [
|
||||
{ title: '查询', name: 'user-login-log-search' },
|
||||
{ title: '删除', name: 'user-login-log-delete' }
|
||||
]
|
||||
},
|
||||
component: () => import('@/views/user-log/user-login-log.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
61
smart-admin-web/src/router/routers.js
Normal file
61
smart-admin-web/src/router/routers.js
Normal file
@@ -0,0 +1,61 @@
|
||||
import { home } from './module/home';
|
||||
import { employee } from './module/employee';
|
||||
import { systemSetting } from './module/system-setting';
|
||||
import { notice } from './module/notice';
|
||||
import { emailSetting } from './module/email';
|
||||
import { monitor } from './module/monitor';
|
||||
import { userLog } from './module/user-log';
|
||||
import { error } from './module/error';
|
||||
import { task } from './module/task';
|
||||
import { reload } from './module/reload';
|
||||
import { apiDoc } from './module/api-doc';
|
||||
import { threeRouter } from './module/three-router';
|
||||
import { keepAlive } from './module/keep-alive';
|
||||
import { heartBeat } from './module/heart-beat';
|
||||
import { file } from './module/file';
|
||||
|
||||
/**
|
||||
*
|
||||
* iview-admin中meta除了原生参数外可配置的参数:
|
||||
* meta: {
|
||||
* title: { String|Number|Function }
|
||||
* 显示在侧边栏、面包屑和标签栏的文字
|
||||
* 使用'{{ 多语言字段 }}'形式结合多语言使用,例子看多语言的路由配置;
|
||||
* 可以传入一个回调函数,参数是当前路由对象,例子看动态路由和带参路由
|
||||
* hideInBread: (false) 设为true后此级路由将不会出现在面包屑中,示例看QQ群路由配置
|
||||
* hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项,
|
||||
* group:{String} 同一功能模块下子页面的功能点权限继承菜单模块创建的路由权限 by lihaifan&lipeng
|
||||
* noKeepAlive: (false) 设为true后页面在切换标签后不会缓存,如果需要缓存,无需设置这个字段,而且需要设置页面组件name属性和路由配置的name一致
|
||||
* access: (null) 可访问该页面的权限数组,当前路由设置的权限会影响子路由
|
||||
* }
|
||||
*/
|
||||
// 登录模块
|
||||
export const login = {
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
meta: {
|
||||
hideInMenu: true,
|
||||
title: 'Login - 登录'
|
||||
},
|
||||
component: () => import('@/views/login/login.vue')
|
||||
};
|
||||
|
||||
// 全部路由
|
||||
export const routers = [
|
||||
login,
|
||||
...home,
|
||||
...employee,
|
||||
...systemSetting,
|
||||
...notice,
|
||||
...emailSetting,
|
||||
...userLog,
|
||||
...monitor,
|
||||
...error,
|
||||
...task,
|
||||
...reload,
|
||||
...apiDoc,
|
||||
...threeRouter,
|
||||
...keepAlive,
|
||||
...heartBeat,
|
||||
...file
|
||||
];
|
||||
Reference in New Issue
Block a user