main.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. import Vue from 'vue'
  2. import App from './App'
  3. import router from './router'
  4. import axios from 'axios'
  5. import { VueJsonp } from 'vue-jsonp' //解决百度地图跨域
  6. Vue.use(VueJsonp)
  7. import './util/http.js'
  8. Vue.prototype.$axios = axios //全局注册,使用方法为:this.$axios
  9. import qs from 'qs'
  10. Vue.prototype.qs = qs //全局注册,使用方法为:this.qs
  11. Vue.prototype.$EventBus = new Vue() //中央时间总线
  12. Vue.config.productionTip = false //是阻止显示生产模式的消息
  13. Vue.prototype.$host = 'http://192.168.1.12:8000/' // 线下图片服务器路径常量
  14. import 'babel-polyfill' //兼容IE11
  15. require("babel-polyfill")
  16. // 引入百度地图
  17. import BaiduMap from 'vue-baidu-map'
  18. import {
  19. BmPolygon,
  20. BmControl,
  21. BmMarker
  22. } from 'vue-baidu-map'
  23. Vue.use(BaiduMap, BmPolygon, BmControl, BmMarker, {
  24. ak: 'nroAiX0Lf6ppNEGt2dBLtDkOldGCPFwF'
  25. })
  26. import store from './vuex/store' //引入store.js
  27. import promise from 'es6-promise'
  28. promise.polyfill();
  29. import VueHighcharts from 'vue-highcharts';
  30. Vue.use(VueHighcharts);
  31. import Viewer from 'v-viewer'
  32. Vue.use(Viewer, {
  33. defaultOptions: {
  34. "zIndex": 9999,
  35. }
  36. })
  37. import 'viewerjs/dist/viewer.css'
  38. // 样式
  39. import './assets/icon/iconfont.css'
  40. import './plugin/elementUi';
  41. // import './assets/css/theme/ffffff/index.css' //皮肤一
  42. import '../theme/index.css' //皮肤一
  43. //导入全局样式
  44. import './assets/css/global.css'
  45. // 图片放大
  46. import preview from 'vue-photo-preview'
  47. import 'vue-photo-preview/dist/skin.css'
  48. Vue.use(preview)
  49. // 图片裁剪
  50. import VueCropper from 'vue-cropper'
  51. Vue.use(VueCropper)
  52. //格式化时间戳
  53. import './util/formatTime'
  54. //设备类型
  55. Vue.filter('equipType', function (i) {
  56. switch (i) {
  57. case '2':
  58. return '杀虫灯';
  59. break;
  60. case '3':
  61. return '虫情测报灯';
  62. break;
  63. case '4':
  64. return '性诱测报';
  65. break;
  66. case '5':
  67. return '环境监测';
  68. break;
  69. case '6':
  70. return '监控';
  71. break;
  72. case '7':
  73. return '孢子仪';
  74. break;
  75. case '9':
  76. return '糖醋测报';
  77. break;
  78. }
  79. })
  80. /* eslint-disable no-new */
  81. new Vue({
  82. el: '#app',
  83. router,
  84. store,
  85. components: {
  86. App
  87. },
  88. template: '<App/>'
  89. })