main.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 '@/assets/styles/ZDindex.sass' // ZD css
  8. import App from './App'
  9. import store from './store'
  10. import router from './router'
  11. import directive from './directive' //directive
  12. import { download } from '@/utils/request'
  13. import hasPermiDom from './directive/permission/hasPermiDom'
  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, spaceJudgment, spaceJudgmentHTML, isNum, urlJudge } from "@/utils/ruoyi";
  19. import Pagination from "@/components/Pagination";
  20. // 自定义表格工具组件
  21. import RightToolbar from "@/components/RightToolbar"
  22. // 富文本组件
  23. import Editor from "@/components/Editor"
  24. import wangEditor from "@/components/wangEditor"
  25. import UEditor from "@/components/UEditor"
  26. // 文件上传组件
  27. import FileUpload from "@/components/FileUpload"
  28. // 图片上传组件
  29. import ImageUpload from "@/components/ImageUpload"
  30. // 字典标签组件
  31. import DictTag from '@/components/DictTag'
  32. // 头部标签组件
  33. import VueMeta from 'vue-meta'
  34. //全屏组件
  35. import dataV from '@jiaminghi/data-view'
  36. //echarts
  37. import echarts from 'echarts'
  38. //文件分片
  39. import uploader from 'vue-simple-uploader'
  40. import VueCropper from 'vue-cropper'
  41. Vue.use(VueCropper)
  42. //echarts
  43. Vue.prototype.$echarts = echarts
  44. // 全局方法挂载
  45. Vue.prototype.getDicts = getDicts
  46. Vue.prototype.getConfigKey = getConfigKey
  47. Vue.prototype.parseTime = parseTime
  48. Vue.prototype.resetForm = resetForm
  49. Vue.prototype.addDateRange = addDateRange
  50. Vue.prototype.selectDictLabel = selectDictLabel
  51. Vue.prototype.selectDictLabels = selectDictLabels
  52. Vue.prototype.download = download
  53. Vue.prototype.hasPermiDom = hasPermiDom.hasPermiDom
  54. Vue.prototype.handleTree = handleTree
  55. Vue.prototype.spaceJudgment = spaceJudgment
  56. Vue.prototype.spaceJudgmentHTML = spaceJudgmentHTML
  57. Vue.prototype.isNum = isNum
  58. Vue.prototype.urlJudge = urlJudge
  59. Vue.prototype.msgSuccess = function (msg) {
  60. this.$message({ showClose: true, message: msg, type: "success", offset:100 });
  61. }
  62. Vue.prototype.msgError = function (msg) {
  63. this.$message({ showClose: true, message: msg, type: "error", offset:100 });
  64. }
  65. Vue.prototype.msgInfo = function (msg) {
  66. this.$message.info(msg);
  67. }
  68. // 全局组件挂载
  69. Vue.component('DictTag', DictTag)
  70. Vue.component('Pagination', Pagination)
  71. Vue.component('RightToolbar', RightToolbar)
  72. Vue.component('Editor', Editor)
  73. Vue.component('wangEditor', wangEditor)
  74. Vue.component('UEditor', UEditor)
  75. Vue.component('FileUpload', FileUpload)
  76. Vue.component('ImageUpload', ImageUpload)
  77. Vue.use(directive)
  78. Vue.use(VueMeta)
  79. Vue.use(uploader)
  80. //全屏组件
  81. Vue.use(dataV)
  82. /**
  83. * If you don't want to use mock-server
  84. * you want to use MockJs for mock api
  85. * you can execute: mockXHR()
  86. *
  87. * Currently MockJs will be used in the production environment,
  88. * please remove it before going online! ! !
  89. */
  90. Vue.use(Element, {
  91. size: Cookies.get('size') || 'medium' // set element-ui default size
  92. })
  93. Vue.config.productionTip = false
  94. new Vue({
  95. el: '#app',
  96. router,
  97. store,
  98. render: h => h(App)
  99. })