Commit 4331b1dd by 姜雷

修改打包

parent bed93281
......@@ -13,7 +13,6 @@
<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
<script src="https://unpkg.com/vuex@3.1.0/dist/vuex.js"></script>
<script src="https://unpkg.com/vue-router@3.0.1/dist/vue-router.js"></script>
<link rel="stylesheet" href="<%= VUE_APP_DEV_LIB_URL %>/lib/manageShell.css" />
<title>多彩综合管理系统</title>
</head>
......
import CreatSystem from './lib/main';
import asyncRouterMap from './router/asyncRoutes';
window.manageShell = { default: CreatSystem };
window.allAasyncRouterMap = [...asyncRouterMap];
const routeFilter = (routes, allRoute) => {
......@@ -32,47 +34,45 @@ script.text = `
'deviceManage',
'smaproManage',
];
System.import(
'${process.env.VUE_APP_DEV_LIB_URL}/lib/manageShell.umd.min.js'
).then(function(module) {
var manageShell = module.default;
return Promise.all(
routeNameList.map(function(name) {
return System.import('${process.env.VUE_APP_SUBSYSTEM}/' + name + '/lib/' + name + '.umd.min.js?t=${new Date().getTime()}');
})
).then(function(res) {
for (let index = 0; index < res.length; index++) {
const element = res[index];
allAasyncRouterMap = allAasyncRouterMap.concat(element.default.default);
}
manageShell.default.createSystem({
basePath: '${process.env.VUE_APP_BASE_URL}',
routers: allAasyncRouterMap,
routeFilter: function(routes, allRoute) {
if (allRoute && allRoute.length) {
let addRoute = manageShell.default.utils.route.formatRouteLink(
allRoute
);
for (let index = 0; index < addRoute.length; index++) {
const element = addRoute[index];
if (element.children) {
routes = routes.concat(element.children);
} else if (
element.menuCode === ${
process.env.VUE_APP_REGISTER_DASHBOARD_CODE
}
) {
routes.unshift(element);
Promise.all(
routeNameList.map(function(name) {
return System.import('${
process.env.VUE_APP_SUBSYSTEM
}/' + name + '/lib/' + name + '.umd.min.js?t=${new Date().getTime()}');
})
)
.then(function(res) {
for (let index = 0; index < res.length; index++) {
const element = res[index];
allAasyncRouterMap = allAasyncRouterMap.concat(element.default.default);
}
manageShell.default.createSystem({
basePath: '${process.env.VUE_APP_BASE_URL}',
routers: allAasyncRouterMap,
routeFilter: function(routes, allRoute) {
if (allRoute && allRoute.length) {
let addRoute = manageShell.default.utils.route.formatRouteLink(
allRoute
);
for (let index = 0; index < addRoute.length; index++) {
const element = addRoute[index];
if (element.children) {
routes = routes.concat(element.children);
} else if (
element.menuCode === ${
process.env.VUE_APP_REGISTER_DASHBOARD_CODE
}
) {
routes.unshift(element);
}
}
}
return {
allRoute,
routes,
};
},
});
return {
allRoute,
routes,
};
},
});
});
`;
......
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