main.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 permission from './directive/permission'
  11. import { download } from '@/utils/request'
  12. import './assets/icons' // icon
  13. import './permission' // permission control
  14. import { getDicts } from "@/api/system/dict/data";
  15. import { getConfigKey } from "@/api/system/config";
  16. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
  17. import Pagination from "@/components/Pagination";
  18. // 自定义表格工具扩展
  19. import RightToolbar from "@/components/RightToolbar"
  20. import DynamicForm from "@/components/DynamicForm"
  21. import DynamicForms from "@/components/DynamicForms"
  22. import MemoranDum from "@/components/MemoranDum"
  23. import 'burgeon-ui/dist/styles/burgeon-ui.css';
  24. import BurgeonUi from 'burgeon-ui';
  25. Vue.use(BurgeonUi);
  26. // 全局方法挂载
  27. Vue.prototype.getDicts = getDicts
  28. Vue.prototype.getConfigKey = getConfigKey
  29. Vue.prototype.parseTime = parseTime
  30. Vue.prototype.resetForm = resetForm
  31. Vue.prototype.addDateRange = addDateRange
  32. Vue.prototype.selectDictLabel = selectDictLabel
  33. Vue.prototype.selectDictLabels = selectDictLabels
  34. Vue.prototype.download = download
  35. Vue.prototype.handleTree = handleTree
  36. Vue.prototype.msgSuccess = function (msg) {
  37. this.$message({ showClose: true, message: msg, type: "success" });
  38. }
  39. Vue.prototype.msgError = function (msg) {
  40. this.$message({ showClose: true, message: msg, type: "error" });
  41. }
  42. Vue.prototype.msgInfo = function (msg) {
  43. this.$message.info(msg);
  44. }
  45. import directive from "@/components/Directives";
  46. Vue.use(directive)
  47. // 全局组件挂载
  48. Vue.component('Pagination', Pagination)
  49. Vue.component('RightToolbar', RightToolbar)
  50. Vue.component('DynamicForm', DynamicForm)
  51. Vue.component('DynamicForms', DynamicForms)
  52. Vue.component('MemoranDum', MemoranDum)
  53. Vue.use(permission)
  54. /**
  55. * If you don't want to use mock-server
  56. * you want to use MockJs for mock api
  57. * you can execute: mockXHR()
  58. *
  59. * Currently MockJs will be used in the production environment,
  60. * please remove it before going online! ! !
  61. */
  62. Vue.use(Element, {
  63. size: Cookies.get('size') || 'medium' // set element-ui default size
  64. })
  65. Vue.config.productionTip = false
  66. new Vue({
  67. el: '#app',
  68. router,
  69. store,
  70. render: h => h(App)
  71. })