main.js 2.4 KB

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