main.js 2.8 KB

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