Commit 186c607a authored by 李苏's avatar 李苏 💬

erp首页调整

parent 3b05ea21
......@@ -66,20 +66,20 @@ export const constantRoutes = [
component: () => import('@/views/error/401'),
hidden: true
},
{
path: '',
component: Layout,
redirect: 'index',
hidden: true,
children: [
{
path: 'index',
component: () => import('@/views/index'),
name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
},
// {
// path: '',
// component: Layout,
// redirect: 'index',
// hidden: true,
// children: [
// {
// path: 'index',
// component: () => import('@/views/index'),
// name: 'Index',
// meta: { title: '首页', icon: 'dashboard', affix: true }
// }
// ]
// },
{
path: '/user',
component: Layout,
......
......@@ -99,6 +99,7 @@ const permission = {
commit('SET_SYSTEMNAME', systemName)
/* 构建新list放进列表切换*/
localStorage.setItem('appName', appName)
localStorage.setItem('appType', res.data.appType||1)
/* 存储system id list*/
/* 将可切换系统存入store*/
let systemInfo = res.data.systemInfo || []
......@@ -149,13 +150,79 @@ const permission = {
newmenus.push(mi)
}
})
// res.data=[...
// newCommonList, ...newErpList, ...newPowerRoutes]
// res.data=[...
// newCommonList, ...newErpList, ...newPowerRoutes]
res.data = dynamicRouter([...newCommonList, ...newErpList, ...newPowerRoutes], asymenus) || [...
newCommonList, ...newErpList, ...newPowerRoutes
]
/* 重置首页路由*/
// let hompePage = treeToList([...newCommonList,...newErpList,...newPowerRoutes]).filter(item=>item.mkid==localStorage.getItem('homeMkid'))
let ttlist = treeToList([...newCommonList, ...newErpList, ...newPowerRoutes])
let homePage = ttlist.filter(item => item.mkid == localStorage.getItem('homeMkid'))
/* 替换首页*/
if (homePage && homePage[0]) {
if (homePage[0].component) {
// Layout ParentView 组件特殊处理
if (homePage[0].component === 'Layout') {
homePage[0].component = Layout
} else if (homePage[0].component === 'ParentView') {
homePage[0].component = ParentView
} else if (homePage[0].component === 'InnerLink') {
homePage[0].component = InnerLink
} else {
if (homePage[0].commonComponent) {
homePage[0].component = loadCommonView(homePage[0].component)
} else if (homePage[0].erpComponent) {
homePage[0].component = loadErpView(homePage[0].component)
} else {
homePage[0].component = loadView(homePage[0].component)
}
}
}
/* 移除默认路由*/
let newHome = {
path: '',
component: Layout,
redirect: 'index',
hidden: true,
children: [{
path: 'index',
component: homePage[0].component ,
name: 'Index',
meta: {
title: '首页',
icon: 'dashboard',
affix: true
}
}]
}
router.addRoutes([newHome])
constantRoutes.push(newHome)
}else{
let newHome= {
path: '',
component: Layout,
redirect: 'index',
hidden: true,
children: [{
path: 'index',
component: () => import('@/views/index'),
name: 'Index',
meta: {
title: '首页',
icon: 'dashboard',
affix: true
}
}]
}
router.addRoutes([newHome])
constantRoutes.push(newHome)
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment