华西海圻ELN前端工程
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.6 KiB

  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 './assets/icons' // icon
  14. import './permission' // permission control
  15. import { getDicts } from '@/api/system/dict/data'
  16. import { getConfigKey } from '@/api/system/config'
  17. import {
  18. parseTime,
  19. resetForm,
  20. addDateRange,
  21. selectDictLabel,
  22. selectDictLabels,
  23. handleTree
  24. } from '@/utils/ruoyi'
  25. import { getMenuName } from '@/utils/menu'
  26. // 分页组件
  27. import Pagination from '@/components/Pagination'
  28. // 自定义表格工具组件
  29. import RightToolbar from '@/components/RightToolbar'
  30. // 富文本组件
  31. import Editor from '@/components/Editor'
  32. // 文件上传组件
  33. import FileUpload from '@/components/FileUpload'
  34. // 图片上传组件
  35. import ImageUpload from '@/components/ImageUpload'
  36. // 图片预览组件
  37. import ImagePreview from '@/components/ImagePreview'
  38. // 字典标签组件
  39. import DictTag from '@/components/DictTag'
  40. // 字典数据组件
  41. import DictData from '@/components/DictData'
  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.getMenuName = getMenuName
  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. DictData.install()
  64. /**
  65. * If you don't want to use mock-server
  66. * you want to use MockJs for mock api
  67. * you can execute: mockXHR()
  68. *
  69. * Currently MockJs will be used in the production environment,
  70. * please remove it before going online! ! !
  71. */
  72. import i18n from './lang'
  73. Vue.use(Element, {
  74. i18n: (key, value) => i18n.t(key, value),
  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. i18n,
  83. render: (h) => h(App)
  84. })