main.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 echarts from 'echarts'
  12. import './assets/icons' // icon
  13. import './permission' // permission control
  14. import { getDicts } from "@/api/system/dict/data";
  15. import { getConfigKey } from "@/api/system/config";
  16. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi";
  17. import Pagination from "@/components/Pagination";
  18. // 自定义表格工具组件
  19. import RightToolbar from "@/components/RightToolbar"
  20. // 富文本组件
  21. import Editor from "@/components/Editor"
  22. // 文件上传组件
  23. import FileUpload from "@/components/FileUpload"
  24. // 图片上传组件
  25. import ImageUpload from "@/components/ImageUpload"
  26. // 字典标签组件
  27. import DictTag from '@/components/DictTag'
  28. // 头部标签组件
  29. import VueMeta from 'vue-meta'
  30. import VueAliplayerV2 from "vue-aliplayer-v2";
  31. // 全局方法挂载
  32. Vue.prototype.getDicts = getDicts
  33. Vue.prototype.getConfigKey = getConfigKey
  34. Vue.prototype.parseTime = parseTime
  35. Vue.prototype.resetForm = resetForm
  36. Vue.prototype.addDateRange = addDateRange
  37. Vue.prototype.selectDictLabel = selectDictLabel
  38. Vue.prototype.selectDictLabels = selectDictLabels
  39. Vue.prototype.download = download
  40. Vue.prototype.handleTree = handleTree
  41. Vue.prototype.$echarts = echarts
  42. Vue.prototype.msgSuccess = function(msg) {
  43. this.$message({ showClose: true, message: msg, type: "success" });
  44. }
  45. Vue.prototype.msgError = function(msg) {
  46. this.$message({ showClose: true, message: msg, type: "error" });
  47. }
  48. Vue.prototype.msgInfo = function(msg) {
  49. this.$message.info(msg);
  50. }
  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.use(directive)
  59. Vue.use(VueMeta)
  60. /**
  61. * If you don't want to use mock-server
  62. * you want to use MockJs for mock api
  63. * you can execute: mockXHR()
  64. *
  65. * Currently MockJs will be used in the production environment,
  66. * please remove it before going online! ! !
  67. */
  68. Vue.use(Element, {
  69. size: Cookies.get('size') || 'medium' // set element-ui default size
  70. })
  71. Vue.use(VueAliplayerV2, {
  72. cssLink: "./aliplayer-min.css",
  73. scriptSrc: "./aliplayer-min.js",
  74. });
  75. Vue.config.productionTip = false
  76. new Vue({
  77. el: '#app',
  78. router,
  79. store,
  80. render: h => h(App)
  81. })