main.js 2.9 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 './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 { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
  18. // 分页组件
  19. import Pagination from "@/components/Pagination";
  20. // 自定义表格工具组件
  21. import RightToolbar from "@/components/RightToolbar"
  22. // 富文本组件
  23. import Editor from "@/components/Editor"
  24. // 文件上传组件
  25. import FileUpload from "@/components/FileUpload"
  26. // 图片上传组件
  27. import ImageUpload from "@/components/ImageUpload"
  28. // 图片预览组件
  29. import ImagePreview from "@/components/ImagePreview"
  30. // 字典标签组件
  31. import DictTag from '@/components/DictTag'
  32. // 头部标签组件
  33. import VueMeta from 'vue-meta'
  34. // 字典数据组件
  35. import DictData from '@/components/DictData'
  36. //echarts组件
  37. import echarts from 'echarts'
  38. import Base64 from 'js-base64'
  39. // 全局方法挂载
  40. Vue.prototype.getDicts = getDicts
  41. Vue.prototype.getConfigKey = getConfigKey
  42. Vue.prototype.parseTime = parseTime
  43. Vue.prototype.resetForm = resetForm
  44. Vue.prototype.addDateRange = addDateRange
  45. Vue.prototype.selectDictLabel = selectDictLabel
  46. Vue.prototype.selectDictLabels = selectDictLabels
  47. Vue.prototype.download = download
  48. Vue.prototype.handleTree = handleTree
  49. Vue.prototype.$echarts = echarts
  50. Vue.prototype.$Base64 = Base64;
  51. // 全局组件挂载
  52. Vue.component('DictTag', DictTag)
  53. Vue.component('Pagination', Pagination)
  54. Vue.component('RightToolbar', RightToolbar)
  55. Vue.component('Editor', Editor)
  56. Vue.component('FileUpload', FileUpload)
  57. Vue.component('ImageUpload', ImageUpload)
  58. Vue.component('ImagePreview', ImagePreview)
  59. Vue.use(directive)
  60. Vue.use(plugins)
  61. Vue.use(VueMeta)
  62. // Vue.use(Base64)
  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. Vue.use(Element, {
  73. size: Cookies.get('size') || 'medium' // set element-ui default size
  74. })
  75. Vue.config.productionTip = false
  76. setTimeout(() => {
  77. document.title = "启东市铁路沿线综合治理信息化管理平台";
  78. }, 1000);
  79. new Vue({
  80. el: '#app',
  81. router,
  82. store,
  83. render: h => h(App)
  84. })