main.js 2.8 KB

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