main.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 './assets/icons' // icon
  12. import './permission' // permission control
  13. import { getDicts } from "@/api/system/dict/data";
  14. import { getConfigKey } from "@/api/system/config";
  15. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi";
  16. import Pagination from "@/components/Pagination";
  17. // 自定义表格工具扩展
  18. import RightToolbar from "@/components/RightToolbar"
  19. // import echarts from "echarts";
  20. import * as echarts from 'echarts'
  21. Vue.prototype.$echarts = echarts;
  22. //自定义列表组件
  23. import listComponent from '@/combination/listComponent'
  24. Vue.component('listComponent', listComponent)
  25. import MainForm from '@/combination/MainForm'
  26. Vue.component('MainForm', MainForm)
  27. import formComponent from '@/combination/formComponent'
  28. Vue.component('formComponent', formComponent)
  29. import draggable from "vuedraggable";
  30. Vue.component('draggable', draggable)
  31. //审批页面
  32. import ApprovalComments from "@/views/startApproval";
  33. import AddOrUpdate from "@/views/viewApproval";
  34. Vue.component('ApprovalComments', ApprovalComments)
  35. Vue.component('AddOrUpdate', AddOrUpdate)
  36. import Print from '@/combination/plugs/print'
  37. Vue.use(Print) // 注册
  38. // 全局方法挂载
  39. Vue.prototype.getDicts = getDicts
  40. Vue.prototype.getConfigKey = getConfigKey
  41. Vue.prototype.parseTime = parseTime
  42. Vue.prototype.resetForm = resetForm
  43. Vue.prototype.addDateRange = addDateRange
  44. Vue.prototype.selectDictLabel = selectDictLabel
  45. Vue.prototype.selectDictLabels = selectDictLabels
  46. Vue.prototype.download = download
  47. Vue.prototype.handleTree = handleTree
  48. Vue.prototype.msgSuccess = function (msg) {
  49. this.$message({ showClose: true, message: msg, type: "success" });
  50. }
  51. Vue.prototype.msgError = function (msg) {
  52. this.$message({ showClose: true, message: msg, type: "error" });
  53. }
  54. Vue.prototype.msgInfo = function (msg) {
  55. this.$message.info(msg);
  56. }
  57. // 全局组件挂载
  58. Vue.component('Pagination', Pagination)
  59. Vue.component('RightToolbar', RightToolbar)
  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. })