main.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import Vue from 'vue'
  2. import Cookies from 'js-cookie'
  3. import Element from 'element-ui'
  4. import './assets/styles/element-variables.scss'
  5. import attachmentModule from '@wangeditor/plugin-upload-attachment'
  6. import {Boot} from '@wangeditor/editor'
  7. Boot.registerModule(attachmentModule)
  8. import '@/assets/styles/index.scss' // global css
  9. import '@/assets/styles/common.scss' // common css
  10. import App from './App'
  11. import store from './store'
  12. import router from './router'
  13. import directive from './directive' //directive
  14. import plugins from './plugins' // plugins
  15. import './assets/icons' // icon
  16. import './permission' // permission control
  17. import { getDicts } from "@/api/system/dict/data";
  18. import { getConfigKey } from "@/api/system/config";
  19. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/common-util";
  20. // 播放器组件
  21. import VideoPlayer from "@/components/VideoPlayer";
  22. // 分页组件
  23. import Pagination from "@/components/Pagination";
  24. // 自定义表格工具组件
  25. import RightToolbar from "@/components/RightToolbar"
  26. // 富文本组件
  27. import WangEditor from "@/components/WangEditor"
  28. // 文件上传组件
  29. import FileUpload from "@/components/FileUpload"
  30. // 图片上传组件
  31. import ImageUpload from "@/components/ImageUpload"
  32. // 字典标签组件
  33. import DictTag from '@/components/DictTag'
  34. // 头部标签组件
  35. import VueMeta from 'vue-meta'
  36. // 字典数据组件
  37. import DictData from '@/components/DictData'
  38. // 全局方法挂载
  39. Vue.prototype.getDicts = getDicts
  40. Vue.prototype.getConfigKey = getConfigKey
  41. Vue.prototype.parseTime = parseTime
  42. Vue.prototype.resetForm = resetForm
  43. Vue.prototype.addDateRange = addDateRange
  44. Vue.prototype.selectDictLabel = selectDictLabel
  45. Vue.prototype.selectDictLabels = selectDictLabels
  46. Vue.prototype.handleTree = handleTree
  47. // 全局组件挂载
  48. Vue.component('DictTag', DictTag)
  49. Vue.component('Pagination', Pagination)
  50. Vue.component('VideoPlayer', VideoPlayer)
  51. Vue.component('RightToolbar', RightToolbar)
  52. Vue.component('WangEditor', WangEditor)
  53. Vue.component('FileUpload', FileUpload)
  54. Vue.component('ImageUpload', ImageUpload)
  55. Vue.use(directive)
  56. Vue.use(plugins)
  57. Vue.use(VueMeta)
  58. DictData.install()
  59. /**
  60. * If you don't want to use mock-server
  61. * you want to use MockJs for mock api
  62. * you can execute: mockXHR()
  63. *
  64. * Currently MockJs will be used in the production environment,
  65. * please remove it before going online! ! !
  66. */
  67. Vue.use(Element, {
  68. size: Cookies.get('size') || 'medium' // set element-ui default size
  69. })
  70. Vue.config.productionTip = false
  71. new Vue({
  72. el: '#app',
  73. router,
  74. store,
  75. render: h => h(App)
  76. })