华西海圻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.

100 lines
2.8 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. clearFormValidate,
  21. addDateRange,
  22. selectDictLabel,
  23. selectDictLabels,
  24. handleTree
  25. } from '@/utils/ruoyi'
  26. import { getMenuName } from '@/utils/menu'
  27. // 分页组件
  28. import Pagination from '@/components/Pagination'
  29. // 自定义表格工具组件
  30. import RightToolbar from '@/components/RightToolbar'
  31. // 富文本组件
  32. import Editor from '@/components/Editor'
  33. // 文件上传组件
  34. import FileUpload from '@/components/FileUpload'
  35. // 图片上传组件
  36. import ImageUpload from '@/components/ImageUpload'
  37. // 图片预览组件
  38. import ImagePreview from '@/components/ImagePreview'
  39. // 字典标签组件
  40. import DictTag from '@/components/DictTag'
  41. // 字典数据组件
  42. import DictData from '@/components/DictData'
  43. import { public_saveSimpleLog } from '@/api/business/public/public'
  44. // 全局方法挂载
  45. Vue.prototype.getDicts = getDicts
  46. Vue.prototype.getConfigKey = getConfigKey
  47. Vue.prototype.parseTime = parseTime
  48. Vue.prototype.resetForm = resetForm
  49. Vue.prototype.clearFormValidate = clearFormValidate
  50. Vue.prototype.addDateRange = addDateRange
  51. Vue.prototype.selectDictLabel = selectDictLabel
  52. Vue.prototype.selectDictLabels = selectDictLabels
  53. Vue.prototype.download = download
  54. Vue.prototype.handleTree = handleTree
  55. Vue.prototype.getMenuName = getMenuName
  56. Vue.prototype.saveSimpleLog = public_saveSimpleLog
  57. // 全局组件挂载
  58. Vue.component('DictTag', DictTag)
  59. Vue.component('Pagination', Pagination)
  60. Vue.component('RightToolbar', RightToolbar)
  61. Vue.component('Editor', Editor)
  62. Vue.component('FileUpload', FileUpload)
  63. Vue.component('ImageUpload', ImageUpload)
  64. Vue.component('ImagePreview', ImagePreview)
  65. Vue.use(directive)
  66. Vue.use(plugins)
  67. DictData.install()
  68. /**
  69. * If you don't want to use mock-server
  70. * you want to use MockJs for mock api
  71. * you can execute: mockXHR()
  72. *
  73. * Currently MockJs will be used in the production environment,
  74. * please remove it before going online! ! !
  75. */
  76. import i18n from './lang'
  77. import _ from 'lodash'
  78. Vue.use(Element, {
  79. i18n: (key, value) => i18n.t(key, value),
  80. size: Cookies.get('size') || 'mini' // set element-ui default size
  81. })
  82. Vue.config.productionTip = false
  83. new Vue({
  84. el: '#app',
  85. router,
  86. store,
  87. i18n,
  88. render: (h) => h(App)
  89. })