main.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // The Vue build version to load with the `import` command
  2. // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
  3. import Vue from 'vue'
  4. import 'normalize.css'
  5. import ElementUI from 'element-ui'
  6. import elementUIVerify from 'element-ui-verify'
  7. import ECharts from 'vue-echarts/components/ECharts.vue'
  8. import 'echarts/lib/chart/bar'
  9. import 'echarts/lib/chart/line'
  10. import 'echarts/lib/chart/pie'
  11. import 'echarts/lib/chart/heatmap'
  12. import 'echarts/lib/component/tooltip'
  13. import 'echarts/lib/component/polar'
  14. import 'echarts/lib/component/geo'
  15. import 'echarts/lib/component/legend'
  16. import 'echarts/lib/component/legendScroll'
  17. import 'echarts/lib/component/title'
  18. import 'echarts/lib/component/visualMap'
  19. import 'echarts/lib/component/dataset'
  20. // import Viser from 'viser-vue'
  21. import VueBus from 'vue-bus'
  22. import '@/assets/css/index-new.css'
  23. import '@/styles/index.scss'
  24. import Tip from '@/components/Tip'
  25. import VueIconFont from 'vue-icon-font'
  26. import i18n from './lang'
  27. import '@/assets/font/iconfont.css'
  28. import '@/icons'
  29. import '@/permission'
  30. import './mock'
  31. import { totalRowClassName } from '@/utils'
  32. import App from './App'
  33. import router from './router'
  34. import * as filters from './filters' // global filters
  35. import store from './store'
  36. Vue.config.devtools = true
  37. Vue.use(ElementUI, {
  38. size: 'mini'
  39. })
  40. Vue.use(elementUIVerify)
  41. Vue.use(VueIconFont)
  42. Vue.use(VueBus)
  43. // Vue.use(Viser)
  44. Vue.component('Tip', Tip)
  45. Vue.component('v-chart', ECharts)
  46. // register global utility filters.
  47. Object.keys(filters).forEach(key => {
  48. Vue.filter(key, filters[key])
  49. })
  50. Vue.config.productionTip = false
  51. Vue.mixin({
  52. data () {
  53. return {
  54. project: '',
  55. pageTitle: '线上分销系统'
  56. }
  57. },
  58. mounted () {
  59. this.project = (this.$route && this.$route.query.project) || localStorage.project || ''
  60. if (this.project) {
  61. const titleMap = {
  62. // cleartv: '徽黄科技'
  63. cleartv: ''
  64. }
  65. this.pageTitle = (titleMap[this.project] || '') + '线上分销系统'
  66. localStorage.project = this.project
  67. }
  68. },
  69. computed: {
  70. pagePermission () {
  71. return this.$route && this.$route.meta && this.$route.meta.permissionList ? this.$route.meta.permissionList : []
  72. }
  73. },
  74. methods: {
  75. totalRowClassName,
  76. checkPermission (type) {
  77. return this.pagePermission.indexOf(type) !== -1 || this.pagePermission.indexOf('all') !== -1
  78. }
  79. }
  80. })
  81. /* eslint-disable no-new */
  82. new Vue({
  83. el: '#app',
  84. router,
  85. store,
  86. i18n,
  87. components: { App },
  88. template: '<App/>'
  89. })