main.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import Vue from 'vue'
  2. import App from '@/App'
  3. // import SuperFlow from 'vue-super-flow'
  4. // import 'vue-super-flow/lib/index.css'
  5. import router from '@/router' // api: https://github.com/vuejs/vue-router
  6. import store from '@/store' // api: https://github.com/vuejs/vuex
  7. import VueCookie from 'vue-cookie' // api: https://github.com/alfhen/vue-cookie
  8. import '@/element-ui' // api: https://github.com/ElemeFE/element
  9. import '@/icons' // api: http://www.iconfont.cn/
  10. import '@/element-ui-theme'
  11. import '@/assets/scss/index.scss'
  12. import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
  13. import { isAuth } from '@/utils'
  14. import cloneDeep from 'lodash/cloneDeep'
  15. import SuperFlow from './views/modules/common/vue-super-flow/index'
  16. import html2pdf from '@/api/pdf'
  17. import Print from 'vue-print-nb'
  18. import * as echarts from 'echarts'
  19. import ElementUI from 'element-ui'
  20. import Contextmenu from 'vue-contextmenujs'
  21. // import 'element-ui/lib/theme-chalk/index.css'
  22. import preventReClick from '@/utils/preventReClick'
  23. Vue.use(VueCookie)
  24. Vue.use(SuperFlow)
  25. Vue.use(html2pdf)
  26. Vue.use(Print)
  27. Vue.use(ElementUI)
  28. Vue.use(Contextmenu)
  29. Vue.use(preventReClick) // 防止重复提交
  30. Vue.config.productionTip = false
  31. // 非生产环境, 适配mockjs模拟数据 // api: https://github.com/nuysoft/Mock
  32. if (process.env.NODE_ENV !== 'production') {
  33. require('@/mock')
  34. }
  35. // 挂载全局
  36. Vue.prototype.$echarts = echarts
  37. Vue.prototype.$http = httpRequest // ajax请求方法
  38. Vue.prototype.isAuth = isAuth // 权限方法
  39. // 保存整站vuex本地储存初始状态
  40. window.SITE_CONFIG['storeState'] = cloneDeep(store.state)
  41. // 禁止复制
  42. // document.onselectstart = function () { return false }
  43. /* eslint-disable no-new */
  44. new Vue({
  45. el: '#app',
  46. router,
  47. store,
  48. template: '<App/>',
  49. components: { App }
  50. })
  51. // 版本封存(2023-7-3)