西藏巴青项目

main.js 2.4KB

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