import Vue from 'vue'
import layer from 'vue-layer'

import 'normalize.css/normalize.css'// A modern alternative to CSS resets


import ElementUI from 'element-ui'
import Vant from 'vant'
import 'element-ui/lib/theme-chalk/index.css'
import '@/assets/custom-theme/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
import VueContextMenu from 'vue-contextmenu'

import '@/styles/index.scss' // global css
import 'vant/lib/index.css';
import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control
import '@/assets/public/css/iconfont/iconfont.css'
import '@/assets/public/css/iconfont/iconfont.js'
import '@/assets/public/css/comIconfont/iconfont/iconfont.css'
import '@/assets/public/css/comIconfont/iconfont/iconfont.js'

import '../public/ueditor/ueditor.config.js'
import '../public/ueditor/ueditor.all.js'
import '../public/ueditor/lang/zh-cn/zh-cn.js'
import '../public/ueditor/formdesign/leipi.formdesign.v4.js'

import 'mapbox-gl/dist/mapbox-gl.css'
import mapBoxGl from 'mapbox-gl'
Vue.prototype.$mapboxgl = mapBoxGl

import MapboxDraw from "@mapbox/mapbox-gl-draw";
import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css'


import 'leaflet/dist/leaflet.css'
// 引入Leaflet对象 挂载到Vue上，便于全局使用，也可以单独页面中单独引用
import * as L from 'leaflet'
import '@geoman-io/leaflet-geoman-free';
import '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css';
import * as turf from '@turf/turf'
Vue.prototype.$turf = turf


//视频播放插件vue-video-player
import VideoPlayer from 'vue-video-player'
require('video.js/dist/video-js.css')
require('vue-video-player/src/custom-theme.css')

Vue.use(VideoPlayer)

// 引入ECharts
import echarts  from 'echarts'

// 引入前端导出Excel插件
import JsonExcel from 'vue-json-excel'

// 引入打印插件
import Print from 'vue-print-nb'

import Axios from 'axios'

import 'leaflet.chinatmsproviders'
import 'leaflet.markercluster'







Vue.prototype.$axios = Axios;
Vue.L = Vue.prototype.$L = L
Vue.use(ElementUI, {locale})

delete L.Icon.Default.prototype._getIconUrl
L.Icon.Default.mergeOptions({
  iconRetinaUrl: require('leaflet/dist/images/marker-icon-2x.png'),
  iconUrl: require('leaflet/dist/images/marker-icon.png'),
  shadowUrl: require('leaflet/dist/images/marker-shadow.png'),
})


Vue.use(L)
Vue.use(Vant)
Vue.use(ElementUI, {locale})
Vue.use(VueContextMenu)

Vue.config.productionTip = false
Vue.prototype.$layer = layer(Vue, {
    msgtime: 3
})
// 挂在echarts
Vue.prototype.$echarts = echarts;
// 导出Excel插件
Vue.component('downloadExcel',JsonExcel);
// 打印插件
Vue.use(Print);
new Vue({
    el: '#app',
    router,
    store,
    render: h => h(App)
})
