main.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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' // 百度统计
  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 $ from 'jquery'
  25. import Antd from 'ant-design-vue';
  26. import 'ant-design-vue/dist/antd.css';
  27. Vue.use(Antd);
  28. import {hiPrintPlugin} from './index'
  29. Vue.use(hiPrintPlugin)
  30. // hiPrintPlugin.disAutoConnect();
  31. import Storage from 'vue-ls'
  32. let options = {
  33. namespace: 'hiPrint-',
  34. name: 'ls',
  35. storage: 'local',
  36. };
  37. Vue.use(Storage, options);
  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. // 全局组件挂载
  51. Vue.component('DictTag', DictTag)
  52. Vue.component('DocAlert', DocAlert)
  53. Vue.component('Pagination', Pagination)
  54. Vue.component('RightToolbar', RightToolbar)
  55. // 字典标签组件
  56. import DictTag from '@/components/DictTag'
  57. import DocAlert from '@/components/DocAlert'
  58. // 头部标签插件
  59. import VueMeta from 'vue-meta'
  60. Vue.use(directive)
  61. Vue.use(plugins)
  62. Vue.use(VueMeta)
  63. // Vue.use(hljs.vuePlugin);
  64. // bpmnProcessDesigner 需要引入
  65. import MyPD from "@/components/bpmnProcessDesigner/package/index.js";
  66. Vue.use(MyPD);
  67. import "@/components/bpmnProcessDesigner/package/theme/index.scss";
  68. import "bpmn-js/dist/assets/diagram-js.css";
  69. import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css";
  70. import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css";
  71. import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";
  72. // Form Generator 组件需要使用到 tinymce
  73. import Tinymce from '@/components/tinymce/index.vue'
  74. Vue.component('tinymce', Tinymce)
  75. import '@/assets/icons'
  76. import request from "@/utils/request" // 实现 form generator 使用自己定义的 axios request 对象
  77. console.log(request)
  78. Vue.prototype.$axios = request
  79. import '@/styles/index.scss'
  80. // 默认点击背景不关闭弹窗
  81. import ElementUI from 'element-ui'
  82. ElementUI.Dialog.props.closeOnClickModal.default = false
  83. /**
  84. * If you don't want to use mock-server
  85. * you want to use MockJs for mock api
  86. * you can execute: mockXHR()
  87. *
  88. * Currently MockJs will be used in the production environment,
  89. * please remove it before going online! ! !
  90. */
  91. Vue.use(Element, {
  92. size: localStorage.getItem("size") || "medium", // set element-ui default size
  93. });
  94. Vue.config.productionTip = false
  95. new Vue({
  96. el: '#app',
  97. router,
  98. store,
  99. render: h => h(App)
  100. })