import Vue from 'vue'

// 动态粒子特效
import VueParticles from 'vue-particles'
Vue.use(VueParticles)
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import BaiduMap from 'vue-baidu-map'
import ElementUI from 'element-ui'
import vueGridLayout from 'vue-grid-layout';
import 'element-ui/lib/theme-chalk/index.css'
import VueResizeObserver from "vue-resize-observer";
import "echarts-liquidfill"; // 引入水球图的组件

import UmyUi from 'umy-ui'
import 'umy-ui/lib/theme-chalk/index.css'; // 引入样式
import '@/utils/elementuiFix' // 覆盖一些element-ui的设定和修复一些bug
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import store from './store'


import '@/styles/index.scss' // global css
//import { createApp } from 'vue/dist/vue.esm-bundler.js'
//import Antd from 'ant-design-vue';

import router from './router/index'
import { addClass } from '@/utils/className'
import App from './App'
//import babel from '../babel.config'
// 'ant-design-vue/dist/antd.css';
import UCore from './utils/UCore.js'
import tools from './utils/tools.js'
import './assets/css/index.css'
import '@/icons' // icon
import '@/permission' // permission control
import loadingPlugin from 'v-loading-plugin'
import ElMenu from '@/components/ElMenu/index.js'
import LbTable from '@/components/LbTable'
import ElTableForm from '@/components/ELTableForm'
import ElInputGroup from '@/components/ElInputGroup'
import FuPage from '@/components/FuPage'
import Page from '@/components/Page'
import WangEditor from '@/components/wangEditor'
import SvgFiller from 'vue-svg-filler'
import '../src/utils/flexible.js'
import 'lib-flexible/flexible'
//import 'lib-flexible'
import adaptive from '@/directive/el-height-adaptive-table/index.js'
import elTableInfiniteScroll from '@/directive/el-table-infinite-scroll/index.js'
import drag from '@/directive/el-drag-dialog'
import getCachedPageByName from '@/utils/getCachedPageByName'
import { setDomFontSize } from './setRem'
import jquery from 'jquery'
import * as d3 from "d3";
import * as echarts from "echarts";
//import echartsGL from 'echarts-gl'
import HighchartsVue from 'highcharts-vue'
import Highcharts from 'highcharts/highstock';
import ElementResizeDetectorMaker from "element-resize-detector"
import less from 'less'
import axios from 'axios'
//import { store2 } from '@/store/store';      //引入axios
import mqtt from './api/global' //引用文件
//import highcharts from 'highcharts'
//import VueHighcharts from 'vue-highcharts'
//import highcharts3d from 'highcharts/highcharts-3d'
import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
import "@wangeditor/editor/dist/css/style.css";
import ECharts from 'vue-echarts';
// import Bus from "./utils/bus";
// Vue.use(Bus);
import Editor from 'vue2-ace-editor';
import { VueJsonp } from 'vue-jsonp'
//引入图标库
import "@/assets/iconfont/iconfont.css"
// import ElementResizeDetectorMaker from "element-resize-detector"
// Vue.prototype.$erd = ElementResizeDetectorMaker()
// import particles from 'particles.js'
// Vue.use(particles)
import {VueMasonryPlugin} from 'vue-masonry';
Vue.use(VueMasonryPlugin)
import TimelineSliderVue from 'timeline-slider-vue'
import 'timeline-slider-vue/lib/timeline-slider-vue.css'
Vue.use(TimelineSliderVue)
import VueSlider from 'vue-slider-component'
import 'vue-slider-component/theme/default.css'

Vue.component('VueSlider', VueSlider)

Vue.use(VueResizeObserver)
Vue.use(VueJsonp)
VXETable.use(VXETablePluginExportXLSX)
Vue.use(VXETable)


VXETable.setup({
    table: {
        scrollX: {
            gt: -1 // 当大于指定条数时自动启用横向虚拟滚动，如果为 -1 则默认关闭虚拟滚动
        },
        scrolly: {
            gt: -1 // 当大于指定条数时自动启用纵向虚拟滚动，如果为 -1 则默认关闭虚拟滚动
        }
    }
})
setDomFontSize()
Vue.prototype.$axios = axios;
//Vue.prototype.$d3 = d3;
//window.d3 = d3;   //暂时设置为全局变量
//highcharts3d(highcharts)
Vue.component('editor', Editor)
Vue.use(less)
Vue.use(Highcharts)
Vue.prototype.$echarts = echarts
const bus = new Vue()
Vue.prototype.$EventBus = bus
    //Vue.prototype.$echartsGL = echartsGL
Vue.prototype.$ = jquery
Vue.use(HighchartsVue)
Vue.use(BaiduMap, {
        ak: 'RpQi6WNFZ9tseKzhdwOQsXwFsoVntnsN'
    })
    // Vue.use(plTable);
Vue.use(loadingPlugin)
Vue.use(LbTable)
Vue.use(VXETable);
Vue.use(ElTableForm)
Vue.use(ElInputGroup)
Vue.use(vueGridLayout)
Vue.use(FuPage)
Vue.use(Page)
Vue.use(WangEditor)
Vue.use(adaptive)
Vue.use(elTableInfiniteScroll)
Vue.use(drag)
Vue.prototype.globalMqtt = mqtt //挂载到Vue实例上面
Vue.prototype.$getCachedPageByName = getCachedPageByName
Vue.prototype.$erd = ElementResizeDetectorMaker()
import dataV from '@jiaminghi/data-view'
Vue.use(dataV)
    //把axios挂载到vue上

// if (process.env.VUE_APP_USE_MOCKXHR === 'true') {
//   const mockXHR = require('./utils/mockXHR').default
//   mockXHR()
// }
Vue.use(UmyUi)
Vue.use(ElementUI, {
    size: store.state.settings.size // set element-ui default size
})
window.addEventListener('load', () => {
    addClass(document.body, `PAGE-SIZE-${store.state.settings.size}`)
})

// element-ui 2.13.0版本菜单组件有bug,这里改手动引用2.10.0版本以及部分bug处理
Vue.use(ElMenu)

Vue.config.productionTip = false
Vue.prototype.$bus = new Vue()
    //Vue.use(Antd)
Vue.component('v-chart', ECharts)
Vue.prototype.$UCore = UCore;
Vue.prototype.$tools = tools;
new Vue({
    //el: '#app',
    router,
    store,
    render: h => h(App),
    beforeCreate() {

    }
}).$mount("#app")
