// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import './assets/css/iconfont/iconfont'
import './assets/css/index.css'
import './assets/css/iconfont1/iconfont.css'
import axios from 'axios'
import store from './store'
import Vuex from 'vuex'
import qs from 'qs'
import language from './utils/i18n.js'
import MANUFACTURER from '../static/config.js'
import elementui from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
import less from 'less'
import "./utils/jquery.min.js";
import "./utils/jquery.ztree.core.min.js";
import "./utils/jquery.ztree.excheck.min.js";
import VueQriously from 'vue-qriously'
import 'echarts-liquidfill'
Vue.use(VueQriously)


// moment.locale('zh-cn');//需要汉化
import AMap from 'vue-amap';
Vue.use(AMap);
AMap.initAMapApiLoader({
  // 高德key
  key: 'b12bd8eb631f003437d1032dcb433065',
  // 插件集合 （插件按需引入）
  plugin: ['AMap.Autocomplete', 'AMap.Geocoder', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar',
    'AMap.MapType', 'AMap.AMapManager', 'AMap.Geolocation'
  ],
  v: '1.4.4',
  uiVersion: '1.0.11'
});
window._AMapSecurityConfig = {
	securityJsCode:"584c59da25977d841e3d7b290898025d"
}

import BaiduMap from 'vue-baidu-map'
Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: 'stOxjAmPN6nZGQMGfc9ZUeVZO8ym3fOI'
})

import 'babel-polyfill'
import Promise from 'es6-promise'
import XLSX from 'xlsx'
Vue.use(XLSX)

import dataV from '@jiaminghi/data-view';
Vue.use(dataV);

// 按需引入vue-awesome图标
import Icon from 'vue-awesome/components/Icon';
import 'vue-awesome/icons/chart-bar.js';
import 'vue-awesome/icons/chart-area.js';
import 'vue-awesome/icons/chart-pie.js';
import 'vue-awesome/icons/chart-line.js';
import 'vue-awesome/icons/align-left.js';
import VeLine from 'v-charts/lib/line.common';
// 全局注册图标
Vue.component('icon', Icon);
Vue.component('VeLine', VeLine);

// 适配flex
import '@/common/flexible.js';

// 引入全局css
import './assets/scss/style.scss';


//引入echart
import echarts from 'echarts'
import 'v-charts/lib/style.css';
import {
  api
} from "@/api/all";
import {
  message
} from './utils/resetMessage.js'
import {Loading} from "element-ui"
import moment from "moment"
Vue.prototype.$echarts = echarts
Vue.prototype.moment = moment
// axios.defaults.baseURL = '/api'
Vue.config.productionTip = false
Vue.prototype.$language = language
Vue.prototype.$MANUFACTURER = MANUFACTURER
Vue.prototype.$store = store
Vue.prototype.$api = api
Vue.prototype.$tenantId = ""
Vue.use(router)
Vue.use(elementui)
Vue.use(qs)
Vue.use(Vuex)
Vue.use(less)
Vue.prototype.$message = message;
Vue.prototype.$Loading = Loading;
//引入全局常量
import GlobalConst from './api/GlobalConst.js'
Vue.use(GlobalConst);

axios.interceptors.request.use(
  config => {
    return config
  },
  error => {
    if (error.response.status === 401) {
      localStorage.setItem("ms_username", '');
      this.$router.push("/login");
    }
    return Promise.reject(error);
  }
)


import VueSocket from './common/plugin/websocket/vuesocket'
Vue.use(new VueSocket({
  connection: 'ws://127.0.0.1:4649',
  store,
  options: {
    path: '/WebServer',
    debug: true
  }
}))
import selectoption from "./components/selectoption/index.vue"
Vue.component('selectoption',selectoption)

import VueAwesomeSwiper from "vue-awesome-swiper"
import "swiper/css/swiper.css"
Vue.use(VueAwesomeSwiper)
// import moment from 'moment'
// Vue.prototype.$moment = moment;//赋值使用

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App),
  components: {
    App
  },
  template: '<App/>'
})


