main.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /** init domain config */
  2. import './config'
  3. import Vue from 'vue'
  4. import App from './App.vue'
  5. import Storage from 'vue-ls'
  6. import router from './router'
  7. import store from './store/'
  8. import { VueAxios } from "@/utils/request"
  9. // 修改框架:全局引入外部字体
  10. import 'roboto-fontface/css/roboto/roboto-fontface.css';
  11. require('@jeecg/antd-online-mini')
  12. require('@jeecg/antd-online-mini/dist/OnlineForm.css')
  13. import Antd, { version } from 'ant-design-vue'
  14. console.log('ant-design-vue version:', version)
  15. import Viser from 'viser-vue'
  16. import 'ant-design-vue/dist/antd.less'; // or 'ant-design-vue/dist/antd.less'
  17. // 修改框架:新增全新弹窗全局组件
  18. import UComponents from '@/components/module_interLock/index'
  19. // 修改框架:新增递归树全局方法
  20. import { handleTree } from "@/utils/interLock";
  21. import '@/permission' // permission control
  22. import '@/utils/filter' // base filter
  23. import Print from 'vue-print-nb-jeecg'
  24. /*import '@babel/polyfill'*/
  25. import preview from 'vue-photo-preview'
  26. import 'vue-photo-preview/dist/skin.css'
  27. import SSO from '@/cas/sso.js'
  28. import {
  29. ACCESS_TOKEN,
  30. DEFAULT_COLOR,
  31. DEFAULT_THEME,
  32. DEFAULT_LAYOUT_MODE,
  33. DEFAULT_COLOR_WEAK,
  34. SIDEBAR_TYPE,
  35. DEFAULT_FIXED_HEADER,
  36. DEFAULT_FIXED_HEADER_HIDDEN,
  37. DEFAULT_FIXED_SIDEMENU,
  38. DEFAULT_CONTENT_WIDTH_TYPE,
  39. DEFAULT_MULTI_PAGE
  40. } from "@/store/mutation-types"
  41. import config from '@/defaultSettings'
  42. import JDictSelectTag from './components/dict/index.js'
  43. import hasPermission from '@/utils/hasPermission'
  44. import vueBus from '@/utils/vueBus';
  45. import JeecgComponents from '@/components/jeecg/index'
  46. import '@/assets/less/JAreaLinkage.less'
  47. import VueAreaLinkage from 'vue-area-linkage'
  48. import '@/components/jeecg/JVxeTable/install'
  49. import '@/components/JVxeCells/install'
  50. //表单验证
  51. import { rules } from '@/utils/rules'
  52. Vue.prototype.rules = rules
  53. Vue.config.productionTip = false
  54. Vue.use(Storage, config.storageOptions)
  55. Vue.use(Antd)
  56. Vue.use(VueAxios, router)
  57. Vue.use(Viser)
  58. Vue.use(hasPermission)
  59. Vue.use(JDictSelectTag)
  60. Vue.use(Print)
  61. Vue.use(preview)
  62. Vue.use(vueBus);
  63. Vue.use(JeecgComponents);
  64. // 修改框架:新增全新弹窗全局组件
  65. Vue.use(UComponents);
  66. // 修改框架:全局挂载方法递归树
  67. Vue.prototype.handleTree = handleTree
  68. Vue.use(VueAreaLinkage);
  69. SSO.init(() => {
  70. main()
  71. })
  72. function main() {
  73. new Vue({
  74. router,
  75. store,
  76. mounted () {
  77. store.commit('SET_SIDEBAR_TYPE', Vue.ls.get(SIDEBAR_TYPE, true))
  78. store.commit('TOGGLE_THEME', Vue.ls.get(DEFAULT_THEME, config.navTheme))
  79. store.commit('TOGGLE_LAYOUT_MODE', Vue.ls.get(DEFAULT_LAYOUT_MODE, config.layout))
  80. store.commit('TOGGLE_FIXED_HEADER', Vue.ls.get(DEFAULT_FIXED_HEADER, config.fixedHeader))
  81. store.commit('TOGGLE_FIXED_SIDERBAR', Vue.ls.get(DEFAULT_FIXED_SIDEMENU, config.fixSiderbar))
  82. store.commit('TOGGLE_CONTENT_WIDTH', Vue.ls.get(DEFAULT_CONTENT_WIDTH_TYPE, config.contentWidth))
  83. store.commit('TOGGLE_FIXED_HEADER_HIDDEN', Vue.ls.get(DEFAULT_FIXED_HEADER_HIDDEN, config.autoHideHeader))
  84. store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak))
  85. store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor))
  86. store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN))
  87. store.commit('SET_MULTI_PAGE',Vue.ls.get(DEFAULT_MULTI_PAGE,config.multipage))
  88. },
  89. render: h => h(App)
  90. }).$mount('#app')
  91. }