审查视图

朱兆平 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'
小范 authored
14
import drag from './drag'
朱兆平 authored
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
// 条形组件
import VueBarcode from '@xkeshi/vue-barcode'; //导入条形码插件
朱兆平 authored
21 22 23 24 25 26 27 28

// markdown 编辑器
import VueMarkdownEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
import createTodoListPlugin from '@kangc/v-md-editor/lib/plugins/todo-list/index';
import '@kangc/v-md-editor/lib/plugins/todo-list/todo-list.css';
朱兆平 authored
29 30
import createEmojiPlugin from '@kangc/v-md-editor/lib/plugins/emoji/index';
import '@kangc/v-md-editor/lib/plugins/emoji/emoji.css'
朱兆平 authored
31 32 33 34 35 36 37
import Prism from 'prismjs';


VueMarkdownEditor.use(vuepressTheme, {
    Prism,
});
VueMarkdownEditor.use(createTodoListPlugin());
朱兆平 authored
38
VueMarkdownEditor.use(createEmojiPlugin());
朱兆平 authored
39 40
Vue.use(VueMarkdownEditor);
41
Vue.component('barcode', VueBarcode);
小范 authored
42
43
44 45 46 47 48
//定义一个全局过滤器实现日期格式化
Vue.filter('datefmt',function(input,fmtstring){

    return moment(input).format(fmtstring)
49
});
小范 authored
50 51
import Chat from 'vue-beautiful-chat'
Vue.use(Chat)
52
// 注册websocket组件到VUE
朱兆平 authored
53
// Vue.prototype.socketApi = socketApi
54
55
Vue.config.productionTip = false
朱兆平 authored
56
// Mock.bootstrap();
57 58 59 60 61
Vue.use(ElementUI,
    {
        // eslint-disable-next-line no-undef
        size: 'mini'
    })
62
// 注册组件库
朱兆平 authored
63 64
Vue.use(VueRouter)
Vue.use(Vuex)
朱兆平 authored
65
Vue.use(Print)
小范 authored
66
67
Vue.prototype.$axios = axios;
朱兆平 authored
68 69

//NProgress.configure({ showSpinner: false });
zhangFan authored
70 71
// console.log("mainjs:");
// console.log(rout.routes);
朱兆平 authored
72
const router = new VueRouter({
73
    routes:rout.routes
74
});
75
Vue.prototype.$rout =router;
76 77 78 79

//本地存储系统初始化的router路由,用来处理用户退出后,把路由数据初始化
sessionStorage.setItem('sysMenu', JSON.stringify(rout.routes));
zhangFan authored
80
const message = Vue.prototype.$message;
朱兆平 authored
81 82
sys_init.init_axios(message,router,axios);
sys_init.init_router(router,axios);
朱兆平 authored
83 84 85 86 87

//router.afterEach(transition => {
//NProgress.done();
//});
88
let vue = new Vue({
朱兆平 authored
89 90 91 92
  //el: '#app',
  //template: '<App/>',
  router,
  store,
朱兆平 authored
93
  i18n,
朱兆平 authored
94 95 96 97
  //components: { App }
  render: h => h(App)
}).$mount('#app')