main.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 { getAction, postFormAction, postAction } from '@/api/manage'
  8. import Antd from 'ant-design-vue'
  9. import Viser from 'viser-vue'
  10. import 'k-form-design/lib/k-form-design.css'
  11. import 'ant-design-vue/dist/antd.less' // or 'ant-design-vue/dist/antd.less'
  12. import '@/permission' // permission control
  13. import '@/utils/filter' // base filter
  14. import Print from 'vue-print-nb-jeecg'
  15. /* import '@babel/polyfill' */
  16. import VueApexCharts from 'vue-apexcharts'
  17. import preview from 'vue-photo-preview'
  18. import 'vue-photo-preview/dist/skin.css'
  19. import {
  20. ACCESS_TOKEN,
  21. DEFAULT_COLOR,
  22. DEFAULT_THEME,
  23. DEFAULT_LAYOUT_MODE,
  24. DEFAULT_COLOR_WEAK,
  25. SIDEBAR_TYPE,
  26. DEFAULT_FIXED_HEADER,
  27. DEFAULT_FIXED_HEADER_HIDDEN,
  28. DEFAULT_FIXED_SIDEMENU,
  29. DEFAULT_CONTENT_WIDTH_TYPE,
  30. DEFAULT_MULTI_PAGE
  31. } from '@/store/mutation-types'
  32. import config from '@/defaultSettings'
  33. import JDictSelectTag from './components/dict/index.js'
  34. import hasPermission from '@/utils/hasPermission'
  35. import vueBus from '@/utils/vueBus'
  36. import JeecgComponents from '@/components/jeecg/index'
  37. import KFormDesign from 'k-form-design'
  38. require('@jeecg/antd-online-214')
  39. require('@jeecg/antd-online-214/dist/OnlineForm.css')
  40. Vue.use(KFormDesign)
  41. Vue.config.productionTip = false
  42. Vue.use(Storage, config.storageOptions)
  43. Vue.use(Antd)
  44. Vue.use(VueAxios, router)
  45. Vue.use(Viser)
  46. Vue.use(hasPermission)
  47. Vue.use(JDictSelectTag)
  48. Vue.use(Print)
  49. Vue.use(VueApexCharts)
  50. Vue.component('apexchart', VueApexCharts)
  51. Vue.use(preview)
  52. Vue.use(vueBus)
  53. Vue.use(JeecgComponents)
  54. // 挂载全局使用的方法
  55. Vue.prototype.doMian = '/jeecg-boot/'
  56. Vue.prototype.postFormAction = postFormAction
  57. Vue.prototype.postDataAction = postAction
  58. Vue.prototype.getAction = getAction
  59. new Vue({
  60. router,
  61. store,
  62. mounted () {
  63. store.commit('SET_SIDEBAR_TYPE', Vue.ls.get(SIDEBAR_TYPE, true))
  64. store.commit('TOGGLE_THEME', Vue.ls.get(DEFAULT_THEME, config.navTheme))
  65. store.commit('TOGGLE_LAYOUT_MODE', Vue.ls.get(DEFAULT_LAYOUT_MODE, config.layout))
  66. store.commit('TOGGLE_FIXED_HEADER', Vue.ls.get(DEFAULT_FIXED_HEADER, config.fixedHeader))
  67. store.commit('TOGGLE_FIXED_SIDERBAR', Vue.ls.get(DEFAULT_FIXED_SIDEMENU, config.fixSiderbar))
  68. store.commit('TOGGLE_CONTENT_WIDTH', Vue.ls.get(DEFAULT_CONTENT_WIDTH_TYPE, config.contentWidth))
  69. store.commit('TOGGLE_FIXED_HEADER_HIDDEN', Vue.ls.get(DEFAULT_FIXED_HEADER_HIDDEN, config.autoHideHeader))
  70. store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak))
  71. store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor))
  72. store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN))
  73. store.commit('SET_MULTI_PAGE', Vue.ls.get(DEFAULT_MULTI_PAGE, config.multipage))
  74. },
  75. render: h => h(App)
  76. }).$mount('#app')