main.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import Vue from 'vue'
  2. import directive from './directive'
  3. import 'normalize.css/normalize.css' // A modern alternative to CSS resets
  4. import ElementUI, {Message, MessageBox} from 'element-ui'
  5. import 'element-ui/lib/theme-chalk/index.css'
  6. import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
  7. import 'font-awesome/scss/font-awesome.scss'
  8. import '@/styles/index.scss' // global css
  9. import 'xe-utils'
  10. import moment from 'moment'
  11. import plugins from './plugins' // plugins
  12. import App from './App'
  13. import store from './store'
  14. import router, {resetRouter} from './router'
  15. import echarts from 'echarts'
  16. import '@/icons' // icon
  17. import '@/permission' // permission control
  18. // import axios from 'axios'
  19. import VXETable from 'vxe-table'
  20. import 'vxe-table/lib/index.css'
  21. import service from './utils/request'
  22. import XEUtils from 'xe-utils'
  23. import {removeToken} from './utils/auth'
  24. // import { resetForm} from "@/utils/index"
  25. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi"
  26. Vue.prototype.$moment = moment
  27. Vue.prototype.$echarts = echarts
  28. Vue.prototype.$XEUtils = XEUtils
  29. import _ from 'lodash'
  30. Vue.prototype._ = _
  31. Vue.prototype.$axios = service
  32. Vue.use(VXETable)
  33. Vue.use(plugins)
  34. Vue.use(directive)
  35. Vue.prototype.handleTree = handleTree
  36. /**
  37. * If you don't want to use mock-server
  38. * you want to use MockJs for mock api
  39. * you can execute: mockXHR()
  40. *
  41. * Currently MockJs will be used in the production environment,
  42. * please remove it before going online ! ! !
  43. */
  44. /* if (process.env.NODE_ENV === 'production') {
  45. const { mockXHR } = require('../mock')
  46. mockXHR()
  47. }*/
  48. // set ElementUI lang to EN
  49. Vue.use(ElementUI, {locale})
  50. // 如果想要中文版 element-ui,按如下方式声明
  51. // Vue.use(ElementUI)
  52. Vue.prototype.$fpath = require('path')
  53. Vue.config.productionTip = false
  54. VXETable.setup({
  55. validArgs: 'obsolete' // 将自定义校验参数还原为 Function(rule, cellValue, callback)
  56. })
  57. Vue.prototype.resetForm = resetForm
  58. Vue.prototype.parseTime = parseTime
  59. new Vue({
  60. el: '#app',
  61. router,
  62. store,
  63. render: h => h(App)
  64. })