import Vue from 'vue'
import md5 from 'js-md5';
import App from './App.vue'
import router from './router'
import store from './store'
import qs from 'qs';
// import VueGridLayout from 'vue-grid-layout';
import './permission'
import Cookies from 'js-cookie'
import util from './api/util.js'
import {DropdownMenu, DropdownItem, Divider, Popup, Overlay, Loading, Dialog, ContactCard, Form, AddressEdit, AddressList, Field, CellGroup, Cell, SwipeCell, Icon, Stepper, Card, Checkbox, CheckboxGroup, Button, Swipe, SwipeItem, PullRefresh, List, Tab, Tabs, GoodsAction, GoodsActionIcon, GoodsActionButton, SubmitBar, Toast ,Search,Picker,Uploader,Notify ,ContactList,Calendar,Radio,RadioGroup,Tag,Tabbar,TabbarItem,Sticky, Grid, GridItem,Skeleton,Col,Row,  Image as VanImage, Badge,NoticeBar,DatetimePicker,
Step, Steps,Lazyload,Popover,Collapse, CollapseItem  } from 'vant'
import 'lib-flexible/flexible'
import vueEsign from 'vue-esign'
Vue.use(vueEsign)
Vue.prototype.util = util
Vue.use(Divider).use(Popup).use(Overlay).use(Loading).use(Dialog).use(Toast).use(ContactCard).use(Form).use(AddressEdit).use(AddressList).use(Field).use(CellGroup).use(Cell).use(SwipeCell).use(Icon).use(Stepper).use(Card).use(Button).use(Swipe).use(SwipeItem).use(PullRefresh).use(List).use(Tab).use(Tabs).use(GoodsAction).use(GoodsActionIcon).use(GoodsActionButton).use(SubmitBar).use(Checkbox).use(CheckboxGroup).use(Search).use(Picker).use(Uploader).use(Notify)
.use(ContactList).use(Calendar).use(Radio).use(RadioGroup).use(Tag).use(Tabbar).use(TabbarItem).use(Sticky)
.use(Grid).use(GridItem).use(Skeleton).use(Col).use(Row).use(VanImage).use(Badge).use(NoticeBar).use(DatetimePicker).use(Step).use(Steps).use(Popover).use(Lazyload).use(Collapse).use(CollapseItem)
Vue.use(DropdownMenu);
Vue.use(DropdownItem);
// 引用高德地图组件 main.js
import VueAMap from 'vue-amap'
Vue.use(VueAMap)
// 初始化
VueAMap.initAMapApiLoader({
  key: '9b16720c3ea21877cfbe73229bba9032',
  plugin: [ // 依赖配置，根据自己的需求引入
    'AMap.PlaceSearch',//POI搜索插件
    'AMap.Scale', 
    'AMap.Geocoder',

    "AMap.Autocomplete", //输入提示插件
    "AMap.OverView", //地图鹰眼插件
    "AMap.ToolBar", //地图工具条
    "AMap.MapType", //类别切换控件，实现默认图层与卫星图、实施交通图层之间切换的控制
    "AMap.PolyEditor", //编辑 折线多边形
    "AMap.CircleEditor", //圆形编辑器插件
    "AMap.Geolocation", //定位控件，用来获取和展示用户主机所在的经纬度位置
    
    "AMap.MouseTool",
    "AMap.Map",
    "mouseTool.polygon",
    "AMap.Polygon",
    "AMap.ControlBar",
    "AMap.DistrictSearch",

    "AMap.Heatmap", // 绘制热力图插件
    ], 
  // 默认高德 sdk 版本为 1.4.4
  v: '1.4.4'
})

// 引入此插件 可解决HBuilderX打包，返回键直接退出
import Mui from 'vue-awesome-mui';
Vue.config.productionTip = false
Vue.use(Mui)
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

Vue.prototype.$md5 = md5;
Vue.prototype.qs = qs;


Array.prototype.remove = function(val) {
  var index = this.indexOf(val);
  if (index > -1) {
    this.splice(index, 1);
  }
}
