main.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import Vue from 'vue'
  2. import App from './App'
  3. import './event-bus' // load events
  4. // 将自动注册所有组件为全局组件
  5. import dataV from '@jiaminghi/data-view'
  6. Vue.use(dataV)
  7. import ElementUI from 'element-ui';
  8. import 'element-ui/lib/theme-chalk/index.css';
  9. Vue.use(ElementUI);
  10. import './global/index'
  11. import notification from './notification'
  12. import '@/styles/common.scss' // global css
  13. import i18n from '@/lang' // Internationalization
  14. import './permission' // permission control
  15. import './registerServiceWorker';
  16. import Print from 'vue-print-nb'
  17. Vue.use(Print);
  18. import crudCommon from '@/mixins/crud'
  19. window.$crudCommon = crudCommon;
  20. import vendors from '@/vendors'
  21. const { router, store } = vendors
  22. Vue.config.productionTip = false
  23. // import AMap from 'vue-amap';
  24. // Vue.use(AMap);
  25. import imgPreview from '@/components/imgPreview'
  26. Vue.use(imgPreview)
  27. import echarts from 'echarts';
  28. import geoJson from '@/styles/china.json'
  29. echarts.registerMap('china', geoJson);
  30. Vue.prototype.$echarts = echarts;
  31. // import Warehouse from './common.js'
  32. import Warehouse from './common.js'
  33. Vue.prototype.WAREHOUSE = Warehouse.houseName
  34. Vue.prototype.common = Warehouse
  35. import axios from 'axios';
  36. Vue.prototype.$axios = axios;
  37. import global from './global.js'
  38. Vue.prototype.global = global
  39. import ItemWrap from './components/item-wrap/item-wrap.vue'
  40. Vue.component('ItemWrap', ItemWrap)
  41. import Echart from './components/echart/index.vue'
  42. Vue.component('Echart', Echart)
  43. import '@/utils/jsmpeg.min'
  44. // 初始化vue-amap
  45. // AMap.initAMapApiLoader({
  46. // // 高德key
  47. // key: 'd5486742b76ab0969e4c3ce26f46dfc6',
  48. // // 插件集合 (插件按需引入)
  49. // plugin: ['AMap.Geolocation', 'Geolocation', 'AMap.DistrictSearch', "AMap.PlaceSearch",'AMap.Autocomplete', 'AMap.Geocoder', 'AMap.DistrictSearch'],
  50. // v: '1.4.4'
  51. // });
  52. // ------------ 通过域名判断起始的登陆页面 开始 --------------------
  53. //使用login的Url
  54. // const urls = [
  55. // 'www.winsea.com',
  56. // 'product-test.winsea.com',
  57. // 'test.winsea.com',
  58. // 'saas.winsea.com',
  59. // 'saas-test.winsea.com'
  60. // ]
  61. // urls.includes(window.location.host)
  62. // ? localStorage.setItem('ws_login_type', 2)
  63. // : localStorage.removeItem('ws_login_type')
  64. // ------------ 通过域名判断起始的登陆页面 结束 --------------------
  65. var vue = new Vue({
  66. el: '#app',
  67. router,
  68. store,
  69. i18n,
  70. render: h => h(App)
  71. })
  72. // 初始化通知监听
  73. notification.init(vue, localStorage.getItem('ws-pf_userId'))
  74. notification.start()