main.js 938 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. Vue.config.productionTip = false
  12. Vue.use(VueAxios)
  13. Vue.prototype.$echarts = echarts
  14. // 注册播放音频事件到Vue实例上
  15. Vue.prototype.playAudio = () => {
  16. const buttonAudio = document.getElementById('eventAudio')
  17. //从头开始播放提示音
  18. buttonAudio.currentTime = 0
  19. buttonAudio.play()
  20. }
  21. Vue.prototype.stopAudio = () => {
  22. const buttonAudio = document.getElementById('eventAudio')
  23. buttonAudio.pause()
  24. //从头开始播放提示音
  25. buttonAudio.currentTime = 0
  26. }
  27. store.dispatch('getClientCode')
  28. store.dispatch('initMqtt')
  29. new Vue({
  30. router,
  31. store,
  32. render: h => h(App)
  33. }).$mount('#app')