main.js 3.0 KB

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