main.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import Vue from 'vue'
  2. import App from './App.vue'
  3. import router from './router'
  4. import store from './store'
  5. import './global.less' // global style
  6. import './assets/css/icon.css'
  7. import './plugins/element.js'
  8. import './plugins/use.js'
  9. import { VueAxios } from './utils/request'
  10. import echarts from '@/plugins/echarts'
  11. import { Carousel, CarouselItem } from 'element-ui'
  12. Vue.config.productionTip = false
  13. Vue.use(Carousel)
  14. Vue.use(CarouselItem)
  15. Vue.use(VueAxios)
  16. Vue.prototype.$echarts = echarts
  17. // 注册播放音频事件到Vue实例上
  18. Vue.prototype.playAudio = () => {
  19. const buttonAudio = document.getElementById('eventAudio')
  20. //从头开始播放提示音
  21. buttonAudio.currentTime = 0
  22. buttonAudio.play()
  23. }
  24. Vue.prototype.stopAudio = () => {
  25. const buttonAudio = document.getElementById('eventAudio')
  26. buttonAudio.pause()
  27. //从头开始播放提示音
  28. buttonAudio.currentTime = 0
  29. }
  30. store.dispatch('getClientCode')
  31. store.dispatch('initMqtt')
  32. new Vue({
  33. router,
  34. store,
  35. render: h => h(App)
  36. }).$mount('#app')