审查视图

朱兆平 authored
1 2 3
import Vue from 'vue'
import App from './App'
import ElementUI from 'element-ui'
4
import 'element-ui/lib/theme-chalk/index.css'
朱兆平 authored
5 6 7 8
//import './assets/theme/theme-green/index.css'
import VueRouter from 'vue-router'
import store from './vuex/store'
import Vuex from 'vuex'
9
import axios from 'axios'
10
import rout from './routes'
朱兆平 authored
11
// import Mock from './mock'
朱兆平 authored
12
import i18n from './lang'
13
import 'font-awesome/css/font-awesome.min.css'
14
15
import * as socketApi from './api/socket'
16
import '@/styles/index.scss'
朱兆平 authored
17
import sys_init from '@/common/init/sys_init'
朱兆平 authored
18
import Print from 'vue-print-nb'
19 20 21 22
// 条形组件
import VueBarcode from '@xkeshi/vue-barcode'; //导入条形码插件
Vue.component('barcode', VueBarcode);
23
24 25 26 27 28
//定义一个全局过滤器实现日期格式化
Vue.filter('datefmt',function(input,fmtstring){

    return moment(input).format(fmtstring)
29 30
});
31
// 注册websocket组件到VUE
朱兆平 authored
32
// Vue.prototype.socketApi = socketApi
33
34
Vue.config.productionTip = false
朱兆平 authored
35
// Mock.bootstrap();
36 37 38 39 40
Vue.use(ElementUI,
    {
        // eslint-disable-next-line no-undef
        size: 'mini'
    })
41
// 注册组件库
朱兆平 authored
42 43
Vue.use(VueRouter)
Vue.use(Vuex)
朱兆平 authored
44
Vue.use(Print)
45
Vue.prototype.$axios = axios;
朱兆平 authored
46 47

//NProgress.configure({ showSpinner: false });
zhangFan authored
48 49
// console.log("mainjs:");
// console.log(rout.routes);
朱兆平 authored
50
const router = new VueRouter({
51
    routes:rout.routes
52
});
53
Vue.prototype.$rout =router;
54 55 56 57

//本地存储系统初始化的router路由,用来处理用户退出后,把路由数据初始化
sessionStorage.setItem('sysMenu', JSON.stringify(rout.routes));
zhangFan authored
58
const message = Vue.prototype.$message;
朱兆平 authored
59 60
sys_init.init_axios(message,router,axios);
sys_init.init_router(router,axios);
朱兆平 authored
61 62 63 64 65

//router.afterEach(transition => {
//NProgress.done();
//});
66
let vue = new Vue({
朱兆平 authored
67 68 69 70
  //el: '#app',
  //template: '<App/>',
  router,
  store,
朱兆平 authored
71
  i18n,
朱兆平 authored
72 73 74 75
  //components: { App }
  render: h => h(App)
}).$mount('#app')