main.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. import Vue from 'vue'
  2. import http from './http';
  3. import App from '@/root/App.vue'
  4. import axios from 'axios'
  5. import router from './router'
  6. import store from './store'
  7. import '@/common/directives/test'
  8. import baseCom from '@/common/components/global.js'
  9. import ElementUI from 'element-ui'
  10. import '../../assets/font/iconfont.css'
  11. import '../../assets/font_9ln4buq8doc/iconfont.css'
  12. import 'element-ui/lib/theme-chalk/index.css'
  13. import '../../assets/css/MapPoint.css'
  14. import '../../assets/css/page.styl'
  15. import './filters/filters';
  16. import PageComponent from './components/Pagination/index';
  17. import commonJS from './utils/common';
  18. import echarts from 'echarts';
  19. Vue.prototype.$echarts = echarts;
  20. Vue.prototype.axios = http;
  21. Vue.prototype.$common = commonJS;
  22. Vue.prototype.$echarts = echarts;
  23. // 引入高德使用高德
  24. import VueAMap from 'vue-amap';
  25. import { lazyAMapApiLoaderInstance } from 'vue-amap';
  26. Vue.use(PageComponent)
  27. Vue.use(VueAMap);
  28. // VueAMap.initAMapApiLoader({
  29. // key: "937eb4405db2a8895695506871c3a1d5",
  30. // plugin: [
  31. // "AMap.Autocomplete",
  32. // "AMap.PlaceSearch",
  33. // "AMap.Scale",
  34. // "AMap.OverView",
  35. // "AMap.ToolBar",
  36. // "AMap.MapType",
  37. // "AMap.PolyEditor",
  38. // "AMap.CircleEditor"
  39. // ],
  40. // v: "1.4.4",
  41. // uiVersion: "1.0.11"
  42. // });
  43. // Vue.prototype.$host = 'http://192.168.1.66:8081';
  44. Vue.use(ElementUI)
  45. Vue.config.productionTip = false
  46. import myToast from '@/common/plugins/Toast'
  47. Vue.use(myToast())
  48. import '@/assets/css/base.css'
  49. import '@/assets/css/fun.styl'
  50. import '@/assets/css/common.css'
  51. baseCom().forEach((item)=>{
  52. Vue.component(item.comName,item.comDefault)
  53. })
  54. // title
  55. Vue.use(require('vue-wechat-title'));
  56. import EventProxy from 'vue-event-proxy';
  57. Vue.use(EventProxy);
  58. Vue.prototype.pathReg = /(http|https):\/\/([\w.]+\/?)\S*/
  59. Vue.prototype.getButton =function (id,callback) {
  60. var url="https://app.edtyun.com:8443/system/menu/getButton"
  61. var param = {
  62. menuId:id
  63. }
  64. return axios.post(url, param,{ headers: {'Authorization': JSON.parse(sessionStorage.getItem('token')),'MobileType':0}})
  65. }
  66. Vue.prototype.$userId = global.$userId = function () {
  67. let userId = sessionStorage.getItem('user');
  68. if (userId) {
  69. return userId;
  70. }
  71. return null;
  72. }
  73. Vue.prototype.$userName = global.$userName = function () {
  74. let userName = sessionStorage.getItem('userName');
  75. if (userName) {
  76. return userName;
  77. }
  78. return null;
  79. }
  80. Vue.config.productionTip = false
  81. new Vue({
  82. router,
  83. store,
  84. render: h => h(App)
  85. }).$mount('#app')