main.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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 permission from './directive/permission'
  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. selectDictLabel,
  21. download,
  22. handleTree,
  23. downloadExcel,
  24. downloadWord,
  25. downloadZip,
  26. downloadHtml,
  27. downloadMarkdown,
  28. } from "@/utils/ruoyi";
  29. import Pagination from "@/components/Pagination";
  30. // 自定义表格工具扩展
  31. import RightToolbar from "@/components/RightToolbar"
  32. // 代码高亮插件
  33. // import hljs from 'highlight.js'
  34. // import 'highlight.js/styles/github-gist.css'
  35. import {DICT_TYPE, getDictDataLabel, getDictDatas, getDictDatas2} from "@/utils/dict";
  36. // 全局方法挂载
  37. Vue.prototype.getDicts = getDicts
  38. Vue.prototype.getConfigKey = getConfigKey
  39. Vue.prototype.parseTime = parseTime
  40. Vue.prototype.resetForm = resetForm
  41. Vue.prototype.addDateRange = addDateRange
  42. Vue.prototype.addBeginAndEndTime = addBeginAndEndTime
  43. Vue.prototype.selectDictLabel = selectDictLabel
  44. Vue.prototype.getDictDatas = getDictDatas
  45. Vue.prototype.getDictDatas2 = getDictDatas2
  46. Vue.prototype.getDictDataLabel = getDictDataLabel
  47. Vue.prototype.DICT_TYPE = DICT_TYPE
  48. Vue.prototype.download = download
  49. Vue.prototype.downloadExcel = downloadExcel
  50. Vue.prototype.downloadWord = downloadWord
  51. Vue.prototype.downloadHtml = downloadHtml
  52. Vue.prototype.downloadMarkdown = downloadMarkdown
  53. Vue.prototype.downloadZip = downloadZip
  54. Vue.prototype.handleTree = handleTree
  55. Vue.prototype.msgSuccess = function (msg) {
  56. this.$message({ showClose: true, message: msg, type: "success" });
  57. }
  58. Vue.prototype.msgError = function (msg) {
  59. this.$message({ showClose: true, message: msg, type: "error" });
  60. }
  61. Vue.prototype.msgInfo = function (msg) {
  62. this.$message.info(msg);
  63. }
  64. // 全局组件挂载
  65. Vue.component('DictTag', DictTag)
  66. Vue.component('Pagination', Pagination)
  67. Vue.component('RightToolbar', RightToolbar)
  68. // 字典标签组件
  69. import DictTag from '@/components/DictTag'
  70. // 头部标签插件
  71. import VueMeta from 'vue-meta'
  72. Vue.use(permission)
  73. Vue.use(VueMeta)
  74. // Vue.use(hljs.vuePlugin);
  75. // bpmnProcessDesigner 需要引入
  76. import MyPD from "@/components/bpmnProcessDesigner/package/index.js";
  77. Vue.use(MyPD);
  78. import "@/components/bpmnProcessDesigner/package/theme/index.scss";
  79. import "bpmn-js/dist/assets/diagram-js.css";
  80. import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css";
  81. import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css";
  82. import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";
  83. // Form Generator 组件需要使用到 tinymce
  84. import Tinymce from '@/components/tinymce/index.vue'
  85. Vue.component('tinymce', Tinymce)
  86. import '@/icons'
  87. import axios from 'axios'
  88. Vue.prototype.$axios = axios
  89. import '@/styles/index.scss'
  90. /**
  91. * If you don't want to use mock-server
  92. * you want to use MockJs for mock api
  93. * you can execute: mockXHR()
  94. *
  95. * Currently MockJs will be used in the production environment,
  96. * please remove it before going online! ! !
  97. */
  98. Vue.use(Element, {
  99. size: Cookies.get('size') || 'medium' // set element-ui default size
  100. })
  101. Vue.config.productionTip = false
  102. new Vue({
  103. el: '#app',
  104. router,
  105. store,
  106. render: h => h(App)
  107. })