main.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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,versionField } 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, clickCopy } 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.versionField = versionField
  56. Vue.prototype.hasPermiDom = hasPermiDom.hasPermiDom
  57. Vue.prototype.handleTree = handleTree
  58. Vue.prototype.spaceJudgment = spaceJudgment
  59. Vue.prototype.spaceJudgmentHTML = spaceJudgmentHTML
  60. Vue.prototype.isNum = isNum
  61. Vue.prototype.urlJudge = urlJudge
  62. Vue.prototype.clickCopy = clickCopy
  63. Vue.prototype.judgmentNetworkReturnAddress = judgmentNetworkReturnAddress
  64. Vue.prototype.msgSuccess = function (msg) {
  65. this.$message({ showClose: true, message: msg, type: "success", offset:100 });
  66. }
  67. Vue.prototype.msgError = function (msg) {
  68. this.$message({ showClose: true, message: msg, type: "error", offset:100 });
  69. }
  70. Vue.prototype.msgInfo = function (msg) {
  71. this.$message.info(msg);
  72. }
  73. // 全局组件挂载
  74. Vue.component('DictTag', DictTag)
  75. Vue.component('Pagination', Pagination)
  76. Vue.component('RightToolbar', RightToolbar)
  77. Vue.component('Editor', Editor)
  78. Vue.component('wangEditor', wangEditor)
  79. Vue.component('UEditor', UEditor)
  80. Vue.component('FileUpload', FileUpload)
  81. Vue.component('ImageUpload', ImageUpload)
  82. Vue.use(directive)
  83. Vue.use(VueMeta)
  84. Vue.use(uploader)
  85. //全屏组件
  86. Vue.use(dataV)
  87. /**
  88. * If you don't want to use mock-server
  89. * you want to use MockJs for mock api
  90. * you can execute: mockXHR()
  91. *
  92. * Currently MockJs will be used in the production environment,
  93. * please remove it before going online! ! !
  94. */
  95. Vue.use(Element, {
  96. size: Cookies.get('size') || 'medium' // set element-ui default size
  97. })
  98. Vue.config.productionTip = false
  99. new Vue({
  100. el: '#app',
  101. router,
  102. store,
  103. render: h => h(App)
  104. })