Commit 187f4285 by 姜雷

Merge branch 'develop' into 'test'

Develop See merge request !175
parents 44d254a3 ea5cfdd5
VUE_APP_SYSTEM_VERSION=1.0.3
VUE_APP_BASE_URL=/ VUE_APP_BASE_URL=/
VUE_APP_DEV_LIB_URL= VUE_APP_DEV_LIB_URL=
VUE_APP_CUSTOMER_MENU_CODE=0001 VUE_APP_CUSTOMER_MENU_CODE=0001
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
"popmotion": "^8.1.22", "popmotion": "^8.1.22",
"qiniu-js": "^2.2.0", "qiniu-js": "^2.2.0",
"rym-element-ui": "^0.1.63", "rym-element-ui": "^0.1.63",
"systemjs": "^4.0.0",
"vue-qr": "^1.2.8", "vue-qr": "^1.2.8",
"vuedraggable": "^2.16.0", "vuedraggable": "^2.16.0",
"wangeditor": "^3.1.1" "wangeditor": "^3.1.1"
......
...@@ -9,10 +9,17 @@ ...@@ -9,10 +9,17 @@
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>ic_logo.ico" /> <link rel="icon" href="<%= BASE_URL %>ic_logo.ico" />
<script src="<%= BASE_URL %>system.js"></script>
<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script> <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/vuex@3.1.0/dist/vuex.js"></script>
<script src="https://unpkg.com/vue-router@3.0.1/dist/vue-router.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" /> <link rel="stylesheet" href="<%= VUE_APP_SUBSYSTEM %>/customerManage/lib/customerManage.css" />
<link rel="stylesheet" href="<%= VUE_APP_SUBSYSTEM %>/baseManage/lib/baseManage.css" />
<link rel="stylesheet" href="<%= VUE_APP_SUBSYSTEM %>/systemManage/lib/systemManage.css" />
<link rel="stylesheet" href="<%= VUE_APP_SUBSYSTEM %>/operateManage/lib/operateManage.css" />
<link rel="stylesheet" href="<%= VUE_APP_SUBSYSTEM %>/statisticsManage/lib/statisticsManage.css" />
<link rel="stylesheet" href="<%= VUE_APP_SUBSYSTEM %>/deviceManage/lib/deviceManage.css" />
<link rel="stylesheet" href="<%= VUE_APP_SUBSYSTEM %>/smaproManage/lib/smaproManage.css" />
<title>多彩综合管理系统</title> <title>多彩综合管理系统</title>
</head> </head>
...@@ -24,21 +31,6 @@ ...@@ -24,21 +31,6 @@
<div id="app"></div> <div id="app"></div>
<script src="https://webapi.amap.com/maps?v=1.4.12&key=dd6103c90f2f17310a8711f2d330a0a6"></script> <script src="https://webapi.amap.com/maps?v=1.4.12&key=dd6103c90f2f17310a8711f2d330a0a6"></script>
<script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script> <script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<script src="<%= VUE_APP_DEV_LIB_URL %>/lib/manageShell.umd.min.js?<%= VUE_APP_SYSTEM_VERSION %>"></script>
<script
src="<%= VUE_APP_SUBSYSTEM %>/customerManage/lib/customerManage.umd.min.js?<%= VUE_APP_SYSTEM_VERSION %>"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/baseManage/lib/baseManage.umd.min.js?<%= VUE_APP_SYSTEM_VERSION %>"></script>
<script
src="<%= VUE_APP_SUBSYSTEM %>/systemManage/lib/systemManage.umd.min.js?<%= VUE_APP_SYSTEM_VERSION %>"></script>
<script
src="<%= VUE_APP_SUBSYSTEM %>/operateManage/lib/operateManage.umd.min.js?<%= VUE_APP_SYSTEM_VERSION %>"></script>
<script
src="<%= VUE_APP_SUBSYSTEM %>/statisticsManage/lib/statisticsManage.umd.min.js?<%= VUE_APP_SYSTEM_VERSION %>"></script>
<script
src="<%= VUE_APP_SUBSYSTEM %>/deviceManage/lib/deviceManage.umd.min.js?<%= VUE_APP_SYSTEM_VERSION %>"></script>
<script
src="<%= VUE_APP_SUBSYSTEM %>/smaproManage/lib/smaproManage.umd.min.js?<%= VUE_APP_SYSTEM_VERSION %>"></script>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>ic_logo.ico" /> <link rel="icon" href="<%= BASE_URL %>ic_logo.ico" />
<script src="<%= BASE_URL %>system.js"></script>
<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script> <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/vuex@3.1.0/dist/vuex.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-router@3.0.1/dist/vue-router.js"></script> <script src="https://cdn.jsdelivr.net/npm/vue-router@3.0.1/dist/vue-router.js"></script>
...@@ -23,14 +24,6 @@ ...@@ -23,14 +24,6 @@
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
<script src="<%= VUE_APP_SUBSYSTEM %>/customerManage/lib/customerManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/baseManage/lib/baseManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/systemManage/lib/systemManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/operateManage/lib/operateManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/statisticsManage/lib/statisticsManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/deviceManage/lib/deviceManage.umd.min.js"></script>
<script src="<%= VUE_APP_SUBSYSTEM %>/smaproManage/lib/smaproManage.umd.min.js"></script>
<script src="https://webapi.amap.com/maps?v=1.4.12&key=dd6103c90f2f17310a8711f2d330a0a6"></script> <script src="https://webapi.amap.com/maps?v=1.4.12&key=dd6103c90f2f17310a8711f2d330a0a6"></script>
<script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script> <script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<script src="https://unpkg.com/@antv/data-set"></script> <script src="https://unpkg.com/@antv/data-set"></script>
......
import System from '../lib/main'; import CreatSystem from '../lib/main';
import asyncRouterMap from '../router/asyncRoutes'; import asyncRouterMap from '../router/asyncRoutes';
window.manageShell = { default: System }; window.manageShell = { default: CreatSystem };
window.allAasyncRouterMap = [...asyncRouterMap];
setTimeout(() => { let constantRouter = [
let allAasyncRouterMap = [...asyncRouterMap]; {
let routeNameList = [ path: '/asd',
name: 'asd',
component: {
template: '<div>asdasdasd</div>',
},
},
];
const routeFilter = (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,
};
};
const script = document.createElement('script');
script.text = `
var routeNameList = [
'customerManage', 'customerManage',
'baseManage', 'baseManage',
'systemManage', 'systemManage',
...@@ -14,48 +43,20 @@ setTimeout(() => { ...@@ -14,48 +43,20 @@ setTimeout(() => {
'deviceManage', 'deviceManage',
'smaproManage', 'smaproManage',
]; ];
routeNameList.map(name => { Promise.all(routeNameList.map(name => System.import('${
try { process.env.VUE_APP_SUBSYSTEM
allAasyncRouterMap = allAasyncRouterMap.concat(window[name].default); }/' + name + '/lib/' + name + '.umd.min.js?t=${new Date().getTime()}'))).then(res => {
} catch (error) { for (let index = 0; index < res.length; index++) {
console.error(name + ': ', error); const element = res[index];
allAasyncRouterMap = allAasyncRouterMap.concat(element.default.default);
} }
return name; manageShell.default.createSystem({
}); basePath: '${process.env.VUE_APP_BASE_URL}',
routers: allAasyncRouterMap,
System.createSystem({ constantRouter: ${JSON.stringify(constantRouter)},
basePath: process.env.VUE_APP_BASE_URL, whiteList: '/asd',
routers: allAasyncRouterMap, routeFilter: ${routeFilter.toString()},
constantRouter: [ })
{ })
path: '/asd', `;
name: 'asd', document.body.appendChild(script);
component: {
render(h) {
return <div>asdasdasd</div>;
},
},
},
],
whiteList: '/asd',
routeFilter: (routes, allRoute) => {
if (allRoute && allRoute.length) {
let addRoute = System.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,
};
},
});
}, 1000);
import CreatSystem from './lib/main';
import asyncRouterMap from './router/asyncRoutes'; import asyncRouterMap from './router/asyncRoutes';
let allAasyncRouterMap = [...asyncRouterMap]; window.manageShell = { default: CreatSystem };
let routeNameList = [ window.allAasyncRouterMap = [...asyncRouterMap];
'customerManage',
'baseManage',
'systemManage',
'operateManage',
'statisticsManage',
'deviceManage',
'smaproManage',
];
routeNameList.map(name => {
try {
allAasyncRouterMap = allAasyncRouterMap.concat(window[name].default);
} catch (error) {
console.error(name + ': ', error);
}
return name;
});
const System = manageShell.default;
export default System.createSystem({ const routeFilter = (routes, allRoute) => {
basePath: process.env.VUE_APP_BASE_URL, if (allRoute && allRoute.length) {
routers: allAasyncRouterMap, let addRoute = System.utils.route.formatRouteLink(allRoute);
routeFilter: (routes, allRoute) => { for (let index = 0; index < addRoute.length; index++) {
if (allRoute && allRoute.length) { const element = addRoute[index];
let addRoute = System.utils.route.formatRouteLink(allRoute); if (element.children) {
for (let index = 0; index < addRoute.length; index++) { routes = routes.concat(element.children);
const element = addRoute[index]; } else if (
if (element.children) { element.menuCode === process.env.VUE_APP_REGISTER_DASHBOARD_CODE
routes = routes.concat(element.children); ) {
} else if ( routes.unshift(element);
element.menuCode === process.env.VUE_APP_REGISTER_DASHBOARD_CODE
) {
routes.unshift(element);
}
} }
} }
return { }
allRoute, return {
routes, allRoute,
}; routes,
}, };
}); };
const script = document.createElement('script');
script.text = `
var routeNameList = [
'customerManage',
'baseManage',
'systemManage',
'operateManage',
'statisticsManage',
'deviceManage',
'smaproManage',
];
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,
};
},
});
});
`;
document.body.appendChild(script);
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