main.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. // 初始化vue-amap
  40. // AMap.initAMapApiLoader({
  41. // // 高德key
  42. // key: 'd5486742b76ab0969e4c3ce26f46dfc6',
  43. // // 插件集合 (插件按需引入)
  44. // plugin: ['AMap.Geolocation', 'Geolocation', 'AMap.DistrictSearch', "AMap.PlaceSearch",'AMap.Autocomplete', 'AMap.Geocoder', 'AMap.DistrictSearch'],
  45. // v: '1.4.4'
  46. // });
  47. // ------------ 通过域名判断起始的登陆页面 开始 --------------------
  48. //使用login的Url
  49. // const urls = [
  50. // 'www.winsea.com',
  51. // 'product-test.winsea.com',
  52. // 'test.winsea.com',
  53. // 'saas.winsea.com',
  54. // 'saas-test.winsea.com'
  55. // ]
  56. // urls.includes(window.location.host)
  57. // ? localStorage.setItem('ws_login_type', 2)
  58. // : localStorage.removeItem('ws_login_type')
  59. // ------------ 通过域名判断起始的登陆页面 结束 --------------------
  60. var vue = new Vue({
  61. el: '#app',
  62. router,
  63. store,
  64. i18n,
  65. render: h => h(App)
  66. })
  67. // 初始化通知监听
  68. notification.init(vue, localStorage.getItem('ws-pf_userId'))
  69. notification.start()