main.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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' // global css
  6. import '@/assets/styles/fuint.scss' // fuint.css
  7. import App from './App'
  8. import store from './store'
  9. import router from './router'
  10. import directive from './directive' // directive
  11. import plugins from './plugins' // plugins
  12. import { download } from '@/utils/request'
  13. import './assets/icons' // icon
  14. import './permission' // permission control
  15. import { getConfigKey } from "@/api/system/config";
  16. import { parseTime, resetForm, addDateRange, getName, handleTree } from "@/utils/fuint";
  17. // 分页组件
  18. import Pagination from "@/components/Pagination";
  19. // 自定义表格工具组件
  20. import RightToolbar from "@/components/RightToolbar"
  21. // 富文本组件
  22. import Editor from "@/components/Editor"
  23. // 文件上传组件
  24. import FileUpload from "@/components/FileUpload"
  25. // 图片上传组件
  26. import ImageUpload from "@/components/ImageUpload"
  27. // 图片预览组件
  28. import ImagePreview from "@/components/ImagePreview"
  29. // 字典标签组件
  30. import DictTag from '@/components/DictTag'
  31. // 头部标签组件
  32. import VueMeta from 'vue-meta'
  33. // 字典数据组件
  34. import DictData from '@/components/DictData'
  35. // 打印插件
  36. import Print from 'vue-print-nb'
  37. // 树形选择组件
  38. import TreeSelect from '@/components/TreeSelect'
  39. // 会员选择组件
  40. import UserSelect from '@/components/UserSelect'
  41. // 多语言
  42. import i18n from './i18n';
  43. // 全局方法挂载
  44. Vue.prototype.getConfigKey = getConfigKey
  45. Vue.prototype.parseTime = parseTime
  46. Vue.prototype.resetForm = resetForm
  47. Vue.prototype.addDateRange = addDateRange
  48. Vue.prototype.getName = getName
  49. Vue.prototype.download = download
  50. Vue.prototype.handleTree = handleTree
  51. // 全局组件挂载
  52. Vue.component('DictTag', DictTag)
  53. Vue.component('Pagination', Pagination)
  54. Vue.component('RightToolbar', RightToolbar)
  55. Vue.component('Editor', Editor)
  56. Vue.component('FileUpload', FileUpload)
  57. Vue.component('ImageUpload', ImageUpload)
  58. Vue.component('ImagePreview', ImagePreview)
  59. Vue.component('TreeSelect', TreeSelect)
  60. Vue.component('UserSelect', UserSelect)
  61. Vue.use(directive)
  62. Vue.use(plugins)
  63. Vue.use(VueMeta)
  64. Vue.use(Print);
  65. DictData.install()
  66. /**
  67. * If you don't want to use mock-server
  68. * you want to use MockJs for mock api
  69. * you can execute: mockXHR()
  70. *
  71. * Currently MockJs will be used in the production environment,
  72. * please remove it before going online! ! !
  73. */
  74. Vue.use(Element, {
  75. size: Cookies.get('size') || 'medium' // set element-ui default size
  76. })
  77. Vue.config.productionTip = false
  78. new Vue({
  79. el: '#app',
  80. router,
  81. store,
  82. i18n,
  83. render: h => h(App)
  84. })