main.js 2.9 KB

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