main.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import Vue from 'vue'
  2. import App from './App.vue'
  3. import Storage from 'vue-ls'
  4. import router from './router'
  5. import store from './store/'
  6. import { VueAxios } from '@/utils/request'
  7. import Antd from 'ant-design-vue'
  8. import Viser from 'viser-vue'
  9. import 'ant-design-vue/dist/antd.less' // or 'ant-design-vue/dist/antd.less'
  10. import '@/permission' // permission control
  11. import '@/utils/filter' // base filter
  12. import Print from 'vue-print-nb-jeecg'
  13. /*import '@babel/polyfill'*/
  14. import preview from 'vue-photo-preview'
  15. import 'vue-photo-preview/dist/skin.css'
  16. import 'intro.js/introjs.css'
  17. import './tailwind.css'
  18. import {
  19. ACCESS_TOKEN,
  20. DEFAULT_COLOR,
  21. DEFAULT_THEME,
  22. DEFAULT_LAYOUT_MODE,
  23. DEFAULT_COLOR_WEAK,
  24. SIDEBAR_TYPE,
  25. DEFAULT_FIXED_HEADER,
  26. DEFAULT_FIXED_HEADER_HIDDEN,
  27. DEFAULT_FIXED_SIDEMENU,
  28. DEFAULT_CONTENT_WIDTH_TYPE,
  29. DEFAULT_MULTI_PAGE,
  30. } from '@/store/mutation-types'
  31. import config from '@/defaultSettings'
  32. import hasPermission from '@/utils/hasPermission'
  33. import vueBus from '@/utils/vueBus'
  34. import JeecgComponents from '@/components/jeecg/index'
  35. import '@/assets/less/JAreaLinkage.less'
  36. import VueAreaLinkage from 'vue-area-linkage'
  37. // vxe-table
  38. import VxeUIAll from 'vxe-pc-ui'
  39. import 'vxe-pc-ui/lib/style.css'
  40. import VxeUITable from 'vxe-table'
  41. import 'vxe-table/lib/style.css'
  42. Vue.use(VxeUIAll)
  43. Vue.use(VxeUITable)
  44. Vue.config.productionTip = false
  45. Vue.use(Storage, config.storageOptions)
  46. Vue.use(Antd)
  47. Vue.use(VueAxios, router)
  48. Vue.use(Viser)
  49. Vue.use(hasPermission)
  50. Vue.use(Print)
  51. Vue.use(preview)
  52. Vue.use(vueBus)
  53. Vue.use(JeecgComponents)
  54. Vue.use(VueAreaLinkage)
  55. new Vue({
  56. router,
  57. store,
  58. mounted() {
  59. // store.commit('SET_SIDEBAR_TYPE', Vue.ls.get(SIDEBAR_TYPE, true))
  60. store.commit('SET_SIDEBAR_TYPE', true)
  61. store.commit('TOGGLE_THEME', Vue.ls.get(DEFAULT_THEME, config.navTheme))
  62. store.commit('TOGGLE_LAYOUT_MODE', Vue.ls.get(DEFAULT_LAYOUT_MODE, config.layout))
  63. store.commit('TOGGLE_FIXED_HEADER', Vue.ls.get(DEFAULT_FIXED_HEADER, config.fixedHeader))
  64. store.commit('TOGGLE_FIXED_SIDERBAR', Vue.ls.get(DEFAULT_FIXED_SIDEMENU, config.fixSiderbar))
  65. store.commit('TOGGLE_CONTENT_WIDTH', Vue.ls.get(DEFAULT_CONTENT_WIDTH_TYPE, config.contentWidth))
  66. store.commit('TOGGLE_FIXED_HEADER_HIDDEN', Vue.ls.get(DEFAULT_FIXED_HEADER_HIDDEN, config.autoHideHeader))
  67. store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak))
  68. store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor))
  69. store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN))
  70. store.commit('SET_MULTI_PAGE', Vue.ls.get(DEFAULT_MULTI_PAGE, config.multipage))
  71. },
  72. render: (h) => h(App),
  73. }).$mount('#app')