main.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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, 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.handleTree = handleTree
  42. // 全局组件挂载
  43. Vue.component('DictTag', DictTag)
  44. Vue.component('Pagination', Pagination)
  45. Vue.component('RightToolbar', RightToolbar)
  46. Vue.component('Editor', Editor)
  47. Vue.component('FileUpload', FileUpload)
  48. Vue.component('ImageUpload', ImageUpload)
  49. Vue.use(directive)
  50. Vue.use(plugins)
  51. Vue.use(VueMeta)
  52. DictData.install()
  53. /**
  54. * If you don't want to use mock-server
  55. * you want to use MockJs for mock api
  56. * you can execute: mockXHR()
  57. *
  58. * Currently MockJs will be used in the production environment,
  59. * please remove it before going online! ! !
  60. */
  61. Vue.use(Element, {
  62. size: Cookies.get('size') || 'medium' // set element-ui default size
  63. })
  64. Vue.config.productionTip = false
  65. new Vue({
  66. el: '#app',
  67. router,
  68. store,
  69. render: h => h(App)
  70. })