rt-sim-training-client/src/main.js

59 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-07-04 10:59:40 +08:00
import Vue from 'vue';
2019-07-02 16:29:52 +08:00
2019-07-04 10:59:40 +08:00
import 'normalize.css/normalize.css'; // A modern alternative to CSS resets
2019-07-02 16:29:52 +08:00
2019-07-04 10:59:40 +08:00
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
2019-07-02 16:29:52 +08:00
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
2019-07-04 10:59:40 +08:00
import '@/styles/index.scss'; // global css
2019-07-02 16:29:52 +08:00
2019-07-04 10:59:40 +08:00
import App from './App';
import store from './store';
import router from './router';
2019-07-30 16:47:11 +08:00
import Theme from '@/jmap/theme/factory';
2019-07-02 16:29:52 +08:00
2019-07-04 10:59:40 +08:00
import '@/icons'; // icon
import '@/permission'; // permission control
import '@/scripts/GlobalPlugin';
2019-07-26 13:32:43 +08:00
import '@/directives';
window.THREE = require('@/jlmap3d/main/three.min.js');
window.zlib = require('@/jlmap3d/main/inflate.min.js');
2019-07-04 10:59:40 +08:00
Vue.use(ElementUI);
2019-07-02 16:29:52 +08:00
2019-07-04 10:59:40 +08:00
Vue.config.productionTip = false;
2019-07-02 16:29:52 +08:00
2019-08-02 14:54:51 +08:00
new Vue({
2019-07-02 16:29:52 +08:00
el: '#app',
router,
store,
render: h => h(App)
2019-07-04 10:59:40 +08:00
});
2019-07-02 16:29:52 +08:00
router.beforeEach((to, from, next) => {
2019-07-04 10:59:40 +08:00
const name = to.fullPath;
2019-07-02 16:29:52 +08:00
if (name.includes('/dp/') || name.includes('display/dp')) {
document.title = '琏课堂-大屏系统';
} else if (name.includes('/plan/') || name.includes('/planEdit/')) {
document.title = '琏计划';
} else {
document.title = '琏课堂';
}
next();
});
2019-07-30 16:47:11 +08:00
Vue.prototype.$theme = new Theme();
2019-07-04 10:59:40 +08:00
Vue.prototype.$messageBox = function(msge) {
2019-07-02 16:29:52 +08:00
if (this.$confirm) {
this.$confirm(`${msge || '处理失败'}`, '提示', {
confirmButtonText: '确定',
type: 'warning',
showCancelButton: false,
center: true
}).then(() => {
}).catch(() => {
});
}
};