main.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import Vue from 'vue'
  2. import 'normalize.css/normalize.css' // A modern alternative to CSS resets
  3. import ElementUI from 'element-ui'
  4. import 'element-ui/lib/theme-chalk/index.css'
  5. import './assets/styles/element-variables.scss'
  6. import '@/assets/styles/index.scss' // global css
  7. // import '@/assets/styles/ruoyi.scss' // ruoyi css
  8. import locale from 'element-ui/lib/locale/lang/en' // lang i18n
  9. import zh from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
  10. import directive from './directive'
  11. import auth from './plugins/auth'
  12. import '@/styles/index.scss' // global css
  13. import '@/assets/styles/ruoyi.scss'
  14. import App from './App'
  15. import store from './store'
  16. import router from './router'
  17. import '@/icons' // icon
  18. import '@/permission' // permission control
  19. import { getDictData } from "@/api/system/dict";
  20. // 字典标签组件
  21. import DictTag from '@/components/DictTag'
  22. // 字典数据组件
  23. import DictData from '@/components/DictData'
  24. import {
  25. parseTime,
  26. resetForm,
  27. addDateRange,
  28. selectDictLabel,
  29. selectDictLabels,
  30. handleTree,
  31. getMonthDate
  32. } from "@/utils/common";
  33. //时间转换主键
  34. import * as moment from 'moment'
  35. Vue.prototype.getDicts = getDictData
  36. Vue.prototype.$moment = moment
  37. Vue.prototype.parseTime = parseTime
  38. Vue.prototype.resetForm = resetForm
  39. Vue.prototype.addDateRange = addDateRange
  40. Vue.prototype.selectDictLabel = selectDictLabel
  41. Vue.prototype.selectDictLabels = selectDictLabels
  42. Vue.prototype.handleTree = handleTree
  43. Vue.prototype.getMonthDate = getMonthDate
  44. Vue.component('DictTag', DictTag)
  45. // 修改 el-dialog 默认点击遮照为不关闭
  46. ElementUI.Dialog.props.closeOnClickModal.default = false
  47. Vue.use(ElementUI, {
  48. locale: zh,
  49. size: 'mini' // set element-ui default size
  50. })
  51. // set ElementUI lang to EN
  52. // Vue.use(ElementUI, { locale })
  53. // 如果想要中文版 element-ui,按如下方式声明
  54. // Vue.use(ElementUI, {locale: zh})
  55. Vue.use(directive)
  56. Vue.use(auth)
  57. DictData.install()
  58. Vue.config.productionTip = false
  59. new Vue({
  60. el: '#app',
  61. router,
  62. store,
  63. render: h => h(App)
  64. })