main.js 3.4 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 App from './App'
  8. import store from './store'
  9. import router from './router'
  10. import directive from './directive' // directive
  11. import './assets/icons' // icon
  12. import './permission' // permission control
  13. import { getDicts } from "@/api/system/dict/data";
  14. import { getConfigKey } from "@/api/infra/config";
  15. import {
  16. parseTime,
  17. resetForm,
  18. addDateRange,
  19. addBeginAndEndTime,
  20. download,
  21. handleTree,
  22. downloadExcel,
  23. downloadWord,
  24. downloadZip,
  25. downloadHtml,
  26. downloadMarkdown,
  27. } from "@/utils/ruoyi";
  28. import Pagination from "@/components/Pagination";
  29. // 自定义表格工具扩展
  30. import RightToolbar from "@/components/RightToolbar"
  31. // 代码高亮插件
  32. // import hljs from 'highlight.js'
  33. // import 'highlight.js/styles/github-gist.css'
  34. import {DICT_TYPE, getDictDataLabel, getDictDatas, getDictDatas2} from "@/utils/dict";
  35. // 全局方法挂载
  36. Vue.prototype.getDicts = getDicts
  37. Vue.prototype.getConfigKey = getConfigKey
  38. Vue.prototype.parseTime = parseTime
  39. Vue.prototype.resetForm = resetForm
  40. Vue.prototype.addDateRange = addDateRange
  41. Vue.prototype.addBeginAndEndTime = addBeginAndEndTime
  42. Vue.prototype.getDictDatas = getDictDatas
  43. Vue.prototype.getDictDatas2 = getDictDatas2
  44. Vue.prototype.getDictDataLabel = getDictDataLabel
  45. Vue.prototype.DICT_TYPE = DICT_TYPE
  46. Vue.prototype.download = download
  47. Vue.prototype.downloadExcel = downloadExcel
  48. Vue.prototype.downloadWord = downloadWord
  49. Vue.prototype.downloadHtml = downloadHtml
  50. Vue.prototype.downloadMarkdown = downloadMarkdown
  51. Vue.prototype.downloadZip = downloadZip
  52. Vue.prototype.handleTree = handleTree
  53. Vue.prototype.msgSuccess = function (msg) {
  54. this.$message({ showClose: true, message: msg, type: "success" });
  55. }
  56. Vue.prototype.msgError = function (msg) {
  57. this.$message({ showClose: true, message: msg, type: "error" });
  58. }
  59. Vue.prototype.msgInfo = function (msg) {
  60. this.$message.info(msg);
  61. }
  62. // 全局组件挂载
  63. Vue.component('DictTag', DictTag)
  64. Vue.component('Pagination', Pagination)
  65. Vue.component('RightToolbar', RightToolbar)
  66. // 字典标签组件
  67. import DictTag from '@/components/DictTag'
  68. // 头部标签插件
  69. import VueMeta from 'vue-meta'
  70. Vue.use(directive)
  71. Vue.use(VueMeta)
  72. // Vue.use(hljs.vuePlugin);
  73. // bpmnProcessDesigner 需要引入
  74. import MyPD from "@/components/bpmnProcessDesigner/package/index.js";
  75. Vue.use(MyPD);
  76. import "@/components/bpmnProcessDesigner/package/theme/index.scss";
  77. import "bpmn-js/dist/assets/diagram-js.css";
  78. import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css";
  79. import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css";
  80. import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";
  81. // Form Generator 组件需要使用到 tinymce
  82. import Tinymce from '@/components/tinymce/index.vue'
  83. Vue.component('tinymce', Tinymce)
  84. import '@/icons'
  85. import axios from 'axios'
  86. Vue.prototype.$axios = axios
  87. import '@/styles/index.scss'
  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. })