main.js 2.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
import Vue from 'vue'
import App from './App.vue'
import Storage from 'vue-ls'
import router from './router'
import store from './store/'

import { VueAxios } from "@/utils/request"

import Antd from 'ant-design-vue'
import Viser from 'viser-vue'
import 'ant-design-vue/dist/antd.less';  // or 'ant-design-vue/dist/antd.less'

import '@/permission' // permission control
import '@/utils/filter' // base filter
15
import Print from 'vue-print-nb-jeecg'
16
/*import '@babel/polyfill'*/
17
import VueApexCharts from 'vue-apexcharts'
18

19 20
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
JEECG低代码平台's avatar
JEECG低代码平台 已提交
21 22
import "@jeecg/antd-online-re"
import '@jeecg/antd-online-re/dist/OnlineForm.css'
23

24 25 26 27 28 29 30 31 32 33
import {
  ACCESS_TOKEN,
  DEFAULT_COLOR,
  DEFAULT_THEME,
  DEFAULT_LAYOUT_MODE,
  DEFAULT_COLOR_WEAK,
  SIDEBAR_TYPE,
  DEFAULT_FIXED_HEADER,
  DEFAULT_FIXED_HEADER_HIDDEN,
  DEFAULT_FIXED_SIDEMENU,
34 35
  DEFAULT_CONTENT_WIDTH_TYPE,
  DEFAULT_MULTI_PAGE
36 37 38
} from "@/store/mutation-types"
import config from '@/defaultSettings'

39
import JDictSelectTag from './components/dict/index.js'
40
import hasPermission from '@/utils/hasPermission'
41
import vueBus from '@/utils/vueBus';
42
import JeecgComponents from '@/components/jeecg/index'
43 44 45 46 47 48 49

Vue.config.productionTip = false
Vue.use(Storage, config.storageOptions)
Vue.use(Antd)
Vue.use(VueAxios, router)
Vue.use(Viser)
Vue.use(hasPermission)
50
Vue.use(JDictSelectTag)
51
Vue.use(Print)
52 53
Vue.use(VueApexCharts)
Vue.component('apexchart', VueApexCharts)
54 55
Vue.use(preview)
Vue.use(vueBus);
56
Vue.use(JeecgComponents);
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

new Vue({
  router,
  store,
  mounted () {
    store.commit('SET_SIDEBAR_TYPE', Vue.ls.get(SIDEBAR_TYPE, true))
    store.commit('TOGGLE_THEME', Vue.ls.get(DEFAULT_THEME, config.navTheme))
    store.commit('TOGGLE_LAYOUT_MODE', Vue.ls.get(DEFAULT_LAYOUT_MODE, config.layout))
    store.commit('TOGGLE_FIXED_HEADER', Vue.ls.get(DEFAULT_FIXED_HEADER, config.fixedHeader))
    store.commit('TOGGLE_FIXED_SIDERBAR', Vue.ls.get(DEFAULT_FIXED_SIDEMENU, config.fixSiderbar))
    store.commit('TOGGLE_CONTENT_WIDTH', Vue.ls.get(DEFAULT_CONTENT_WIDTH_TYPE, config.contentWidth))
    store.commit('TOGGLE_FIXED_HEADER_HIDDEN', Vue.ls.get(DEFAULT_FIXED_HEADER_HIDDEN, config.autoHideHeader))
    store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak))
    store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor))
    store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN))
JEECG低代码平台's avatar
JEECG低代码平台 已提交
72
    store.commit('SET_MULTI_PAGE',Vue.ls.get(DEFAULT_MULTI_PAGE,config.multipage))
73 74 75
  },
  render: h => h(App)
}).$mount('#app')