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'
21 22 23

require('@jeecg/antd-online-214')
require('@jeecg/antd-online-214/dist/OnlineForm.css')
24

25 26 27 28 29 30 31 32 33 34
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,
35 36
  DEFAULT_CONTENT_WIDTH_TYPE,
  DEFAULT_MULTI_PAGE
37 38 39
} from "@/store/mutation-types"
import config from '@/defaultSettings'

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

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

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低代码平台 已提交
73
    store.commit('SET_MULTI_PAGE',Vue.ls.get(DEFAULT_MULTI_PAGE,config.multipage))
74 75 76
  },
  render: h => h(App)
}).$mount('#app')