|
@ -6,6 +6,7 @@ import store from "@/js/store"; |
|
|
|
|
|
|
|
|
Vue.use(Router); |
|
|
Vue.use(Router); |
|
|
|
|
|
|
|
|
|
|
|
const CUSTOMER = process.env.VUE_APP_CUSTOMER; |
|
|
// 页面路由(独立页面)
|
|
|
// 页面路由(独立页面)
|
|
|
export const pageRoutes = [ |
|
|
export const pageRoutes = [ |
|
|
{ |
|
|
{ |
|
@ -26,7 +27,11 @@ export const pageRoutes = [ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
path: "/login", |
|
|
path: "/login", |
|
|
component: () => import("@/views/pages/login"), |
|
|
component: () => { |
|
|
|
|
|
return CUSTOMER == "yantai" |
|
|
|
|
|
? import("@/views/pages/yantai-login") |
|
|
|
|
|
: import("@/views/pages/login"); |
|
|
|
|
|
}, |
|
|
name: "login", |
|
|
name: "login", |
|
|
meta: { |
|
|
meta: { |
|
|
title: "登录", |
|
|
title: "登录", |
|
@ -35,7 +40,11 @@ export const pageRoutes = [ |
|
|
{ |
|
|
{ |
|
|
path: "/", |
|
|
path: "/", |
|
|
name: "index", |
|
|
name: "index", |
|
|
component: () => import("@/views/pages/index"), |
|
|
component: () => { |
|
|
|
|
|
return CUSTOMER == "yantai" |
|
|
|
|
|
? import("@/views/pages/yantai-index") |
|
|
|
|
|
: import("@/views/pages/index"); |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
path: "/indexWork", |
|
|
path: "/indexWork", |
|
@ -138,6 +147,18 @@ function cookApiDataItem(item) { |
|
|
// });
|
|
|
// });
|
|
|
return item; |
|
|
return item; |
|
|
} |
|
|
} |
|
|
|
|
|
// 把按钮都化为页面内部的权限
|
|
|
|
|
|
function cookApiDataItem2(item) { |
|
|
|
|
|
let { children } = item; |
|
|
|
|
|
if (children && Array.isArray(children) && children.length > 0) { |
|
|
|
|
|
let btns = item.children.filter((item) => item.type == 1); |
|
|
|
|
|
item.btns = btns; |
|
|
|
|
|
item.children = item.children |
|
|
|
|
|
.filter((val) => val.type == 0) |
|
|
|
|
|
.map((val) => cookApiDataItem2(val)); |
|
|
|
|
|
} |
|
|
|
|
|
return item; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 模块路由(基于主入口布局页面) 可视化数据
|
|
|
// 模块路由(基于主入口布局页面) 可视化数据
|
|
|
export const moduleShujuRoutes = { |
|
|
export const moduleShujuRoutes = { |
|
@ -145,7 +166,10 @@ export const moduleShujuRoutes = { |
|
|
component: () => import("@/views/main-shuju/main"), |
|
|
component: () => import("@/views/main-shuju/main"), |
|
|
name: "main-shuju", |
|
|
name: "main-shuju", |
|
|
redirect: { |
|
|
redirect: { |
|
|
path: "/main-shuju/visual-basicinfo-basicInfoMain", |
|
|
path: |
|
|
|
|
|
CUSTOMER == "yantai" && process.env.VUE_APP_NODE_ENV == "prod" |
|
|
|
|
|
? "/main-shuju/i-1536625421829599234" |
|
|
|
|
|
: "/main-shuju/visual-basicinfo-basicInfoMain", |
|
|
}, |
|
|
}, |
|
|
meta: { |
|
|
meta: { |
|
|
title: "主入口布局", |
|
|
title: "主入口布局", |
|
@ -282,9 +306,9 @@ router.beforeEach((to, from, next) => { |
|
|
name: "login", |
|
|
name: "login", |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
window.SITE_CONFIG["menuList"] = res.data.map((item) => |
|
|
window.SITE_CONFIG["menuList"] = res.data |
|
|
cookApiDataItem(item) |
|
|
.map((item) => cookApiDataItem2(item)) |
|
|
); |
|
|
.map((item) => cookApiDataItem(item)); |
|
|
fnAddDynamicMenuRoutes(window.SITE_CONFIG["menuList"]); |
|
|
fnAddDynamicMenuRoutes(window.SITE_CONFIG["menuList"]); |
|
|
// next({ ...to, replace: true })
|
|
|
// next({ ...to, replace: true })
|
|
|
next({ |
|
|
next({ |
|
@ -338,6 +362,7 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) { |
|
|
...window.SITE_CONFIG["contentTabDefault"], |
|
|
...window.SITE_CONFIG["contentTabDefault"], |
|
|
menuId: menuList[i].id, |
|
|
menuId: menuList[i].id, |
|
|
title: menuList[i].name, |
|
|
title: menuList[i].name, |
|
|
|
|
|
btns: menuList[i].btns || [], |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
// eslint-disable-next-line
|
|
|
// eslint-disable-next-line
|
|
|