main.js 2.9 KB

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