main.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. import ElTableInfiniteScroll from 'el-table-infinite-scroll'
  36. Vue.prototype.getDicts = getDictData
  37. Vue.prototype.$moment = moment
  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.handleTree = handleTree
  44. Vue.prototype.getMonthDate = getMonthDate
  45. Vue.component('DictTag', DictTag)
  46. // 修改 el-dialog 默认点击遮照为不关闭
  47. ElementUI.Dialog.props.closeOnClickModal.default = false
  48. Vue.use(ElementUI, {
  49. locale: zh,
  50. size: 'mini' // set element-ui default size
  51. })
  52. // set ElementUI lang to EN
  53. // Vue.use(ElementUI, { locale })
  54. // 如果想要中文版 element-ui,按如下方式声明
  55. // Vue.use(ElementUI, {locale: zh})
  56. Vue.use(directive)
  57. Vue.directive("el-table-infinite-scroll", ElTableInfiniteScroll);
  58. Vue.use(auth)
  59. DictData.install()
  60. Vue.config.productionTip = false
  61. new Vue({
  62. el: '#app',
  63. router,
  64. store,
  65. render: h => h(App)
  66. })