main.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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'
  6. import '@/assets/styles/tiegu.scss'
  7. import App from './App'
  8. import store from './store'
  9. import router from './router'
  10. import directive from './directive'
  11. import plugins from './plugins'
  12. import { download } from '@/utils/request'
  13. import './assets/icons'
  14. import './permission'
  15. import { getDicts } from '@/api/system/dict/data'
  16. import { getConfigKey } from '@/api/system/config'
  17. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree, copyFormFiled } from '@/utils/tiegu'
  18. // 分页组件
  19. import Pagination from '@/components/Pagination'
  20. // 自定义表格工具组件
  21. import RightToolbar from '@/components/RightToolbar'
  22. // 富文本组件
  23. import Editor from '@/components/Editor'
  24. // 文件上传组件
  25. import FileUpload from '@/components/FileUpload'
  26. // 图片上传组件
  27. import ImageUpload from '@/components/ImageUpload'
  28. // 字典标签组件
  29. import DictTag from '@/components/DictTag'
  30. // 头部标签组件
  31. import VueMeta from 'vue-meta'
  32. // 字典数据组件
  33. import DictData from '@/components/DictData'
  34. // 全局方法挂载
  35. Vue.prototype.getDicts = getDicts
  36. Vue.prototype.getConfigKey = getConfigKey
  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.download = download
  43. Vue.prototype.handleTree = handleTree
  44. Vue.prototype.copyFormFiled = copyFormFiled
  45. // 全局组件挂载
  46. Vue.component('DictTag', DictTag)
  47. Vue.component('Pagination', Pagination)
  48. Vue.component('RightToolbar', RightToolbar)
  49. Vue.component('Editor', Editor)
  50. Vue.component('FileUpload', FileUpload)
  51. Vue.component('ImageUpload', ImageUpload)
  52. Vue.use(directive)
  53. Vue.use(plugins)
  54. Vue.use(VueMeta)
  55. DictData.install()
  56. Vue.use(Element, {
  57. size: Cookies.get('size') || 'medium' // set element-ui default size
  58. })
  59. Vue.config.productionTip = false
  60. new Vue({
  61. el: '#app',
  62. router,
  63. store,
  64. render: (h) => h(App)
  65. })