数据库结构分类
This commit is contained in:
parent
8c8c548f70
commit
4aca5a138e
|
@ -10,13 +10,13 @@ const constantRouterComponents = {
|
||||||
BlankLayout: BlankLayout,
|
BlankLayout: BlankLayout,
|
||||||
RouteView: RouteView,
|
RouteView: RouteView,
|
||||||
PageView: PageView,
|
PageView: PageView,
|
||||||
'403': () => import(/* webpackChunkName: "error" */ '@/views/exception/403'),
|
403: () => import(/* webpackChunkName: "error" */ '@/views/exception/403'),
|
||||||
'404': () => import(/* webpackChunkName: "error" */ '@/views/exception/404'),
|
404: () => import(/* webpackChunkName: "error" */ '@/views/exception/404'),
|
||||||
'500': () => import(/* webpackChunkName: "error" */ '@/views/exception/500'),
|
500: () => import(/* webpackChunkName: "error" */ '@/views/exception/500'),
|
||||||
|
|
||||||
// 你需要动态引入的页面组件
|
// 你需要动态引入的页面组件
|
||||||
WorkplaceEquipment: () => import('@/views/dashboard/WorkplaceEquipment'),
|
WorkplaceEquipment: () => import('@/views/dashboard/WorkplaceEquipment'),
|
||||||
Analysis: () => import('@/views/dashboard/Analysis')
|
Analysis: () => import('@/views/dashboard/Analysis'),
|
||||||
// 'TestWork': () => import(/* webpackChunkName: "TestWork" */ '@/views/dashboard/TestWork')
|
// 'TestWork': () => import(/* webpackChunkName: "TestWork" */ '@/views/dashboard/TestWork')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ const constantRouterComponents = {
|
||||||
const notFoundRouter = {
|
const notFoundRouter = {
|
||||||
path: '*',
|
path: '*',
|
||||||
redirect: '/404',
|
redirect: '/404',
|
||||||
hidden: true
|
hidden: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根级菜单
|
// 根级菜单
|
||||||
|
@ -36,9 +36,72 @@ const rootRouter = {
|
||||||
component: 'BasicLayout',
|
component: 'BasicLayout',
|
||||||
// redirect: '/dashboard/equipment',
|
// redirect: '/dashboard/equipment',
|
||||||
meta: {
|
meta: {
|
||||||
title: '首页'
|
title: '首页',
|
||||||
},
|
},
|
||||||
children: []
|
children: [],
|
||||||
|
}
|
||||||
|
|
||||||
|
const systemNav = {
|
||||||
|
id: '_67ed94a37b03415c8ee77a8991e79745',
|
||||||
|
title: '系统管理',
|
||||||
|
key: 'System',
|
||||||
|
name: '系统管理',
|
||||||
|
component: 'BasicLayout',
|
||||||
|
redirect: '/system/userlist',
|
||||||
|
parentId: '',
|
||||||
|
icon: 'dashboard',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
id: '_1',
|
||||||
|
title: '菜单管理',
|
||||||
|
key: 'MenuList',
|
||||||
|
name: '菜单管理',
|
||||||
|
component: 'isystem/menuList',
|
||||||
|
redirect: null,
|
||||||
|
parentId: '67ed94a37b03415c8ee77a8991e79745',
|
||||||
|
icon: 'dashboard',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '_5114bf6a963f41149ab2435c86551927',
|
||||||
|
title: '用户管理',
|
||||||
|
key: 'UserList',
|
||||||
|
name: '用户管理',
|
||||||
|
component: 'isystem/userList',
|
||||||
|
redirect: null,
|
||||||
|
parentId: '67ed94a37b03415c8ee77a8991e79745',
|
||||||
|
icon: 'dashboard',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '_230a5ebe7cdc41acb997122d6de2d86f',
|
||||||
|
title: '角色管理',
|
||||||
|
key: 'RoleList',
|
||||||
|
name: '角色管理',
|
||||||
|
component: 'isystem/roleList',
|
||||||
|
redirect: null,
|
||||||
|
parentId: '67ed94a37b03415c8ee77a8991e79745',
|
||||||
|
icon: 'dashboard',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '_2fd1683b13c241be84c34185ff55028e',
|
||||||
|
title: '字典管理',
|
||||||
|
key: 'DictIndex',
|
||||||
|
name: '字典管理',
|
||||||
|
component: 'isystem/dict/dictlist',
|
||||||
|
redirect: null,
|
||||||
|
parentId: '67ed94a37b03415c8ee77a8991e79745',
|
||||||
|
icon: 'dashboard',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '_85924f8619f1451e847c9f69705f360f',
|
||||||
|
title: '系统日志',
|
||||||
|
key: 'LogList',
|
||||||
|
name: '系统日志',
|
||||||
|
component: 'isystem/logList',
|
||||||
|
redirect: null,
|
||||||
|
parentId: '67ed94a37b03415c8ee77a8991e79745',
|
||||||
|
icon: 'dashboard',
|
||||||
|
},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,11 +138,11 @@ const rootRouter = {
|
||||||
// })
|
// })
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
export const generatorDynamicRouter = token => {
|
export const generatorDynamicRouter = (token) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
loginService
|
loginService
|
||||||
.getCurrentUserNav()
|
.getCurrentUserNav()
|
||||||
.then(res => {
|
.then((res) => {
|
||||||
console.log('generatorDynamicRouter response:', res)
|
console.log('generatorDynamicRouter response:', res)
|
||||||
const data = res.data
|
const data = res.data
|
||||||
const childrenNav = []
|
const childrenNav = []
|
||||||
|
@ -87,11 +150,14 @@ export const generatorDynamicRouter = token => {
|
||||||
// 后端数据, 根级树数组, 根级 PID
|
// 后端数据, 根级树数组, 根级 PID
|
||||||
listToTree(data, childrenNav, '')
|
listToTree(data, childrenNav, '')
|
||||||
console.log('childrenNav', childrenNav)
|
console.log('childrenNav', childrenNav)
|
||||||
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
|
childrenNav.push(systemNav)
|
||||||
|
}
|
||||||
const routers = generator(childrenNav)
|
const routers = generator(childrenNav)
|
||||||
console.log('routers', routers)
|
console.log('routers', routers)
|
||||||
resolve(routers)
|
resolve(routers)
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch((err) => {
|
||||||
reject(err)
|
reject(err)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -105,7 +171,7 @@ export const generatorDynamicRouter = token => {
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export const generator = (routerMap, parent) => {
|
export const generator = (routerMap, parent) => {
|
||||||
return routerMap.map(item => {
|
return routerMap.map((item) => {
|
||||||
const { title, show, hideChildren, hiddenHeaderContent, target, icon } = item || item.meta || {}
|
const { title, show, hideChildren, hiddenHeaderContent, target, icon } = item || item.meta || {}
|
||||||
const currentRouter = {
|
const currentRouter = {
|
||||||
// 如果路由设置了 path,则作为默认 path,否则 路由地址 动态拼接生成如 /dashboard/workplace
|
// 如果路由设置了 path,则作为默认 path,否则 路由地址 动态拼接生成如 /dashboard/workplace
|
||||||
|
@ -123,9 +189,9 @@ export const generatorDynamicRouter = token => {
|
||||||
title: title,
|
title: title,
|
||||||
icon: icon || undefined,
|
icon: icon || undefined,
|
||||||
hiddenHeaderContent: hiddenHeaderContent,
|
hiddenHeaderContent: hiddenHeaderContent,
|
||||||
target: target
|
target: target,
|
||||||
// permission: item.name
|
// permission: item.name
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
// 是否设置了隐藏菜单
|
// 是否设置了隐藏菜单
|
||||||
if (show === false) {
|
if (show === false) {
|
||||||
|
@ -157,13 +223,13 @@ export const generatorDynamicRouter = token => {
|
||||||
* @param parentId 父ID
|
* @param parentId 父ID
|
||||||
*/
|
*/
|
||||||
const listToTree = (list, tree, parentId) => {
|
const listToTree = (list, tree, parentId) => {
|
||||||
list.forEach(item => {
|
list.forEach((item) => {
|
||||||
// 判断是否为父级菜单
|
// 判断是否为父级菜单
|
||||||
if (item.parentId === parentId) {
|
if (item.parentId === parentId) {
|
||||||
const child = {
|
const child = {
|
||||||
...item,
|
...item,
|
||||||
key: item.key || item.name,
|
key: item.key || item.name,
|
||||||
children: []
|
children: [],
|
||||||
}
|
}
|
||||||
// 迭代 list, 找到当前菜单相符合的所有子菜单
|
// 迭代 list, 找到当前菜单相符合的所有子菜单
|
||||||
listToTree(list, child.children, item.id)
|
listToTree(list, child.children, item.id)
|
||||||
|
|
|
@ -28,49 +28,49 @@ export default {
|
||||||
{
|
{
|
||||||
title: '作战力量数据库',
|
title: '作战力量数据库',
|
||||||
image: require('@/assets/images/simulation-scene/database/zzllsjk.png'),
|
image: require('@/assets/images/simulation-scene/database/zzllsjk.png'),
|
||||||
path: '/databaseSystem/zzllsjk',
|
path: '/bzstlsjk/zzllsjk',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '保障力量数据库',
|
title: '保障力量数据库',
|
||||||
image: require('@/assets/images/simulation-scene/database/bzllsjk.png'),
|
image: require('@/assets/images/simulation-scene/database/bzllsjk.png'),
|
||||||
path: '/databaseSystem/bzllsjk',
|
path: '/bzstlsjk/bzllsjk',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '保障环境数据库',
|
title: '保障环境数据库',
|
||||||
image: require('@/assets/images/simulation-scene/database/bzhjsjk.png'),
|
image: require('@/assets/images/simulation-scene/database/bzhjsjk.png'),
|
||||||
path: '/databaseSystem/bzhjsjk',
|
path: '/bzstlsjk/bzhjsjk',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '装备数据库',
|
title: '装备数据库',
|
||||||
image: require('@/assets/images/simulation-scene/database/bzhjsjk.png'),
|
image: require('@/assets/images/simulation-scene/database/bzhjsjk.png'),
|
||||||
path: '/databaseSystem/zbsjk',
|
path: '/bzstlsjk/zbsjk',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
ywyylsjk: [
|
ywyylsjk: [
|
||||||
{
|
{
|
||||||
title: '想定数据库',
|
title: '想定数据库',
|
||||||
image: require('@/assets/images/simulation-scene/database/xdsjk.png'),
|
image: require('@/assets/images/simulation-scene/database/xdsjk.png'),
|
||||||
path: '/databaseSystem/xdsjk',
|
path: '/ywyylsjk/xdsjk',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '方案数据库',
|
title: '方案数据库',
|
||||||
image: require('@/assets/images/simulation-scene/database/fasjk.png'),
|
image: require('@/assets/images/simulation-scene/database/fasjk.png'),
|
||||||
path: '/databaseSystem/fasjk',
|
path: '/ywyylsjk/fasjk',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '进程数据库',
|
title: '进程数据库',
|
||||||
image: require('@/assets/images/simulation-scene/database/jcsjk.png'),
|
image: require('@/assets/images/simulation-scene/database/jcsjk.png'),
|
||||||
path: '/databaseSystem/jcsjk',
|
path: '/ywyylsjk/jcsjk',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '图形数据库',
|
title: '图形数据库',
|
||||||
image: require('@/assets/images/simulation-scene/database/txsjk.png'),
|
image: require('@/assets/images/simulation-scene/database/txsjk.png'),
|
||||||
path: '/databaseSystem/txsjk',
|
path: '/bzstlsjk/txsjk',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '运行记录数据库',
|
title: '运行记录数据库',
|
||||||
image: require('@/assets/images/simulation-scene/database/yxjlsjk.png'),
|
image: require('@/assets/images/simulation-scene/database/yxjlsjk.png'),
|
||||||
path: '/databaseSystem/yxjlsjk',
|
path: '/ywyylsjk/yxjlsjk',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ export default {
|
||||||
moduleCode: 'db_system',
|
moduleCode: 'db_system',
|
||||||
moduleName: '数据库子系统',
|
moduleName: '数据库子系统',
|
||||||
icon: require('@/assets/images/simulation-scene/system-icon/database.png'),
|
icon: require('@/assets/images/simulation-scene/system-icon/database.png'),
|
||||||
modulePath: '/databaseSystem/zzllsjk',
|
modulePath: '/bzstlsjk/zzllsjk',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
moduleCode: 'simulation_system',
|
moduleCode: 'simulation_system',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user