1
0

main.js 2.3 KB

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