main.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import Vue from 'vue'
  2. import App from './App'
  3. import './event-bus' // load events
  4. import './global/index'
  5. import notification from './notification'
  6. import '@/styles/common.scss' // global css
  7. import i18n from '@/lang' // Internationalization
  8. import './permission' // permission control
  9. import './registerServiceWorker';
  10. import Print from 'vue-print-nb'
  11. Vue.use(Print);
  12. import crudCommon from '@/mixins/crud'
  13. window.$crudCommon = crudCommon;
  14. import vendors from '@/vendors'
  15. const { router, store } = vendors
  16. Vue.config.productionTip = false
  17. import AMap from 'vue-amap';
  18. Vue.use(AMap);
  19. import imgPreview from '@/components/imgPreview'
  20. Vue.use(imgPreview)
  21. import echarts from "echarts";
  22. Vue.prototype.$echarts = echarts;
  23. import $ from 'jquery'
  24. // import Warehouse from './common.js'
  25. import Warehouse from './common.js'
  26. Vue.prototype.WAREHOUSE = Warehouse.houseName
  27. Vue.prototype.common = Warehouse
  28. // 初始化vue-amap
  29. AMap.initAMapApiLoader({
  30. // 高德key
  31. key: 'd5486742b76ab0969e4c3ce26f46dfc6',
  32. // 插件集合 (插件按需引入)
  33. plugin: ['AMap.Geolocation', 'Geolocation', 'AMap.DistrictSearch', "AMap.PlaceSearch",],
  34. v: '1.4.4'
  35. });
  36. // ------------ 通过域名判断起始的登陆页面 开始 --------------------
  37. //使用login的Url
  38. // const urls = [
  39. // 'www.winsea.com',
  40. // 'product-test.winsea.com',
  41. // 'test.winsea.com',
  42. // 'saas.winsea.com',
  43. // 'saas-test.winsea.com'
  44. // ]
  45. // urls.includes(window.location.host)
  46. // ? localStorage.setItem('ws_login_type', 2)
  47. // : localStorage.removeItem('ws_login_type')
  48. // ------------ 通过域名判断起始的登陆页面 结束 --------------------
  49. var vue = new Vue({
  50. el: '#app',
  51. router,
  52. store,
  53. i18n,
  54. render: h => h(App)
  55. })
  56. // 初始化通知监听
  57. notification.init(vue, localStorage.getItem('ws-pf_userId'))
  58. notification.start()