main.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. import Vue from 'vue'
  2. import Element from 'element-ui'
  3. import './assets/styles/element-variables.scss'
  4. import '@/assets/styles/index.scss' // global css
  5. import '@/assets/styles/ruoyi.scss' // ruoyi css
  6. import App from './App'
  7. import store from './store'
  8. import router from './router'
  9. import directive from './directive' // directive
  10. import plugins from './plugins' // plugins
  11. import './assets/icons' // icon
  12. import './permission' // permission control
  13. // import './tongji' // 百度统计 该项目不用百度统计,而且统计这个命名真的很low
  14. import { getDicts } from "@/api/system/dict/data";
  15. import { getConfigKey } from "@/api/infra/config";
  16. import { parseTime, resetForm, handleTree, addBeginAndEndTime, divide} 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. import SearchBar from '@/components/SearchBar'
  25. import DictSelect from '@/components/DictSelect'
  26. // 简易高级查询组件
  27. import QueryFormWrapper from '@/components/QueryFormWrapper'
  28. import EasyAdvancedQuery from '@/components/EasyAdvancedQuery'
  29. // 表格自适应
  30. import AutoResizer from '@/components/AutoResizer'
  31. // 字典标签组件
  32. import DictTag from '@/components/DictTag'
  33. // 头部标签插件
  34. import VueMeta from 'vue-meta'
  35. import VXETable from 'vxe-table'
  36. import 'vxe-table/lib/style.css'
  37. import { CCPrintingAPI } from "./utils/CCPrintingAPI.min";
  38. // 全局方法挂载
  39. Vue.prototype.getDicts = getDicts
  40. Vue.prototype.getConfigKey = getConfigKey
  41. Vue.prototype.parseTime = parseTime
  42. Vue.prototype.resetForm = resetForm
  43. Vue.prototype.getDictDatas = getDictDatas
  44. Vue.prototype.getDictDatas2 = getDictDatas2
  45. Vue.prototype.getDictDataLabel = getDictDataLabel
  46. Vue.prototype.DICT_TYPE = DICT_TYPE
  47. Vue.prototype.handleTree = handleTree
  48. Vue.prototype.addBeginAndEndTime = addBeginAndEndTime
  49. Vue.prototype.divide = divide
  50. Vue.prototype.CCPrintingAPI = CCPrintingAPI
  51. // 全局组件挂载
  52. Vue.component('DictTag', DictTag)
  53. Vue.component('Pagination', Pagination)
  54. Vue.component('RightToolbar', RightToolbar)
  55. Vue.component('SearchBar', SearchBar)
  56. Vue.component('QueryFormWrapper', QueryFormWrapper)
  57. Vue.component('EasyAdvancedQuery', EasyAdvancedQuery)
  58. Vue.component('AutoResizer', AutoResizer)
  59. Vue.component('DictSelect', DictSelect)
  60. Vue.use(directive)
  61. Vue.use(plugins)
  62. Vue.use(VueMeta)
  63. Vue.use(VXETable)
  64. // Vue.use(hljs.vuePlugin);
  65. // bpmnProcessDesigner 需要引入
  66. import MyPD from "@/components/BpmnProcessDesigner/package/index.js";
  67. Vue.use(MyPD);
  68. import "@/components/BpmnProcessDesigner/package/theme/index.scss";
  69. import "bpmn-js/dist/assets/diagram-js.css";
  70. import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css";
  71. import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css";
  72. import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";
  73. // Form Generator 组件需要使用到 tinymce
  74. import Tinymce from '@/components/Tinymce/index.vue'
  75. Vue.component('tinymce', Tinymce)
  76. import '@/icons'
  77. import request from "@/utils/request" // 实现 form generator 使用自己定义的 axios request 对象
  78. Vue.prototype.$axios = request
  79. import '@/styles/index.scss'
  80. // 默认点击背景不关闭弹窗
  81. import ElementUI from 'element-ui'
  82. import vueCompositionApi from '@vue/composition-api'
  83. ElementUI.Dialog.props.closeOnClickModal.default = false
  84. /**
  85. * If you don't want to use mock-server
  86. * you want to use MockJs for mock api
  87. * you can execute: mockXHR()
  88. *
  89. * Currently MockJs will be used in the production environment,
  90. * please remove it before going online! ! !
  91. */
  92. Vue.use(Element, {
  93. size: localStorage.getItem("size") || "medium", // set element-ui default size
  94. });
  95. Vue.config.productionTip = false
  96. new Vue({
  97. el: '#app',
  98. router,
  99. store,
  100. render: h => h(App)
  101. })