main.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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('DocAlert', DocAlert)
  39. Vue.component('Pagination', Pagination)
  40. Vue.component('RightToolbar', RightToolbar)
  41. // 字典标签组件
  42. import DictTag from '@/components/DictTag'
  43. import DocAlert from '@/components/DocAlert'
  44. // 头部标签插件
  45. import VueMeta from 'vue-meta'
  46. Vue.use(directive)
  47. Vue.use(plugins)
  48. Vue.use(VueMeta)
  49. // Vue.use(hljs.vuePlugin);
  50. // bpmnProcessDesigner 需要引入
  51. import MyPD from "@/components/bpmnProcessDesigner/package/index.js";
  52. Vue.use(MyPD);
  53. import "@/components/bpmnProcessDesigner/package/theme/index.scss";
  54. import "bpmn-js/dist/assets/diagram-js.css";
  55. import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css";
  56. import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css";
  57. import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";
  58. // Form Generator 组件需要使用到 tinymce
  59. import Tinymce from '@/components/tinymce/index.vue'
  60. Vue.component('tinymce', Tinymce)
  61. import '@/icons'
  62. import axios from 'axios'
  63. Vue.prototype.$axios = axios
  64. import '@/styles/index.scss'
  65. /**
  66. * If you don't want to use mock-server
  67. * you want to use MockJs for mock api
  68. * you can execute: mockXHR()
  69. *
  70. * Currently MockJs will be used in the production environment,
  71. * please remove it before going online! ! !
  72. */
  73. Vue.use(Element, {
  74. size: Cookies.get('size') || 'medium' // set element-ui default size
  75. })
  76. Vue.config.productionTip = false
  77. new Vue({
  78. el: '#app',
  79. router,
  80. store,
  81. render: h => h(App)
  82. })