main.js 3.7 KB

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