7e9c1033049669cc90737c3eb54ba7a13f138180.svn-base 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import 'normalize.css/normalize.css' // A modern alternative to CSS resets
  4. import ElementUI from 'element-ui'
  5. import 'element-ui/lib/theme-chalk/index.css'
  6. // const ElementUI = require('element-ui')
  7. // require('element-ui/lib/theme-chalk/index.css')
  8. import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
  9. import iconfont from './assets/iconfont/iconfont.css'
  10. import '@/styles/index.scss' // global css
  11. import * as Sentry from '@sentry/browser'
  12. import { Vue as VueIntegration } from '@sentry/integrations'
  13. import App from './App'
  14. import store from './store'
  15. import router from './router'
  16. import i18n from './i18n'
  17. import '@/icons' // icon
  18. import '@/permission' // permission control
  19. import './icons'
  20. import * as filters from './filters' // global filters
  21. Vue.config.productionTip = false
  22. /**
  23. * If you don't want to use mock-server
  24. * you want to use MockJs for mock api
  25. * you can execute: mockXHR()
  26. *
  27. * Currently MockJs will be used in the production environment,
  28. * please remove it before going online! ! !
  29. */
  30. // import { mockXHR } from '../mock'
  31. if (process.env.NODE_ENV === 'production') {
  32. // mockXHR()
  33. }
  34. var pageCount = 50
  35. // console.log(process.env)
  36. if (process.env.NODE_ENV !== 'development') {
  37. Sentry.init({
  38. release: 'vislib@' + process.env.npm_package_version,
  39. dsn: 'https://9d8ee0ea1a2749949dd1e641b0f7c071@o286322.ingest.sentry.io/5217806',
  40. integrations: [new VueIntegration({ Vue, attachProps: true })]
  41. })
  42. }
  43. store.commit('app/SET_LANG', 'CN')
  44. Vue.use(VueRouter)
  45. Vue.use(pageCount)
  46. Vue.use(ElementUI, {
  47. i18n: (key, value) => i18n.t(key, value)
  48. })
  49. // register global utility filters
  50. Object.keys(filters).forEach(key => {
  51. Vue.filter(key, filters[key])
  52. })
  53. import echarts from 'echarts'
  54. Vue.use(echarts)
  55. // Vue.prototype.$echarts = echarts
  56. new Vue({
  57. el: '#app',
  58. router,
  59. store,
  60. i18n,
  61. render: h => h(App)
  62. })