main.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Vue
  2. import Vue from 'vue'
  3. import i18n from './i18n'
  4. import App from './App'
  5. // 核心插件
  6. import ibps from './plugins/ibps'
  7. // store
  8. import store from './store/index'
  9. // 菜单和路由设置
  10. import router from './router'
  11. // 数据大屏插件
  12. import dataV from '@jiaminghi/data-view'
  13. // less的css编码语法
  14. import less from 'less'
  15. // 表格自适应高度
  16. // import Plugin from 'v-fit-columns'
  17. // import Blob from './excel/Blob'
  18. // import Export2Excel from './excel/Export2Excel.js'
  19. // less的css编码
  20. Vue.use(less)
  21. // 数据大屏插件
  22. Vue.use(dataV)
  23. // 核心插件
  24. Vue.use(ibps)
  25. Vue.directive('removeAriaHidden', {
  26. bind (el, binding) {
  27. const ariaEls = el.querySelectorAll('.el-radio__original')
  28. ariaEls.forEach((item) => {
  29. item.removeAttribute('aria-hidden')
  30. })
  31. }
  32. })
  33. new Vue({
  34. router,
  35. store,
  36. i18n,
  37. devtools: process.env.NODE_ENV === 'development',
  38. async created () {
  39. // 加载接口配置
  40. await this.$store.dispatch('ibps/api/load')
  41. },
  42. async mounted () {
  43. // 展示系统信息
  44. await this.$store.commit('ibps/releases/versionShow')
  45. // 用户登录后从数据库加载一系列的设置
  46. await this.$store.dispatch('ibps/account/load')
  47. // 获取并记录用户 UA
  48. await this.$store.commit('ibps/ua/get')
  49. // 初始化全屏监听
  50. await this.$store.dispatch('ibps/fullscreen/listen')
  51. // 初始化加载是否修改用户信息
  52. await this.$store.dispatch('ibps/user/listen')
  53. },
  54. render: h => h(App)
  55. }).$mount('#app')