main.js 3.5 KB

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