main.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 { download } from '@/utils/request'
  13. // 防止重复点击事件
  14. import install from '@/utils/preventReClick'
  15. /* 导入第三方vant-ui插件 */
  16. import Vant from 'vant';
  17. import 'vant/lib/index.css';
  18. Vue.use(Vant);
  19. import './assets/icons' // icon
  20. import './permission' // permission control
  21. import { getDicts } from "@/api/system/dict/data";
  22. import { getConfigKey } from "@/api/system/config";
  23. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
  24. // 分页组件
  25. import Pagination from "@/components/Pagination";
  26. // 自定义表格工具组件
  27. import RightToolbar from "@/components/RightToolbar"
  28. // 富文本组件
  29. import Editor from "@/components/Editor"
  30. // 文件上传组件
  31. import FileUpload from "@/components/FileUpload"
  32. // 图片上传组件
  33. import ImageUpload from "@/components/ImageUpload"
  34. // 图片预览组件
  35. import ImagePreview from "@/components/ImagePreview"
  36. // 字典标签组件
  37. import DictTag from '@/components/DictTag'
  38. // 头部标签组件
  39. import VueMeta from 'vue-meta'
  40. // 字典数据组件
  41. import DictData from '@/components/DictData'
  42. import Tinymce from '@/components/tinymce/index.vue'
  43. // 查询条件展开收起组件
  44. import SearchFilter from '@/components/SearchFilter/index.vue'
  45. // 节点表格组件
  46. import nodeTableList from '@/components/nodeTableList/index.vue'
  47. // font-Awesome icon
  48. import { library } from '@fortawesome/fontawesome-svg-core'
  49. import { fas } from '@fortawesome/free-solid-svg-icons'
  50. import { far } from '@fortawesome/free-regular-svg-icons'
  51. import { fab } from '@fortawesome/free-brands-svg-icons'
  52. import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
  53. library.add(fas,)
  54. library.add(far)
  55. library.add(fab)
  56. Vue.component('font-awesome-icon', FontAwesomeIcon)
  57. // import VConsole from "vconsole";
  58. // const vConsole = new VConsole();
  59. // import * as dd from 'dingtalk-jsapi'
  60. // 全局方法挂载
  61. Vue.prototype.getDicts = getDicts
  62. Vue.prototype.getConfigKey = getConfigKey
  63. Vue.prototype.parseTime = parseTime
  64. Vue.prototype.resetForm = resetForm
  65. Vue.prototype.addDateRange = addDateRange
  66. Vue.prototype.selectDictLabel = selectDictLabel
  67. Vue.prototype.selectDictLabels = selectDictLabels
  68. Vue.prototype.download = download
  69. Vue.prototype.handleTree = handleTree
  70. // 全局组件挂载
  71. Vue.component('DictTag', DictTag)
  72. Vue.component('Pagination', Pagination)
  73. Vue.component('RightToolbar', RightToolbar)
  74. Vue.component('Editor', Editor)
  75. Vue.component('FileUpload', FileUpload)
  76. Vue.component('ImageUpload', ImageUpload)
  77. Vue.component('ImagePreview', ImagePreview)
  78. Vue.component('tinymce', Tinymce)
  79. Vue.component('SearchFilter', SearchFilter)
  80. Vue.component('nodeTableList', nodeTableList)
  81. Vue.use(directive)
  82. Vue.use(plugins)
  83. Vue.use(VueMeta)
  84. Vue.use(install)
  85. DictData.install()
  86. /**
  87. * If you don't want to use mock-server
  88. * you want to use MockJs for mock api
  89. * you can execute: mockXHR()
  90. *
  91. * Currently MockJs will be used in the production environment,
  92. * please remove it before going online! ! !
  93. */
  94. Vue.use(Element, {
  95. size: Cookies.get('size') || 'medium' // set element-ui default size
  96. })
  97. Vue.config.productionTip = false
  98. new Vue({
  99. el: '#app',
  100. router,
  101. store,
  102. render: h => h(App)
  103. })