main.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 plugins from './plugins' // plugins
  12. import './assets/icons' // icon
  13. import './permission' // permission control
  14. import { getDicts } from "@/api/system/dict/data";
  15. import { getConfigKey } from "@/api/infra/config";
  16. import { parseTime, resetForm, addDateRange, addBeginAndEndTime, handleTree} from "@/utils/ruoyi";
  17. import Pagination from "@/components/Pagination";
  18. // 自定义表格工具扩展
  19. import RightToolbar from "@/components/RightToolbar"
  20. // 代码高亮插件
  21. // import hljs from 'highlight.js'
  22. // import 'highlight.js/styles/github-gist.css'
  23. import {DICT_TYPE, getDictDataLabel, getDictDatas, getDictDatas2} from "@/utils/dict";
  24. // 全局方法挂载
  25. Vue.prototype.getDicts = getDicts
  26. Vue.prototype.getConfigKey = getConfigKey
  27. Vue.prototype.parseTime = parseTime
  28. Vue.prototype.resetForm = resetForm
  29. Vue.prototype.addDateRange = addDateRange
  30. Vue.prototype.addBeginAndEndTime = addBeginAndEndTime
  31. Vue.prototype.getDictDatas = getDictDatas
  32. Vue.prototype.getDictDatas2 = getDictDatas2
  33. Vue.prototype.getDictDataLabel = getDictDataLabel
  34. Vue.prototype.DICT_TYPE = DICT_TYPE
  35. Vue.prototype.handleTree = handleTree
  36. // 全局组件挂载
  37. Vue.component('DictTag', DictTag)
  38. Vue.component('Pagination', Pagination)
  39. Vue.component('RightToolbar', RightToolbar)
  40. // 字典标签组件
  41. import DictTag from '@/components/DictTag'
  42. // 头部标签插件
  43. import VueMeta from 'vue-meta'
  44. Vue.use(directive)
  45. Vue.use(plugins)
  46. Vue.use(VueMeta)
  47. // Vue.use(hljs.vuePlugin);
  48. // bpmnProcessDesigner 需要引入
  49. import MyPD from "@/components/bpmnProcessDesigner/package/index.js";
  50. Vue.use(MyPD);
  51. import "@/components/bpmnProcessDesigner/package/theme/index.scss";
  52. import "bpmn-js/dist/assets/diagram-js.css";
  53. import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css";
  54. import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css";
  55. import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";
  56. // Form Generator 组件需要使用到 tinymce
  57. import Tinymce from '@/components/tinymce/index.vue'
  58. Vue.component('tinymce', Tinymce)
  59. import '@/icons'
  60. import axios from 'axios'
  61. Vue.prototype.$axios = axios
  62. import '@/styles/index.scss'
  63. /**
  64. * If you don't want to use mock-server
  65. * you want to use MockJs for mock api
  66. * you can execute: mockXHR()
  67. *
  68. * Currently MockJs will be used in the production environment,
  69. * please remove it before going online! ! !
  70. */
  71. Vue.use(Element, {
  72. size: Cookies.get('size') || 'medium' // set element-ui default size
  73. })
  74. Vue.config.productionTip = false
  75. new Vue({
  76. el: '#app',
  77. router,
  78. store,
  79. render: h => h(App)
  80. })